repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
tongquhq/about
test/config/parser-spec.js
2320
/** * Created by at15 on 2016/9/7. */ 'use strict'; const expect = require('chai').expect; const fsUtil = require('../../lib/util/fs'); const Parser = require('../../lib/config/parser'); describe('Parser', () => { it('can load yaml file', () => { expect(Parser.shallowParse('example/data/sway.yml')).to.eql({ mail: 'lq@lq.com', github: 'swaylq', twitter: 'swaylq' }); }); it('can check inner reference syntax', ()=> { expect(Parser.isInnerRef('#/people/sway')).to.eql(true); expect(Parser.isInnerRef('sway.yml')).to.eql(false); }); it('can check partial external reference syntax', ()=> { expect(Parser.isExternalRefPartial('address.yml/#/SJTU')).to.eql(true); }); it('can add file', () => { let parser = new Parser(); let file = 'example/data/people.yml'; parser.addFile(file); expect(parser.parsed).to.have.ownProperty(fsUtil.fullPath(file)); }); it('can add several files', () => { let parser = new Parser(); let file1 = 'example/data/people.yml'; let file2 = 'example/data/sway.yml'; parser.addFile(file1); parser.addFile((file2)); expect(parser.parsed).to.have.all.keys(fsUtil.fullPath(file1), fsUtil.fullPath(file2)); }); // FIXME: relative file path is not handled it('can resolve external file', () => { let parser = new Parser(); let entry = 'example/data/people.yml'; parser.addFile(entry); parser.resolveFile(entry); expect(parser.getResolved(entry).sway).to.eql(Parser.shallowParse('example/data/sway.yml')); }); it('can get file path from partial external ref', () => { expect(Parser.getRefFilePath('sway.yml/#/address')).to.eql('sway.yml'); }); it('can get partial from partial external ref', () => { expect(Parser.getRefPartial('sway.yml/#/address')).to.eql('address'); }); it('can resolve partial external ref', () => { let parser = new Parser(); let entry = 'example/data/people.yml'; parser.addFile(entry); parser.resolveFile(entry); expect(parser.getResolved(entry).arrowrowe.currentAddress).to.eql(Parser.shallowParse('example/data/address.yml').SJTU); }) });
mit
QoboLtd/cakephp-utils
src/ModuleConfig/PathFinder/PathFinderInterface.php
1196
<?php /** * Copyright (c) Qobo Ltd. (https://www.qobo.biz) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) Qobo Ltd. (https://www.qobo.biz) * @license https://opensource.org/licenses/mit-license.php MIT License */ namespace Qobo\Utils\ModuleConfig\PathFinder; use Qobo\Utils\ErrorAwareInterface; /** * PathFinderInterface Interface * * This interface defines the standard approach for * finding paths (files and directories) in standard * places, with a bit of flexibility for custom * situations. * * @author Leonid Mamchenkov <l.mamchenkov@qobo.biz> */ interface PathFinderInterface extends ErrorAwareInterface { /** * Find path * * @param string $module Module to look for files in * @param string $path Path to look for * @param bool $validate Validate existence of the result * @return null|string|array Null for not found, string for single path, array for multiple paths */ public function find(string $module, string $path = '', bool $validate = true); }
mit
droath/project-x
tests/Project/DrushCommandTest.php
1135
<?php namespace Droath\ProjectX\Tests\Project; use Droath\ProjectX\Project\Command\DrushCommand; use Droath\ProjectX\Tests\TestBase; class DrushCommandTest extends TestBase { protected $drushCommand; protected $drupalProject; public function setUp() { parent::setUp(); $this->drushCommand = new DrushCommand(); } public function testEnableInteraction() { $command = $this->drushCommand ->command('cc all') ->enableInteraction() ->build(); $this->assertEquals('drush -r /var/www/html/www cc all', $command); } public function testBuildSingle() { $command = $this->drushCommand ->command('cc all') ->build(); $this->assertEquals('drush -r /var/www/html/www --yes cc all', $command); } public function testBuildMultiple() { $command = $this->drushCommand ->command('cex') ->command('updb') ->build(); $this->assertEquals('drush -r /var/www/html/www --yes cex && drush -r /var/www/html/www --yes updb', $command); } }
mit
pnhepw/java-lessons-kirylka
homework/lesson_4/src/model/Doctor.java
2654
package model; import java.util.Arrays; public class Doctor extends Human { public static final int DOCTORS = 2; private int experience; //experience (years) private String[] specialization = new String[2]; // Constructor public Doctor(int experience, String[] specialization) { this.experience = experience; this.specialization = specialization; } public Doctor(String[] specialization) { this.specialization = specialization; } /* Getters */ public int getExperience() { return experience; } public void setExperience(int experience) { this.experience = experience; } /* Setters */ public String[] getSpecialization() { return specialization; } public void setSpecialization(String[] specialization) { this.specialization = specialization; } // Print doctor's card public void print(int number) { System.out.println("----------------------"); System.out.println("Card of doctor #" + number); String firstnameInfo = "Firstname: " + this.getFirstname(); String lastnameInfo = "Lastname: " + this.getLastname(); String experienceInfo = "Experience: " + this.getExperience(); String specializationInfo = "Specialization: "; for (int i = 0; i < this.getSpecialization().length; i++) { specializationInfo += this.getSpecialization()[i]; if (i < this.getSpecialization().length - 1) { specializationInfo += ", "; } } System.out.println(firstnameInfo); System.out.println(lastnameInfo); System.out.println(experienceInfo); System.out.println(specializationInfo); } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Doctor)) return false; if (!super.equals(o)) return false; Doctor doctor = (Doctor) o; if (getExperience() != doctor.getExperience()) return false; // Probably incorrect - comparing Object[] arrays with Arrays.equals return Arrays.equals(getSpecialization(), doctor.getSpecialization()); } @Override public int hashCode() { int result = super.hashCode(); result = 31 * result + getExperience(); result = 31 * result + Arrays.hashCode(getSpecialization()); return result; } @Override public String toString() { return "Doctor{" + "experience=" + experience + ", specialization=" + Arrays.toString(specialization) + '}'; } }
mit
fbazzarella/afiliados
db/migrate/20140904004803_rename_verified_at_to_bounced_at_on_email.rb
143
class RenameVerifiedAtToBouncedAtOnEmail < ActiveRecord::Migration def change rename_column :emails, :verified_at, :bounced_at end end
mit
localvore-today/react-mapbox-autocomplete
index.js
7163
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _propTypes = require('prop-types'); var _propTypes2 = _interopRequireDefault(_propTypes); var _lodash = require('lodash'); require('./index.css'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ReactMapboxAutocomplete = function (_React$Component) { _inherits(ReactMapboxAutocomplete, _React$Component); function ReactMapboxAutocomplete() { var _ref; var _temp, _this, _ret; _classCallCheck(this, ReactMapboxAutocomplete); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ReactMapboxAutocomplete.__proto__ || Object.getPrototypeOf(ReactMapboxAutocomplete)).call.apply(_ref, [this].concat(args))), _this), _this.state = { error: false, errorMsg: '', query: _this.props.query ? _this.props.query : '', queryResults: [], publicKey: _this.props.publicKey, resetSearch: _this.props.resetSearch ? _this.props.resetSearch : false }, _this._updateQuery = function (event) { _this.setState({ query: event.target.value }); var header = { 'Content-Type': 'application/json' }; var path = 'https://api.mapbox.com/geocoding/v5/mapbox.places/' + _this.state.query + '.json?access_token=' + _this.state.publicKey; if (_this.props.country) { path = 'https://api.mapbox.com/geocoding/v5/mapbox.places/' + _this.state.query + '.json?access_token=' + _this.state.publicKey + '&country=' + _this.props.country; } if (_this.state.query.length > 2) { return fetch(path, { headers: header }).then(function (res) { if (!res.ok) throw Error(res.statusText); return res.json(); }).then(function (json) { _this.setState({ error: false, queryResults: json.features }); }).catch(function (err) { _this.setState({ error: true, errorMsg: 'There was a problem retrieving data from mapbox', queryResults: [] }); }); } else { _this.setState({ error: false, queryResults: [] }); } }, _this._resetSearch = function () { if (_this.state.resetSearch) { _this.setState({ query: '', queryResults: [] }); } else { _this.setState({ queryResults: [] }); } }, _this._onSuggestionSelect = function (event) { if (_this.state.resetSearch === false) { _this.setState({ query: event.target.getAttribute('data-suggestion') }); } _this.props.onSuggestionSelect(event.target.getAttribute('data-suggestion'), event.target.getAttribute('data-lat'), event.target.getAttribute('data-lng'), event.target.getAttribute('data-text')); }, _temp), _possibleConstructorReturn(_this, _ret); } _createClass(ReactMapboxAutocomplete, [{ key: 'render', value: function render() { var _this2 = this; return _react2.default.createElement( 'div', null, _react2.default.createElement('input', { placeholder: this.props.placeholder || 'Search', id: this.props.inputId, onClick: this.props.inputOnClick, onBlur: this.props.inputOnBlur, onFocus: this.props.inputOnFocus, className: this.props.inputClass ? this.props.inputClass + ' react-mapbox-ac-input' : 'react-mapbox-ac-input', onChange: this._updateQuery, value: this.state.query, type: 'text' }), _react2.default.createElement( 'span', null, _react2.default.createElement( 'div', { className: 'react-mapbox-ac-menu', style: this.state.queryResults.length > 0 || this.state.error ? { display: 'block' } : { display: 'none' }, onClick: this._resetSearch }, (0, _lodash.map)(this.state.queryResults, function (place, i) { return _react2.default.createElement( 'div', { className: 'react-mapbox-ac-suggestion', onClick: _this2._onSuggestionSelect, key: i, 'data-suggestion': place.place_name, 'data-lng': place.center[0], 'data-lat': place.center[1], 'data-text': place.text }, place.place_name ); }), this.state.error && _react2.default.createElement( 'div', { className: 'react-mapbox-ac-suggestion' }, this.state.errorMsg ) ) ) ); } }]); return ReactMapboxAutocomplete; }(_react2.default.Component); ReactMapboxAutocomplete.defaultProps = { inputId: null, inputOnFocus: null, inputOnBlur: null, inputOnClick: null }; ReactMapboxAutocomplete.propTypes = { inputId: _propTypes2.default.string, inputOnFocus: _propTypes2.default.func, inputOnBlur: _propTypes2.default.func, inputOnClick: _propTypes2.default.func, inputClass: _propTypes2.default.string, publicKey: _propTypes2.default.string.isRequired, placeholder: _propTypes2.default.string, onSuggestionSelect: _propTypes2.default.func.isRequired, country: _propTypes2.default.string, query: _propTypes2.default.string, resetSearch: _propTypes2.default.bool }; exports.default = ReactMapboxAutocomplete;
mit
DavidAnson/markdownlint
test/rules/any-blockquote.js
714
// @ts-check "use strict"; const { filterTokens } = require("markdownlint-rule-helpers"); module.exports = { "names": [ "any-blockquote" ], "description": "Rule that reports an error for any blockquote", "information": new URL( "https://github.com/DavidAnson/markdownlint" + "/blob/main/test/rules/any-blockquote.js" ), "tags": [ "test" ], "function": (params, onError) => { filterTokens(params, "blockquote_open", (blockquote) => { const lines = blockquote.map[1] - blockquote.map[0]; onError({ "lineNumber": blockquote.lineNumber, "detail": "Blockquote spans " + lines + " line(s).", "context": blockquote.line.substr(0, 7) }); }); } };
mit
spokesoftware/zitdunyet
lib/zitdunyet/evaluation.rb
1880
module Zitdunyet module Evaluation def complete? self.class.checklist.each { |item| return false unless item.logic.call(self) } true end def percent_complete # Scale the percentages if they don't add up to 100. When units are part of the mix, scale the units to fit into # the percentage slice leftover after totaling the percentages. unit_percentage = 0 pct_percentage = 1 if self.class.percentage < 100 unit_percentage = ((100 - self.class.percentage) / self.class.units.to_f) if (self.class.units > 0) pct_percentage = (100 / self.class.percentage.to_f) if (self.class.units == 0) elsif self.class.percentage > 100 pct_percentage = (100 / self.class.percentage.to_f) if (self.class.units == 0) end completed_pct = 0 completed_units = 0 complete = true @hints = {} @checklist = {} self.class.checklist.each do |item| completed = item.logic.call(self) @checklist[item.label] = completed if completed if item.percent completed_pct += item.percent else completed_units += item.units if item.units end else complete = false hint = item.hint || item.label @hints[hint] = item.percent ? item.percent * pct_percentage : item.units * unit_percentage end end complete ? 100 : (completed_pct * pct_percentage) + (completed_units * unit_percentage) end def hints percent_complete unless @hints hints = {} @hints.each_pair do |hint, pct| if hint.respond_to? :call hints[hint.call(self)] = pct else hints[hint.to_s] = pct end end hints end def checklist percent_complete unless @checklist @checklist end end end
mit
laribee/mochachino
node_modules/chai/lib/chai.js
814
/*! * chai * Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com> * MIT Licensed */ var exports = module.exports = {}; exports.version = '0.2.1'; exports.Assertion = require('./assertion'); exports.AssertionError = require('./error'); exports.inspect = require('./utils/inspect'); exports.use = function (fn) { fn(this); return this; }; exports.fail = function (actual, expected, message, operator, stackStartFunction) { throw new exports.AssertionError({ message: message, actual: actual, expected: expected, operator: operator, stackStartFunction: stackStartFunction }); }; var expect = require('./interface/expect'); exports.use(expect); var should = require('./interface/should'); exports.use(should); var assert = require('./interface/assert'); exports.use(assert);
mit
uspgamedev/demos
cellular_automaton/conf.lua
2805
function love.conf(t) t.window = t.window or t.screen t.identity = nil -- The name of the save directory (string) t.version = "0.10.1" -- The LÖVE version this game was made for (string) t.console = true -- Attach a console (boolean, Windows only) t.window.title = "Cellular Automaton UGD Demo" -- The window title (string) t.window.icon = nil -- Filepath to an image to use as the window's icon (string) t.window.width = 1024 -- The window width (number) t.window.height = 768 -- The window height (number) t.window.borderless = false -- Remove all border visuals from the window (boolean) t.window.resizable = false -- Let the window be user-resizable (boolean) t.window.minwidth = 1 -- Minimum window width if the window is resizable (number) t.window.minheight = 1 -- Minimum window height if the window is resizable (number) t.window.fullscreen = false -- Enable fullscreen (boolean) t.window.fullscreentype = "desktop" -- Standard fullscreen or desktop fullscreen mode (string) t.window.vsync = false -- Enable vertical sync (boolean) t.window.fsaa = 4 -- The number of samples to use with multi-sampled antialiasing (number) t.window.display = 1 -- Index of the monitor to show the window in (number) t.window.highdpi = false -- Enable high-dpi mode for the window on a Retina display (boolean). Added in 0.9.1 t.window.srgb = false -- Enable sRGB gamma correction when drawing to the screen (boolean). Added in 0.9.1 t.modules.audio = false -- Enable the audio module (boolean) t.modules.event = true -- Enable the event module (boolean) t.modules.graphics = true -- Enable the graphics module (boolean) t.modules.image = true -- Enable the image module (boolean) t.modules.joystick = false -- Enable the joystick module (boolean) t.modules.keyboard = true -- Enable the keyboard module (boolean) t.modules.math = false -- Enable the math module (boolean) t.modules.mouse = true -- Enable the mouse module (boolean) t.modules.physics = false -- Enable the physics module (boolean) t.modules.sound = false -- Enable the sound module (boolean) t.modules.system = true -- Enable the system module (boolean) t.modules.timer = true -- Enable the timer module (boolean) t.modules.window = true -- Enable the window module (boolean) t.modules.thread = true -- Enable the thread module (boolean) end
mit
ciervogris/algoritmosII-P2
src/grafoListaAdyacencia/IGrafoL.java
509
package grafoListaAdyacencia; public interface IGrafoL { public void crearGrafoVacio(int maxNodos); public void agregarVertice(int numero); public void agregarArista(int origen, int destino, int peso); public void eliminarVertice(int numero); public void eliminarArista(int origen, int destino); public boolean sonAdyacentes(int origen, int destino); public Lista verticesAdyacentes(int vertice); public boolean existeVertice(int v); public boolean esConexo(); }
mit
danielchalmers/Network-Monitor
Network Monitor/Properties/AssemblyInfo.cs
2214
using System.Reflection; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Network Monitor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Daniel Chalmers")] [assembly: AssemblyProduct("Network Monitor")] [assembly: AssemblyCopyright("© Daniel Chalmers 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.2.0")] [assembly: Guid("FB1814E0-AA8C-47EF-96A9-5F936CB0DF3F")]
mit
anton23/gpanalyser
src-probes/uk/ac/imperial/doc/gpa/probes/IProbe.java
282
package uk.ac.imperial.doc.gpa.probes; import uk.ac.imperial.doc.gpa.fsm.NFAState; public interface IProbe { public String getName (); public void setName (String name); public void setStartingState (NFAState state); public NFAState getStartingState (); }
mit
hughpyle/inguz-DSPUtil
Shuffler.cs
1766
using System; using System.Collections.Generic; using System.Text; namespace DSPUtil { /// <summary> /// Channel-shuffle (LR to MS or vice versa) /// Requires two-channel input. /// </summary> public class Shuffler: SoundObj { public Shuffler() { } /// <summary> /// Get an iterator for samples /// </summary> public override IEnumerator<ISample> Samples { get { if (_input == null) { yield break; } // Return (a+b)/2 and (a-b)/2 foreach (ISample sample in _input) { yield return _next(sample); } } } internal ISample _next(ISample s) { if (_nc != 2) { // NOP! } else { double L = s[0]; double R = s[1]; // Set sample values in-place (quicker than newing another sample) s[0] = (L + R) * _sigmaGain; s[1] = (L - R) * _deltaGain; } return s; } private double _deltaGain = MathUtil.SQRT2; public double DeltaGain { get { return _deltaGain; } set { _deltaGain = value; } } private double _sigmaGain = MathUtil.SQRT2; public double SigmaGain { get { return _sigmaGain; } set { _sigmaGain = value; } } } // This is symmetrical if you shuffle twice, // L, R --> (L+R)/2, (L-R)/2 // (L+R), (L-R) --> (L/2+R/2+L/2-R/2), (L/2+R/2-L/2+R/2) = L, R }
mit
brh55/go-feeling
feeling.go
1251
// Package feeling provides terminal output of feelings through text emoticons. package feeling import "github.com/fatih/color" // Uncertain appends (,,◕ ⋏ ◕,,) in blue func Uncertain(text string) string { text += color.BlueString(" (,,◕ ⋏ ◕,,)") return text } // Whatever appends ¯\\_(ツ)_/¯ in green func Whatever(text string) string { text += color.GreenString(" ¯\\_(ツ)_/¯") return text } // Scared appends ヽ(゚Д゚)ノ in yellow func Scared(text string) string { text += color.YellowString(" ヽ(゚Д゚)ノ") return text } // Upset appends (╯°□°)╯︵ ┻━┻ in cyan func Upset(text string) string { text += color.CyanString(" (╯°□°)╯︵ ┻━┻") return text } // Cheerful appends (๑´▿`๑)♫•*¨*•.¸¸♪✧ in cyan func Cheerful(text string) string { text += color.CyanString(" (๑´▿`๑)♫•*¨*•.¸¸♪✧") return text } // Loved appends (*^3^)/~♡ in red func Loved(text string) string { text += color.RedString(" (*^3^)/~♡") return text } // Stumped appends (;¬_¬) in blue func Stumped(text string) (string) { text += color.BlueString(" (;¬_¬)") return text }
mit
krzysztofengineer/pesel
tests/PeselDateTest.php
1459
<?php use KrzysztofEngineer\Pesel\PeselInfo; class PeselDateTest extends PHPUnit_Framework_TestCase { /** * @test * @dataProvider simplePeselInfoProvider */ public function it_fetches_birthday_for_simple_cases($pesel, $year, $month, $day) { $peselInfo = new PeselInfo($pesel); $date = $peselInfo->date(); $this->assertInstanceOf(DateTime::class, $date); $this->assertEquals($year, $peselInfo->year()); $this->assertEquals($month, $peselInfo->month()); $this->assertEquals($day, $peselInfo->day()); } /** * @test * @dataProvider hardPeselInfoProvider */ public function it_fetches_birthday_for_hard_cases($pesel, $year, $month, $day) { $peselInfo = new PeselInfo($pesel); $date = $peselInfo->date(); $this->assertInstanceOf(DateTime::class, $date); $this->assertEquals($year, $peselInfo->year()); $this->assertEquals($month, $peselInfo->month()); $this->assertEquals($day, $peselInfo->day()); } public function simplePeselInfoProvider() { return [ [ '56112702130', 1956, 11, 27 ], [ '66100315480', 1966, 10, 3 ], [ '80041681613', 1980, 4, 16 ], ]; } public function hardPeselInfoProvider() { return [ [ '00270166813', 2000, 7, 1 ], [ '16323106507', 2016, 12, 31 ], ]; } }
mit
lina9527/easybi
utils.py
19645
"""Utility functions used across Superset""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import decimal import functools import json import logging import numpy import os import parsedatetime import pytz import smtplib import sqlalchemy as sa import signal import uuid import sys import zlib from builtins import object from datetime import date, datetime, time import celery from dateutil.parser import parse from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.application import MIMEApplication from email.utils import formatdate from flask import flash, Markup, render_template, url_for, redirect, request from flask_appbuilder.const import ( LOGMSG_ERR_SEC_ACCESS_DENIED, FLAMSG_ERR_SEC_ACCESS_DENIED, PERMISSION_PREFIX ) from flask_cache import Cache from flask_appbuilder._compat import as_unicode from flask_babel import gettext as __ import markdown as md from past.builtins import basestring from pydruid.utils.having import Having from sqlalchemy import event, exc, select from sqlalchemy.types import TypeDecorator, TEXT logging.getLogger('MARKDOWN').setLevel(logging.INFO) PY3K = sys.version_info >= (3, 0) EPOCH = datetime(1970, 1, 1) DTTM_ALIAS = '__timestamp' class SupersetException(Exception): pass class SupersetTimeoutException(SupersetException): pass class SupersetSecurityException(SupersetException): pass class MetricPermException(SupersetException): pass class NoDataException(SupersetException): pass class SupersetTemplateException(SupersetException): pass def can_access(sm, permission_name, view_name, user): """Protecting from has_access failing from missing perms/view""" if user.is_anonymous(): return sm.is_item_public(permission_name, view_name) else: return sm._has_view_access(user, permission_name, view_name) def flasher(msg, severity=None): """Flask's flash if available, logging call if not""" try: flash(msg, severity) except RuntimeError: if severity == 'danger': logging.error(msg) else: logging.info(msg) class memoized(object): # noqa """Decorator that caches a function's return value each time it is called If called later with the same arguments, the cached value is returned, and not re-evaluated. """ def __init__(self, func): self.func = func self.cache = {} def __call__(self, *args): try: return self.cache[args] except KeyError: value = self.func(*args) self.cache[args] = value return value except TypeError: # uncachable -- for instance, passing a list as an argument. # Better to not cache than to blow up entirely. return self.func(*args) def __repr__(self): """Return the function's docstring.""" return self.func.__doc__ def __get__(self, obj, objtype): """Support instance methods.""" return functools.partial(self.__call__, obj) def js_string_to_python(item): return None if item in ('null', 'undefined') else item def string_to_num(s): """Converts a string to an int/float Returns ``None`` if it can't be converted >>> string_to_num('5') 5 >>> string_to_num('5.2') 5.2 >>> string_to_num(10) 10 >>> string_to_num(10.1) 10.1 >>> string_to_num('this is not a string') is None True """ if isinstance(s, (int, float)): return s if s.isdigit(): return int(s) try: return float(s) except ValueError: return None class DimSelector(Having): def __init__(self, **args): # Just a hack to prevent any exceptions Having.__init__(self, type='equalTo', aggregation=None, value=None) self.having = {'having': { 'type': 'dimSelector', 'dimension': args['dimension'], 'value': args['value'], }} def list_minus(l, minus): """Returns l without what is in minus >>> list_minus([1, 2, 3], [2]) [1, 3] """ return [o for o in l if o not in minus] def parse_human_datetime(s): """ Returns ``datetime.datetime`` from human readable strings >>> from datetime import date, timedelta >>> from dateutil.relativedelta import relativedelta >>> parse_human_datetime('2015-04-03') datetime.datetime(2015, 4, 3, 0, 0) >>> parse_human_datetime('2/3/1969') datetime.datetime(1969, 2, 3, 0, 0) >>> parse_human_datetime("now") <= datetime.now() True >>> parse_human_datetime("yesterday") <= datetime.now() True >>> date.today() - timedelta(1) == parse_human_datetime('yesterday').date() True >>> year_ago_1 = parse_human_datetime('one year ago').date() >>> year_ago_2 = (datetime.now() - relativedelta(years=1) ).date() >>> year_ago_1 == year_ago_2 True """ try: dttm = parse(s) except Exception: try: cal = parsedatetime.Calendar() parsed_dttm, parsed_flags = cal.parseDT(s) # when time is not extracted, we "reset to midnight" if parsed_flags & 2 == 0: parsed_dttm = parsed_dttm.replace(hour=0, minute=0, second=0) dttm = dttm_from_timtuple(parsed_dttm.utctimetuple()) except Exception as e: logging.exception(e) raise ValueError("Couldn't parse date string [{}]".format(s)) return dttm def dttm_from_timtuple(d): return datetime( d.tm_year, d.tm_mon, d.tm_mday, d.tm_hour, d.tm_min, d.tm_sec) def parse_human_timedelta(s): """ Returns ``datetime.datetime`` from natural language time deltas >>> parse_human_datetime("now") <= datetime.now() True """ cal = parsedatetime.Calendar() dttm = dttm_from_timtuple(datetime.now().timetuple()) d = cal.parse(s, dttm)[0] d = datetime( d.tm_year, d.tm_mon, d.tm_mday, d.tm_hour, d.tm_min, d.tm_sec) return d - dttm class JSONEncodedDict(TypeDecorator): """Represents an immutable structure as a json-encoded string.""" impl = TEXT def process_bind_param(self, value, dialect): if value is not None: value = json.dumps(value) return value def process_result_value(self, value, dialect): if value is not None: value = json.loads(value) return value def datetime_f(dttm): """Formats datetime to take less room when it is recent""" if dttm: dttm = dttm.isoformat() now_iso = datetime.now().isoformat() if now_iso[:10] == dttm[:10]: dttm = dttm[11:] elif now_iso[:4] == dttm[:4]: dttm = dttm[5:] return "<nobr>{}</nobr>".format(dttm) def base_json_conv(obj): if isinstance(obj, numpy.int64): return int(obj) elif isinstance(obj, numpy.bool_): return bool(obj) elif isinstance(obj, set): return list(obj) elif isinstance(obj, decimal.Decimal): return float(obj) elif isinstance(obj, uuid.UUID): return str(obj) def json_iso_dttm_ser(obj): """ json serializer that deals with dates >>> dttm = datetime(1970, 1, 1) >>> json.dumps({'dttm': dttm}, default=json_iso_dttm_ser) '{"dttm": "1970-01-01T00:00:00"}' """ val = base_json_conv(obj) if val is not None: return val if isinstance(obj, datetime): obj = obj.isoformat() elif isinstance(obj, date): obj = obj.isoformat() elif isinstance(obj, time): obj = obj.isoformat() else: raise TypeError( "Unserializable object {} of type {}".format(obj, type(obj)) ) return obj def datetime_to_epoch(dttm): if dttm.tzinfo: epoch_with_tz = pytz.utc.localize(EPOCH) return (dttm - epoch_with_tz).total_seconds() * 1000 return (dttm - EPOCH).total_seconds() * 1000 def now_as_float(): return datetime_to_epoch(datetime.utcnow()) def json_int_dttm_ser(obj): """json serializer that deals with dates""" val = base_json_conv(obj) if val is not None: return val if isinstance(obj, datetime): obj = datetime_to_epoch(obj) elif isinstance(obj, date): obj = (obj - EPOCH.date()).total_seconds() * 1000 else: raise TypeError( "Unserializable object {} of type {}".format(obj, type(obj)) ) return obj def json_dumps_w_dates(payload): return json.dumps(payload, default=json_int_dttm_ser) def error_msg_from_exception(e): """Translate exception into error message Database have different ways to handle exception. This function attempts to make sense of the exception object and construct a human readable sentence. TODO(bkyryliuk): parse the Presto error message from the connection created via create_engine. engine = create_engine('presto://localhost:3506/silver') - gives an e.message as the str(dict) presto.connect("localhost", port=3506, catalog='silver') - as a dict. The latter version is parsed correctly by this function. """ msg = '' if hasattr(e, 'message'): if type(e.message) is dict: msg = e.message.get('message') elif e.message: msg = "{}".format(e.message) return msg or '{}'.format(e) def markdown(s, markup_wrap=False): s = md.markdown(s or '', [ 'markdown.extensions.tables', 'markdown.extensions.fenced_code', 'markdown.extensions.codehilite', ]) if markup_wrap: s = Markup(s) return s def readfile(file_path): with open(file_path) as f: content = f.read() return content def generic_find_constraint_name(table, columns, referenced, db): """Utility to find a constraint name in alembic migrations""" t = sa.Table(table, db.metadata, autoload=True, autoload_with=db.engine) for fk in t.foreign_key_constraints: if ( fk.referred_table.name == referenced and set(fk.column_keys) == columns): return fk.name def get_datasource_full_name(database_name, datasource_name, schema=None): if not schema: return "[{}].[{}]".format(database_name, datasource_name) return "[{}].[{}].[{}]".format(database_name, schema, datasource_name) def get_schema_perm(database, schema): if schema: return "[{}].[{}]".format(database, schema) def validate_json(obj): if obj: try: json.loads(obj) except Exception: raise SupersetException("JSON is not valid") def table_has_constraint(table, name, db): """Utility to find a constraint name in alembic migrations""" t = sa.Table(table, db.metadata, autoload=True, autoload_with=db.engine) for c in t.constraints: if c.name == name: return True return False class timeout(object): """ To be used in a ``with`` block and timeout its content. """ def __init__(self, seconds=1, error_message='Timeout'): self.seconds = seconds self.error_message = error_message def handle_timeout(self, signum, frame): logging.error("Process timed out") raise SupersetTimeoutException(self.error_message) def __enter__(self): try: # signal.signal(signal.SIGALRM, self.handle_timeout) pass except ValueError as e: logging.warning("timeout can't be used in the current context") logging.exception(e) def __exit__(self, type, value, traceback): try: pass except ValueError as e: logging.warning("timeout can't be used in the current context") logging.exception(e) def pessimistic_connection_handling(some_engine): @event.listens_for(some_engine, "engine_connect") def ping_connection(connection, branch): if branch: # "branch" refers to a sub-connection of a connection, # we don't want to bother pinging on these. return # turn off "close with result". This flag is only used with # "connectionless" execution, otherwise will be False in any case save_should_close_with_result = connection.should_close_with_result connection.should_close_with_result = False try: # run a SELECT 1. use a core select() so that # the SELECT of a scalar value without a table is # appropriately formatted for the backend connection.scalar(select([1])) except exc.DBAPIError as err: # catch SQLAlchemy's DBAPIError, which is a wrapper # for the DBAPI's exception. It includes a .connection_invalidated # attribute which specifies if this connection is a "disconnect" # condition, which is based on inspection of the original exception # by the dialect in use. if err.connection_invalidated: # run the same SELECT again - the connection will re-validate # itself and establish a new connection. The disconnect detection # here also causes the whole connection pool to be invalidated # so that all stale connections are discarded. connection.scalar(select([1])) else: raise finally: # restore "close with result" connection.should_close_with_result = save_should_close_with_result class QueryStatus(object): """Enum-type class for query statuses""" STOPPED = 'stopped' FAILED = 'failed' PENDING = 'pending' RUNNING = 'running' SCHEDULED = 'scheduled' SUCCESS = 'success' TIMED_OUT = 'timed_out' def notify_user_about_perm_udate( granter, user, role, datasource, tpl_name, config): msg = render_template(tpl_name, granter=granter, user=user, role=role, datasource=datasource) logging.info(msg) subject = __('[Superset] Access to the datasource %(name)s was granted', name=datasource.full_name) send_email_smtp(user.email, subject, msg, config, bcc=granter.email, dryrun=not config.get('EMAIL_NOTIFICATIONS')) def send_email_smtp(to, subject, html_content, config, files=None, dryrun=False, cc=None, bcc=None, mime_subtype='mixed'): """ Send an email with html content, eg: send_email_smtp( 'test@example.com', 'foo', '<b>Foo</b> bar',['/dev/null'], dryrun=True) """ smtp_mail_from = config.get('SMTP_MAIL_FROM') to = get_email_address_list(to) msg = MIMEMultipart(mime_subtype) msg['Subject'] = subject msg['From'] = smtp_mail_from msg['To'] = ", ".join(to) recipients = to if cc: cc = get_email_address_list(cc) msg['CC'] = ", ".join(cc) recipients = recipients + cc if bcc: # don't add bcc in header bcc = get_email_address_list(bcc) recipients = recipients + bcc msg['Date'] = formatdate(localtime=True) mime_text = MIMEText(html_content, 'html') msg.attach(mime_text) for fname in files or []: basename = os.path.basename(fname) with open(fname, "rb") as f: msg.attach(MIMEApplication( f.read(), Content_Disposition='attachment; filename="%s"' % basename, Name=basename )) send_MIME_email(smtp_mail_from, recipients, msg, config, dryrun=dryrun) def send_MIME_email(e_from, e_to, mime_msg, config, dryrun=False): SMTP_HOST = config.get('SMTP_HOST') SMTP_PORT = config.get('SMTP_PORT') SMTP_USER = config.get('SMTP_USER') SMTP_PASSWORD = config.get('SMTP_PASSWORD') SMTP_STARTTLS = config.get('SMTP_STARTTLS') SMTP_SSL = config.get('SMTP_SSL') if not dryrun: s = smtplib.SMTP_SSL(SMTP_HOST, SMTP_PORT) if SMTP_SSL else \ smtplib.SMTP(SMTP_HOST, SMTP_PORT) if SMTP_STARTTLS: s.starttls() if SMTP_USER and SMTP_PASSWORD: s.login(SMTP_USER, SMTP_PASSWORD) logging.info("Sent an alert email to " + str(e_to)) s.sendmail(e_from, e_to, mime_msg.as_string()) s.quit() else: logging.info('Dryrun enabled, email notification content is below:') logging.info(mime_msg.as_string()) def get_email_address_list(address_string): if isinstance(address_string, basestring): if ',' in address_string: address_string = address_string.split(',') elif ';' in address_string: address_string = address_string.split(';') else: address_string = [address_string] return address_string def has_access(f): """ Use this decorator to enable granular security permissions to your methods. Permissions will be associated to a role, and roles are associated to users. By default the permission's name is the methods name. Forked from the flask_appbuilder.security.decorators TODO(bkyryliuk): contribute it back to FAB """ if hasattr(f, '_permission_name'): permission_str = f._permission_name else: permission_str = f.__name__ def wraps(self, *args, **kwargs): permission_str = PERMISSION_PREFIX + f._permission_name if self.appbuilder.sm.has_access( permission_str, self.__class__.__name__): return f(self, *args, **kwargs) else: logging.warning(LOGMSG_ERR_SEC_ACCESS_DENIED.format( permission_str, self.__class__.__name__)) flash(as_unicode(FLAMSG_ERR_SEC_ACCESS_DENIED), "danger") # adds next arg to forward to the original path once user is logged in. return redirect(url_for( self.appbuilder.sm.auth_view.__class__.__name__ + ".login", next=request.path)) f._permission_name = permission_str return functools.update_wrapper(wraps, f) def choicify(values): """Takes an iterable and makes an iterable of tuples with it""" return [(v, v) for v in values] def setup_cache(app, cache_config): """Setup the flask-cache on a flask app""" if cache_config and cache_config.get('CACHE_TYPE') != 'null': return Cache(app, config=cache_config) def zlib_compress(data): """ Compress things in a py2/3 safe fashion >>> json_str = '{"test": 1}' >>> blob = zlib_compress(json_str) """ if PY3K: if isinstance(data, str): return zlib.compress(bytes(data, "utf-8")) return zlib.compress(data) return zlib.compress(data) def zlib_decompress_to_string(blob): """ Decompress things to a string in a py2/3 safe fashion >>> json_str = '{"test": 1}' >>> blob = zlib_compress(json_str) >>> got_str = zlib_decompress_to_string(blob) >>> got_str == json_str True """ if PY3K: if isinstance(blob, bytes): decompressed = zlib.decompress(blob) else: decompressed = zlib.decompress(bytes(blob, "utf-8")) return decompressed.decode("utf-8") return zlib.decompress(blob) _celery_app = None def get_celery_app(config): global _celery_app if _celery_app: return _celery_app _celery_app = celery.Celery(config_source=config.get('CELERY_CONFIG')) return _celery_app
mit
utilForever/CppChart
CppChart/ChartTest.cpp
2833
#include <thread> #include "Chart.h" #include "Bar.h" #include "Line.h" void DrawOnScreen(CppChart::Chart*); void ChartTest(); int main() { std::thread t(ChartTest); t.join(); return 0; } void DrawOnScreen(CppChart::Chart* graph) { sf::ContextSettings settings; settings.antialiasingLevel = 8; sf::RenderWindow window(sf::VideoMode(800, 600), "Graph Plotting", sf::Style::Default, settings); graph->m_chartOffsets.x = 2; graph->m_chartOffsets.y = 2; graph->SetDimensions(700, 500); graph->m_screenMargins.top = 25; graph->m_screenMargins.bottom = 25; graph->m_screenMargins.left = 25; graph->m_screenMargins.right = 25; graph->SetDefaultLegendMetrics(); window.clear(sf::Color(255, 255, 255)); graph->DrawToScreen(&window); window.display(); while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) { window.close(); } else if (event.type == sf::Event::KeyPressed) { if (event.key.code == sf::Keyboard::Escape || event.key.code == sf::Keyboard::Return) { window.close(); } } } std::this_thread::sleep_for(std::chrono::milliseconds(50)); } } void ChartTest() { char option; CppChart::Chart* graph; do { std::cout << "Which graph do you want to see ?\n"; std::cout << "1. Bar Graph\n"; std::cout << "2. Multi Bar Graph\n"; std::cout << "3. Line Chart\n"; std::cout << "Enter your option [1-3] : "; std::cin >> option; switch (option) { case '1': graph = new CppChart::BarChart(std::vector<CppChart::DataElement> { CppChart::DataElement{ "AAA", sf::Color(255, 105, 97), 23 }, CppChart::DataElement{ "BBB", sf::Color(255, 179, 71), 14 }, CppChart::DataElement{ "CCC", sf::Color(119, 190, 119), 33 }, CppChart::DataElement{ "DDD", sf::Color(150, 111, 214), 12 } }, false); break; case '2': graph = new CppChart::MultiBarChart( { {20, 20}, {35, 56}, {12, 17}, {23, 29} }, { "AAA", "BBB", "CCC", "DDD" }, { sf::Color(50, 200, 50), sf::Color(50, 50, 200) }); graph->m_legend.AddData({ {"AAA", sf::Color(50, 200, 50)}, {"BBB", sf::Color(50, 50, 200)} }); break; case '3': graph = new CppChart::LineChart ({ CppChart::DataElement{ "AAA", sf::Color(255, 105, 97), 23 }, CppChart::DataElement{ "BBB", sf::Color(255, 179, 71), 14 }, CppChart::DataElement{ "CCC", sf::Color(119, 190, 119), 33 }, CppChart::DataElement{ "DDD", sf::Color(150, 111, 214), 12 }, CppChart::DataElement{ "EEE", sf::Color(250, 111, 214), 28 }, CppChart::DataElement{ "FFF", sf::Color(150, 111, 114), 7 } }); break; default: return; } DrawOnScreen(graph); std::cin.get(); std::cin.get(); delete graph; // Clear Screen for (int i = 0; i < 1000; ++i) { std::cout << "\n"; } } while (true); }
mit
Rokfor/rokfor-php-db
config/generated-classes/FieldpostprocessorQuery.php
456
<?php use Base\FieldpostprocessorQuery as BaseFieldpostprocessorQuery; /** * Skeleton subclass for performing query and update operations on the '_fieldpostprocessor' table. * * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as * long as it does not already exist in the output directory. * */ class FieldpostprocessorQuery extends BaseFieldpostprocessorQuery { }
mit
BryceHQ/form-designer
src/lang/zh-cn.js
2957
const lang = { name: '表单设计器', sidebar: '浏览', menu: { "new": '新建', open: '打开', saveAs: '另存为', history: '历史版本', }, button: { newOne: '新建', comfirm: '确认', cancel: '取消', close: '关闭', signin: '登录', signup: '注册', logout: '退出', personCenter: '个人中心', markdown: '使用markdown编辑', expand: '展开', collapse: '收起', add: '添加(在当前页之后)', remove: '删除(当前页)', fullscreen: '全屏', help: '查看帮助', menu: '菜单', background: '设置为默认背景', moreFiles: '到个人中心中查看更多...', }, message: { successSave: '保存成功', successOperate: '操作成功', fullscreen: '按ESC退出全屏', loading: '加载中...', nothing: '这里什么也没有...', upload: '拖拽到这里上传...', uploadBG: '上传背景图片', history(time){ return `创建于 ${time}`; }, historyHint: '点击还原该历史记录', }, error: { passwordUnmatch: '两次输入的密码不一致', }, toolbar: { h1: '一级标题', h2: '二级标题', h3: '三级标题', bold: '加粗', italic: '斜体', quote: '引用', listNumbered: '数字列表', listBulleted: '列表', code: '代码', strikeThrough: '删除线', indent: '缩进', photo: '上传背景图片', }, transition: { text: '切换效果', fade: '淡入', slideRight: '水平滑入', slideUp: '垂直滑入', flash: '闪烁', bounce: '跳跃', zoom: '放大', flip: '翻转', rotate: '旋转', roll: '滚动', }, background: { text: '背景显示效果', right: '右侧突出', left: '左侧突出', vague: '模糊', clear: '清晰', }, default: '# 请输入标题', columns: { name: '名称', lastUpdateTime: '上次更新时间', createTime: '创建时间', }, time: { justnow: '刚刚', minutesago(m){ return `${m} 分钟前`; }, hoursago(h){ return `${h} 小时前`; }, yesterday: '昨天', daysago(d){ return `${d} 天前`; }, longago: '很久之前', }, route: { signup:{ userNameHint: '请输入账号',//please input your account. userNameLabel: '账号', //Your Account passwordHint: '请输入密码', //please input your password. passwordLabel: '密码', //Your Password comfirmHint: '请确认您的密码', //please confirm your password. comfirmLabel: '确认密码', //Confirm Your Password rememberMe: '记住我', //Remember me }, home: { nicknameHint: '昵称', descriptionHint: '写点什么...', profile: '编辑个人介绍', allFiles: '全部的文件', recentFiles: '最近的文件', }, } }; export default lang;
mit
howdyai/botkit
packages/testbot/features/test_convo.js
1320
module.exports = function(controller) { // controller.cms.before('tests','default', async function (bot, convo) { // convo.vars.bar = 'foo'; // convo.vars.foo = 'bar'; // await bot.say('A'); // }); // controller.cms.before('tests','default', async function (bot, convo) { // convo.vars.handler1 = true; // convo.gotoThread('new thread'); // await bot.say('B'); // }); // controller.cms.before('tests','new thread', async function (bot, convo) { // convo.vars.handler2 = 'true'; // convo.gotoThread('new thread 2'); // await bot.say('C'); // }); // controller.cms.onChange('tests', 'question_1', async function (bot, convo, value) { // console.log('CHANGED QUESTION_1 VALUE', value); // convo.vars.question_1 = 'OVERRIDDEN'; // convo.gotoThread('final'); // await bot.say('D'); // }); // controller.cms.after('tests', async function (bot, results) { // // make sure all vars are set // if (!(results.bar && results.foo && results.handler1 && results.handler2)) { // throw new Error('FAILED TO AGGREGATE VARS THROUGH STEPS'); // } // console.log('TESTS SCRIPT IS DONE!', results); // await bot.say('E'); // }); }
mit
bitzesty/trade-tariff-backend
spec/support/codes_mapping_helper.rb
219
module CodesMappingHelper def stub_codes_mapping_data res = [ %w[10101111 22101122], %w[10101112 22101133] ].to_h allow(SearchService::CodesMapping).to receive(:data).and_return(res) end end
mit
DennisWandschura/vxEngine
source/LevelEditorSharp/EditorForm.Designer.cs
56593
/* The MIT License (MIT) Copyright (c) 2015 Dennis Wandschura 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. */ namespace LevelEditor { partial class EditorForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditorForm)); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.importAssetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.loadMeshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveSceneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.addJointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.removeJointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.createToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.createMeshInstanceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.createLightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.createActorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.itemShotNavmesh = new System.Windows.Forms.ToolStripMenuItem(); this.itemInfluenceMap = new System.Windows.Forms.ToolStripMenuItem(); this.lightsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.panel_render = new System.Windows.Forms.Panel(); this.openFileDialog_importAsset = new System.Windows.Forms.OpenFileDialog(); this.treeView_entities = new System.Windows.Forms.TreeView(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.comboBox_selectEditorMode = new System.Windows.Forms.ToolStripComboBox(); this.toolStripButtonCreateLight = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonCreateMeshInstance = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonCreateSpawn = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonCreateJoint = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonCreateLightGeometryProxy = new System.Windows.Forms.ToolStripButton(); this.openFileDialog1_loadScene = new System.Windows.Forms.OpenFileDialog(); this.saveFileDialog_scene = new System.Windows.Forms.SaveFileDialog(); this.numericUpDownNavmeshPositionZ = new System.Windows.Forms.NumericUpDown(); this.numericUpDownNavmeshPositionY = new System.Windows.Forms.NumericUpDown(); this.numericUpDownNavmeshPositionX = new System.Windows.Forms.NumericUpDown(); this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel(); this.label4 = new System.Windows.Forms.Label(); this.groupBoxNavMesh = new System.Windows.Forms.GroupBox(); this.groupBoxLight = new System.Windows.Forms.GroupBox(); this.flowLayoutPanel10 = new System.Windows.Forms.FlowLayoutPanel(); this.label9 = new System.Windows.Forms.Label(); this.numericUpDownLightFalloff = new System.Windows.Forms.NumericUpDown(); this.flowLayoutPanel5 = new System.Windows.Forms.FlowLayoutPanel(); this.label5 = new System.Windows.Forms.Label(); this.numericUpDownLightX = new System.Windows.Forms.NumericUpDown(); this.numericUpDownLightY = new System.Windows.Forms.NumericUpDown(); this.numericUpDownLightZ = new System.Windows.Forms.NumericUpDown(); this.flowLayoutPanel11 = new System.Windows.Forms.FlowLayoutPanel(); this.label10 = new System.Windows.Forms.Label(); this.numericUpDownLightLumen = new System.Windows.Forms.NumericUpDown(); this.treeViewActionList = new System.Windows.Forms.TreeView(); this.groupBoxSpawn = new System.Windows.Forms.GroupBox(); this.comboBoxActor = new System.Windows.Forms.ComboBox(); this.flowLayoutPanel13 = new System.Windows.Forms.FlowLayoutPanel(); this.label12 = new System.Windows.Forms.Label(); this.numericUpDownSpawnType = new System.Windows.Forms.NumericUpDown(); this.label1 = new System.Windows.Forms.Label(); this.flowLayoutPanel12 = new System.Windows.Forms.FlowLayoutPanel(); this.label11 = new System.Windows.Forms.Label(); this.numericUpDownSpawnPosX = new System.Windows.Forms.NumericUpDown(); this.numericUpDownSpawnPosY = new System.Windows.Forms.NumericUpDown(); this.numericUpDownSpawnPosZ = new System.Windows.Forms.NumericUpDown(); this.toolStripButtonTestProxies = new System.Windows.Forms.ToolStripButton(); this.menuStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownNavmeshPositionZ)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownNavmeshPositionY)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownNavmeshPositionX)).BeginInit(); this.flowLayoutPanel4.SuspendLayout(); this.groupBoxNavMesh.SuspendLayout(); this.groupBoxLight.SuspendLayout(); this.flowLayoutPanel10.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLightFalloff)).BeginInit(); this.flowLayoutPanel5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLightX)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLightY)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLightZ)).BeginInit(); this.flowLayoutPanel11.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLightLumen)).BeginInit(); this.groupBoxSpawn.SuspendLayout(); this.flowLayoutPanel13.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpawnType)).BeginInit(); this.flowLayoutPanel12.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpawnPosX)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpawnPosY)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpawnPosZ)).BeginInit(); this.SuspendLayout(); // // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.editToolStripMenuItem, this.createToolStripMenuItem, this.viewToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(2544, 24); this.menuStrip1.TabIndex = 0; this.menuStrip1.Text = "menuStrip1"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.importAssetToolStripMenuItem, this.loadMeshToolStripMenuItem, this.saveToolStripMenuItem, this.saveSceneToolStripMenuItem, this.exitToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "File"; // // importAssetToolStripMenuItem // this.importAssetToolStripMenuItem.Name = "importAssetToolStripMenuItem"; this.importAssetToolStripMenuItem.Size = new System.Drawing.Size(186, 22); this.importAssetToolStripMenuItem.Text = "Import Asset"; this.importAssetToolStripMenuItem.Click += new System.EventHandler(this.importAssetToolStripMenuItem_Click); // // loadMeshToolStripMenuItem // this.loadMeshToolStripMenuItem.Name = "loadMeshToolStripMenuItem"; this.loadMeshToolStripMenuItem.Size = new System.Drawing.Size(186, 22); this.loadMeshToolStripMenuItem.Text = "Load"; this.loadMeshToolStripMenuItem.Click += new System.EventHandler(this.loadMeshToolStripMenuItem_Click); // // saveToolStripMenuItem // this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); this.saveToolStripMenuItem.Size = new System.Drawing.Size(186, 22); this.saveToolStripMenuItem.Text = "Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // // saveSceneToolStripMenuItem // this.saveSceneToolStripMenuItem.Name = "saveSceneToolStripMenuItem"; this.saveSceneToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.S))); this.saveSceneToolStripMenuItem.Size = new System.Drawing.Size(186, 22); this.saveSceneToolStripMenuItem.Text = "Save As"; this.saveSceneToolStripMenuItem.Click += new System.EventHandler(this.saveSceneToolStripMenuItem_Click); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Size = new System.Drawing.Size(186, 22); this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // // editToolStripMenuItem // this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.undoToolStripMenuItem, this.redoToolStripMenuItem, this.addJointToolStripMenuItem, this.removeJointToolStripMenuItem}); this.editToolStripMenuItem.Name = "editToolStripMenuItem"; this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); this.editToolStripMenuItem.Text = "Edit"; // // undoToolStripMenuItem // this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; this.undoToolStripMenuItem.Size = new System.Drawing.Size(145, 22); this.undoToolStripMenuItem.Text = "Undo"; this.undoToolStripMenuItem.Click += new System.EventHandler(this.undoToolStripMenuItem_Click); // // redoToolStripMenuItem // this.redoToolStripMenuItem.Name = "redoToolStripMenuItem"; this.redoToolStripMenuItem.Size = new System.Drawing.Size(145, 22); this.redoToolStripMenuItem.Text = "Redo"; this.redoToolStripMenuItem.Click += new System.EventHandler(this.redoToolStripMenuItem_Click); // // addJointToolStripMenuItem // this.addJointToolStripMenuItem.Name = "addJointToolStripMenuItem"; this.addJointToolStripMenuItem.Size = new System.Drawing.Size(145, 22); this.addJointToolStripMenuItem.Text = "Add Joint"; this.addJointToolStripMenuItem.Visible = false; this.addJointToolStripMenuItem.Click += new System.EventHandler(this.addJointToolStripMenuItem_Click); // // removeJointToolStripMenuItem // this.removeJointToolStripMenuItem.Name = "removeJointToolStripMenuItem"; this.removeJointToolStripMenuItem.Size = new System.Drawing.Size(145, 22); this.removeJointToolStripMenuItem.Text = "Remove Joint"; this.removeJointToolStripMenuItem.Visible = false; this.removeJointToolStripMenuItem.Click += new System.EventHandler(this.removeJointToolStripMenuItem_Click); // // createToolStripMenuItem // this.createToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.createMeshInstanceToolStripMenuItem, this.createLightToolStripMenuItem, this.createActorToolStripMenuItem}); this.createToolStripMenuItem.Name = "createToolStripMenuItem"; this.createToolStripMenuItem.Size = new System.Drawing.Size(53, 20); this.createToolStripMenuItem.Text = "Create"; // // createMeshInstanceToolStripMenuItem // this.createMeshInstanceToolStripMenuItem.Name = "createMeshInstanceToolStripMenuItem"; this.createMeshInstanceToolStripMenuItem.Size = new System.Drawing.Size(187, 22); this.createMeshInstanceToolStripMenuItem.Text = "Create Mesh Instance"; this.createMeshInstanceToolStripMenuItem.Click += new System.EventHandler(this.createMeshInstanceToolStripMenuItem_Click); // // createLightToolStripMenuItem // this.createLightToolStripMenuItem.Name = "createLightToolStripMenuItem"; this.createLightToolStripMenuItem.Size = new System.Drawing.Size(187, 22); this.createLightToolStripMenuItem.Text = "Create Light"; this.createLightToolStripMenuItem.Click += new System.EventHandler(this.createLightToolStripMenuItem_Click); // // createActorToolStripMenuItem // this.createActorToolStripMenuItem.Name = "createActorToolStripMenuItem"; this.createActorToolStripMenuItem.Size = new System.Drawing.Size(187, 22); this.createActorToolStripMenuItem.Text = "Create Actor"; this.createActorToolStripMenuItem.Click += new System.EventHandler(this.createActorToolStripMenuItem_Click); // // viewToolStripMenuItem // this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.itemShotNavmesh, this.itemInfluenceMap, this.lightsToolStripMenuItem}); this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.viewToolStripMenuItem.Text = "View"; // // itemShotNavmesh // this.itemShotNavmesh.Checked = true; this.itemShotNavmesh.CheckOnClick = true; this.itemShotNavmesh.CheckState = System.Windows.Forms.CheckState.Checked; this.itemShotNavmesh.Name = "itemShotNavmesh"; this.itemShotNavmesh.Size = new System.Drawing.Size(150, 22); this.itemShotNavmesh.Text = "Navmesh"; this.itemShotNavmesh.Click += new System.EventHandler(this.itemShotNavmesh_Click); // // itemInfluenceMap // this.itemInfluenceMap.Checked = true; this.itemInfluenceMap.CheckOnClick = true; this.itemInfluenceMap.CheckState = System.Windows.Forms.CheckState.Checked; this.itemInfluenceMap.Name = "itemInfluenceMap"; this.itemInfluenceMap.Size = new System.Drawing.Size(150, 22); this.itemInfluenceMap.Text = "Influence Map"; this.itemInfluenceMap.Click += new System.EventHandler(this.itemInfluenceMap_Click); // // lightsToolStripMenuItem // this.lightsToolStripMenuItem.Checked = true; this.lightsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.lightsToolStripMenuItem.Name = "lightsToolStripMenuItem"; this.lightsToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.lightsToolStripMenuItem.Text = "Lights"; this.lightsToolStripMenuItem.Click += new System.EventHandler(this.lightsToolStripMenuItem_Click); // // panel_render // this.panel_render.Location = new System.Drawing.Point(12, 118); this.panel_render.Name = "panel_render"; this.panel_render.Size = new System.Drawing.Size(1920, 1080); this.panel_render.TabIndex = 1; this.panel_render.Paint += new System.Windows.Forms.PaintEventHandler(this.panel_render_Paint); this.panel_render.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel_render_MouseDown); this.panel_render.MouseEnter += new System.EventHandler(this.panel_render_MouseEnter); this.panel_render.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_render_MouseMove); this.panel_render.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel_render_MouseUp); // // openFileDialog_importAsset // this.openFileDialog_importAsset.Filter = "mesh|*.mesh|material|*.material|fbx|*.fbx|animation|*.animation"; this.openFileDialog_importAsset.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog_import_FileOk); // // treeView_entities // this.treeView_entities.Location = new System.Drawing.Point(1977, 118); this.treeView_entities.Name = "treeView_entities"; this.treeView_entities.Size = new System.Drawing.Size(280, 398); this.treeView_entities.TabIndex = 2; this.treeView_entities.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_entities_AfterSelect); // // toolStrip1 // this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.comboBox_selectEditorMode, this.toolStripButtonCreateLight, this.toolStripButtonCreateMeshInstance, this.toolStripButtonCreateSpawn, this.toolStripButtonCreateJoint, this.toolStripButtonCreateLightGeometryProxy, this.toolStripButtonTestProxies}); this.toolStrip1.Location = new System.Drawing.Point(0, 24); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(2544, 25); this.toolStrip1.TabIndex = 11; this.toolStrip1.Text = "toolStrip1"; // // comboBox_selectEditorMode // this.comboBox_selectEditorMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox_selectEditorMode.Name = "comboBox_selectEditorMode"; this.comboBox_selectEditorMode.Size = new System.Drawing.Size(150, 25); this.comboBox_selectEditorMode.SelectedIndexChanged += new System.EventHandler(this.comboBox_selectEditorMode_SelectedIndexChanged); this.comboBox_selectEditorMode.Click += new System.EventHandler(this.comboBox_selectEditorMode_Click); // // toolStripButtonCreateLight // this.toolStripButtonCreateLight.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButtonCreateLight.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonCreateLight.Image"))); this.toolStripButtonCreateLight.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonCreateLight.Name = "toolStripButtonCreateLight"; this.toolStripButtonCreateLight.Size = new System.Drawing.Size(23, 22); this.toolStripButtonCreateLight.Text = "Create Light"; this.toolStripButtonCreateLight.Visible = false; this.toolStripButtonCreateLight.Click += new System.EventHandler(this.toolStripButtonCreateLight_Click); // // toolStripButtonCreateMeshInstance // this.toolStripButtonCreateMeshInstance.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButtonCreateMeshInstance.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonCreateMeshInstance.Image"))); this.toolStripButtonCreateMeshInstance.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonCreateMeshInstance.Name = "toolStripButtonCreateMeshInstance"; this.toolStripButtonCreateMeshInstance.Size = new System.Drawing.Size(23, 22); this.toolStripButtonCreateMeshInstance.Text = "Create Mesh Instance"; this.toolStripButtonCreateMeshInstance.Visible = false; this.toolStripButtonCreateMeshInstance.Click += new System.EventHandler(this.toolStripButtonCreateMeshInstance_Click); // // toolStripButtonCreateSpawn // this.toolStripButtonCreateSpawn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButtonCreateSpawn.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonCreateSpawn.Image"))); this.toolStripButtonCreateSpawn.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonCreateSpawn.Name = "toolStripButtonCreateSpawn"; this.toolStripButtonCreateSpawn.Size = new System.Drawing.Size(23, 22); this.toolStripButtonCreateSpawn.Text = "Create Spawn"; this.toolStripButtonCreateSpawn.Visible = false; this.toolStripButtonCreateSpawn.Click += new System.EventHandler(this.toolStripButtonCreateSpawn_Click); // // toolStripButtonCreateJoint // this.toolStripButtonCreateJoint.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButtonCreateJoint.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonCreateJoint.Image"))); this.toolStripButtonCreateJoint.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonCreateJoint.Name = "toolStripButtonCreateJoint"; this.toolStripButtonCreateJoint.Size = new System.Drawing.Size(23, 22); this.toolStripButtonCreateJoint.Text = "Create Joint"; this.toolStripButtonCreateJoint.Visible = false; this.toolStripButtonCreateJoint.Click += new System.EventHandler(this.toolStripButtonCreateJoint_Click); // // toolStripButtonCreateLightGeometryProxy // this.toolStripButtonCreateLightGeometryProxy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButtonCreateLightGeometryProxy.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonCreateLightGeometryProxy.Image"))); this.toolStripButtonCreateLightGeometryProxy.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonCreateLightGeometryProxy.Name = "toolStripButtonCreateLightGeometryProxy"; this.toolStripButtonCreateLightGeometryProxy.Size = new System.Drawing.Size(23, 22); this.toolStripButtonCreateLightGeometryProxy.Text = "Create Light Geometry Proxy"; this.toolStripButtonCreateLightGeometryProxy.Visible = false; this.toolStripButtonCreateLightGeometryProxy.Click += new System.EventHandler(this.toolStripButtonCreateLightProxyGeometry_Click); // // openFileDialog1_loadScene // this.openFileDialog1_loadScene.FileName = "openFileDialog1"; this.openFileDialog1_loadScene.Filter = "scene|*scene"; this.openFileDialog1_loadScene.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_loadScene_FileOk); // // saveFileDialog_scene // this.saveFileDialog_scene.DefaultExt = "scene"; this.saveFileDialog_scene.Filter = "Scene|*.scene"; this.saveFileDialog_scene.FileOk += new System.ComponentModel.CancelEventHandler(this.saveFileDialog_scene_FileOk); // // numericUpDownNavmeshPositionZ // this.numericUpDownNavmeshPositionZ.DecimalPlaces = 4; this.numericUpDownNavmeshPositionZ.Location = new System.Drawing.Point(265, 3); this.numericUpDownNavmeshPositionZ.Maximum = new decimal(new int[] { 50000, 0, 0, 0}); this.numericUpDownNavmeshPositionZ.Minimum = new decimal(new int[] { 50000, 0, 0, -2147483648}); this.numericUpDownNavmeshPositionZ.Name = "numericUpDownNavmeshPositionZ"; this.numericUpDownNavmeshPositionZ.Size = new System.Drawing.Size(100, 20); this.numericUpDownNavmeshPositionZ.TabIndex = 14; this.numericUpDownNavmeshPositionZ.ValueChanged += new System.EventHandler(this.numericUpDownNavmeshPositionZ_ValueChanged); // // numericUpDownNavmeshPositionY // this.numericUpDownNavmeshPositionY.DecimalPlaces = 4; this.numericUpDownNavmeshPositionY.Location = new System.Drawing.Point(159, 3); this.numericUpDownNavmeshPositionY.Maximum = new decimal(new int[] { 50000, 0, 0, 0}); this.numericUpDownNavmeshPositionY.Minimum = new decimal(new int[] { 50000, 0, 0, -2147483648}); this.numericUpDownNavmeshPositionY.Name = "numericUpDownNavmeshPositionY"; this.numericUpDownNavmeshPositionY.Size = new System.Drawing.Size(100, 20); this.numericUpDownNavmeshPositionY.TabIndex = 13; this.numericUpDownNavmeshPositionY.ValueChanged += new System.EventHandler(this.numericUpDownNavmeshPositionY_ValueChanged); // // numericUpDownNavmeshPositionX // this.numericUpDownNavmeshPositionX.DecimalPlaces = 4; this.numericUpDownNavmeshPositionX.Location = new System.Drawing.Point(53, 3); this.numericUpDownNavmeshPositionX.Maximum = new decimal(new int[] { 50000, 0, 0, 0}); this.numericUpDownNavmeshPositionX.Minimum = new decimal(new int[] { 50000, 0, 0, -2147483648}); this.numericUpDownNavmeshPositionX.Name = "numericUpDownNavmeshPositionX"; this.numericUpDownNavmeshPositionX.Size = new System.Drawing.Size(100, 20); this.numericUpDownNavmeshPositionX.TabIndex = 12; this.numericUpDownNavmeshPositionX.ValueChanged += new System.EventHandler(this.numericUpDownNavmeshPositionX_ValueChanged); // // flowLayoutPanel4 // this.flowLayoutPanel4.Controls.Add(this.label4); this.flowLayoutPanel4.Controls.Add(this.numericUpDownNavmeshPositionX); this.flowLayoutPanel4.Controls.Add(this.numericUpDownNavmeshPositionY); this.flowLayoutPanel4.Controls.Add(this.numericUpDownNavmeshPositionZ); this.flowLayoutPanel4.Location = new System.Drawing.Point(12, 19); this.flowLayoutPanel4.Name = "flowLayoutPanel4"; this.flowLayoutPanel4.Size = new System.Drawing.Size(380, 28); this.flowLayoutPanel4.TabIndex = 15; // // label4 // this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(3, 0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(44, 26); this.label4.TabIndex = 16; this.label4.Text = "Position"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // groupBoxNavMesh // this.groupBoxNavMesh.Controls.Add(this.flowLayoutPanel4); this.groupBoxNavMesh.Location = new System.Drawing.Point(1983, 957); this.groupBoxNavMesh.Name = "groupBoxNavMesh"; this.groupBoxNavMesh.Size = new System.Drawing.Size(398, 59); this.groupBoxNavMesh.TabIndex = 16; this.groupBoxNavMesh.TabStop = false; this.groupBoxNavMesh.Text = "Navmesh"; // // groupBoxLight // this.groupBoxLight.Controls.Add(this.flowLayoutPanel10); this.groupBoxLight.Controls.Add(this.flowLayoutPanel5); this.groupBoxLight.Controls.Add(this.flowLayoutPanel11); this.groupBoxLight.Location = new System.Drawing.Point(1983, 1022); this.groupBoxLight.Name = "groupBoxLight"; this.groupBoxLight.Size = new System.Drawing.Size(398, 124); this.groupBoxLight.TabIndex = 17; this.groupBoxLight.TabStop = false; this.groupBoxLight.Text = "Lights"; // // flowLayoutPanel10 // this.flowLayoutPanel10.Controls.Add(this.label9); this.flowLayoutPanel10.Controls.Add(this.numericUpDownLightFalloff); this.flowLayoutPanel10.Location = new System.Drawing.Point(12, 53); this.flowLayoutPanel10.Name = "flowLayoutPanel10"; this.flowLayoutPanel10.Size = new System.Drawing.Size(380, 28); this.flowLayoutPanel10.TabIndex = 15; // // label9 // this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(3, 0); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(35, 26); this.label9.TabIndex = 16; this.label9.Text = "Falloff"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // numericUpDownLightFalloff // this.numericUpDownLightFalloff.DecimalPlaces = 4; this.numericUpDownLightFalloff.Location = new System.Drawing.Point(44, 3); this.numericUpDownLightFalloff.Maximum = new decimal(new int[] { 50000, 0, 0, 0}); this.numericUpDownLightFalloff.Minimum = new decimal(new int[] { 50000, 0, 0, -2147483648}); this.numericUpDownLightFalloff.Name = "numericUpDownLightFalloff"; this.numericUpDownLightFalloff.Size = new System.Drawing.Size(100, 20); this.numericUpDownLightFalloff.TabIndex = 12; this.numericUpDownLightFalloff.ValueChanged += new System.EventHandler(this.numericUpDownLightFalloff_ValueChanged); // // flowLayoutPanel5 // this.flowLayoutPanel5.Controls.Add(this.label5); this.flowLayoutPanel5.Controls.Add(this.numericUpDownLightX); this.flowLayoutPanel5.Controls.Add(this.numericUpDownLightY); this.flowLayoutPanel5.Controls.Add(this.numericUpDownLightZ); this.flowLayoutPanel5.Location = new System.Drawing.Point(12, 19); this.flowLayoutPanel5.Name = "flowLayoutPanel5"; this.flowLayoutPanel5.Size = new System.Drawing.Size(380, 28); this.flowLayoutPanel5.TabIndex = 15; // // label5 // this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(3, 0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(44, 26); this.label5.TabIndex = 16; this.label5.Text = "Position"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // numericUpDownLightX // this.numericUpDownLightX.DecimalPlaces = 4; this.numericUpDownLightX.Location = new System.Drawing.Point(53, 3); this.numericUpDownLightX.Maximum = new decimal(new int[] { 50000, 0, 0, 0}); this.numericUpDownLightX.Minimum = new decimal(new int[] { 50000, 0, 0, -2147483648}); this.numericUpDownLightX.Name = "numericUpDownLightX"; this.numericUpDownLightX.Size = new System.Drawing.Size(100, 20); this.numericUpDownLightX.TabIndex = 12; this.numericUpDownLightX.ValueChanged += new System.EventHandler(this.numericUpDownLightX_ValueChanged); // // numericUpDownLightY // this.numericUpDownLightY.DecimalPlaces = 4; this.numericUpDownLightY.Location = new System.Drawing.Point(159, 3); this.numericUpDownLightY.Maximum = new decimal(new int[] { 50000, 0, 0, 0}); this.numericUpDownLightY.Minimum = new decimal(new int[] { 50000, 0, 0, -2147483648}); this.numericUpDownLightY.Name = "numericUpDownLightY"; this.numericUpDownLightY.Size = new System.Drawing.Size(100, 20); this.numericUpDownLightY.TabIndex = 13; this.numericUpDownLightY.ValueChanged += new System.EventHandler(this.numericUpDownLightY_ValueChanged); // // numericUpDownLightZ // this.numericUpDownLightZ.DecimalPlaces = 4; this.numericUpDownLightZ.Location = new System.Drawing.Point(265, 3); this.numericUpDownLightZ.Maximum = new decimal(new int[] { 50000, 0, 0, 0}); this.numericUpDownLightZ.Minimum = new decimal(new int[] { 50000, 0, 0, -2147483648}); this.numericUpDownLightZ.Name = "numericUpDownLightZ"; this.numericUpDownLightZ.Size = new System.Drawing.Size(100, 20); this.numericUpDownLightZ.TabIndex = 14; this.numericUpDownLightZ.ValueChanged += new System.EventHandler(this.numericUpDownLightZ_ValueChanged); // // flowLayoutPanel11 // this.flowLayoutPanel11.Controls.Add(this.label10); this.flowLayoutPanel11.Controls.Add(this.numericUpDownLightLumen); this.flowLayoutPanel11.Location = new System.Drawing.Point(12, 87); this.flowLayoutPanel11.Name = "flowLayoutPanel11"; this.flowLayoutPanel11.Size = new System.Drawing.Size(380, 28); this.flowLayoutPanel11.TabIndex = 17; // // label10 // this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(3, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(39, 26); this.label10.TabIndex = 16; this.label10.Text = "Lumen"; this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // numericUpDownLightLumen // this.numericUpDownLightLumen.DecimalPlaces = 4; this.numericUpDownLightLumen.Location = new System.Drawing.Point(48, 3); this.numericUpDownLightLumen.Maximum = new decimal(new int[] { 50000, 0, 0, 0}); this.numericUpDownLightLumen.Name = "numericUpDownLightLumen"; this.numericUpDownLightLumen.Size = new System.Drawing.Size(100, 20); this.numericUpDownLightLumen.TabIndex = 12; this.numericUpDownLightLumen.ValueChanged += new System.EventHandler(this.numericUpDownLightLumen_ValueChanged); // // treeViewActionList // this.treeViewActionList.Location = new System.Drawing.Point(2295, 118); this.treeViewActionList.Name = "treeViewActionList"; this.treeViewActionList.Size = new System.Drawing.Size(209, 398); this.treeViewActionList.TabIndex = 18; this.treeViewActionList.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViewActionList_AfterSelect); // // groupBoxSpawn // this.groupBoxSpawn.Controls.Add(this.comboBoxActor); this.groupBoxSpawn.Controls.Add(this.flowLayoutPanel13); this.groupBoxSpawn.Controls.Add(this.label1); this.groupBoxSpawn.Controls.Add(this.flowLayoutPanel12); this.groupBoxSpawn.Location = new System.Drawing.Point(1990, 1198); this.groupBoxSpawn.Name = "groupBoxSpawn"; this.groupBoxSpawn.Size = new System.Drawing.Size(398, 147); this.groupBoxSpawn.TabIndex = 17; this.groupBoxSpawn.TabStop = false; this.groupBoxSpawn.Text = "Spawn"; // // comboBoxActor // this.comboBoxActor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxActor.FormattingEnabled = true; this.comboBoxActor.Location = new System.Drawing.Point(130, 102); this.comboBoxActor.Name = "comboBoxActor"; this.comboBoxActor.Size = new System.Drawing.Size(121, 21); this.comboBoxActor.TabIndex = 19; this.comboBoxActor.SelectedIndexChanged += new System.EventHandler(this.comboBoxActor_SelectedIndexChanged); // // flowLayoutPanel13 // this.flowLayoutPanel13.Controls.Add(this.label12); this.flowLayoutPanel13.Controls.Add(this.numericUpDownSpawnType); this.flowLayoutPanel13.Location = new System.Drawing.Point(12, 53); this.flowLayoutPanel13.Name = "flowLayoutPanel13"; this.flowLayoutPanel13.Size = new System.Drawing.Size(380, 28); this.flowLayoutPanel13.TabIndex = 18; // // label12 // this.label12.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.label12.AutoSize = true; this.label12.Location = new System.Drawing.Point(3, 0); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(31, 26); this.label12.TabIndex = 16; this.label12.Text = "Type"; this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // numericUpDownSpawnType // this.numericUpDownSpawnType.Location = new System.Drawing.Point(40, 3); this.numericUpDownSpawnType.Maximum = new decimal(new int[] { 2, 0, 0, 0}); this.numericUpDownSpawnType.Name = "numericUpDownSpawnType"; this.numericUpDownSpawnType.Size = new System.Drawing.Size(100, 20); this.numericUpDownSpawnType.TabIndex = 12; this.numericUpDownSpawnType.ValueChanged += new System.EventHandler(this.numericUpDownSpawnType_ValueChanged); // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(89, 110); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(35, 13); this.label1.TabIndex = 17; this.label1.Text = "Actor:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // flowLayoutPanel12 // this.flowLayoutPanel12.Controls.Add(this.label11); this.flowLayoutPanel12.Controls.Add(this.numericUpDownSpawnPosX); this.flowLayoutPanel12.Controls.Add(this.numericUpDownSpawnPosY); this.flowLayoutPanel12.Controls.Add(this.numericUpDownSpawnPosZ); this.flowLayoutPanel12.Location = new System.Drawing.Point(12, 19); this.flowLayoutPanel12.Name = "flowLayoutPanel12"; this.flowLayoutPanel12.Size = new System.Drawing.Size(380, 28); this.flowLayoutPanel12.TabIndex = 15; // // label11 // this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(3, 0); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(44, 26); this.label11.TabIndex = 16; this.label11.Text = "Position"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // numericUpDownSpawnPosX // this.numericUpDownSpawnPosX.DecimalPlaces = 4; this.numericUpDownSpawnPosX.Location = new System.Drawing.Point(53, 3); this.numericUpDownSpawnPosX.Maximum = new decimal(new int[] { 50000, 0, 0, 0}); this.numericUpDownSpawnPosX.Minimum = new decimal(new int[] { 50000, 0, 0, -2147483648}); this.numericUpDownSpawnPosX.Name = "numericUpDownSpawnPosX"; this.numericUpDownSpawnPosX.Size = new System.Drawing.Size(100, 20); this.numericUpDownSpawnPosX.TabIndex = 12; this.numericUpDownSpawnPosX.ValueChanged += new System.EventHandler(this.numericUpDownSpawnPosX_ValueChanged); // // numericUpDownSpawnPosY // this.numericUpDownSpawnPosY.DecimalPlaces = 4; this.numericUpDownSpawnPosY.Location = new System.Drawing.Point(159, 3); this.numericUpDownSpawnPosY.Maximum = new decimal(new int[] { 50000, 0, 0, 0}); this.numericUpDownSpawnPosY.Minimum = new decimal(new int[] { 50000, 0, 0, -2147483648}); this.numericUpDownSpawnPosY.Name = "numericUpDownSpawnPosY"; this.numericUpDownSpawnPosY.Size = new System.Drawing.Size(100, 20); this.numericUpDownSpawnPosY.TabIndex = 13; this.numericUpDownSpawnPosY.ValueChanged += new System.EventHandler(this.numericUpDownSpawnPosY_ValueChanged); // // numericUpDownSpawnPosZ // this.numericUpDownSpawnPosZ.DecimalPlaces = 4; this.numericUpDownSpawnPosZ.Location = new System.Drawing.Point(265, 3); this.numericUpDownSpawnPosZ.Maximum = new decimal(new int[] { 50000, 0, 0, 0}); this.numericUpDownSpawnPosZ.Minimum = new decimal(new int[] { 50000, 0, 0, -2147483648}); this.numericUpDownSpawnPosZ.Name = "numericUpDownSpawnPosZ"; this.numericUpDownSpawnPosZ.Size = new System.Drawing.Size(100, 20); this.numericUpDownSpawnPosZ.TabIndex = 14; this.numericUpDownSpawnPosZ.ValueChanged += new System.EventHandler(this.numericUpDownSpawnPosZ_ValueChanged); // // toolStripButtonTestProxies // this.toolStripButtonTestProxies.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButtonTestProxies.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonTestProxies.Image"))); this.toolStripButtonTestProxies.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonTestProxies.Name = "toolStripButtonTestProxies"; this.toolStripButtonTestProxies.Size = new System.Drawing.Size(23, 22); this.toolStripButtonTestProxies.Text = "Test Proxies"; this.toolStripButtonTestProxies.Visible = false; this.toolStripButtonTestProxies.Click += new System.EventHandler(this.toolStripButtonTestProxies_Click); // // EditorForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(2544, 1401); this.Controls.Add(this.groupBoxSpawn); this.Controls.Add(this.treeViewActionList); this.Controls.Add(this.groupBoxLight); this.Controls.Add(this.groupBoxNavMesh); this.Controls.Add(this.toolStrip1); this.Controls.Add(this.treeView_entities); this.Controls.Add(this.panel_render); this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; this.Name = "EditorForm"; this.Text = "vxEditor"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown); this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Form1_KeyPress); this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyUp); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownNavmeshPositionZ)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownNavmeshPositionY)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownNavmeshPositionX)).EndInit(); this.flowLayoutPanel4.ResumeLayout(false); this.flowLayoutPanel4.PerformLayout(); this.groupBoxNavMesh.ResumeLayout(false); this.groupBoxLight.ResumeLayout(false); this.flowLayoutPanel10.ResumeLayout(false); this.flowLayoutPanel10.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLightFalloff)).EndInit(); this.flowLayoutPanel5.ResumeLayout(false); this.flowLayoutPanel5.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLightX)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLightY)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLightZ)).EndInit(); this.flowLayoutPanel11.ResumeLayout(false); this.flowLayoutPanel11.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLightLumen)).EndInit(); this.groupBoxSpawn.ResumeLayout(false); this.groupBoxSpawn.PerformLayout(); this.flowLayoutPanel13.ResumeLayout(false); this.flowLayoutPanel13.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpawnType)).EndInit(); this.flowLayoutPanel12.ResumeLayout(false); this.flowLayoutPanel12.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpawnPosX)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpawnPosY)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpawnPosZ)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem loadMeshToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; private System.Windows.Forms.Panel panel_render; private System.Windows.Forms.ToolStripMenuItem createToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem createMeshInstanceToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem createLightToolStripMenuItem; private System.Windows.Forms.OpenFileDialog openFileDialog_importAsset; private System.Windows.Forms.TreeView treeView_entities; private System.Windows.Forms.ToolStripMenuItem saveSceneToolStripMenuItem; private System.Windows.Forms.ToolStrip toolStrip1; private System.Windows.Forms.ToolStripMenuItem importAssetToolStripMenuItem; private System.Windows.Forms.OpenFileDialog openFileDialog1_loadScene; private System.Windows.Forms.SaveFileDialog saveFileDialog_scene; private System.Windows.Forms.ToolStripComboBox comboBox_selectEditorMode; private System.Windows.Forms.NumericUpDown numericUpDownNavmeshPositionZ; private System.Windows.Forms.NumericUpDown numericUpDownNavmeshPositionY; private System.Windows.Forms.NumericUpDown numericUpDownNavmeshPositionX; private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel4; private System.Windows.Forms.GroupBox groupBoxNavMesh; private System.Windows.Forms.Label label4; private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem itemShotNavmesh; private System.Windows.Forms.ToolStripMenuItem itemInfluenceMap; private System.Windows.Forms.GroupBox groupBoxLight; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel5; private System.Windows.Forms.Label label5; private System.Windows.Forms.NumericUpDown numericUpDownLightX; private System.Windows.Forms.NumericUpDown numericUpDownLightY; private System.Windows.Forms.NumericUpDown numericUpDownLightZ; private System.Windows.Forms.ToolStripButton toolStripButtonCreateLight; private System.Windows.Forms.ToolStripButton toolStripButtonCreateMeshInstance; private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem; private System.Windows.Forms.TreeView treeViewActionList; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel10; private System.Windows.Forms.Label label9; private System.Windows.Forms.NumericUpDown numericUpDownLightFalloff; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel11; private System.Windows.Forms.Label label10; private System.Windows.Forms.NumericUpDown numericUpDownLightLumen; private System.Windows.Forms.ToolStripButton toolStripButtonCreateSpawn; private System.Windows.Forms.GroupBox groupBoxSpawn; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel12; private System.Windows.Forms.Label label11; private System.Windows.Forms.NumericUpDown numericUpDownSpawnPosX; private System.Windows.Forms.NumericUpDown numericUpDownSpawnPosY; private System.Windows.Forms.NumericUpDown numericUpDownSpawnPosZ; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel13; private System.Windows.Forms.Label label12; private System.Windows.Forms.NumericUpDown numericUpDownSpawnType; private System.Windows.Forms.ToolStripButton toolStripButtonCreateJoint; private System.Windows.Forms.ToolStripMenuItem removeJointToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem addJointToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem createActorToolStripMenuItem; private System.Windows.Forms.ComboBox comboBoxActor; private System.Windows.Forms.Label label1; private System.Windows.Forms.ToolStripButton toolStripButtonCreateLightGeometryProxy; private System.Windows.Forms.ToolStripMenuItem lightsToolStripMenuItem; private System.Windows.Forms.ToolStripButton toolStripButtonTestProxies; } }
mit
impedimentToProgress/UCI-BlueChip
VHDLExpressionEval/src/net/java/dev/eval/Compiler.java
3268
/* * Copyright 2008 Reg Whitton * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.java.dev.eval; class Compiler { private final Tokeniser tokeniser; Compiler(String expression) { tokeniser = new Tokeniser(expression); } Operation compile() { Object expression = compile(null, null, 0, (char) 0, -1); /* * If expression is a variable name or constant value then we * need to put into a NOP operation. */ if(expression instanceof Operation) { return (Operation)expression; } return Operation.nopOperationfactory(expression); } private Object compile(Object preReadOperand, Operator preReadOperator, int nestingLevel, char endOfExpressionChar, int terminatePrecedence) { Object operand = preReadOperand != null ? preReadOperand : getOperand(nestingLevel); Operator operator = preReadOperator != null ? preReadOperator : tokeniser.getOperator(endOfExpressionChar); while(operator != Operator.END) { Object nextOperand = getOperand(nestingLevel); Operator nextOperator = tokeniser.getOperator(endOfExpressionChar); if(nextOperator == Operator.END) { /* We are at the end of the expression */ operand = Operation.binaryOperationfactory(operator, operand, nextOperand); operator = Operator.END; } else if(nextOperator.precedence <= terminatePrecedence) { /* * The precedence of the following operator effectively * brings this expression to an end. */ operand = Operation.binaryOperationfactory(operator, operand, nextOperand); tokeniser.pushBack(nextOperator); operator = Operator.END; } else if(operator.precedence >= nextOperator.precedence) { /* The current operator binds tighter than any following it */ operand = Operation.binaryOperationfactory(operator, operand, nextOperand); operator = nextOperator; } else { /* * The following operator binds tighter so compile the * following expression first. */ operand = Operation.binaryOperationfactory(operator, operand, compile(nextOperand, nextOperator, nestingLevel, endOfExpressionChar, operator.precedence)); operator = tokeniser.getOperator(endOfExpressionChar); } } return operand; } private Object getOperand(int nestingLevel) { Object operand = tokeniser.getOperand(); if(operand == Tokeniser.START_NEW_EXPRESSION) { operand = compile(null, null, nestingLevel + 1, ')', -1); } else if(operand instanceof Operator) { /* Can get unary operators when expecting operand */ return Operation.unaryOperationfactory((Operator) operand, getOperand(nestingLevel)); } return operand; } }
mit
AlexGhiondea/SmugMug.NET
src/SmugMug.NET/Types/Album/AlbumTemplate/AlbumTemplate.manual.cs
668
// Copyright (c) Alex Ghiondea. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Threading.Tasks; using SmugMug.v2.Authentication; namespace SmugMug.v2.Types { public partial class AlbumTemplateEntity : SmugMugEntity { public async Task<UserEntity> Considered_Fixup_user___ () { // /user/(*) // /user/(*) string requestUri = string.Format("{0}/user/{1}", SmugMug.v2.Constants.Addresses.SmugMugApi, string.Empty); return await RetrieveEntityAsync<UserEntity>(requestUri); } } }
mit
delian1986/SoftUni-C-Sharp-repo
Programming Basics/06. Drawing with Loops/Drawing with Loops Lekcia/axe/axe.cs
2042
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace axe { class axe { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var upRows = n - 1; var col = 5 * n; var leftDash = 3 * n; var rightDash = col-leftDash - 2; var innerDash = 1; var edgeInner = n - 1; var edgeRight = n - 1; //top Console.Write(new string('-',leftDash)); Console.Write(new string('*',2)); Console.WriteLine(new string('-',rightDash)); //body for (int row = 1; row <=upRows; row++) { Console.Write(new string('-',leftDash)); Console.Write('*'); Console.Write(new string('-',innerDash)); Console.Write('*'); Console.WriteLine(new string('-',rightDash-1)); innerDash++; rightDash--; } //handle for (int i = 1; i <=n/2; i++) { Console.Write(new string('*',leftDash+1)); Console.Write(new string('-',n-1)); Console.Write('*'); Console.WriteLine(new string('-',n-1)); } //edge for (int cow = 1; cow <= (n - 2) / 2; cow++) { Console.Write(new string('-',leftDash)); Console.Write('*'); Console.Write(new string('-', edgeInner)); Console.Write('*'); Console.WriteLine(new string('-', edgeRight)); edgeInner=edgeInner+2; leftDash--; edgeRight --; } //bott Console.Write(new string('-', leftDash)); Console.Write(new string('*', edgeInner+2)); Console.WriteLine(new string('-', edgeRight)); } } }
mit
jmdobry/angular-data-localForage
test/destroyAll.test.js
775
describe('DSLocalForageAdapter.destroyAll', function () { it('should destroy all items', function (done) { var id; DSLocalForageAdapter.create(User, { name: 'John' }) .then(function (user) { id = user.id; return DSLocalForageAdapter.findAll(User, { name: 'John' }); }).then(function (users) { assert.equal(users.length, 1); assert.deepEqual(users[0], { id: id, name: 'John' }); return DSLocalForageAdapter.destroyAll(User, { name: 'John' }); }).then(function () { return DSLocalForageAdapter.findAll(User, { name: 'John' }); }).then(function (users) { assert.equal(users.length, 0); done(); }).catch(done); }); });
mit
RadishSystems/choiceview-webapi-twilio-demo
CVClassLib/Models/Link.cs
511
namespace WebApiInterface.Models { public class Link { public static string StateNotificationRel = "/rels/statenotification"; public static string MessageNotificationRel = "/rels/messagenotification"; public static string SessionRel = "/rels/session"; public static string PayloadRel = "/rels/properties"; public static string ControlMessageRel = "/rels/controlmessage"; public string rel { get; set; } public string href { get; set; } } }
mit
ApiGen/ElementReflection
src/Php/Factory/ClassConstantReflectionFactoryInterface.php
622
<?php /** * This file is part of the ApiGen (http://apigen.org) * * For the full copyright and license information, please view * the file license.md that was distributed with this source code. */ namespace ApiGen\ElementReflection\Php\Factory; use ApiGen\ElementReflection\Php\ClassConstantReflection; use ApiGen\ElementReflection\Php\ClassReflection; interface ClassConstantReflectionFactoryInterface { /** * @param string $name * @param mixed $value * @param ClassReflection $declaringClass * @return ClassConstantReflection */ function create($name, $value, ClassReflection $declaringClass); }
mit
vuthea/schedule
application/libraries/Usage Example.php
915
<?php /** * Usage Examples * * @author Sebastian Borggrewe <me@sebastianborggrewe.de> * @since 2010/01/24 * @package APNP */ error_reporting(E_ALL | E_STRICT); include 'APNSBase.php'; include 'APNotification.php'; include 'APFeedback.php'; try{ # Notification Example $notification = new APNotification('development'); $notification->setDeviceToken("xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx"); $notification->setMessage("Test Push"); $notification->setBadge(1); $notification->setPrivateKey('certificate/apns-dev.pem'); $notification->setPrivateKeyPassphrase('test'); $notification->send(); # Feedback Example $feedback = new APFeedback('development'); $feedback->setPrivateKey('certificate/apns-dev.pem'); $feedback->setPrivateKeyPassphrase('test'); $feedback->receive(); }catch(Exception $e){ echo $e->getLine().': '.$e->getMessage(); } ?>
mit
havster09/haven-weather
app/src/app.js
1563
"use strict"; // Load libraries import angular from 'angular'; import 'angular-animate'; import 'angular-aria'; import 'angular-material'; import 'ngcomponentrouter'; import 'angular-ui-router'; import AppController from 'src/AppController'; import Charts from 'src/charts/Charts'; import GlobeDataService from "./charts/services/GlobeDataService"; export default angular.module('starter-app', ['ngMaterial', 'ngComponentRouter', 'ui.router', Charts.name]) .config(($mdIconProvider, $mdThemingProvider) => { // Register the user `avatar` icons $mdIconProvider .defaultIconSet("./assets/svg/avatars.svg", 128) .icon("menu", "./assets/svg/menu.svg", 24) .icon("share", "./assets/svg/share.svg", 24) .icon("google_plus", "./assets/svg/google_plus.svg", 24) .icon("hangouts", "./assets/svg/hangouts.svg", 24) .icon("twitter", "./assets/svg/twitter.svg", 24) .icon("phone", "./assets/svg/phone.svg", 24); $mdThemingProvider.theme('default') .primaryPalette('amber') .accentPalette('grey'); }) .value("$routerRootComponent", "dataViz") .component("dataViz", { templateUrl: "./src/app.html", $routeConfig: [ {path:"/d3-globe-chart", component: "d3GlobeChart", name: "D3 Globe Chart", useAsDefault: true}, { path: "/**", redirectTo: ["D3 Globe Chart", ""] } ] }) .controller('AppController', AppController) .service('GlobeDataService', GlobeDataService);
mit
victorbstan/images-feed
public/app/controllers/image-controller.js
430
'use strict'; App.controller('imageController', function($scope, $http, $location, $anchorScroll) { console.log($location.path()); $http.get($location.path()) .success(function(data, status, headers, config) { console.log('DATA', data); $scope.image = data; $anchorScroll(); }) .error(function(data, status, headers, config) { console.log('ERROR', data, status); $scope.errors = data; }); });
mit
wistityhq/strapi
packages/strapi-plugin-upload/admin/src/components/EditForm/ErrorMessage.js
217
import styled from 'styled-components'; import CardErrorMessage from '../CardErrorMessage'; const ErrorMessage = styled(CardErrorMessage)` margin-top: 11px; margin-bottom: 18px; `; export default ErrorMessage;
mit
ewillman/qbank3api-dotnetwrapper
Exception/ResponseException.php
100
<? php namespace QBNK\QBank\API\Exception; class ResponseException extends QBankApiException { }
mit
codeclimate/codeclimate-duplication
spec/cc/engine/analyzers/javascript/main_spec.rb
10578
require 'spec_helper' require 'cc/engine/analyzers/javascript/main' require 'cc/engine/analyzers/reporter' require 'cc/engine/analyzers/engine_config' RSpec.describe CC::Engine::Analyzers::Javascript::Main, in_tmpdir: true do include AnalyzerSpecHelpers describe "#run" do it "prints an issue for identical code" do create_source_file("foo.js", <<-EOJS) console.log("hello JS!"); console.log("hello JS!"); console.log("hello JS!"); EOJS issues = run_engine(engine_conf).strip.split("\0") result = issues.first.strip json = JSON.parse(result) expect(json["type"]).to eq("issue") expect(json["check_name"]).to eq("identical-code") expect(json["description"]).to eq("Identical blocks of code found in 3 locations. Consider refactoring.") expect(json["categories"]).to eq(["Duplication"]) expect(json["location"]).to eq({ "path" => "foo.js", "lines" => { "begin" => 1, "end" => 1 }, }) expect(json["remediation_points"]).to eq(600_000) expect(json["other_locations"]).to eq([ {"path" => "foo.js", "lines" => { "begin" => 2, "end" => 2} }, {"path" => "foo.js", "lines" => { "begin" => 3, "end" => 3} }, ]) expect(json["content"]["body"]).to match(/This issue has a mass of 11/) expect(json["fingerprint"]).to eq("c4d29200c20d02297c6f550ad2c87c15") expect(json["severity"]).to eq(CC::Engine::Analyzers::Base::MAJOR) end it "prints an issue for similar code" do create_source_file("foo.js", <<-EOJS) console.log("hello JS!"); console.log("hellllllo JS!"); console.log("helllllllllllllllllo JS!"); EOJS issues = run_engine(engine_conf).strip.split("\0") result = issues.first.strip json = JSON.parse(result) expect(json["type"]).to eq("issue") expect(json["check_name"]).to eq("similar-code") expect(json["description"]).to eq("Similar blocks of code found in 3 locations. Consider refactoring.") expect(json["categories"]).to eq(["Duplication"]) expect(json["location"]).to eq({ "path" => "foo.js", "lines" => { "begin" => 1, "end" => 1 }, }) expect(json["remediation_points"]).to eq(600_000) expect(json["other_locations"]).to eq([ {"path" => "foo.js", "lines" => { "begin" => 2, "end" => 2} }, {"path" => "foo.js", "lines" => { "begin" => 3, "end" => 3} }, ]) expect(json["content"]["body"]).to match(/This issue has a mass of 11/) expect(json["fingerprint"]).to eq("d9dab8e4607e2a74da3b9eefb49eacec") expect(json["severity"]).to eq(CC::Engine::Analyzers::Base::MAJOR) end it "handles ES6 spread params" do create_source_file("foo.jsx", <<-EOJS) const ThingClass = React.createClass({ propTypes: { ...OtherThing.propTypes, otherProp: "someVal" } }); EOJS expect(CC.logger).not_to receive(:info).with(/Skipping file/) run_engine(engine_conf) end it "skips unparsable files" do create_source_file("foo.js", <<-EOJS) function () { do(); // missing closing brace EOJS expect(CC.logger).to receive(:warn).with(/Skipping \.\/foo\.js/) expect(CC.logger).to receive(:warn).with("Response status: 422") expect(run_engine(engine_conf)).to eq("") end it "skips minified files" do path = fixture_path("huge_js_file.js") create_source_file("foo.js", File.read(path)) expect(CC.logger).to receive(:warn).with(/Skipping \.\/foo\.js/) expect(CC.logger).to receive(:warn).with("Response status: 422") expect(run_engine(engine_conf)).to eq("") end it "handles parser 500s" do create_source_file("foo.js", <<-EOJS) EOJS error = CC::Parser::Client::HTTPError.new(500, "Error processing file: ./foo.js") allow(CC::Parser).to receive(:parse).with("", "/javascript", filename: "./foo.js").and_raise(error) expect(CC.logger).to receive(:error).with("Error processing file: ./foo.js") expect(CC.logger).to receive(:error).with(error.message) expect { run_engine(engine_conf) }.to raise_error(error) end end it "does not flag duplicate comments" do create_source_file("foo.js", <<-EOJS) // A comment. // A comment. /* A comment. */ /* A comment. */ EOJS expect(run_engine(engine_conf)).to be_empty end it "does not report the same line for multiple issues" do create_source_file("dup.jsx", <<-EOJSX) <a className='button button-primary full' href='#' onClick={this.onSubmit.bind(this)}>Login</a> EOJSX issues = run_engine(engine_conf).strip.split("\0") expect(issues.length).to eq 1 end it "ignores imports" do create_source_file("foo.js", <<~EOJS) import React, { Component, PropTypes } from 'react' import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow } from 'material-ui/Table' import values from 'lodash/values' import { v4 } from 'uuid' EOJS create_source_file("bar.js", <<~EOJS) import React, { Component, PropTypes } from 'react' import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow } from 'material-ui/Table' import values from 'lodash/values' import { v4 } from 'uuid' EOJS issues = run_engine(engine_conf).strip.split("\0") expect(issues).to be_empty end it "ignores requires" do create_source_file("foo.js", <<~EOJS) const a = require('foo'), b = require('bar'), c = require('baz'), d = require('bam'); a + b + c + d; EOJS create_source_file("bar.js", <<~EOJS) const a = require('foo'), b = require('bar'), c = require('baz'), d = require('bam'); print(a); EOJS issues = run_engine(engine_conf 3).strip.split("\0") expect(issues).to be_empty end it "ignores imports and reports proper line number boundaries" do create_source_file("foo.js", <<~EOJS) 'use strict'; import React from 'react'; import Translator from '../../../i18n/translator-tag.jsx'; import { gettingSeniorID } from '../../../helpers/data/senior'; import { choosingReducedFee } from '../../../helpers/data/reduced-fee'; import { correctID } from '../../../helpers/data/card-type'; const Senior = (props) => { if (!gettingSeniorID(props.IDApp)) { return null; } return <Translator tag='p' translationPath = 'intro.getStartedPage.whatYouAreDoing.correctingSeniorID' /> }; const Reduced = (props) => { if (!choosingReducedFee(props.IDApp)) { return null; } return <Translator tag='p' translationPath = 'intro.getStartedPage.whatYouAreDoing.correctingReducedFeeID' /> }; const Regular = (props) => { if (gettingSeniorID(props.IDApp) || choosingReducedFee(props.IDApp)) { return null; } return <Translator tag='p' translationPath = 'intro.getStartedPage.whatYouAreDoing.correctingID' /> }; const CorrectingIDInfo = (props) => { if(!correctID(props)) { return null; } return ( <div className='correcting-id-info'> <Senior IDApp = {props.IDApp }/> <Reduced IDApp = {props.IDApp }/> <Regular IDApp = { props.IDApp}/> </div> ); }; export default CorrectingIDInfo; EOJS create_source_file("bar.js", <<~EOJS) 'use strict'; import React from 'react'; import { updateID } from '../../../helpers/data/card-type'; import { gettingSeniorID } from '../../../helpers/data/senior'; import { choosingReducedFee } from '../../../helpers/data/reduced-fee'; import Translator from '../../../i18n/translator-tag.jsx'; const Senior = (props) => { if (!gettingSeniorID(props.IDApp)) { return null; } return <Translator tag='p' translationPath = 'intro.getStartedPage.whatYouAreDoing.updatingSeniorID' /> }; const Reduced = (props) => { if (!choosingReducedFee(props.IDApp)) { return null; } return <Translator tag='p' translationPath = 'intro.getStartedPage.whatYouAreDoing.updatingReducedFeeID' /> }; const Regular = (props) => { if (gettingSeniorID(props.IDApp) || choosingReducedFee(props.IDApp)) { return null; } return <Translator tag='p' translationPath = 'intro.getStartedPage.whatYouAreDoing.updatingID' /> }; const UpdatingIDInfo = (props) => { if (!updateID(props)) { return null; } return ( <div className='updating-id-info'> <Senior IDApp = {props.IDApp } /> <Reduced IDApp = {props.IDApp } /> <Regular IDApp = { props.IDApp} /> </div> ); }; export default UpdatingIDInfo; EOJS issues = run_engine(engine_conf).strip.split("\0") issues = issues.map { |issue| JSON.parse issue } infected = issues.any? { |i| i.dig("location", "lines", "begin") == 1 } expect(infected).to be false end it "outputs the correct line numbers for ASTs missing line details (codeclimate/app#6227)" do create_source_file("foo.js", <<~EOJS) `/movie?${getQueryString({ movie_id: movieId })}` EOJS create_source_file("bar.js", <<~EOJS) var greeting = "hello"; `/movie?${getQueryString({ movie_id: movieId })}` EOJS issues = run_engine(engine_conf).strip.split("\0") expect(issues).to_not be_empty issues.map! { |issue| JSON.parse(issue) } foo_issue = issues.detect { |issue| issue.fetch("location").fetch("path") == "foo.js" } expect(foo_issue["location"]).to eq({ "path" => "foo.js", "lines" => { "begin" => 1, "end" => 1 }, }) bar_issue = issues.detect { |issue| issue.fetch("location").fetch("path") == "bar.js" } expect(bar_issue["location"]).to eq({ "path" => "bar.js", "lines" => { "begin" => 3, "end" => 3 }, }) end def engine_conf mass = 1 CC::Engine::Analyzers::EngineConfig.new({ 'config' => { 'checks' => { 'similar-code' => { 'enabled' => true, }, 'identical-code' => { 'enabled' => true, }, }, 'languages' => { 'javascript' => { 'mass_threshold' => mass, }, }, }, }) end end
mit
macgyver/dotfiles
slate/scripts/bash_docker.py
297
from subprocess import check_output, call def get_bash_login(container, shell='bash'): obj = check_output(['docker', 'ps']) for line in obj.split('\n'): if container in line: cmd = 'docker exec -it %s %s' % (line.split(' ')[0], shell) call(cmd.split(' '))
mit
adamdawkins/react-mdl-stepper
src/step_actions.js
252
import React from 'react'; class StepActions extends React.Component { render() { const { children } = this.props; return ( <div className="mdl-step__actions"> {children} </div> ); } } export default StepActions;
mit
kafti/pynasl
pynasl/visitors/statistic/statistic.py
10321
#------------------------------------------------------------------------------- # Copyright (c) 2011, Kafti team # # Released under the MIT license. See the LICENSE file for details. #------------------------------------------------------------------------------- """Visitor for collecting nasl functions statistics""" import os import logging import csv from collections import defaultdict from pynasl.naslAST import BaseNodeVisitor logger = logging.getLogger("statistic") logger.setLevel(logging.INFO) output_dir = 'results' # map id(stat_var_name) => path_string # filled by write_func_dict_to_csv _detailed_stat_file = {} class NaslStatistic(BaseNodeVisitor): """Visitor for collecting nasl functions statistics @ivar FuncCall_nasl_dict: function's calls in *.nasl files @ivar FuncCall_inc_dict: function's calls in *.inc files @ivar FuncDecl_nasl_dict: function's declarations in *.nasl files @ivar FuncDecl_inc_dict: function's declarations in *.inc files @ivar Include_nasl_dict: include functions in *.nasl files @ivar Include_inc_dict: include functions in *.inc files @ivar FuncCall_dict: function's calls in all files @ivar FuncDecl_dict: function's declarations in all files @ivar internal_nasl_func_calls: internal nasl language function's calls in *.nasl files @ivar unused_decl_nasl: unused function's declarations in *.nasl files @ivar internal_func_calls: total internal nasl language function's calls @ivar unused_decl_inc: unused function's declarations in *.inc files @ivar unused_inc: unused *.inc files """ def __init__(self): self.FuncCall_nasl_dict = defaultdict(list) self.FuncCall_inc_dict = defaultdict(list) self.FuncDecl_nasl_dict = defaultdict(list) self.FuncDecl_inc_dict = defaultdict(list) self.Include_nasl_dict = defaultdict(list) self.Include_inc_dict = defaultdict(list) self.FuncCall_dict = defaultdict(list) self.FuncDecl_dict = defaultdict(list) self.file_name = None self.inc_list = [] self.internal_nasl_func_calls = {} self.unused_decl_nasl = {} self.internal_func_calls = {} self.unused_decl_inc = [] self.unused_inc = [] def preprocess_file(self, file_name): self.file_name = file_name if file_name.endswith('.inc'): self.inc_list.append(file_name) def visit_FuncCall(self, node): self._add_to_nasl_or_inc_dict(node.name, self.FuncCall_nasl_dict, self.FuncCall_inc_dict) self.FuncCall_dict[node.name].append(self.file_name) self.generic_visit(node) def visit_FuncDecl(self, node): self._add_to_nasl_or_inc_dict(node.name, self.FuncDecl_nasl_dict, self.FuncDecl_inc_dict) self.FuncDecl_dict[node.name].append(self.file_name) self.generic_visit(node) def visit_Include(self, node): self._add_to_nasl_or_inc_dict(node.filename[1:-1], self.Include_nasl_dict, self.Include_inc_dict) self.generic_visit(node) def _add_to_nasl_or_inc_dict(self, node_name, nasl_dict, inc_dict): if self.file_name.endswith('.nasl'): nasl_dict[node_name].append(self.file_name) else: inc_dict[node_name].append(self.file_name) def _cut_decl_function(self, funcDecl_dict, funcCall_dict): unused_func = [] for func_name_Decl in funcDecl_dict.keys(): if func_name_Decl in funcCall_dict.keys(): del funcCall_dict[func_name_Decl] else: unused_func.append(func_name_Decl) return unused_func def finalize_calculations(self): self.internal_nasl_func_calls = self.FuncCall_nasl_dict.copy() self.unused_decl_nasl = self._cut_decl_function(self.FuncDecl_nasl_dict, self.internal_nasl_func_calls) self._cut_decl_function(self.FuncDecl_inc_dict, self.internal_nasl_func_calls) self.internal_func_calls = self.FuncCall_dict.copy() self._cut_decl_function(self.FuncDecl_dict, self.internal_func_calls) self.unused_decl_inc = [func for func in self.FuncDecl_inc_dict if func not in self.FuncCall_nasl_dict and func not in self.FuncCall_inc_dict] self.unused_inc = [inc for inc in self.inc_list if inc not in self.Include_nasl_dict and inc not in self.Include_inc_dict] def create_statistic(plugins_dir): from pynasl.naslparse import naslparser stat = NaslStatistic() logger.info('Files processing started') total_files = 0 for root,dirs,files in os.walk(plugins_dir): for name in files: if name.endswith(('.nasl', '.inc')): stat.preprocess_file(name) fullname = os.path.join(root, name) stat.visit(naslparser(fullname, True)) total_files += 1 if total_files % 1000 == 0: logger.info("Processed %s files" % total_files) logger.info('Files processing finished') stat.finalize_calculations() _write_detailed_statistic(stat) _write_main_statistic(stat, 'statistic.txt') def write_func_dict_to_csv(func_dict, stat_file_name): with open(os.path.join(output_dir, stat_file_name), "w") as stat_file: writer = csv.writer(stat_file, delimiter=';', quoting=csv.QUOTE_NONE, lineterminator='\n') writer.writerow( ('Function name', 'Count', 'Files name') ) for func_name in func_dict.keys(): writer.writerow( (func_name, len(func_dict[func_name]), func_dict[func_name]) ) _detailed_stat_file[id(func_dict)] = stat_file_name def _write_detailed_statistic(stat): write_func_dict_to_csv(stat.FuncDecl_nasl_dict, "stat_decl_function_nasl.csv") write_func_dict_to_csv(stat.FuncDecl_inc_dict, "stat_decl_function_inc.csv") write_func_dict_to_csv(stat.FuncDecl_dict, "stat_all_decl.csv") write_func_dict_to_csv(stat.FuncCall_nasl_dict, "stat_call_function_nasl.csv") write_func_dict_to_csv(stat.FuncCall_inc_dict, "stat_call_function_inc.csv") write_func_dict_to_csv(stat.FuncCall_dict, "stat_all_call.csv") write_func_dict_to_csv(stat.Include_nasl_dict, "stat_include_nasl.csv") write_func_dict_to_csv(stat.Include_inc_dict, "stat_include_inc.csv") write_func_dict_to_csv(stat.internal_nasl_func_calls, "stat_call_function_nasl_internal.csv") write_func_dict_to_csv(stat.internal_func_calls, "stat_internal.csv") def _write_main_statistic(stat, file_name): with open(os.path.join(output_dir, file_name), 'wb') as main_stat: main_stat.write("DECLARATION Function\n") main_stat.write("-" * 100 + '\n') main_stat.write("*.nasl files contain %s function's declarations\n" % len(stat.FuncDecl_nasl_dict)) main_stat.write("Detailed statistic is in %s\n\n" % _detailed_stat_file[id(stat.FuncDecl_nasl_dict)]) main_stat.write("*.inc files contain %s function's declarations\n" % len(stat.FuncDecl_inc_dict)) main_stat.write("Detailed statistic is in %s\n\n" % _detailed_stat_file[id(stat.FuncDecl_inc_dict)]) main_stat.write("All files contain %s function's declarations\n" % len(stat.FuncDecl_dict)) main_stat.write("Detailed statistic is in %s\n" % _detailed_stat_file[id(stat.FuncDecl_dict)]) main_stat.write("-" * 100 + '\n') main_stat.write("CALL Function\n") main_stat.write("-" * 100 + '\n') main_stat.write("*.nasl files contain %s different function's calls\n" % len(stat.FuncCall_nasl_dict)) main_stat.write("Detailed statistic is in %s\n\n" % _detailed_stat_file[id(stat.FuncCall_nasl_dict)]) main_stat.write("*.nasl files contain %s internal function's calls\n" % len(stat.internal_nasl_func_calls)) main_stat.write("Detailed statistic in %s\n\n" % _detailed_stat_file[id(stat.internal_nasl_func_calls)]) main_stat.write("*.inc files contain %s different function's calls\n" % len(stat.FuncCall_inc_dict)) main_stat.write("Detailed statistic is in %s\n\n" % _detailed_stat_file[id(stat.FuncCall_inc_dict)]) main_stat.write("All files contain %s different function's calls\n" % len(stat.FuncCall_dict)) main_stat.write("Detailed statistic is in %s\n\n" % _detailed_stat_file[id(stat.FuncCall_dict)]) main_stat.write("All files contain %s internal function's calls\n" % len(stat.internal_func_calls)) main_stat.write("Detailed statistic is in %s\n" % _detailed_stat_file[id(stat.internal_func_calls)]) main_stat.write("-" * 100 + '\n') main_stat.write("USING FUNCTIONS\n") main_stat.write("-" * 100 + '\n') if stat.unused_decl_nasl: main_stat.write("Unused function's declarations in nasl scripts:\n") main_stat.write('%s\n\n' % stat.unused_decl_nasl) if stat.unused_decl_inc: main_stat.write("%s unused function's declarations in inc files:\n" % len(stat.unused_decl_inc)) main_stat.write('%s\n\n' % stat.unused_decl_inc) main_stat.write("-" * 100 + '\n') main_stat.write("INCLUDE FILES\n") main_stat.write("-" * 100 + '\n') main_stat.write("*.nasl files contain %s different include()\n" % len(stat.Include_nasl_dict)) main_stat.write("Detailed statistic is in %s\n\n" % _detailed_stat_file[id(stat.Include_nasl_dict)]) main_stat.write("*.inc files contain %s different include()\n" % len(stat.Include_inc_dict)) main_stat.write("Detailed statistic in %s\n\n" % _detailed_stat_file[id(stat.Include_inc_dict)]) main_stat.write("%s *.inc files are unused\n" % len(stat.unused_inc)) main_stat.write('%s\n' % stat.unused_inc) main_stat.write("-" * 100 + '\n') if __name__ == "__main__": logging.basicConfig(format='%(asctime)s %(levelname)-8s %(name)-20s %(message)s', datefmt='%H:%M:%S') create_statistic(os.environ['KAFTI_NASLSCRIPTS_PATH'])
mit
educreations/python-iap
tests/test_forms.py
13702
import datetime from iap.forms import ( AppleLatestReceiptInfoForm, AppleUnifiedPendingRenewalInfoForm, AppleUnifiedReceiptForm, AppleStatusUpdateForm, ) def test_valid_latest_receipt_info_form(): # An example response from Apple data = { "app_item_id": "000000000", "bid": "com.educreations.ios.Educreations", "bvrs": "00000", "expires_date": "1595808159000", "expires_date_formatted": "2020-07-27 00:02:39 Etc/GMT", "expires_date_formatted_pst": "2020-07-26 17:02:39 America/Los_Angeles", "is_in_intro_offer_period": "false", "is_trial_period": "false", "item_id": "000000000", "original_purchase_date": "2020-06-27 00:02:42 Etc/GMT", "original_purchase_date_ms": "1593216162000", "original_purchase_date_pst": "2020-06-26 17:02:42 America/Los_Angeles", "original_transaction_id": "000000000000000", "product_id": "com.educreations.proteacher.1month", "purchase_date": "2020-06-27 00:02:39 Etc/GMT", "purchase_date_ms": "1593216159000", "purchase_date_pst": "2020-06-26 17:02:39 America/Los_Angeles", "quantity": "1", "subscription_group_identifier": "00000000", "transaction_id": "000000000000000", "unique_identifier": "00000000-0011495C1413002E", "unique_vendor_identifier": "88888888-A3AA-4E93-AC24-50049702C82F", "version_external_identifier": "000000000", "web_order_line_item_id": "000000000000000", } form = AppleLatestReceiptInfoForm(data) assert form.is_valid(), form.errors.as_data() assert isinstance(form.cleaned_data["expires_date"], datetime.datetime) assert isinstance(form.cleaned_data["original_purchase_date"], datetime.datetime) assert isinstance(form.cleaned_data["purchase_date"], datetime.datetime) assert not form.cleaned_data["is_in_intro_offer_period"] assert not form.cleaned_data["is_trial_period"] assert form.cleaned_data["quantity"] == 1 def test_valid_unified_pending_renewal_info_form(): data = { "auto_renew_product_id": "com.educreations.proteacher.1month", "auto_renew_status": "1", "original_transaction_id": "000000000000000", "product_id": "com.educreations.proteacher.1month", } form = AppleUnifiedPendingRenewalInfoForm(data) assert form.is_valid(), form.errors.as_data() def test_valid_unified_receipt_form(): data = { "environment": "Production", "latest_receipt": "YXNkZmFzZGZhc2RmYXNkZmFzZGZhc2RmYXNkZmFzZGZhc2Rm", "latest_receipt_info": [ { "expires_date": "2020-07-27 00:02:39 Etc/GMT", "expires_date_ms": "1595808159000", "expires_date_pst": "2020-07-26 17:02:39 America/Los_Angeles", "is_in_intro_offer_period": "false", "is_trial_period": "false", "original_purchase_date": "2020-06-27 00:02:42 Etc/GMT", "original_purchase_date_ms": "1593216162000", "original_purchase_date_pst": "2020-06-26 17:02:42 America/Los_Angeles", "original_transaction_id": "000000000000000", "product_id": "com.educreations.proteacher.1month", "purchase_date": "2020-06-27 00:02:39 Etc/GMT", "purchase_date_ms": "1593216159000", "purchase_date_pst": "2020-06-26 17:02:39 America/Los_Angeles", "quantity": "1", "subscription_group_identifier": "00000000", "transaction_id": "000000000000000", "web_order_line_item_id": "000000000000000", } ], "pending_renewal_info": [ { "auto_renew_product_id": "com.educreations.proteacher.1month", "auto_renew_status": "1", "original_transaction_id": "000000000000000", "product_id": "com.educreations.proteacher.1month", } ], "status": 0, } form = AppleUnifiedReceiptForm(data) assert form.is_valid(), form.errors.as_data() def test_valid_unified_receipt_form_receipt_info(): data = { "environment": "Production", "latest_receipt": "YXNkZmFzZGZhc2RmYXNkZmFzZGZhc2RmYXNkZmFzZGZhc2Rm", "latest_receipt_info": [ { "expires_date": "2020-07-27 00:02:39 Etc/GMT", "expires_date_ms": "1595808159000", "expires_date_pst": "2020-07-26 17:02:39 America/Los_Angeles", "is_in_intro_offer_period": "false", "is_trial_period": "false", "original_purchase_date": "2020-06-27 00:02:42 Etc/GMT", "original_purchase_date_ms": "1593216162000", "original_purchase_date_pst": "2020-06-26 17:02:42 America/Los_Angeles", "original_transaction_id": "000000000000000", "product_id": "com.educreations.proteacher.1month", "purchase_date": "2020-06-27 00:02:39 Etc/GMT", "purchase_date_ms": "1593216159000", "purchase_date_pst": "2020-06-26 17:02:39 America/Los_Angeles", "quantity": "1", "subscription_group_identifier": "00000000", "transaction_id": "000000000000000", } ], "pending_renewal_info": [ { "auto_renew_product_id": "com.educreations.proteacher.1month", "auto_renew_status": "1", "original_transaction_id": "000000000000000", "product_id": "com.educreations.proteacher.1month", } ], "status": 0, } form = AppleUnifiedReceiptForm(data) assert form.is_valid(), form.errors.as_data() def test_apple_status_update_form(): data = { "auto_renew_product_id": "com.educreations.proteacher.1month", "auto_renew_status": "true", "bid": "com.educreations.ios.Educreations", "bvrs": "00000", "environment": "PROD", "latest_receipt": "YXNkZmFzZGZhc2RmYXNkZmFzZGZhc2RmYXNkZmFzZGZhc2Rm", "latest_receipt_info": { "app_item_id": "000000000", "bid": "com.educreations.ios.Educreations", "bvrs": "00000", "expires_date": "1595808159000", "expires_date_formatted": "2020-07-27 00:02:39 Etc/GMT", "expires_date_formatted_pst": "2020-07-26 17:02:39 America/Los_Angeles", "is_in_intro_offer_period": "false", "is_trial_period": "false", "item_id": "000000000", "original_purchase_date": "2020-06-27 00:02:42 Etc/GMT", "original_purchase_date_ms": "1593216162000", "original_purchase_date_pst": "2020-06-26 17:02:42 America/Los_Angeles", "original_transaction_id": "000000000000000", "product_id": "com.educreations.proteacher.1month", "purchase_date": "2020-06-27 00:02:39 Etc/GMT", "purchase_date_ms": "1593216159000", "purchase_date_pst": "2020-06-26 17:02:39 America/Los_Angeles", "quantity": "1", "subscription_group_identifier": "00000000", "transaction_id": "000000000000000", "unique_identifier": "00000000-0011495C1413002E", "unique_vendor_identifier": "88888888-A3AA-4E93-AC24-50049702C82F", "version_external_identifier": "000000000", "web_order_line_item_id": "000000000000000", }, "notification_type": "INITIAL_BUY", "password": "asdf", "unified_receipt": { "environment": "Production", "latest_receipt": "YXNkZmFzZGZhc2RmYXNkZmFzZGZhc2RmYXNkZmFzZGZhc2Rm", "latest_receipt_info": [ { "expires_date": "2020-07-27 00:02:39 Etc/GMT", "expires_date_ms": "1595808159000", "expires_date_pst": "2020-07-26 17:02:39 America/Los_Angeles", "is_in_intro_offer_period": "false", "is_trial_period": "false", "original_purchase_date": "2020-06-27 00:02:42 Etc/GMT", "original_purchase_date_ms": "1593216162000", "original_purchase_date_pst": "2020-06-26 17:02:42 America/Los_Angeles", "original_transaction_id": "000000000000000", "product_id": "com.educreations.proteacher.1month", "purchase_date": "2020-06-27 00:02:39 Etc/GMT", "purchase_date_ms": "1593216159000", "purchase_date_pst": "2020-06-26 17:02:39 America/Los_Angeles", "quantity": "1", "subscription_group_identifier": "00000000", "transaction_id": "000000000000000", "web_order_line_item_id": "000000000000000", } ], "pending_renewal_info": [ { "auto_renew_product_id": "com.educreations.proteacher.1month", "auto_renew_status": "1", "original_transaction_id": "000000000000000", "product_id": "com.educreations.proteacher.1month", } ], "status": 0, }, } form = AppleStatusUpdateForm(data) assert form.is_valid(), form.errors.as_data() assert ( form.cleaned_data["unified_receipt"]["pending_renewal_info"][0][ "auto_renew_status" ] is True ) def test_apple_status_update_form_failed_to_renew(): data = { "auto_renew_product_id": "com.educreations.proteacher.1month", "auto_renew_status": "true", "bid": "com.educreations.ios.Educreations", "bvrs": "00000", "environment": "PROD", "latest_receipt": "YXNkZmFzZGZhc2RmYXNkZmFzZGZhc2RmYXNkZmFzZGZhc2Rm", "latest_expired_receipt_info": { "app_item_id": "000000000", "bid": "com.educreations.ios.Educreations", "bvrs": "00000", "expires_date": "1599527817000", "expires_date_formatted": "2020-09-08 01:16:57 Etc/GMT", "expires_date_formatted_pst": "2020-09-07 18:16:57 America/Los_Angeles", "is_in_intro_offer_period": "false", "is_trial_period": "false", "item_id": "000000000", "original_purchase_date": "2020-04-08 01:16:58 Etc/GMT", "original_purchase_date_ms": "1586308618000", "original_purchase_date_pst": "2020-04-07 18:16:58 America/Los_Angeles", "original_transaction_id": "70000762954330", "product_id": "com.educreations.proteacher.1month", "purchase_date": "2020-08-08 01:16:57 Etc/GMT", "purchase_date_ms": "1596849417000", "purchase_date_pst": "2020-08-07 18:16:57 America/Los_Angeles", "quantity": "1", "subscription_group_identifier": "00000000", "transaction_id": "00000000000000", "unique_identifier": "0000000000000000000000000000000000000000", "unique_vendor_identifier": "00000000-2AC8-44B0-89AB-EB057BAF7913", "version_external_identifier": "000000000", "web_order_line_item_id": "00000000000000", }, "notification_type": "DID_FAIL_TO_RENEW", "password": "asdf", "unified_receipt": { "environment": "Production", "latest_receipt": "YXNkZmFzZGZhc2RmYXNkZmFzZGZhc2RmYXNkZmFzZGZhc2Rm", }, } form = AppleStatusUpdateForm(data) assert form.is_valid(), form.errors.as_data() def test_apple_status_update_form_non_subscription(): data = { "bid": "com.educreations.ios.Educreations", "bvrs": "00000", "environment": "PROD", "latest_receipt": "YXNkZmFzZGZhc2RmYXNkZmFzZGZhc2RmYXNkZmFzZGZhc2Rm", "latest_receipt_info": { "app_item_id": "000000000", "bid": "com.educreations.ios.Educreations", "bvrs": "00000", "cancellation_date": "2020-09-05 11:48:12 Etc/GMT", "cancellation_date_ms": "1599306492000", "cancellation_date_pst": "2020-09-05 04:48:12 America/Los_Angeles", "cancellation_reason": "0", "is_in_intro_offer_period": "false", "is_trial_period": "false", "item_id": "000000000", "original_purchase_date": "2020-08-25 14:32:42 Etc/GMT", "original_purchase_date_ms": "1598365962000", "original_purchase_date_pst": "2020-08-25 07:32:42 America/Los_Angeles", "original_transaction_id": "00000000000000", "product_id": "com.educreations.proteacher.1year", "purchase_date": "2020-08-25 14:32:42 Etc/GMT", "purchase_date_ms": "1598365962000", "purchase_date_pst": "2020-08-25 07:32:42 America/Los_Angeles", "quantity": "1", "transaction_id": "00000000000000", "unique_identifier": "0000000000000000000000000000000000000000", "unique_vendor_identifier": "00000000-8B53-473C-9093-340CB76F2D26", "version_external_identifier": "000000000", }, "notification_type": "REFUND", "password": "asdfasdf", "unified_receipt": { "environment": "Production", "latest_receipt": "YXNkZmFzZGZhc2RmYXNkZmFzZGZhc2RmYXNkZmFzZGZhc2Rm", }, } form = AppleStatusUpdateForm(data) assert form.is_valid(), form.errors.as_data()
mit
Namzar/BasicBlog
src/Functionality/NavbarBundle/Form/Type/NavbarType/NavbarNavbarLinkType.php
1649
<?php namespace Functionality\NavbarBundle\Form\Type\NavbarType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class NavbarNavbarLinkType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $readOnly = $options['read_only']; if (!$readOnly) { $attr = array('data-prototype' => 'self-referencing'); } else { $attr = array(); } $builder ->add('name', 'text', array( 'read_only' => $readOnly, )) ->add('weight', 'integer', array( 'read_only' => $readOnly, )) ->add('enable','checkbox', array( 'required' => false, 'read_only' => $readOnly, 'disabled' => $readOnly, )) ->add('linkEnable','checkbox', array( 'required' => false, 'read_only' => $readOnly, 'disabled' => $readOnly, )) ->add('navbarLinkRef', new NavbarNavbarLinkRefType(), array( 'required' => false, 'read_only' => $readOnly, )) ->add('childs', 'collection', array( 'type'=> new NavbarNavbarLinkType(), 'options' => array('read_only' => $readOnly), 'allow_add' => true, 'allow_delete' => true, 'by_reference' => false, 'prototype' => false, 'attr' => $attr, 'read_only' => $readOnly, )) ; } public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( 'data_class' => 'Functionality\NavbarBundle\Entity\NavbarLink', 'read_only' => false, )); } public function getName() { return 'Navbar_NavbarLink'; } }
mit
ChicagoPublicSchools/Map-LSCElections2016
scripts/map.js
28435
// LSC Vacancies Map (Community and Parent vacancies) // web services // 4/2016 var fusionTableId = "142zjKh-oFZIGF8GKTcUrivcwS4U4OzhfJUN7QAxQ" ; // LSCvacancies_2016 as of 3/22/2016 var LSCdistrictsTableId = "1WRXaOoaBmKqjOOqYfd7ltc8pPHbKhMUtQ_gy6joW" ; // LSC Voting Districts SY16/17 var googleAPIkey = "AIzaSyDPyV9JDVE0rLOHBiN4npwdhsm53GBiMuk"; // with restrictions var googleAPIurl = "https://www.googleapis.com/fusiontables/v1/query"; var APIurl = "https://secure.cps.edu/json/lscvacancies2016?callback=test"; var heatmap = null; var heatMapData = []; var studentCountArray = []; var voteCountArray = []; var arrayforautocomplete = []; var map; var geocoder; var addrMarker = null; var addrMarkerImage = 'images/yellow-pin-lg.png'; var geoaddress = null; // geocoded pin placement address var searchPolyAttendance = null; // lsc boundary layer var markersArray = []; // for the marker array var infoWindowsas = null; // infowindow var latlngbounds = null; // for panning and zooming to include all searched markers var selectedSchoolID = null; // passing of info for poping selected school infowindow var searchtype = null; // allschools, oneschool, address var chicago; var satisfiedCount = 0; var availableCount = 0; function initializeMap() { clearSearch(); getCount(); getVoteCount(); var grayStyles = [ { "featureType": "road", "elementType": "geometry.fill", "stylers": [ { "lightness": 1 }, { "saturation": -100 } ] },{ "featureType": "road.highway.controlled_access", "elementType": "geometry.stroke", "stylers": [ { "saturation": -100 }, { "visibility": "off" } ] },{ "featureType": "road", "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] },{ "featureType": "road.local", "elementType": "geometry.fill", "stylers": [ { "color": "#808080" }, { "lightness": 50 } ] },{ "featureType": "road", "elementType": "labels.text.stroke", "stylers": [ { "saturation": -100 }, { "gamma": 9.91 } ] },{ "featureType": "landscape", "stylers": [ { "saturation": -70 } ] },{ "featureType": "administrative", "stylers": [ { "visibility": "on" } ] },{ "featureType": "poi", "stylers": [ { "saturation": -50 } ] },{ "featureType": "road", "elementType": "labels", "stylers": [ { "saturation": -70 } ] },{ "featureType": "transit", "stylers": [ { "saturation": -70 } ] } ]; geocoder = new google.maps.Geocoder(); chicago = new google.maps.LatLng(41.839, -87.67); // default center of map var myOptions = { styles: grayStyles, zoom: 10, center: chicago, disableDefaultUI: true, scrollwheel: false, navigationControl: true, panControl: false, scaleControl: false, mapTypeControl: false, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, position: google.maps.ControlPosition.RIGHT_BOTTOM }, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.RIGHT_BOTTOM }, //navigationControlOptions: {style: google.maps.NavigationControlStyle.LARGE }, mapTypeId: google.maps.MapTypeId.ROADMAP //TERRAIN }; map = new google.maps.Map($("#map_canvas")[0], myOptions); //get the schools for the dropdown //queryForSchoolsDD(); //mapQueryAll("all"); hopscotch.startTour(maptourlg, 0); } function getCount(){ studentCountArray =[]; arrayforautocomplete = []; $("#txtSearchAddress").val(''); searchtype = "allschools"; $.ajax({ type: "GET" , //url: "https://secure.cps.edu/json/lscvacancies2016?callback=?", url: "https://secure.cps.edu/json/lsc/getlscvacancies?callback=?", dataType: "jsonp", error: function (jqXHR, exception) { // net::ERR_NAME_NOT_RESOLVED // above error is not called when dev is not available console.log(jqXHR, exception); // results = "<span style='color:red;'>There was a problem getting the candidate count.</span>"; // $("#resultList").html(results); }, success: function(d){ $.each(d,function(i,r){ //console.log(i,r); var sid = (d[i].SchoolId); var slat = (d[i].Lat); var slng = (d[i].Lng); var sname = (d[i].SchoolName); var saddress = (d[i].Address); var sphone = (d[i].Phone); var stype = (d[i].SchoolType); var ptmax = (d[i].PARENT_MAX); var ptcand = (d[i].PARENT_CAND); var ptstat = (d[i].PARENT_STAT); var cmmax = (d[i].COMMUNITY_MAX); var cmcand = (d[i].COMMUNITY_CAND); var cmstat = (d[i].COMMUNITY_STAT); var sappointedlsc = (d[i].AppointedLSC); studentCountArray.push({id:sid, lat:slat, lng:slng, name:sname, address:saddress , phone:sphone, type:stype, pmax:ptmax, pcand:ptcand, pstat:ptstat, cmax:cmmax , ccand:cmcand, cstat:cmstat, appointedlsc:sappointedlsc }); arrayforautocomplete.push(sname); }); createMarkersJson(studentCountArray); initAutocomplete(); //$("#btnHeatmap").removeClass("hidden"); //$("#btnSignups").removeClass("hidden"); }, }); } function getVoteCount(){ voteCountArray =[]; searchtype = "allschools"; $.ajax({ type: "GET" , url: "https://secure.cps.edu/json/lsc/GetCandidateVoteTotal?callback=?", dataType: "jsonp", error: function (jqXHR, exception) { // net::ERR_NAME_NOT_RESOLVED // above error is not called when dev is not available console.log(jqXHR, exception); // results = "<span style='color:red;'>There was a problem getting the candidate vote count</span>"; // $("#resultList").html(results); }, success: function(d){ $.each(d,function(i,r){ //console.log(i,r); var sid = (d[i].SchoolId); var mtype = (d[i].LSCMemberType); var mname = (d[i].MemberName); var mvotes = (d[i].MemberVotes); voteCountArray.push({id:sid, type:mtype, name:mname, votes:mvotes }); }); }, }); } function initAutocomplete() { $( "#txtSearchAddress" ).autocomplete({ appendTo: "#autocomplete-input-group", source: arrayforautocomplete, focus: function( event, ui ) { // autocomplete result is focused on $("#txtSearchAddress").val( ui.item.value ); return false; }, select: function ( event, ui ) { // autocomplete result is selected event.preventDefault(); $("#txtSearchAddress").val( ui.item.value ); searchInputField(); }, close: function ( event, ui ) { //$("#autocomplete").val("" ); //console.log("close"); }, search: function ( event, ui ) { $( "#txtSearchAddress" ).autocomplete( "close" ); //console.log($("#autocomplete").val()); //console.log("search"); }, open: function() { //$('.ui-autocomplete').css('width','300px'); //$('.ui-autocomplete').css('margin-left','70px'); //$('.ui-autocomplete').css('height','300px'); }, change: function() { //$('.ui-autocomplete').css('width','300px'); //$('.ui-autocomplete').css('margin-left','70px'); //$('.ui-autocomplete').css('height','300px'); } }); } function searchInputField() { //school names are uppercase var theInput = $.trim( $("#txtSearchAddress").val().toUpperCase() ); if(theInput !== "") { clearSearch(); // check if the value is found in the autocomplete array // autocompleteArray has school names if ($.inArray(theInput, arrayforautocomplete) !== -1) { _trackClickEventWithGA("Search", "School Name LSC", theInput); schoolSearch(theInput) } else { // value is not in the array //if(/^\d.*/.test(theInput)) {// - starts with a number //addressSearch(); // return; //} addressSearch(); } }else{ // empty alert("Please enter an address or a school."); } } function schoolSearch(theInput) { searchtype = "oneschool"; var query = "SELECT ID "+ " FROM " + fusionTableId + " WHERE Name = '" + theInput + "'"; encodeQuery(query, createMarkersJson); } // not used // called from initialize script "all" displays all SchoolTypes // when called from the legend displays by SchoolType function mapQueryAll(st) { clearSearch(); $("#txtSearchAddress").val(''); searchtype = "allschools"; var query=""; if(st==="all") { query = "SELECT ID, Lat, Long, Name, Address, Phone, Type, PARENT_MAX, PARENT_CAND, PARENT_STAT, COMMUNITY_MAX, COMMUNITY_CAND, COMMUNITY_STAT FROM "+ fusionTableId + " ORDER BY Name "; } encodeQuery(query, createMarkers); // if(!isMobile()) { // $("#txtSearchAddress").focus(); // } } // displays schools whose boundaries encompass the address loc function addressSearch() { var theInput = $.trim( $("#txtSearchAddress").val().toUpperCase() ); var address = theInput; if (address !== "" ) { clearSearch(); if (address.toUpperCase().indexOf("chicago, illinois") === -1) { address = address + " CHICAGO, ILLINOIS"; } geocoder.geocode({ 'address': address }, function (results, status) { if (status === google.maps.GeocoderStatus.OK) { geoaddress = (results[0].formatted_address); map.setCenter(results[0].geometry.location); if (addrMarker) { addrMarker.setMap(null); } addrMarker = new google.maps.Marker({ position: results[0].geometry.location, map: map, icon: addrMarkerImage, animation: google.maps.Animation.DROP, title: geoaddress }); searchtype="address"; $("#txtSearchAddress").val(geoaddress); _trackClickEventWithGA("Search", "Address LSC", geoaddress); map.panTo(addrMarker.position); // schools whose boundaries encompass the loc whereClause = " WHERE " ; whereClause += " ST_INTERSECTS('geometry', CIRCLE(LATLNG"+addrMarker.position+ "," + .00001 + "))"; //whereClause += " ORDER BY 'Name'"; var query = "SELECT ID FROM "+ LSCdistrictsTableId + whereClause; //console.log(query); encodeQuery(query, addressQuery); } else {//geocoder status not ok alert("We could not find your address: " + status); } }); } else {//didn't enter an address alert("Please enter an address."); } } // called from the address search function addressQuery(d) { var query = "" ; var addressMarkersArray=[]; if( d.rows !== null && d.rows !== undefined ) { for (var i = 0; i < d.rows.length; i++) { var sid = d.rows[i][0]; addressMarkersArray.push(sid); } } //query = "SELECT ID, Lat, Long, Name, Address, Phone, Type FROM "+ fusionTableId + " WHERE ID IN (" + addressMarkersArray + ") ORDER BY Name "; //encodeQuery(query, createMarkers); query = "SELECT ID FROM "+ fusionTableId + " WHERE ID IN (" + addressMarkersArray + ") "; encodeQuery(query, createMarkersJson); } // creates markers and infowindow data function createMarkersJson(d) { //console.log(d); satisfiedCount=0; availableCount=0; if (d.kind === "fusiontables#sqlresponse") {//check for fusiondata from address lookup var isfusion = true; var dlength = d.rows.length; }else{ var isfusion = false; var dlength = d.length; } if( d !== null && d !== undefined ) { for (var i = 0; i < dlength; i++) { if (isfusion) { // address search returns array of ids // info goes and gets data from jsonp created array. var info = getInfoFromID(d.rows[i][0]); var sid = info[0]; var slat = info[1]; var slng = info[2]; var sname = info[3].toUpperCase(); var saddress = info[4]; var sphone = info[5]; var stype = info[6]; var spmax = info[7]; var spcand = info[8]; var spstat = info[9]; var scmax = info[10]; var sccand = info[11]; var scstat = info[12]; var sappointedlsc = info[13]; }else{ // other searches return array of data var r=d[i]; var sid = r.id; var slat = r.lat; var slng = r.lng; var sname = r.name.toUpperCase(); var saddress = r.address; var sphone = r.phone; var stype = r.type; var spmax = r.pmax; var spcand = r.pcand; var spstat = r.pstat; var scmax = r.cmax; var sccand = r.ccand; var scstat = r.cstat; var sappointedlsc = r.appointedlsc; } var sposition = new google.maps.LatLng(slat,slng); var image = getImage(spstat, scstat); var sweight = getWeight(sid); var sattending = getAttending(sid); if(spstat === "I" || scstat === "I" ){ availableCount++; }else{ satisfiedCount++; } var marker = new google.maps.Marker({ id : sid, lat : slat, lng : slng, name : sname, address : saddress, phone : sphone, type : stype, pmax : spmax, pcand : spcand, pstat : spstat, cmax : scmax, ccand : sccand, cstat : scstat, position : sposition, rowid : i, icon : image, map : map, weight : sweight, attending : sattending, appointedlsc : sappointedlsc }); // if(marker.weight !== 0) { // heatMapData.push({location:marker.position, weight:marker.weight}); // } latlngbounds.extend(sposition); var fn = markerClick(map, marker, infoWindowsas); google.maps.event.addListener(marker, 'click', fn); markersArray.push(marker); infoWindowsas = new google.maps.InfoWindow(); } // end loop google.maps.event.addListener(infoWindowsas, 'closeclick', closeinfowindow ); createResultsList(); }else{ // nothing returned from query // will happen if address loc is not within a boundary or bad query results = "<span style='color:red;'>We're sorry, the search didn't turn up anything.</span>"; $("#resultList").html(results); return; } //setMapZoom(); // if there is jsonp data then initialize the heat map but don't view it until button is clicked. // map also displays circles based on signup numbers. // if(isHeatMapData()) { // heatmap = new google.maps.visualization.HeatmapLayer({ // data: heatMapData, // dissipating: true, // radius:40 //, don't display just yet // //map: map // }); // $("#btnHeatmap").removeClass("hidden"); // $("#btnSignups").removeClass("hidden"); // }else { // $("#btnHeatmap").removeClass("hidden").addClass("hidden"); // $("#btnSignups").removeClass("hidden").addClass("hidden"); // } } function getInfoFromID(sid){ var result = $.grep(studentCountArray, function(e){ return e.id == sid; }); if (result.length === 0) { return 0; } else if (result.length === 1) { return [result[0].id, result[0].lat, result[0].lng, result[0].name, result[0].address, result[0].phone, result[0].type, result[0].pmax, result[0].pcand,result[0].pstat,result[0].cmax,result[0].ccand,result[0].cstat,result[0].appointedlsc ]; } else { return [result[0].id, result[0].lat, result[0].lng, result[0].name, result[0].address, result[0].phone, result[0].type, result[0].pmax, result[0].pcand,result[0].pstat,result[0].cmax,result[0].ccand,result[0].cstat,result[0].appointedlsc ];} } function getVotes(sid){ var result = $.grep(voteCountArray, function(e){ return e.id == sid; }); if (result.length === 0) { return 0; } else if (result.length === 1) { return [result[0].type, result[0].name, result[0].votes]; } else { return result; } } function closeinfowindow() { if (searchPolyAttendance != null) { searchPolyAttendance.setMap(null); } } function createResultsList() { var results = ""; if (markersArray) { // sort alphabetically by name // thanks to: http://stackoverflow.com/questions/14208651/javascript-sort-key-value-pair-object-based-on-value markersArray = markersArray.sort(function (a, b) { return a.name.localeCompare( b.name ); }); results += "<div id='locationcount'><span>"+markersArray.length+" locations</span>&nbsp;&nbsp;<img src='images/green_star.png' /><span style='color:#1E5F08; margin-left:2px;'>Satisfied: "+satisfiedCount +"</span>&nbsp;&nbsp;<img src='images/red_ex.png' /><span style='color:#B20000;margin-left:2px;'>Available: "+availableCount +"</span><button id='btnHeatmap' class='btn btn-default btn-xs pull-right hidden' onclick='toggleHeatmap()' style='margin-right:10px;'>Heatmap</button><button id='btnSignups' class='btn btn-default btn-xs pull-right hidden' onclick='toggleSignupCircles()' style='margin-right:10px;'>Signups</button></div>"; for (i in markersArray) { var linkcolor = getLinkColor(markersArray[i].pstat, markersArray[i].cstat ); results += "" + "<div id='resultList"+markersArray[i].id+"' class='resultsrow' onclick=' openInfoWindow(&quot;"+ markersArray[i].id+"&quot;,&quot;"+ markersArray[i].name+"&quot;,&quot;"+ markersArray[i].address+"&quot;,&quot;"+ markersArray[i].phone+"&quot;,&quot;"+ markersArray[i].type+"&quot;,"+ markersArray[i].lat+","+ markersArray[i].lng+","+ markersArray[i].weight+","+ markersArray[i].attending+",&quot;"+ markersArray[i].pmax+"&quot;,&quot;"+ markersArray[i].pcand+"&quot;,&quot;"+ markersArray[i].pstat+"&quot;,&quot;"+ markersArray[i].cmax+"&quot;,&quot;"+ markersArray[i].ccand+"&quot;,&quot;"+ markersArray[i].cstat+"&quot;,&quot;"+ markersArray[i].appointedlsc+"&quot;); '>" + "<img src='" +markersArray[i].icon+ "' />" ; if (markersArray[i].weight === 0) { results +="<span style='color:"+linkcolor+ "; ' >"+markersArray[i].name+"</span>"; }else{ results +="<span style='color:"+linkcolor+ "; ' >"+markersArray[i].name+" - "+markersArray[i].attending+" / "+markersArray[i].weight+"</span>"; } results +="</div>" ; } } $("#resultList").html(results); $("#resultListContainer").scrollTop(0); if (searchtype === "oneschool") { var m=""; openInfoWindow(markersArray[0].id, markersArray[0].name, markersArray[0].address, markersArray[0].phone, markersArray[0].type, markersArray[0].lat, markersArray[0].lng, markersArray[0].weight, markersArray[0].attending, markersArray[0].pmax, markersArray[0].pcand, markersArray[0].pstat, markersArray[0].cmax, markersArray[0].ccand, markersArray[0].cstat, markersArray[0].appointedlsc); }else if (searchtype === "allschools") { // fixes the inital search moving map down // needs work map.setCenter(chicago); map.setZoom(11); if( $( window ).width() > 767 ) { map.panBy(-calcPinLocation(), 0); } else { map.panBy(0 , -($( window ).height() / 2.5 )) ; } }else{ setMapZoom(); } } function displayLSCBoundary(id) { //show the boundaries of the school if (searchPolyAttendance != null) { searchPolyAttendance.setMap(null); } searchPolyAttendance = null; var wh="'ID' = '" + id + "'" ; searchPolyAttendance = new google.maps.FusionTablesLayer({ query: { from: LSCdistrictsTableId, select: "geometry", where: wh }, styles: [ { polygonOptions: { fillColor: "#0b5394", fillOpacity: .10, strokeColor: "#0149da", strokeWeight: 3 } }, ], suppressInfoWindows: true }); searchPolyAttendance.setMap(map); } // populates the info window // called from markerclick and resultslist click function openInfoWindow(id, name, address, phone, type, lat, lng, weight, attending, pmax, pcand, pstat, cmax, ccand, cstat, appointedlsc) { var sposition = new google.maps.LatLng(lat,lng); //var headcolor = getLinkColor(pstat, cstat); var typeText = getType(type); var parentNeed = (pmax-pcand); var communityNeed = (cmax-ccand); var results = getVotes(id); if(results){ results = results.sort(function (a, b) { return a.type.localeCompare( b.type ); }); } var startaddr = ""; if (addrMarker !== null) { startaddr = "saddr="+ geoaddress + "&"; } var destaddr = "daddr="+address; var dirlink = " <a class='link-get-directions' data-toggle='tooltip' style='color:#333;' title='Directions' href='http://maps.google.com/maps?"+ startaddr + destaddr + "' target='_blank' ><span style='margin-left:5px;'><span class='glyphicon glyphicon-share-alt' aria-hidden='true'></span></span></a>"; var contents = "<div class='googft-info-window'>" + "<h4>" + name + "</h4>" + "<p>" + "<span>" + typeText + "</span><br />" + address + dirlink + "<br /><a style='color:#333;' href='tel:"+phone+"'>" + phone + "</a></p>" ; if (appointedlsc !== "Y" ) { if (pstat == "I" ) { contents += "<div style='color:#B20000;'>Parent Candidates: <strong>" + pcand + " of "+ pmax +"</strong></div>"; }else{ contents += "<div style='color:#1E5F08;'>Parent Candidates: <strong>" + pcand + " of "+ pmax +"</strong></div>"; } if (cstat == "I" ) { contents += "<div style='color:#B20000;'>Community Candidates: <strong>" + ccand + " of "+ cmax +"</strong></div>"; }else{ contents += "<div style='color:#1E5F08;'>Community Candidates: <strong>" + ccand + " of "+ cmax +"</strong></div>"; } contents += "<div id='divvotes'><table id='tblvotes' class='table table-striped table-condensed'><tbody><tr><th>Type</th><th>Name</th><th>Votes*</th></tr>"; for (i in results) { contents += "<tr><td>"+results[i].type+"</td><td>"+results[i].name+"</td><td>"+results[i].votes+"</td></tr>"; } contents += "</tbody></table></div>"; contents += "<div style='margin-top:10px;'><strong>* Unofficial Results</strong></div>"; } else { contents += "<div><h5>This school will not have an election.</h5></div>"; } // if(isHeatMapData()) { // if(weight>0) { // contents += "<p><span style='font-weight:bold'>Signups: </span>" + getWeight(id) + "<br />"; // contents += "<span style='font-weight:bold'>Attending: </span>" + getAttending(id) + "</p>"; // } // } displayLSCBoundary(id); hopscotch.endTour(); // have the info window appear in the center of the circles and offset higher on the pngs. if( isMarkerImage() ) { infoWindowsas.setOptions({ pixelOffset: new google.maps.Size(0, -14) }); }else{ infoWindowsas.setOptions({ pixelOffset: new google.maps.Size(0, 0) }); } infoWindowsas.setContent(contents); infoWindowsas.setPosition(sposition); infoWindowsas.open(map); map.panTo(sposition); positionMarkersOnMap(); } // popup infowindow called when user clicks on a marker on the map function markerClick(map, m, ifw) { return function() { _trackClickEventWithGA("Click", "Marker on Map LSC", m.name); openInfoWindow(m.id, m.name, m.address, m.phone, m.type, m.lat, m.lng, m.weight, m.attending, m.pmax, m.pcand, m.pstat, m.cmax, m.ccand, m.cstat, m.appointedlsc); }; } function setMapZoom() { if (searchtype === "allschools") { //map.fitBounds(latlngbounds); map.setCenter(chicago); map.setZoom(11); positionMarkersOnMap(); } else if (searchtype === "address") { //map.fitBounds(latlngbounds); map.panTo(addrMarker.position); map.setZoom(13); positionMarkersOnMap(); } else if (searchtype === "oneschool") { positionMarkersOnMap(); //one school from dd // map.fitBounds(latlngbounds); // map.setZoom(14);//map.setZoom(map.getZoom()-1); //zoom one click out // query4infowindowData(selectedSchoolID); } } function toggleHeatmap() { if(heatmap) { heatmap.setMap(heatmap.getMap() ? null : map); if (heatmap.getMap() !== null) { clearMarkers(); if (infoWindowsas) { infoWindowsas.close(map); } }else{ showMarkers(); } } } function toggleSignupCircles() { if (markersArray) { if( isMarkerImage() ) { for (i in markersArray) { var newimage = getCircle(markersArray[i].weight, markersArray[i].type ); markersArray[i].setIcon(newimage); } }else{ for (i in markersArray) { var newimage = getImage(markersArray[i].type); markersArray[i].setIcon(newimage); } } } } function getCircle(magnitude, type) { var c = getLinkColor(type); var circle = { path: google.maps.SymbolPath.CIRCLE, fillColor: c, fillOpacity: .4, scale: magnitude,//Math.pow(1, magnitude) / 2, strokeColor: c, strokeWeight: 1 }; return circle; } function isMarkerImage(){ if (markersArray) { if($.type( markersArray[0].icon ) === "string") { return true; // marker is an image } else { return false; // marker is an object - circles } } } function isHeatMapData() { if(heatMapData.length>0) { return true; } else { return false; } } function isMobile() { if( $( window ).width() > 767 ) { return false; }else{ return true; } } //centers the markers on the right side of the viewport on larger displays //centers the markers on the middle bottom of the screen on mobile displays function positionMarkersOnMap() { if(!isMobile()) { map.panBy(-calcPinLocation(), -($( window ).height() / 2.5 )); } else { map.panBy(0 , -($( window ).height() / 2.5 )) ; } } function calcPinLocation() { var w=$( window ).width() / 4; return(w); } function getType(stype) { var mytype = "School"; if( stype === "HS" ) { mytype = "High School"; }else if (stype === "ES"){ mytype = "Elementary School"; }else if (stype === "MS"){ mytype = "Middle School"; } return mytype; } function getWeight(sid){ return 0; // var result = $.grep(studentCountArray, function(e){ return e.id == sid; }); // if (result.length === 0) { // return 0; // } else if (result.length === 1) { // return result[0].weight; // } else { // return result[0].weight; // } } function getAttending(sid){ return 0; // var result = $.grep(studentCountArray, function(e){ return e.id == sid; }); // if (result.length === 0) { // return 0; // } else if (result.length === 1) { // return result[0].attending; // } else { // return result[0].attending; // } } function getLinkColor(pstat, cstat) { var linkcolor = "#333"; if( pstat == "I" || cstat == "I" ) { linkcolor = "#B20000"; }else{ linkcolor = "#1E5F08"; } return linkcolor; } function getImage(pstat, cstat) { var image = "images/number_star.png"; if(pstat === "I" || cstat === "I" || pstat === "" || cstat === "" ){ image = 'images/red_ex.png' ; }else{ image = 'images/green_star.png' ; } return image; } // reset btn function resetmap() { var pageurl = top.location.href if(pageurl.indexOf("?") >=0) { var x = pageurl.split('?')[0]; top.location.href = x; } else { $("#txtSearchAddress").val(''); initializeMap(); } hopscotch.endTour(); } function clearSearch() { if (searchPolyAttendance != null) { searchPolyAttendance.setMap(null); } if (infoWindowsas) { infoWindowsas.close(map); } deleteMarkers(); latlngbounds = new google.maps.LatLngBounds(null); searchtype = null; searchPolyAttendance = null; addrMarker = null } // lists the markers from the map function listMarkers() { if (markersArray) { for (i in markersArray) { console.log(markersArray[i].sid); } } } // Removes the markers from the map, but keeps them in the array function clearMarkers() { if (markersArray) { for (i in markersArray) { markersArray[i].setMap(null); } } } // Shows any markers currently in the array function showMarkers() { if (markersArray) { for (i in markersArray) { markersArray[i].setMap(map); } } } // Deletes all markers in the array by removing references to them function deleteMarkers() { if (markersArray) { for (i in markersArray) { markersArray[i].setMap(null); } markersArray.length = 0; } } // encodes the query, returns json, and calls sf if success function encodeQuery(q,sf) { var encodedQuery = encodeURIComponent(q); var url = [googleAPIurl]; url.push('?sql=' + encodedQuery); url.push('&key='+ googleAPIkey); url.push('&callback=?'); $.ajax({ url: url.join(''), dataType: "jsonp", success: sf, error: function () {alert("AJAX ERROR for " + q ); } }); }
mit
markbates/split_logger
test/split_logger/split_logger_test.rb
2228
require 'test_helper' require 'logger' describe SplitLogger do let(:sp) {SplitLogger.new} describe 'add' do it 'should add a logger to the list' do sp.list.size.must_equal 0 sp.add(:std, ::Logger.new(STDOUT)) sp.list.size.must_equal 1 end end describe 'list' do it 'should return a list of all loggers' do std = mock('std logger') sp.add(:std, std) sp.list.must_equal(std: std) end end describe 'remove' do it 'should remove a logger from the list' do std = mock('std logger') sp.add(:std, std) other = mock('other logger') sp.add(:other, other) sp.list.must_equal(std: std, other: other) sp.remove(:other) sp.list.must_equal(std: std) end end describe 'Rails' do before(:each) do Object.send(:remove_const, 'RAILS_DEFAULT_LOGGER') if defined?(RAILS_DEFAULT_LOGGER) end after(:each) do Object.send(:remove_const, 'RAILS_DEFAULT_LOGGER') if defined?(RAILS_DEFAULT_LOGGER) end it 'should automatically add the RAILS_DEFAULT_LOGGER to the list, if defined' do RAILS_DEFAULT_LOGGER = mock('rails_default_logger') sp.list.must_equal(rails_default_logger: RAILS_DEFAULT_LOGGER) end end [:debug, :info, :warn, :error, :fatal].each do |level| describe level do it "should call #{level} on each logger" do std = mock('std logger') other = mock('other logger') std.expects(level).with('this is my message') other.expects(level).with('this is my message') sp.add(:std, std) sp.add(:other, other) sp.send(level, 'this is my message') end it 'should remove a bad logger from the list and write a message to the other loggers' do std = mock('std logger') std.expects(level).with('this is my message') std.expects(level).with("Ah! Crap!") std.expects(level).with("Removed logger 'oops' from the logger list!") oops = mock('oops') oops.expects(level).with('this is my message').raises('Ah! Crap!') sp.add(:std, std) sp.add(:oops, oops) sp.send(level, 'this is my message') end end end end
mit
lianggx/mystaging
src/MyStaging/Metadata/TableType.cs
102
namespace MyStaging.Metadata { public enum TableType { Table, View } }
mit
medericDelamare/USCL
app/DoctrineMigrations/Version20170622202214.php
1052
<?php namespace Application\Migrations; use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; /** * Auto-generated Migration: Please modify to your needs! */ class Version20170622202214 extends AbstractMigration { /** * @param Schema $schema */ public function up(Schema $schema) { // this up() migration is auto-generated, please modify it to your needs $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE historique_stats ADD saison VARCHAR(255) NOT NULL'); } /** * @param Schema $schema */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE historique_stats DROP saison'); } }
mit
BadQuanta/sdl2_ffi
lib/sdl2/audio.rb
3670
require 'sdl2' require 'sdl2/rwops' module SDL2 typedef :uint16, :audio_format module Audio module MASK include EnumerableConstants BITSIZE= (0xFF) DATATYPE= (1<<8) ENDIAN= (1<<12) SIGNED= (1<<15) end def self.bitsize(x) x & Mask.BITSIZE end def self.is_float?(x) (x & Mask.DATATYPE) != 0 end def self.is_big_endian?(x) x & mask.ENDIAN end def self.is_signed?(x) x & mask.SIGNED end def self.is_int?(x) !is_float?(x) end def self.is_little_endian?(x) !is_big_endian?(x) end def self.is_unsigned?(x) !is_signed?(x) end U8 = 0x0008 S8 = 0x8008 U16LSB = 0x0010 S16LSB = 0x8010 U16MSB = 0x1010 S16MSB = 0x9010 U16 = U16LSB S16 = S16LSB S32LSB = 0x8020 S32MSB = 0x9020 S32 = S32LSB F32LSB = 0x8120 F32MSB = 0x9120 F32= F32LSB ALLOW_FREQUENCY_CHANGE =0x00000001 ALLOW_FORMAT_CHANGE =0x00000002 ALLOW_CHANNELS_CHANGE =0x00000004 ALLOW_ANY_CHANGE =(ALLOW_FREQUENCY_CHANGE|ALLOW_FORMAT_CHANGE|ALLOW_CHANNELS_CHANGE) class Spec < Struct layout :freq, :int, :format, :uint16, :channels, :uint8, :silence, :uint8, :samples, :uint16, :padding, :uint16, :size, :uint32, :callback, :pointer, #:audio_callback, :userdata, :pointer end class CVT < Struct layout :needed, :int, :src_format, :uint16, :dst_format, :uint16, :rate_incr, :double, :buf, :pointer, :len, :int, :len_cvt, :int, :len_mult, :int, :len_ratio, :double, :filters, [:pointer, 10], # :audio_filter callback :filter_index, :int end end#module Audio callback :audio_callback, [:pointer, :pointer, :int], :void callback :audio_filter, [Audio::CVT.by_ref, :audio_format], :void ## # api :SDL_GetNumAudioDrivers, [], :int ## # api :SDL_GetAudioDriver, [:int], :string ## # api :SDL_AudioInit, [:string], :int ## # api :SDL_AudioQuit, [], :void ## # api :SDL_GetCurrentAudioDriver, [], :string ## # api :SDL_OpenAudio, [Audio::Spec.by_ref, Audio::Spec.by_ref], :int typedef :uint32, :audio_device_id ## # api :SDL_GetNumAudioDevices, [:int], :int ## # api :SDL_GetAudioDeviceName, [:int, :int], :string ## # api :SDL_OpenAudioDevice, [:string, :int, Audio::Spec.by_ref, Audio::Spec.by_ref, :int], :audio_device_id enum :audio_status, [:STOPPED, 0, :PLAYING, :PAUSED] ## # api :SDL_GetAudioStatus, [], :audio_status ## # api :SDL_PauseAudio, [:int], :void ## # api :SDL_PauseAudioDevice, [:audio_device_id, :int], :void ## # api :SDL_LoadWAV_RW, [RWops.by_ref, :int, Audio::Spec.by_ref, :pointer, :pointer], Audio::Spec.by_ref def self.load_wav(file, spec, audio_buf, audio_len) load_wav_rw(rw_from_file) end ## # api :SDL_FreeWAV, [:pointer], :void ## # api :SDL_BuildAudioCVT, [Audio::CVT.by_ref, :audio_format, :uint8, :int, :audio_format, :uint8, :int], :int ## # api :SDL_ConvertAudio, [Audio::CVT.by_ref], :int MIX_MAXVOLUME = 128 ## # api :SDL_MixAudio, [:pointer, :pointer, :uint32, :int], :void ## # api :SDL_MixAudioFormat, [:pointer, :pointer, :audio_format, :uint32, :int], :void ## # api :SDL_LockAudio, [], :void ## # api :SDL_LockAudioDevice, [:audio_device_id], :void ## # api :SDL_UnlockAudio, [], :void ## # api :SDL_UnlockAudioDevice, [:audio_device_id], :void ## # api :SDL_CloseAudio, [], :void ## # api :SDL_CloseAudioDevice, [:audio_device_id], :void end
mit
hekailiang/cloud-config
cloud-config-ui/index.js
399
import React from 'react'; import ReactDOM from 'react-dom'; import Main from './components/main'; function run() { ReactDOM.render( <Main/>, document.getElementById('app') ); } const loadedStates = ['complete', 'loaded', 'interactive']; if (loadedStates.includes(document.readyState) && document.body) { run(); } else { window.addEventListener('DOMContentLoaded', run, false); }
mit
lurienanofab/labscheduler
LabScheduler/scripts/jquery.dateManager.js
4424
(function ($) { $.fn.dateManager = function (options) { return this.each(function () { var $this = $(this); var opt = $.extend({}, { "onChange": null, "format": "mm/dd/yyyy" }, options); var $datepicker = $('.datepicker', $this).datepicker({ 'autoclose': true, 'format': opt.format, 'verbose': false }); var $daterange = $('.daterange-select', $this); var writeLog = function (label, obj) { if (opt.verbose) console.log(label, obj); }; var onChange = function () { if (typeof opt.onChange === 'function') { opt.onChange({ 'sdate': formatDate($('.sdate', $this).datepicker('getDate'), opt.format), 'edate': formatDate($('.edate', $this).datepicker('getDate'), opt.format) }); } }; var now = new Date(); var formatDate = function (d, f) { if (d === null || d === '') return ''; var dd = d.getDate(); var mm = d.getMonth() + 1; var yy = d.getFullYear(); var dow = d.getDay(); var monthNames = ['January', 'Februray', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; var dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; var result = f.toString() .replace('mm', (mm + 100).toString().substr(1, 2)) .replace('m', mm.toString()) .replace('dd', (dd + 100).toString().substr(1, 2)) .replace('d', dd.toString()) .replace('yyyy', yy.toString()) .replace('yy', yy.toString().substr(2, 2)) .replace('MM', monthNames[mm - 1]) .replace('M', monthNames[mm - 1].substr(0, 3)) .replace('DD', dayNames[dow]) .replace('D', dayNames[dow].substr(0, 3)); return result; }; var ranges = [ { 'text': '30 days', 'sdate': formatDate(new Date(now.getFullYear(), now.getMonth(), now.getDate() - 30), opt.format), 'edate': formatDate(now, opt.format) }, { 'text': '3 months', 'sdate': formatDate(new Date(now.getFullYear(), now.getMonth() - 3, now.getDate()), opt.format), 'edate': formatDate(now, opt.format) }, { 'text': '1 year', 'sdate': formatDate(new Date(now.getFullYear() - 1, now.getMonth(), now.getDate()), opt.format), 'edate': formatDate(now, opt.format) }, { 'text': 'All', 'sdate': '', 'edate': '' } ]; writeLog('ranges', ranges); var checkDateRange = function () { var index = -1; var sd = formatDate($('.sdate', $this).datepicker('getDate'), opt.format); var ed = formatDate($('.edate', $this).datepicker('getDate'), opt.format); for (i = 0; i < ranges.length; i++) { if (ed === ranges[i].edate) { if (sd === ranges[i].sdate) { index = i; break; } } } writeLog('checkDateRange', { 'sd': sd, 'ed': ed, 'index': index }); $daterange.get(0).selectedIndex = index; }; var setDateRange = function (r) { $datepicker.off('changeDate'); writeLog('setDateRange', { 'range': ranges[r] }); $('.sdate', $this).datepicker('setDate', ranges[r].sdate); $('.edate', $this).datepicker('setDate', ranges[r].edate); onChange(); $datepicker.on('changeDate', handleChangeDate); }; var handleChangeDate = function () { checkDateRange(); onChange(); }; $datepicker.on('changeDate', handleChangeDate); $daterange.change(function () { var val = parseInt($(this).val()); setDateRange(val); }); checkDateRange(); }); }; }(jQuery));
mit
tomp2p/TomP2P.NET
TomP2P/TomP2P.Core/Peers/PeerAddress.cs
25678
using System; using System.Collections; using System.Collections.Generic; using System.Net; using System.Text; using TomP2P.Core.Storage; using TomP2P.Extensions; namespace TomP2P.Core.Peers { /// <summary> /// A peer address contains the node ID and how to contact this node both TCP and UDP. /// <para>The following format applies:</para> /// <para>20 bytes Number160</para> /// <para> 2 bytes Header</para> /// <para> - 1 byte Options: IPv6, firewalled UDP, firewalled TCP</para> /// <para> - 1 byte Relays:</para> /// <para> - first 3 bits: nr of relays (max. 5)</para> /// <para> - last 5 bits: if the 5 relays are IPv6 (bit set) or not (no bit set)</para> /// <para> 2 bytes TCP port</para> /// <para> 2 bytes UDP port</para> /// <para> 2 or 4 bytes Inet Address</para> /// <para> 0-5 relays:</para> /// <para> - 2 bytes TCP port</para> /// <para> - 2 bytes UDP port</para> /// <para> - 4 or 16 bytes Inet Address</para> /// </summary> public class PeerAddress : IComparable<PeerAddress>, IEquatable<PeerAddress> { public const int MaxSize = 142; public const int MinSize = 30; public const int MaxRelays = 5; private const int Net6 = 1; // 0001 private const int FirewallUdp = 2; // 0010 private const int FirewallTcp = 4; // 0100 private const int Relayed = 8; // 1000 // network information /// <summary> /// The ID of the peer. A peer cannot change its ID. /// </summary> public Number160 PeerId { get; private set; } public PeerSocketAddress PeerSocketAddress { get; private set; } // connection information /// <summary> /// True, if the internet address is IPv6. /// </summary> public bool IsIPv6 { get; private set; } /// <summary> /// True, if the internet address is IPv4. /// </summary> public bool IsIPv4 { get { return !IsIPv6; } } /// <summary> /// True, if the peer cannot be reached via UDP. /// </summary> public bool IsFirewalledUdp { get; private set; } /// <summary> /// True, if the peer cannot be reached via TCP. /// </summary> public bool IsFirewalledTcp { get; private set; } /// <summary> /// True, if the peer address is used as a relay. /// </summary> public bool IsRelayed { get; private set; } // calculate only once and cache private readonly int _hashCode; /// <summary> /// When deserializing, we need to know how much we deserialized from the constructor call. /// </summary> public long Offset { get; private set; } /// <summary> /// The size of the serialized peer address. /// </summary> public long Size { get; private set; } public int RelaySize { get; private set; } private readonly BitArray _relayType; private static readonly BitArray EmptyRelayType = new BitArray(0); // relays /// <summary> /// The relay peers. /// </summary> public ICollection<PeerSocketAddress> PeerSocketAddresses { get; private set; } public static readonly ICollection<PeerSocketAddress> EmptyPeerSocketAddresses = new HashSet<PeerSocketAddress>(); // TODO correct empty set? private const int TypeBitSize = 5; private const int HeaderSize = 2; private const int PortsSize = 4; // count both ports, UDP and TCP // used for relay bit shifting private const int Mask1F = 0x1f; // 0001 1111 private const int Mask07 = 0x7; // 0000 0111 /// <summary> /// Creates a peer address where the byte array has to be in the right format and size. /// The new offset can be accessed through the Offset property. /// </summary> /// <param name="me">The serialized array.</param> public PeerAddress(sbyte[] me) : this(me, 0) { } /// <summary> /// Creates a peer address from a continuous byte array. This is useful if you don't know the size beforehand. /// The new offset can be accessed through the Offset property. /// </summary> /// <param name="me">The serialized array.</param> /// <param name="initialOffset">The offset where to start.</param> public PeerAddress(sbyte[] me, int initialOffset) { // get the peer ID, this is independent of the type long offset = initialOffset; // get the options int options = me[offset++] & Utils.Utils.MaskFf; IsIPv6 = (options & Net6) > 0; // TODO static methods could be used instead IsFirewalledUdp = (options & FirewallUdp) > 0; IsFirewalledTcp = (options & FirewallTcp) > 0; IsRelayed = (options & Relayed) > 0; // get the relays int relays = me[offset++] & Utils.Utils.MaskFf; // first 3 bits are the size RelaySize = (relays >> TypeBitSize) & Mask07; // last 5 bits indicate if IPv6 or IPv4 var b = (byte)(relays & Mask1F); // TODO check if works (2x) _relayType = new BitArray(b); // get the ID var tmp = new sbyte[Number160.ByteArraySize]; Array.Copy(me, offset, tmp, 0, Number160.ByteArraySize); PeerId = new Number160(tmp); offset += Number160.ByteArraySize; PeerSocketAddress = PeerSocketAddress.Create(me, IsIPv4, offset); offset = PeerSocketAddress.Offset; if (RelaySize > 0) { PeerSocketAddresses = new List<PeerSocketAddress>(RelaySize); for (int i = 0; i < RelaySize; i++) { var psa = PeerSocketAddress.Create(me, !_relayType.Get(i), offset); PeerSocketAddresses.Add(psa); offset = psa.Offset; } } else { PeerSocketAddresses = EmptyPeerSocketAddresses; } Size = offset - initialOffset; Offset = offset; _hashCode = PeerId.GetHashCode(); } /// <summary> /// Creates a peer address from a byte buffer. /// </summary> /// <param name="buffer">The channel buffer to read from.</param> public PeerAddress(AlternativeCompositeByteBuf buffer) { long readerIndex = buffer.ReaderIndex; // get the type int options = buffer.ReadByte(); IsIPv6 = (options & Net6) > 0; IsFirewalledUdp = (options & FirewallUdp) > 0; IsFirewalledTcp = (options & FirewallTcp) > 0; IsRelayed = (options & Relayed) > 0; // get the relays int relays = buffer.ReadByte(); RelaySize = (relays >> TypeBitSize) & Mask07; var b = (byte) (relays & Mask1F); // TODO check if works (2x) _relayType = new BitArray(b); // get the ID var me = new sbyte[Number160.ByteArraySize]; buffer.ReadBytes(me); PeerId = new Number160(me); PeerSocketAddress = PeerSocketAddress.Create(buffer, IsIPv4); if (RelaySize > 0) { PeerSocketAddresses = new List<PeerSocketAddress>(RelaySize); for (int i = 0; i < RelaySize; i++) { PeerSocketAddresses.Add(PeerSocketAddress.Create(buffer, !_relayType.Get(i))); } } else { PeerSocketAddresses = EmptyPeerSocketAddresses; } Size = buffer.ReaderIndex - readerIndex; Offset = -1; // not used here _hashCode = PeerId.GetHashCode(); } /// <summary> /// If you only need to know the ID. /// </summary> /// <param name="id">The ID of the peer.</param> public PeerAddress(Number160 id) : this(id, (IPAddress) null, -1, -1) { } /// <summary> /// If you only need to know the ID and the internet address. /// </summary> /// <param name="id">The ID of the peer.</param> /// <param name="inetAddress">The internet address of the peer.</param> public PeerAddress(Number160 id, IPAddress inetAddress) : this(id, inetAddress, -1, -1) { } /// <summary> /// Creates a peer address if all the values are known. /// </summary> /// <param name="id">The ID of the peer.</param> /// <param name="peerSocketAddress">The peer socket address including both ports UDP and TCP.</param> /// <param name="isFirewalledTcp">Indicates if the peer is not reachable via UDP.</param> /// <param name="isFirewalledUdp">Indicates if the peer is not reachable via TCP.</param> /// <param name="isRelayed">Indicates if the peer is used as a relay.</param> /// <param name="peerSocketAddresses">The relay peers.</param> public PeerAddress(Number160 id, PeerSocketAddress peerSocketAddress, bool isFirewalledTcp, bool isFirewalledUdp, bool isRelayed, ICollection<PeerSocketAddress> peerSocketAddresses) { PeerId = id; int size = Number160.ByteArraySize; PeerSocketAddress = peerSocketAddress; _hashCode = id.GetHashCode(); IsIPv6 = peerSocketAddress.InetAddress.IsIPv6(); IsFirewalledUdp = isFirewalledUdp; IsFirewalledTcp = isFirewalledTcp; IsRelayed = isRelayed; // header + TCP port + UDP port size += HeaderSize + PortsSize + (IsIPv6 ? Utils.Utils.IPv6Bytes : Utils.Utils.IPv4Bytes); if (PeerSocketAddresses == null) { PeerSocketAddresses = EmptyPeerSocketAddresses; _relayType = EmptyRelayType; RelaySize = 0; } else { RelaySize = PeerSocketAddresses.Count; if (RelaySize > TypeBitSize) { throw new ArgumentException(String.Format("Can only store up to {0} relay peers. Tried to store {1} relay peers.", TypeBitSize, RelaySize)); } PeerSocketAddresses = peerSocketAddresses; _relayType = new BitArray(RelaySize); } int index = 0; foreach (var psa in peerSocketAddresses) { bool isIPv6 = psa.InetAddress.IsIPv6(); _relayType.Set(index, isIPv6); size += psa.Size(); index++; } Size = size; Offset = -1; // not used here } // Facade Constructors: /// <summary> /// Facade for PeerAddress(Number160, PeerSocketAddress, bool, bool, bool, Collection-PeerSocketAddress>)}. /// </summary> /// <param name="peerId">The ID of the peer.</param> /// <param name="inetAddress">The internet address of the peer.</param> /// <param name="tcpPort">The TCP port of the peer.</param> /// <param name="udpPort">The UDP port of the peer.</param> public PeerAddress(Number160 peerId, IPAddress inetAddress, int tcpPort, int udpPort) // TODO both IPv4 and IPv6 can be passed here -> fix flags : this(peerId, new PeerSocketAddress(inetAddress, tcpPort, udpPort), false, false, false, EmptyPeerSocketAddresses) { } /// <summary> /// Facade for PeerAddress(Number160, PeerSocketAddress, bool, bool, bool, Collection-PeerSocketAddress>. /// </summary> /// <param name="peerId">The ID of the peer.</param> /// <param name="inetAddress">The internet address of the peer.</param> /// <param name="tcpPort">The TCP port of the peer.</param> /// <param name="udpPort">The UDP port of the peer.</param> /// <param name="options">The options for the created <see cref="PeerAddress"/>.</param> public PeerAddress(Number160 peerId, IPAddress inetAddress, int tcpPort, int udpPort, int options) : this(peerId, new PeerSocketAddress(inetAddress, tcpPort, udpPort), ReadIsFirewalledTcp(options), ReadIsFirewalledUdp(options), ReadIsRelay(options), EmptyPeerSocketAddresses) { } /// <summary> /// Facade for PeerAddress(Number160, IPAddress, int, int). /// </summary> /// <param name="peerId">The ID of the peer.</param> /// <param name="inetAddress">The internet address of the peer.</param> /// <param name="tcpPort">The TCP port of the peer.</param> /// <param name="udpPort">The UDP port of the peer.</param> public PeerAddress(Number160 peerId, string inetAddress, int tcpPort, int udpPort) : this(peerId, IPAddress.Parse(inetAddress), tcpPort, udpPort) { } /// <summary> /// Facade for PeerAddress(Number160, IPAddress, int, int). /// </summary> /// <param name="peerId">The ID of the peer.</param> /// <param name="inetSocketAddress">The socket address of the peer. Both TCP and UDP will be set to the same port.</param> public PeerAddress(Number160 peerId, IPEndPoint inetSocketAddress) : this(peerId, inetSocketAddress.Address, inetSocketAddress.Port, inetSocketAddress.Port) { } /// <summary> /// Serializes to a new array with the proper size. /// </summary> /// <returns>The serialized representation.</returns> public sbyte[] ToByteArray() { var me = new sbyte[Size]; ToByteArray(me, 0); return me; } /// <summary> /// Serializes to an existing array. /// </summary> /// <param name="me">The array where the result should be stored.</param> /// <param name="offset">The offset where to start to save the result in the byte array.</param> /// <returns>The new offset.</returns> public int ToByteArray(sbyte[] me, int offset) { // save the peer ID int newOffset = offset; me[newOffset++] = Options; me[newOffset++] = Relays; newOffset = PeerId.ToByteArray(me, newOffset); // we store both the addresses of the peer and the relays // currently, this is not needed as we don't consider asymmetric relays newOffset = PeerSocketAddress.ToByteArray(me, newOffset); foreach (var psa in PeerSocketAddresses) { newOffset = psa.ToByteArray(me, newOffset); } return newOffset; } /// <summary> /// Creates and returns the socket address using the TCP port. /// </summary> /// <returns>The socket address how to reach this peer.</returns> public IPEndPoint CreateSocketTcp() { return new IPEndPoint(PeerSocketAddress.InetAddress, PeerSocketAddress.TcpPort); } /// <summary> /// Creates and returns the socket address using the UDP port. /// </summary> /// <returns>The socket address how to reach this peer.</returns> public IPEndPoint CreateSocketUdp() { return new IPEndPoint(PeerSocketAddress.InetAddress, PeerSocketAddress.UdpPort); } /// <summary> /// Create a new peer address and change the relayed status. /// </summary> /// <param name="isRelayed">The new relay status.</param> /// <returns>The newly created peer address.</returns> public PeerAddress ChangeIsRelayed(bool isRelayed) { return new PeerAddress(PeerId, PeerSocketAddress, IsFirewalledTcp, IsFirewalledUdp, isRelayed, PeerSocketAddresses); } /// <summary> /// Create a new peer address and change the firewall UDP status. /// </summary> /// <param name="isFirewalledUdp">The new firewall UDP status.</param> /// <returns>The newly created peer address.</returns> public PeerAddress ChangeIsFirewalledUdp(bool isFirewalledUdp) { return new PeerAddress(PeerId, PeerSocketAddress, IsFirewalledTcp, isFirewalledUdp, IsRelayed, PeerSocketAddresses); } /// <summary> /// Create a new peer address and change the firewall TCP status. /// </summary> /// <param name="isFirewalledTcp">The new firewall TCP status.</param> /// <returns>The newly created peer address.</returns> public PeerAddress ChangeIsFirewalledTcp(bool isFirewalledTcp) { return new PeerAddress(PeerId, PeerSocketAddress, isFirewalledTcp, IsFirewalledUdp, IsRelayed, PeerSocketAddresses); } /// <summary> /// Create a new peer address and change the internet address. /// </summary> /// <param name="inetAddress">The new internet address.</param> /// <returns>The newly created peer address.</returns> public PeerAddress ChangeAddress(IPAddress inetAddress) { return new PeerAddress(PeerId, new PeerSocketAddress(inetAddress, PeerSocketAddress.TcpPort, PeerSocketAddress.UdpPort), IsFirewalledTcp, IsFirewalledUdp, IsRelayed, PeerSocketAddresses); } /// <summary> /// Create a new peer address and change the TCP and UDP ports. /// </summary> /// <param name="tcpPort">The new TCP port.</param> /// <param name="udpPort">The new UDP port.</param> /// <returns>The newly created peer address.</returns> public PeerAddress ChangePorts(int tcpPort, int udpPort) { return new PeerAddress(PeerId, new PeerSocketAddress(PeerSocketAddress.InetAddress, tcpPort, udpPort), IsFirewalledTcp, IsFirewalledUdp, IsRelayed, PeerSocketAddresses); } /// <summary> /// Create a new peer address and change the peer ID. /// </summary> /// <param name="peerId">The new peer ID.</param> /// <returns>The newly created peer address.</returns> public PeerAddress ChangePeerId(Number160 peerId) { return new PeerAddress(peerId, PeerSocketAddress, IsFirewalledTcp, IsFirewalledUdp, IsRelayed, PeerSocketAddresses); } public PeerAddress ChangePeerSocketAddress(PeerSocketAddress peerSocketAddress) { return new PeerAddress(PeerId, peerSocketAddress, IsFirewalledTcp, IsFirewalledUdp, IsRelayed, PeerSocketAddresses); } public PeerAddress ChangePeerSocketAddresses(ICollection<PeerSocketAddress> peerSocketAddresses) { return new PeerAddress(PeerId, PeerSocketAddress, IsFirewalledTcp, IsFirewalledUdp, IsRelayed, peerSocketAddresses); } /// <summary> /// Calculates the size based on the two header bytes. /// </summary> /// <param name="header">The header in the lower 16 bits of this integer.</param> /// <returns>The expected size of the peer address.</returns> public static int CalculateSize(int header) { // TODO check correctness, potential BUG int options = (header >> Utils.Utils.ByteBits) & Utils.Utils.MaskFf; int relays = header & Utils.Utils.MaskFf; return CalculateSize(options, relays); } /// <summary> /// Calculates the size based on the two header bytes. /// </summary> /// <param name="options">The options tell us if the internet address is IPv4 or IPv6.</param> /// <param name="relays">The relays tell us how many relays we have and of what type they are.</param> /// <returns>The expected size of the peer address.</returns> public static int CalculateSize(int options, int relays) { // header + tcp port + udp port + peer id int size = HeaderSize + PortsSize + Number160.ByteArraySize; if (ReadIsNet6(options)) { size += Utils.Utils.IPv6Bytes; } else { size += Utils.Utils.IPv4Bytes; } // count the relays int relaySize = (relays >> TypeBitSize) & Mask07; var b = (byte) (relays & Mask1F); var relayType = new BitArray(b); for (int i = 0; i < relaySize; i++) { size += PortsSize; if (relayType.Get(i)) { size += Utils.Utils.IPv6Bytes; } else { size += Utils.Utils.IPv4Bytes; } } return size; } /// <summary> /// Checks if options has IPv6 set. /// </summary> /// <param name="options">The option field, lowest 8 bit.</param> /// <returns>True, if its IPv6.</returns> private static bool ReadIsNet6(int options) { return ((options & Utils.Utils.MaskFf) & Net6) > 0; } /// <summary> /// Checks if options has firewall UDP set. /// </summary> /// <param name="options">The option field, lowest 8 bit.</param> /// <returns>True, if its firewalled via UDP.</returns> private static bool ReadIsFirewalledUdp(int options) { return ((options & Utils.Utils.MaskFf) & FirewallUdp) > 0; } /// <summary> /// Checks if options has firewall TCP set. /// </summary> /// <param name="options">The option field, lowest 8 bit.</param> /// <returns>True, if its firewalled via TCP.</returns> private static bool ReadIsFirewalledTcp(int options) { return ((options & Utils.Utils.MaskFf) & FirewallTcp) > 0; } /// <summary> /// Checks if options has relay flag set. /// </summary> /// <param name="options">The option field, lowest 8 bit.</param> /// <returns>True, if its used as a relay.</returns> private static bool ReadIsRelay(int options) { return ((options & Utils.Utils.MaskFf) & Relayed) > 0; } public int CompareTo(PeerAddress other) { // the ID determines if two peers are equal, the address does not matter return PeerId.CompareTo(other.PeerId); } public override string ToString() { var sb = new StringBuilder("paddr["); return sb.Append(PeerId) .Append(PeerSocketAddress) .Append("]/relay(").Append(IsRelayed) .Append(",").Append(PeerSocketAddresses.Count) .Append(")=").Append(Convenient.ToString(PeerSocketAddresses)) .ToString(); } public override bool Equals(object obj) { if (ReferenceEquals(obj, null)) { return false; } if (ReferenceEquals(this, obj)) { return true; } if (GetType() != obj.GetType()) { return false; } return Equals(obj as PeerAddress); } public bool Equals(PeerAddress other) { return other != null && PeerId.Equals(other.PeerId); } public override int GetHashCode() { // use cached hash code return _hashCode; } /// <summary> /// The IP address of this peer. /// </summary> public IPAddress InetAddress { get { return PeerSocketAddress.InetAddress; } } /// <summary> /// The encoded options. /// </summary> public sbyte Options { get { sbyte result = 0; if (IsIPv6) { result |= Net6; } if (IsFirewalledUdp) { result |= FirewallUdp; } if (IsFirewalledTcp) { result |= FirewallTcp; } if (IsRelayed) { result |= Relayed; } return result; } } /// <summary> /// The encoded relays. There are maximal 5 relays. /// </summary> public sbyte Relays { get { if (RelaySize > 0) { var result = (sbyte) (RelaySize << TypeBitSize); sbyte types = _relayType.ToByte(); result |= (sbyte) (types & Mask1F); return result; } return 0; } } /// <summary> /// UDP port. /// </summary> public int UdpPort { get { return PeerSocketAddress.UdpPort; } } /// <summary> /// TCP port. /// </summary> public int TcpPort { get { return PeerSocketAddress.TcpPort; } } } }
mit
xXBeTaV2Xx/Cubics-Networking
CubicsGamesNetworking/Tools/Logger.cs
2937
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CubicsGamesNetworking.Tools { public static class Logger { private static bool LogInConsole = true; private static bool ErrorInConsole = true; public static void SetLogInConsole(bool log) { LogInConsole = log; } public static void SetErrorInConsole(bool log) { ErrorInConsole = log; } public static void Log(string msg) { if (!LogInConsole) { return; } Console.WriteLine(getTime() + "[Server][Log] " + msg); } public static void Error(string msg) { if (!ErrorInConsole) { return; } Console.WriteLine(getTime() + "[Server][Error] " + msg); } public static void Log(Connection con, string msg) { if (!LogInConsole) { return; } if (con != null) { Console.WriteLine(getTime() + "[Client][" + con.getUID().ToString() + "][Log] " + msg); } else { Console.WriteLine(getTime() + "[Client][Log] " + msg); } } public static void Error(Connection con, string msg) { if (!ErrorInConsole) { return; } if (con != null) { Console.WriteLine(getTime() + "[Client][" + con.getUID().ToString() + "][Error] " + msg); } else { Console.WriteLine(getTime() + "[Client][Error] " + msg); } } public static string getTime() { String hours = "00", minutes = "00", seconds = "00"; DateTime Time = DateTime.Now; if (Time != null) { if (Time.Hour > 9) { hours = Time.Hour.ToString(); } else { hours = "0" + Time.Hour.ToString(); } if (Time.Minute > 9) { minutes = Time.Minute.ToString(); } else { minutes = "0" + Time.Minute.ToString(); } if (Time.Second > 9) { seconds = Time.Second.ToString(); } else { seconds = "0" + Time.Second.ToString(); } } return "[" + hours + ":" + minutes + ":" + seconds + "]"; } } }
mit
msvalina/pcl-surface-mesh-reconstruction
mesh-reconstruction/logwindow.cpp
613
#include <logwindow.h> LogWindow::LogWindow(QWidget *parent) : QPlainTextEdit(parent) { appendMessage("Welcome young padawan. \n"); } void LogWindow::appendMessage(const QString& text) { this->appendPlainText(text); // Adds the message to the widget this->verticalScrollBar()->setValue(this->verticalScrollBar()->maximum()); this->setReadOnly(true); logText = logText + text + "\n"; } void LogWindow::saveLogMessage(const QString &saveFile) { QFile data(saveFile); if (data.open(QFile::WriteOnly | QFile::Truncate)) { QTextStream out(&data); out << logText; } }
mit
Blecki/RMUD
Core/Core/Parser/Matchers/RankGate.cs
1007
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace RMUD { public partial class CommandFactory { public static CommandTokenMatcher RequiredRank(int Rank) { return new RankGate(Rank); } } internal class RankGate : CommandTokenMatcher { public int RequiredRank; internal RankGate(int RequiredRank) { this.RequiredRank = RequiredRank; } public List<PossibleMatch> Match(PossibleMatch State, MatchContext Context) { var R = new List<PossibleMatch>(); if (Context.ExecutingActor.GetProperty<int>("rank") >= RequiredRank) R.Add(State); //else // throw new CommandParser.MatchAborted("You do not have sufficient rank to use that command."); return R; } public String FindFirstKeyWord() { return null; } public String Emit() { return "<Rank must be >= " + RequiredRank + ">"; } } }
mit
JordanMajd/Electronic_Life
src/entities/herbivore.js
139
'use strict'; var Animal = require('../entities/animal'); function Herbivore() { //TODO: implement me } module.exports = Herbivore;
mit
kristenkotkas/moviediary
src/main/java/server/template/ui/RecommenderTemplate.java
91
package server.template.ui; public interface RecommenderTemplate extends BaseTemplate { }
mit
openpprn/opn
config/initializers/merit.rb
3432
# Use this hook to configure merit parameters Merit.setup do |config| # Check rules on each request or in background # config.checks_on_each_request = true # Define ORM. Could be :active_record (default) and :mongoid # config.orm = :active_record # Add application observers to get notifications when reputation changes. # config.add_observer 'MyObserverClassName' # Define :user_model_name. This model will be used to grant badge if no # `:to` option is given. Default is 'User'. # config.user_model_name = 'User' # Define :current_user_method. Similar to previous option. It will be used # to retrieve :user_model_name object if no `:to` option is given. Default # is "current_#{user_model_name.downcase}". # config.current_user_method = 'current_user' end # Create application badges (uses https://github.com/norman/ambry) # Multi-Level Badges inquisitor_attr = {name: 'inquisitor', custom_fields: { title: 'Inquisitor', icon: 'fa-question-circle', category: 'research' } } voter_attr = {name: 'voter', custom_fields: { title: 'Voter', icon: 'fa-check-circle-o', category: 'research' } } badges = [ # Home {name: 'just-registered', description: 'You joined! You\'re a boss!', custom_fields: { title: 'You Joined!', icon: 'fa-user', category: 'home' }}, # Research Topics inquisitor_attr.merge({level: 1, description: "level one son!"}), inquisitor_attr.merge({level: 2, description: "level two blue!"}), inquisitor_attr.merge({level: 3, description: "level three bee!"}), voter_attr.merge({level: 1, description: "newbie voter"}), voter_attr.merge({level: 2, description: "voted twice"}), voter_attr.merge({level: 3, description: "you've voted like everything!"}), {name: 'discusser', description: 'You commented on 3 topics', custom_fields: { title: 'Discusser', icon: 'fa-comments-o', category: 'research' }}, {name: 'great-ideamaker', description: 'Your ideas are in the top 25%', custom_fields: { title: 'Great Ideamaker', icon: 'fa-lightbulb-o', category: 'research' }}, {name: 'dutiful-citizen', description: 'You\'ve responded to 10 biannual surveys', custom_fields: { title: 'Dutiful Citizen', icon: 'fa-list-ul', category: 'research' }}, # Health Data {name: 'check-iner', description: 'You\'ve done 40 frequent surveys', custom_fields: { title: 'Frequent Check-iner', icon: 'fa-clock-o', category: 'health_data' }}, {name: 'on-fire', description: 'You\'re on a 5 survey streak', custom_fields: { title: 'On Fire', icon: 'fa-fire', category: 'health_data' }}, {name: 'connector', description: 'You\'ve connected 3 Data Sources', custom_fields: { title: 'Connector', icon: 'fa-link', category: 'health_data' }}, {name: 'data-dumper', description: 'Use Your Connected Devices', custom_fields: { title: 'Data Dumper', icon: 'fa-bar-chart', category: 'health_data' }}, {name: 'sherlock', description: 'Investigate and graph your data', custom_fields: { title: 'Sherlock', icon: 'fa-search', category: 'health_data' }}, # Members {name: 'socialite', description: 'You socialize like a boss!', custom_fields: { title: 'Socialite', icon: 'fa-group', category: 'members' }}, {name: 'greeter', description: 'You have your profile photo on the homepage', custom_fields: { title: 'Greeter', icon: 'fa-slideshare', category: 'members' }}, ] badge_id = 1 badges.each do |attrs| Merit::Badge.create!(attrs.merge({id: badge_id})) badge_id += 1 end
mit
hfeeki/cmdln
test/cmdln_help1.py
1370
#!/usr/bin/env python """ $ python cmdln_help1.py help HelpShell: blah blah blah $ python cmdln_help1.py help documented documented: blah documented blah $ python cmdln_help1.py help hashelpfunc hashelpfunc: blah hashelpfunc blah $ python cmdln_help1.py help undocumented cmdln_help1.py: no help on 'undocumented' $ python cmdln_help1.py help undefined cmdln_help1.py: unknown command: 'undefined' Try 'cmdln_help1.py help' for info. $ python cmdln_help1.py #expecttest: INTERACTIVE, PROMPT="help-test> " help-test> help HelpShell: blah blah blah help-test> help documented documented: blah documented blah help-test> help hashelpfunc hashelpfunc: blah hashelpfunc blah help-test> help undocumented no help on 'undocumented' help-test> help undefined unknown command: 'undefined' help-test> ^D """ import sys import cmdln class HelpShell(cmdln.RawCmdln): """HelpShell: blah blah blah""" prompt = "help-test> " def do_documented(self, argv): """${cmd_name}: blah documented blah""" def do_undocumented(self, argv): pass def help_hashelpfunc(self): return "${cmd_name}: blah hashelpfunc blah" def do_hashelpfunc(self, argv): pass if __name__ == "__main__": sys.exit(HelpShell().main(loop=cmdln.LOOP_IF_EMPTY))
mit
huyang1532/datamining
src/main/java/me/huyang/ReadLocalFile.java
1007
package me.huyang; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; /** * Created by young on 2015/5/5. */ public class ReadLocalFile { public static void readFile(String hdfsPath, File file) throws Exception { FileReader fileReader = new FileReader(file); BufferedReader reader = new BufferedReader(fileReader); String string; WriteFileToHDFS.setPathStr(hdfsPath); while ((string = reader.readLine()) != null) { String[] keyvalue = string.split("\\t"); WriteFileToHDFS.write(Integer.valueOf(keyvalue[0]), keyvalue[1]); } } public static void main(String[] args) { String hdfsPath = args[args.length -1]; String localPath = args[args.length -2]; File file = new File(localPath); try { readFile(hdfsPath, file); } catch (Exception e) { System.out.println("error here"); e.printStackTrace(); } } }
mit
CorsoJavaGenesis/Common
src/main/java/corsojavagenesis/common/oop/abstractclass/ClasseConcreta.java
306
package corsojavagenesis.common.oop.abstractclass; public class ClasseConcreta extends ClasseAstratta { public ClasseConcreta(){ super(); System.out.println("Costruttore di ClasseConcreta"); } @Override public int nome(int a) { // TODO Auto-generated method stub return 0; } }
mit
zhenxuan00/mmdgm
conv-mmdgm/layer/BernoulliVisiable.py
2319
import theano.tensor as T import theano.tensor.nnet as Tnn import numpy as np import theano import nonlinearity class BernoulliVisiable(object): """ Stochastic layer: Bernoulli distribution """ def __init__(self, rng, input, data, n_in, n_out, W_mean=None, b_mean=None, activation=None): """ :rng :sampling np for initialization :type input: theano.tensor.dmatrix :param input: a symbolic tensor of shape (n_examples, n_in) :type n_in: int :param n_in: dimensionality of input :type n_out: int :param n_out: number of hidden units :type activation: theano.Op or function :param activation: Non linearity to be applied in the stochastic layer typically """ self.input = input if W_mean is None: if activation is None: W_values_mean = nonlinearity.initialize_matrix(rng, n_in, n_out) elif activation == T.tanh or activation == Tnn.sigmoid: W_values_mean = np.asarray( rng.uniform( low=-np.sqrt(6. / (n_in + n_out)), high=np.sqrt(6. / (n_in + n_out)), size=(n_in, n_out) ), dtype=theano.config.floatX ) if activation == Tnn.sigmoid: W_values_mean *= 4 else: raise Exception('Unknown activation in HiddenLayer.') W_mean = theano.shared(value=W_values_mean, name='W', borrow=True) if b_mean is None: b_values_mean = np.zeros((n_out,), dtype=theano.config.floatX) b_mean = theano.shared(value=b_values_mean, name='b', borrow=True) self.W_mean = W_mean self.b_mean = b_mean self.q_mean = T.nnet.sigmoid(T.dot(input, self.W_mean) + self.b_mean) # loglikelihood #self.logpx = - ((self.q_mean - data)**2).sum(axis = 1) self.logpx = (- T.nnet.binary_crossentropy(self.q_mean, data)).sum(axis=1) # parameters of the model self.params = [self.W_mean, self.b_mean] def sample_x(self, rng_share): return rng_share.binomial(n=1,p=self.q_mean,dtype=theano.config.floatX)
mit
waldo2188/OpenIdConnectRelyingPartyBundle
DependencyInjection/Security/Factory/OICFactory.php
3371
<?php namespace Waldo\OpenIdConnect\RelyingPartyBundle\DependencyInjection\Security\Factory; use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\DefinitionDecorator; use Symfony\Component\DependencyInjection\Reference; /** * OICFactory * * @author valérian Girard <valerian.girard@educagri.fr> */ class OICFactory extends AbstractFactory { public function addConfiguration(\Symfony\Component\Config\Definition\Builder\NodeDefinition $node) { parent::addConfiguration($node); $node->children() ->scalarNode('create_users')->defaultFalse()->end() ->arrayNode('created_users_roles') ->treatNullLike(array()) ->beforeNormalization() ->ifTrue(function($v) { return !is_array($v); }) ->then(function($v) { return array($v); }) ->end() ->prototype('scalar')->end() ->defaultValue(array("ROLE_OIC_USER")) ->end() ->end() ; } /** * {@inheritDoc} */ protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId) { $providerId = 'security.authentication.provider.oic_rp.' . $id; $container ->setDefinition($providerId, new DefinitionDecorator('waldo_oic_rp.authentication.provider')) ->addArgument(new Reference($userProviderId)) ->addArgument(new Reference('waldo_oic_rp.resource_owner.generic')) ->addArgument($config['create_users']) ->addArgument($config['created_users_roles']) ; return $providerId; } /** * {@inheritDoc} */ protected function createEntryPoint($container, $id, $config, $defaultEntryPoint) { $entryPointId = 'security.authentication.entrypoint.oic_rp.' . $id; $container ->setDefinition($entryPointId, new DefinitionDecorator('waldo_oic_rp.authentication.entrypoint')) ->addArgument(new Reference('waldo_oic_rp.resource_owner.generic')) ; return $entryPointId; } /** * {@inheritDoc} */ protected function createListener($container, $id, $config, $userProvider) { $listenerId = parent::createListener($container, $id, $config, $userProvider); $container ->getDefinition($listenerId) ->addMethodCall('setResourceOwner', array(new Reference('waldo_oic_rp.resource_owner.generic'))) ->addMethodCall('setSecurityContext', array(new Reference('security.context'))) ; return $listenerId; } /** * {@inheritDoc} */ protected function getListenerId() { return 'waldo_oic_rp.authentication.listener'; } /** * {@inheritDoc} * Allow to add a custom configuration in a firewall's configuration * in the security.yml file. */ public function getKey() { return 'openidconnect'; } /** * {@inheritDoc} */ public function getPosition() { return 'pre_auth'; } }
mit
CS2103AUG2016-T17-C3/main
src/main/java/seedu/task/model/task/Status.java
2864
package seedu.task.model.task; // @@author A0147335E /** * Represents a Task status in the task manager. */ public class Status { private boolean isDone; private boolean isOverdue; private boolean isFavorite; public Status() { this.isDone = false; this.isOverdue = false; this.isFavorite = false; } public Status(boolean isDone, boolean isOverdue, boolean isFavorite) { this.isDone = isDone; this.isOverdue = isOverdue; this.isFavorite = isFavorite; } public void setDoneStatus(boolean doneStatus) { this.isDone = doneStatus; } public void setOverdueStatus(boolean overdueStatus) { this.isDone = overdueStatus; } public void setFavoriteStatus(boolean isFavorite) { this.isFavorite = isFavorite; } public boolean getDoneStatus() { return isDone; } public boolean getOverdueStatus() { return isOverdue; } public boolean getFavoriteStatus() { return isFavorite; } // @@author A0147944U /** * Compares the two Statuses based on DoneStatus. * * @return zero if this done status represents the same boolean value as the * argument; a positive value if this done status represents true * and the argument represents false; and a negative value if this * done status represents false and the argument represents true */ public int compareDoneStatusTo(Status anotherStatus) { return (Boolean.valueOf(this.getDoneStatus()).compareTo(Boolean.valueOf(anotherStatus.getDoneStatus()))); } /** * Compares the two Statuses based on OverdueStatus. * * @return zero if this overdue status represents the same boolean value as the * argument; a positive value if this overdue status represents true * and the argument represents false; and a negative value if this * overdue status represents false and the argument represents true */ public int compareOverdueStatusTo(Status anotherStatus) { return (Boolean.valueOf(this.getOverdueStatus()).compareTo(Boolean.valueOf(anotherStatus.getOverdueStatus()))); } /** * Compares the two Statuses based on FavoriteStatus. * * @return zero if this favorite status represents the same boolean value as the * argument; a positive value if this favorite status represents true * and the argument represents false; and a negative value if this * favorite status represents false and the argument represents true */ public int compareFavoriteStatusTo(Status anotherStatus) { return (Boolean.valueOf(this.getFavoriteStatus()).compareTo(Boolean.valueOf(anotherStatus.getFavoriteStatus()))); } // @@author }
mit
jbryant32/webstore
WebStrore/wwwroot/js/formValidation.js
4149
 let app = angular.module("formModule", []); app.controller("registerUserController", ($scope, $http) => { ///create goo auth let GoogleAuth; // Google Auth object. function initClient() { gapi.client.init({ 'clientId': '82884474617-4ij42qcvd3tqr5ln8p7eb6k891fcug45.apps.googleusercontent.com', 'scope': 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/plus.login' }).then(function () {//after initiliazed GoogleAuth = gapi.auth2.getAuthInstance();//get reference to newly created client GoogleAuth.isSignedIn.listen(updateSigninStatus);//called whenever login status changes console.log(GoogleAuth); }); } function updateSigninStatus() { console.log("login status changed"); } gapi.load('client', initClient);//instantiate the client $scope.oauthSignIn = function () { if (GoogleAuth) { if (GoogleAuth.isSignedIn) { gapi.client.request({ 'method': 'GET', 'path': 'https://www.googleapis.com/oauth2/v1/userinfo?alt=json' //end point }).then((response) => { console.log(response); }, (reject) => { console.log("user get data failed"); console.log(reject); }) } else { GoogleAuth.signIn(); }//if not signed in call the signin page } else { initClient(); } } $scope.userName; $scope.password; $scope.firstName; $scope.lastName; $scope.email; }); app.directive("registerUserForm", () => { return { templateUrl: "/views/registerForm.html" } }) app.directive("validateForm", () => { return { require: "form", link: (scope, elem, attr, mCtrl) => { let passwordValid = false; let usernameValid = false; mCtrl.UserName.$parsers.push(watchUserName); function watchUserName(newVal) { var username = String(newVal); if (username) { if (username.length >= 4) usernameValid = true; } else { usernameValid = false; } CheckValidity(); } mCtrl.Password.$parsers.push(watchPassword); function watchPassword(newVal) { let exp = /[A-Z]/g; let capsCount = []; let maxCapitals = 1; let requireLength = 8; capsCount = String(newVal).match(exp);//check for capitals if (capsCount) { if (capsCount.length >= maxCapitals && newVal.length > requireLength) {//required lentgth of password an required total of caps passwordValid = true; } } if (!capsCount || capsCount.length < maxCapitals || newVal.length < 5) { passwordValid = false; } CheckValidity(); } function CheckValidity() { if (usernameValid) { mCtrl.$setValidity("userNameValid", true); } if (!usernameValid) { mCtrl.$setValidity("userNameValid", false); } if (passwordValid) { mCtrl.$setValidity("passwordValid", true); } if (!passwordValid) { mCtrl.$setValidity("passwordValid", false); } } scope.$watch("myForm.$error.passwordValid", (newVal, oldVal) => {//Activate inactivate submit button if (usernameValid && passwordValid)//NO ERRORS FOUND { document.getElementById('submitButton').removeAttribute("disabled"); } else {//ERRORS FOUND document.getElementById('submitButton').setAttribute("disabled", "true"); } }); } } });
mit
superhj1987/awesome-codes
python/progressbar-python.py
718
# -*- coding:utf-8 -*- import sys, time class ProgressBar: def __init__(self, count = 0, total = 0, width = 50): self.count = count self.total = total self.width = width def move(self): self.count += 1 def log(self, s): sys.stdout.write(' ' * (self.width + 9) + '\r') sys.stdout.flush() print s progress = self.width * self.count / self.total sys.stdout.write('%3d/%3d: \r' % (self.count, self.total)) if progress == self.width: sys.stdout.write('\n') sys.stdout.flush() bar = ProgressBar(total = 10) for i in range(10): bar.move() bar.log('We have arrived at: ' + str(i + 1)) time.sleep(1)
mit
rockResolve/dialog
dist/amd/dialog-service.js
3525
define(['exports', 'aurelia-metadata', 'aurelia-dependency-injection', 'aurelia-templating', './dialog-controller', './renderers/renderer', './lifecycle'], function (exports, _aureliaMetadata, _aureliaDependencyInjection, _aureliaTemplating, _dialogController, _renderer, _lifecycle) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.DialogService = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _class, _temp; var DialogService = exports.DialogService = (_temp = _class = function () { function DialogService(container, compositionEngine) { _classCallCheck(this, DialogService); this.container = container; this.compositionEngine = compositionEngine; this.controllers = []; this.hasActiveDialog = false; } DialogService.prototype.open = function open(settings) { var _this = this; var dialogController = void 0; var promise = new Promise(function (resolve, reject) { var childContainer = _this.container.createChild(); dialogController = new _dialogController.DialogController(childContainer.get(_renderer.Renderer), settings, resolve, reject); childContainer.registerInstance(_dialogController.DialogController, dialogController); var host = dialogController._renderer.getDialogContainer(); var instruction = { container: _this.container, childContainer: childContainer, model: dialogController.settings.model, viewModel: dialogController.settings.viewModel, viewSlot: new _aureliaTemplating.ViewSlot(host, true), host: host }; return _getViewModel(instruction, _this.compositionEngine).then(function (returnedInstruction) { dialogController.viewModel = returnedInstruction.viewModel; dialogController.slot = returnedInstruction.viewSlot; return (0, _lifecycle.invokeLifecycle)(dialogController.viewModel, 'canActivate', dialogController.settings.model).then(function (canActivate) { if (canActivate) { _this.controllers.push(dialogController); _this.hasActiveDialog = !!_this.controllers.length; return _this.compositionEngine.compose(returnedInstruction).then(function (controller) { dialogController.controller = controller; dialogController.view = controller.view; return dialogController._renderer.showDialog(dialogController); }); } }); }); }); return promise.then(function (result) { var i = _this.controllers.indexOf(dialogController); if (i !== -1) { _this.controllers.splice(i, 1); _this.hasActiveDialog = !!_this.controllers.length; } return result; }); }; return DialogService; }(), _class.inject = [_aureliaDependencyInjection.Container, _aureliaTemplating.CompositionEngine], _temp); function _getViewModel(instruction, compositionEngine) { if (typeof instruction.viewModel === 'function') { instruction.viewModel = _aureliaMetadata.Origin.get(instruction.viewModel).moduleId; } if (typeof instruction.viewModel === 'string') { return compositionEngine.ensureViewModel(instruction); } return Promise.resolve(instruction); } });
mit
ckcks12/Homework
algorithm/hw1/src/Main.java
5529
/** * Created by ckcks12 on 2016. 12. 14.. */ import java.util.*; import java.math.*; import java.util.concurrent.Callable; public class Main { static class Person implements Cloneable{ int dist = 0; int cmp_cnt = 0; boolean done = false; LinkedList<Integer> trace = new LinkedList<>(); public boolean isVisited(int idx) { for(int i : trace) { if( i == idx ) return true; } return false; } public void visit(int idx, int dist) { trace.push(idx); this.dist += dist; } public boolean isVisitedAll(int max) { for(int i=0; i<max; i++ ) { if( ! isVisited(i) ) return false; } return true; } public int getDepth() { return trace.size() - 1; } @Override protected Person clone() { try { Person person = (Person)super.clone(); person.trace = (LinkedList)trace.clone(); return person; } catch (CloneNotSupportedException e) { e.printStackTrace(); return null; } } } public static void main(String[] args) { int[][] graph = {}; int[][] graph5 = { {0, 1, 3, 5, 4}, {3, 0, 4, 7, 7}, {6, 4, 0, 4, 8}, {1, 2, 3, 0, 4}, {7, 3, 2, 4, 0} }; int[][] graph10 = { }; Scanner scanner = new Scanner(System.in); // int select = scanner.nextInt(); int select = 5; if( select == 5 ) { graph = graph5; } else if( select == 10 ) { graph = graph10; } else { System.out.println("how there you"); } System.out.println("1. Breath First Search"); System.out.println("2. Best - Textbook Version"); System.out.println("3. Best - Estimated Version"); System.out.println("4. Best - Kown Cost Version"); // select = scanner.nextInt(); select = 1; algorithm(graph, select); } public static void algorithm(int[][] graph, int bound_type) { int cmp_cnt = 0; LinkedList<Person> queue = new LinkedList<>(); Person done = null; Person person = null; // first start queue person = new Person(); person.visit(0, 0); queue.offer(person.clone()); while(!queue.isEmpty()) { cmp_cnt++; // 큐에서 꺼내기 전에 bound 친다 // 큐에서 하나 꺼낸다 // 이때 알고리즘 타입에 따라 다르게 꺼낸다 // person = queue.poll(); switch(bound_type) { case 1: person = queue.poll(); break; case 2: break; case 3: break; case 4: HashMap<Integer, Integer> map = new HashMap<>(); int max_depth = 0; for(Person p : queue) { if( p.getDepth() > max_depth ) max_depth = p.getDepth(); if( ! map.containsKey(p.getDepth()) ) { map.put(p.getDepth(), p.dist); } else { if( map.get(p.getDepth()) > p.dist ) map.put(p.getDepth(), p.dist); } } break; } // 모든 곳 다 갔었으면 이제 0으로 빡구하면서 done이랑 비교해본다. if( person.isVisitedAll(graph.length) ) { person.visit(0, graph[person.trace.getLast()][0]); if( done == null ) { person.cmp_cnt = cmp_cnt; done = person; } else { if( done.dist > person.dist ) { person.cmp_cnt = cmp_cnt; done = person; } } } // 아니라면 갈 수 있는 모든 곳으로 간다 else { for(int i=0; i<graph.length; i++ ) { if( graph[person.trace.getLast()][i] > 0 && ! person.isVisited(i) ) { Person p = person.clone(); p.visit(i, graph[person.trace.getLast()][i]); queue.offer(p); } } } } if( done != null ) { System.out.println("trace"); for(int i : done.trace) { System.out.print(i); System.out.print("->"); } System.out.println(""); System.out.println("compare count : " + String.valueOf(done.cmp_cnt)); // System.out.println("compare count : " + String.valueOf(cmp_cnt)); } } }
mit
Rachels-Courses/Course-Common-Files
STUDENT_REFERENCE/EXAMPLE_CODE/Operator Overloading/Words/Phrase.cpp
1547
#include "Phrase.hpp" ostream& operator<<( ostream& out, Phrase& item ) { out << item.m_text; return out; } istream& operator>>( istream& in, Phrase& item ) { in >> item.m_text; return in; } Phrase operator+( const Phrase& item1, const Phrase& item2 ) { return Phrase( item1.m_text + item2.m_text ); } Phrase operator-( const Phrase& item1, const Phrase& item2 ) { string result = item1.m_text; int foundPos = result.find( item2.m_text ); if ( foundPos != string::npos ) { result.erase( foundPos, item2.m_text.size() ); } return Phrase( result ); } bool operator==( Phrase& item1, Phrase& item2 ) { return ( item1.m_text.size() == item2.m_text.size() ); } bool operator!=( Phrase& item1, Phrase& item2 ) { return ( item1.m_text.size() != item2.m_text.size() ); } bool operator<( Phrase& item1, Phrase& item2 ) { return ( item1.m_text.size() < item2.m_text.size() ); } bool operator<=( Phrase& item1, Phrase& item2 ) { return ( item1 < item2 || item1 == item2 ); } bool operator>( Phrase& item1, Phrase& item2 ) { return ( item1.m_text.size() > item2.m_text.size() ); } bool operator>=( Phrase& item1, Phrase& item2 ) { return ( item1 > item2 || item1 == item2 ); } char Phrase::operator[]( const int index ) { if ( index >= 0 && index < m_text.size() ) { return m_text[ index ]; } else { return ' '; } } Phrase& Phrase::operator=( const Phrase& rhs ) { if ( this == &rhs ) { return *this; } m_text = rhs.m_text; return *this; }
mit
rlugojr/cytoscape.js
test/core-export.js
3391
var expect = require('chai').expect; var cytoscape = require('../src', cytoscape); describe('Core export', function(){ var cy; // test setup beforeEach(function(done){ cytoscape({ styleEnabled: true, elements: { nodes: [ { data: { id: "n1", foo: "bar" }, classes: "odd one" }, ] }, ready: function(){ cy = this; done(); } }); }); afterEach(function(){ cy.destroy(); }); it('has all properties defined', function(){ var json = cy.json(); expect( json ).to.have.property('elements'); expect( json ).to.have.property('renderer'); expect( json ).to.have.property('minZoom').that.equals( cy.minZoom() ); expect( json ).to.have.property('maxZoom').that.equals( cy.maxZoom() ); expect( json ).to.have.property('zoomingEnabled').that.equals( cy.zoomingEnabled() ); expect( json ).to.have.property('userZoomingEnabled').that.equals( cy.userZoomingEnabled() ); expect( json ).to.have.property('panningEnabled').that.equals( cy.panningEnabled() ); expect( json ).to.have.property('userPanningEnabled').that.equals( cy.userPanningEnabled() ); expect( json ).to.have.property('boxSelectionEnabled').that.equals( cy.boxSelectionEnabled() ); expect( json ).to.have.property('zoom').that.equals( cy.zoom() ); expect( json ).to.have.property('pan').that.deep.equals( cy.pan() ); expect( json ).to.have.property('style'); // these are optional so not important to check // expect( json ).to.have.property('hideEdgesOnViewport'); // expect( json ).to.have.property('hideLabelsOnViewport'); // expect( json ).to.have.property('textureOnViewport'); // expect( json ).to.have.property('wheelSensitivity'); // expect( json ).to.have.property('motionBlur'); }); var itExportsSelector = function( sel ){ it('exports `' + sel + '` selector in style', function(){ cy.style([ { selector: sel, style: {} }, ]); expect( cy.json().style[0].selector ).to.equal( sel ); }); }; itExportsSelector('#foo'); itExportsSelector('.foo'); itExportsSelector('[foo]'); itExportsSelector('[^foo]'); itExportsSelector('[?foo]'); itExportsSelector('[!foo]'); itExportsSelector('[foo = 1]'); itExportsSelector('[foo = 1.23]'); itExportsSelector('[foo != 1]'); itExportsSelector('[foo > 1]'); itExportsSelector('[foo >= 1]'); itExportsSelector('[foo < 1]'); itExportsSelector('[foo <= 1]'); itExportsSelector('[foo = "bar"]'); itExportsSelector('[foo != "bar"]'); itExportsSelector('[foo *= "bar"]'); itExportsSelector('[foo ^= "bar"]'); itExportsSelector('[foo $= "bar"]'); itExportsSelector('[foo @= "bar"]'); itExportsSelector('[foo @!= "bar"]'); itExportsSelector('[foo @*= "bar"]'); itExportsSelector('[foo @^= "bar"]'); itExportsSelector('[foo @$= "bar"]'); itExportsSelector('[[degree > 2]]'); itExportsSelector('[[degree < 2]]'); itExportsSelector('[[degree = 2]]'); itExportsSelector('[[degree != 2]]'); itExportsSelector('node > node'); itExportsSelector('node node'); itExportsSelector('$node > node'); itExportsSelector('node > $node'); itExportsSelector('node > node'); itExportsSelector(':selected'); itExportsSelector('$node:selected > node[?foo][bar > 2][baz *= "bat"][[degree > 1]]:locked'); });
mit
xedoscoin/xedoscoin
src/util.cpp
42177
// Copyright (c) 2009-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. #ifndef WIN32 // for posix_fallocate #ifdef __linux__ #define _POSIX_C_SOURCE 200112L #endif #include <fcntl.h> #include <sys/stat.h> #include <sys/resource.h> #endif #include "chainparams.h" #include "util.h" #include "sync.h" #include "version.h" #include "ui_interface.h" #include <boost/algorithm/string/join.hpp> #include <boost/algorithm/string/case_conv.hpp> // for to_lower() #include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith() // Work around clang compilation problem in Boost 1.46: // /usr/include/boost/program_options/detail/config_file.hpp:163:17: error: call to function 'to_internal' that is neither visible in the template definition nor found by argument-dependent lookup // See also: http://stackoverflow.com/questions/10020179/compilation-fail-in-boost-librairies-program-options // http://clang.debian.net/status.php?version=3.0&key=CANNOT_FIND_FUNCTION namespace boost { namespace program_options { std::string to_internal(const std::string&); } } #include <boost/program_options/detail/config_file.hpp> #include <boost/program_options/parsers.hpp> #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> #include <boost/foreach.hpp> #include <boost/thread.hpp> #include <openssl/crypto.h> #include <openssl/rand.h> #include <stdarg.h> #ifdef WIN32 #ifdef _MSC_VER #pragma warning(disable:4786) #pragma warning(disable:4804) #pragma warning(disable:4805) #pragma warning(disable:4717) #endif #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif #define _WIN32_WINNT 0x0501 #ifdef _WIN32_IE #undef _WIN32_IE #endif #define _WIN32_IE 0x0501 #define WIN32_LEAN_AND_MEAN 1 #ifndef NOMINMAX #define NOMINMAX #endif #include <io.h> /* for _commit */ #include "shlobj.h" #elif defined(__linux__) # include <sys/prctl.h> #endif using namespace std; map<string, string> mapArgs; map<string, vector<string> > mapMultiArgs; bool fDebug = false; bool fDebugNet = false; bool fPrintToConsole = false; bool fPrintToDebugger = false; bool fDaemon = false; bool fServer = false; bool fCommandLine = false; string strMiscWarning; bool fNoListen = false; bool fLogTimestamps = false; CMedianFilter<int64> vTimeOffsets(200,0); volatile bool fReopenDebugLog = false; bool fCachedPath[2] = {false, false}; // Init OpenSSL library multithreading support static CCriticalSection** ppmutexOpenSSL; void locking_callback(int mode, int i, const char* file, int line) { if (mode & CRYPTO_LOCK) { ENTER_CRITICAL_SECTION(*ppmutexOpenSSL[i]); } else { LEAVE_CRITICAL_SECTION(*ppmutexOpenSSL[i]); } } LockedPageManager LockedPageManager::instance; // Init class CInit { public: CInit() { // Init OpenSSL library multithreading support ppmutexOpenSSL = (CCriticalSection**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(CCriticalSection*)); for (int i = 0; i < CRYPTO_num_locks(); i++) ppmutexOpenSSL[i] = new CCriticalSection(); CRYPTO_set_locking_callback(locking_callback); #ifdef WIN32 // Seed random number generator with screen scrape and other hardware sources RAND_screen(); #endif // Seed random number generator with performance counter RandAddSeed(); } ~CInit() { // Shutdown OpenSSL library multithreading support CRYPTO_set_locking_callback(NULL); for (int i = 0; i < CRYPTO_num_locks(); i++) delete ppmutexOpenSSL[i]; OPENSSL_free(ppmutexOpenSSL); } } instance_of_cinit; void RandAddSeed() { // Seed with CPU performance counter int64 nCounter = GetPerformanceCounter(); RAND_add(&nCounter, sizeof(nCounter), 1.5); memset(&nCounter, 0, sizeof(nCounter)); } void RandAddSeedPerfmon() { RandAddSeed(); // This can take up to 2 seconds, so only do it every 10 minutes static int64 nLastPerfmon; if (GetTime() < nLastPerfmon + 10 * 60) return; nLastPerfmon = GetTime(); #ifdef WIN32 // Don't need this on Linux, OpenSSL automatically uses /dev/urandom // Seed with the entire set of perfmon data unsigned char pdata[250000]; memset(pdata, 0, sizeof(pdata)); unsigned long nSize = sizeof(pdata); long ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, pdata, &nSize); RegCloseKey(HKEY_PERFORMANCE_DATA); if (ret == ERROR_SUCCESS) { RAND_add(pdata, nSize, nSize/100.0); OPENSSL_cleanse(pdata, nSize); printf("RandAddSeed() %lu bytes\n", nSize); } #endif } uint64 GetRand(uint64 nMax) { if (nMax == 0) return 0; // The range of the random source must be a multiple of the modulus // to give every possible output value an equal possibility uint64 nRange = (std::numeric_limits<uint64>::max() / nMax) * nMax; uint64 nRand = 0; do RAND_bytes((unsigned char*)&nRand, sizeof(nRand)); while (nRand >= nRange); return (nRand % nMax); } int GetRandInt(int nMax) { return GetRand(nMax); } uint256 GetRandHash() { uint256 hash; RAND_bytes((unsigned char*)&hash, sizeof(hash)); return hash; } // // OutputDebugStringF (aka printf -- there is a #define that we really // should get rid of one day) has been broken a couple of times now // by well-meaning people adding mutexes in the most straightforward way. // It breaks because it may be called by global destructors during shutdown. // Since the order of destruction of static/global objects is undefined, // defining a mutex as a global object doesn't work (the mutex gets // destroyed, and then some later destructor calls OutputDebugStringF, // maybe indirectly, and you get a core dump at shutdown trying to lock // the mutex). static boost::once_flag debugPrintInitFlag = BOOST_ONCE_INIT; // We use boost::call_once() to make sure these are initialized in // in a thread-safe manner the first time it is called: static FILE* fileout = NULL; static boost::mutex* mutexDebugLog = NULL; static void DebugPrintInit() { assert(fileout == NULL); assert(mutexDebugLog == NULL); boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; fileout = fopen(pathDebug.string().c_str(), "a"); if (fileout) setbuf(fileout, NULL); // unbuffered mutexDebugLog = new boost::mutex(); } int OutputDebugStringF(const char* pszFormat, ...) { int ret = 0; // Returns total number of characters written if (fPrintToConsole) { // print to console va_list arg_ptr; va_start(arg_ptr, pszFormat); ret += vprintf(pszFormat, arg_ptr); va_end(arg_ptr); } else if (!fPrintToDebugger) { static bool fStartedNewLine = true; boost::call_once(&DebugPrintInit, debugPrintInitFlag); if (fileout == NULL) return ret; boost::mutex::scoped_lock scoped_lock(*mutexDebugLog); // reopen the log file, if requested if (fReopenDebugLog) { fReopenDebugLog = false; boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; if (freopen(pathDebug.string().c_str(),"a",fileout) != NULL) setbuf(fileout, NULL); // unbuffered } // Debug print useful for profiling if (fLogTimestamps && fStartedNewLine) ret += fprintf(fileout, "%s ", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime()).c_str()); if (pszFormat[strlen(pszFormat) - 1] == '\n') fStartedNewLine = true; else fStartedNewLine = false; va_list arg_ptr; va_start(arg_ptr, pszFormat); ret += vfprintf(fileout, pszFormat, arg_ptr); va_end(arg_ptr); } #ifdef WIN32 if (fPrintToDebugger) { static CCriticalSection cs_OutputDebugStringF; // accumulate and output a line at a time { LOCK(cs_OutputDebugStringF); static std::string buffer; va_list arg_ptr; va_start(arg_ptr, pszFormat); buffer += vstrprintf(pszFormat, arg_ptr); va_end(arg_ptr); int line_start = 0, line_end; while((line_end = buffer.find('\n', line_start)) != -1) { OutputDebugStringA(buffer.substr(line_start, line_end - line_start).c_str()); line_start = line_end + 1; ret += line_end-line_start; } buffer.erase(0, line_start); } } #endif return ret; } string vstrprintf(const char *format, va_list ap) { char buffer[50000]; char* p = buffer; int limit = sizeof(buffer); int ret; loop { va_list arg_ptr; va_copy(arg_ptr, ap); #ifdef WIN32 ret = _vsnprintf(p, limit, format, arg_ptr); #else ret = vsnprintf(p, limit, format, arg_ptr); #endif va_end(arg_ptr); if (ret >= 0 && ret < limit) break; if (p != buffer) delete[] p; limit *= 2; p = new char[limit]; if (p == NULL) throw std::bad_alloc(); } string str(p, p+ret); if (p != buffer) delete[] p; return str; } string real_strprintf(const char *format, int dummy, ...) { va_list arg_ptr; va_start(arg_ptr, dummy); string str = vstrprintf(format, arg_ptr); va_end(arg_ptr); return str; } string real_strprintf(const std::string &format, int dummy, ...) { va_list arg_ptr; va_start(arg_ptr, dummy); string str = vstrprintf(format.c_str(), arg_ptr); va_end(arg_ptr); return str; } bool error(const char *format, ...) { va_list arg_ptr; va_start(arg_ptr, format); std::string str = vstrprintf(format, arg_ptr); va_end(arg_ptr); printf("ERROR: %s\n", str.c_str()); return false; } void ParseString(const string& str, char c, vector<string>& v) { if (str.empty()) return; string::size_type i1 = 0; string::size_type i2; loop { i2 = str.find(c, i1); if (i2 == str.npos) { v.push_back(str.substr(i1)); return; } v.push_back(str.substr(i1, i2-i1)); i1 = i2+1; } } string FormatMoney(int64 n, bool fPlus) { // Note: not using straight sprintf here because we do NOT want // localized number formatting. int64 n_abs = (n > 0 ? n : -n); int64 quotient = n_abs/COIN; int64 remainder = n_abs%COIN; string str = strprintf("%"PRI64d".%08"PRI64d, quotient, remainder); // Right-trim excess zeros before the decimal point: int nTrim = 0; for (int i = str.size()-1; (str[i] == '0' && isdigit(str[i-2])); --i) ++nTrim; if (nTrim) str.erase(str.size()-nTrim, nTrim); if (n < 0) str.insert((unsigned int)0, 1, '-'); else if (fPlus && n > 0) str.insert((unsigned int)0, 1, '+'); return str; } bool ParseMoney(const string& str, int64& nRet) { return ParseMoney(str.c_str(), nRet); } bool ParseMoney(const char* pszIn, int64& nRet) { string strWhole; int64 nUnits = 0; const char* p = pszIn; while (isspace(*p)) p++; for (; *p; p++) { if (*p == '.') { p++; int64 nMult = CENT*10; while (isdigit(*p) && (nMult > 0)) { nUnits += nMult * (*p++ - '0'); nMult /= 10; } break; } if (isspace(*p)) break; if (!isdigit(*p)) return false; strWhole.insert(strWhole.end(), *p); } for (; *p; p++) if (!isspace(*p)) return false; if (strWhole.size() > 10) // guard against 63 bit overflow return false; if (nUnits < 0 || nUnits > COIN) return false; int64 nWhole = atoi64(strWhole); int64 nValue = nWhole*COIN + nUnits; nRet = nValue; return true; } static const signed char phexdigit[256] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1, -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, }; bool IsHex(const string& str) { BOOST_FOREACH(unsigned char c, str) { if (phexdigit[c] < 0) return false; } return (str.size() > 0) && (str.size()%2 == 0); } vector<unsigned char> ParseHex(const char* psz) { // convert hex dump to vector vector<unsigned char> vch; loop { while (isspace(*psz)) psz++; signed char c = phexdigit[(unsigned char)*psz++]; if (c == (signed char)-1) break; unsigned char n = (c << 4); c = phexdigit[(unsigned char)*psz++]; if (c == (signed char)-1) break; n |= c; vch.push_back(n); } return vch; } vector<unsigned char> ParseHex(const string& str) { return ParseHex(str.c_str()); } static void InterpretNegativeSetting(string name, map<string, string>& mapSettingsRet) { // interpret -nofoo as -foo=0 (and -nofoo=0 as -foo=1) as long as -foo not set if (name.find("-no") == 0) { std::string positive("-"); positive.append(name.begin()+3, name.end()); if (mapSettingsRet.count(positive) == 0) { bool value = !GetBoolArg(name, false); mapSettingsRet[positive] = (value ? "1" : "0"); } } } void ParseParameters(int argc, const char* const argv[]) { mapArgs.clear(); mapMultiArgs.clear(); for (int i = 1; i < argc; i++) { std::string str(argv[i]); std::string strValue; size_t is_index = str.find('='); if (is_index != std::string::npos) { strValue = str.substr(is_index+1); str = str.substr(0, is_index); } #ifdef WIN32 boost::to_lower(str); if (boost::algorithm::starts_with(str, "/")) str = "-" + str.substr(1); #endif if (str[0] != '-') break; mapArgs[str] = strValue; mapMultiArgs[str].push_back(strValue); } // New 0.6 features: BOOST_FOREACH(const PAIRTYPE(string,string)& entry, mapArgs) { string name = entry.first; // interpret --foo as -foo (as long as both are not set) if (name.find("--") == 0) { std::string singleDash(name.begin()+1, name.end()); if (mapArgs.count(singleDash) == 0) mapArgs[singleDash] = entry.second; name = singleDash; } // interpret -nofoo as -foo=0 (and -nofoo=0 as -foo=1) as long as -foo not set InterpretNegativeSetting(name, mapArgs); } } std::string GetArg(const std::string& strArg, const std::string& strDefault) { if (mapArgs.count(strArg)) return mapArgs[strArg]; return strDefault; } int64 GetArg(const std::string& strArg, int64 nDefault) { if (mapArgs.count(strArg)) return atoi64(mapArgs[strArg]); return nDefault; } bool GetBoolArg(const std::string& strArg, bool fDefault) { if (mapArgs.count(strArg)) { if (mapArgs[strArg].empty()) return true; return (atoi(mapArgs[strArg]) != 0); } return fDefault; } bool SoftSetArg(const std::string& strArg, const std::string& strValue) { if (mapArgs.count(strArg)) return false; mapArgs[strArg] = strValue; return true; } bool SoftSetBoolArg(const std::string& strArg, bool fValue) { if (fValue) return SoftSetArg(strArg, std::string("1")); else return SoftSetArg(strArg, std::string("0")); } string EncodeBase64(const unsigned char* pch, size_t len) { static const char *pbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; string strRet=""; strRet.reserve((len+2)/3*4); int mode=0, left=0; const unsigned char *pchEnd = pch+len; while (pch<pchEnd) { int enc = *(pch++); switch (mode) { case 0: // we have no bits strRet += pbase64[enc >> 2]; left = (enc & 3) << 4; mode = 1; break; case 1: // we have two bits strRet += pbase64[left | (enc >> 4)]; left = (enc & 15) << 2; mode = 2; break; case 2: // we have four bits strRet += pbase64[left | (enc >> 6)]; strRet += pbase64[enc & 63]; mode = 0; break; } } if (mode) { strRet += pbase64[left]; strRet += '='; if (mode == 1) strRet += '='; } return strRet; } string EncodeBase64(const string& str) { return EncodeBase64((const unsigned char*)str.c_str(), str.size()); } vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid) { static const int decode64_table[256] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; if (pfInvalid) *pfInvalid = false; vector<unsigned char> vchRet; vchRet.reserve(strlen(p)*3/4); int mode = 0; int left = 0; while (1) { int dec = decode64_table[(unsigned char)*p]; if (dec == -1) break; p++; switch (mode) { case 0: // we have no bits and get 6 left = dec; mode = 1; break; case 1: // we have 6 bits and keep 4 vchRet.push_back((left<<2) | (dec>>4)); left = dec & 15; mode = 2; break; case 2: // we have 4 bits and get 6, we keep 2 vchRet.push_back((left<<4) | (dec>>2)); left = dec & 3; mode = 3; break; case 3: // we have 2 bits and get 6 vchRet.push_back((left<<6) | dec); mode = 0; break; } } if (pfInvalid) switch (mode) { case 0: // 4n base64 characters processed: ok break; case 1: // 4n+1 base64 character processed: impossible *pfInvalid = true; break; case 2: // 4n+2 base64 characters processed: require '==' if (left || p[0] != '=' || p[1] != '=' || decode64_table[(unsigned char)p[2]] != -1) *pfInvalid = true; break; case 3: // 4n+3 base64 characters processed: require '=' if (left || p[0] != '=' || decode64_table[(unsigned char)p[1]] != -1) *pfInvalid = true; break; } return vchRet; } string DecodeBase64(const string& str) { vector<unsigned char> vchRet = DecodeBase64(str.c_str()); return string((const char*)&vchRet[0], vchRet.size()); } string EncodeBase32(const unsigned char* pch, size_t len) { static const char *pbase32 = "abcdefghijklmnopqrstuvwxyz234567"; string strRet=""; strRet.reserve((len+4)/5*8); int mode=0, left=0; const unsigned char *pchEnd = pch+len; while (pch<pchEnd) { int enc = *(pch++); switch (mode) { case 0: // we have no bits strRet += pbase32[enc >> 3]; left = (enc & 7) << 2; mode = 1; break; case 1: // we have three bits strRet += pbase32[left | (enc >> 6)]; strRet += pbase32[(enc >> 1) & 31]; left = (enc & 1) << 4; mode = 2; break; case 2: // we have one bit strRet += pbase32[left | (enc >> 4)]; left = (enc & 15) << 1; mode = 3; break; case 3: // we have four bits strRet += pbase32[left | (enc >> 7)]; strRet += pbase32[(enc >> 2) & 31]; left = (enc & 3) << 3; mode = 4; break; case 4: // we have two bits strRet += pbase32[left | (enc >> 5)]; strRet += pbase32[enc & 31]; mode = 0; } } static const int nPadding[5] = {0, 6, 4, 3, 1}; if (mode) { strRet += pbase32[left]; for (int n=0; n<nPadding[mode]; n++) strRet += '='; } return strRet; } string EncodeBase32(const string& str) { return EncodeBase32((const unsigned char*)str.c_str(), str.size()); } vector<unsigned char> DecodeBase32(const char* p, bool* pfInvalid) { static const int decode32_table[256] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; if (pfInvalid) *pfInvalid = false; vector<unsigned char> vchRet; vchRet.reserve((strlen(p))*5/8); int mode = 0; int left = 0; while (1) { int dec = decode32_table[(unsigned char)*p]; if (dec == -1) break; p++; switch (mode) { case 0: // we have no bits and get 5 left = dec; mode = 1; break; case 1: // we have 5 bits and keep 2 vchRet.push_back((left<<3) | (dec>>2)); left = dec & 3; mode = 2; break; case 2: // we have 2 bits and keep 7 left = left << 5 | dec; mode = 3; break; case 3: // we have 7 bits and keep 4 vchRet.push_back((left<<1) | (dec>>4)); left = dec & 15; mode = 4; break; case 4: // we have 4 bits, and keep 1 vchRet.push_back((left<<4) | (dec>>1)); left = dec & 1; mode = 5; break; case 5: // we have 1 bit, and keep 6 left = left << 5 | dec; mode = 6; break; case 6: // we have 6 bits, and keep 3 vchRet.push_back((left<<2) | (dec>>3)); left = dec & 7; mode = 7; break; case 7: // we have 3 bits, and keep 0 vchRet.push_back((left<<5) | dec); mode = 0; break; } } if (pfInvalid) switch (mode) { case 0: // 8n base32 characters processed: ok break; case 1: // 8n+1 base32 characters processed: impossible case 3: // +3 case 6: // +6 *pfInvalid = true; break; case 2: // 8n+2 base32 characters processed: require '======' if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || p[4] != '=' || p[5] != '=' || decode32_table[(unsigned char)p[6]] != -1) *pfInvalid = true; break; case 4: // 8n+4 base32 characters processed: require '====' if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || decode32_table[(unsigned char)p[4]] != -1) *pfInvalid = true; break; case 5: // 8n+5 base32 characters processed: require '===' if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || decode32_table[(unsigned char)p[3]] != -1) *pfInvalid = true; break; case 7: // 8n+7 base32 characters processed: require '=' if (left || p[0] != '=' || decode32_table[(unsigned char)p[1]] != -1) *pfInvalid = true; break; } return vchRet; } string DecodeBase32(const string& str) { vector<unsigned char> vchRet = DecodeBase32(str.c_str()); return string((const char*)&vchRet[0], vchRet.size()); } bool WildcardMatch(const char* psz, const char* mask) { loop { switch (*mask) { case '\0': return (*psz == '\0'); case '*': return WildcardMatch(psz, mask+1) || (*psz && WildcardMatch(psz+1, mask)); case '?': if (*psz == '\0') return false; break; default: if (*psz != *mask) return false; break; } psz++; mask++; } } bool WildcardMatch(const string& str, const string& mask) { return WildcardMatch(str.c_str(), mask.c_str()); } static std::string FormatException(std::exception* pex, const char* pszThread) { #ifdef WIN32 char pszModule[MAX_PATH] = ""; GetModuleFileNameA(NULL, pszModule, sizeof(pszModule)); #else const char* pszModule = "xedoscoin"; #endif if (pex) return strprintf( "EXCEPTION: %s \n%s \n%s in %s \n", typeid(*pex).name(), pex->what(), pszModule, pszThread); else return strprintf( "UNKNOWN EXCEPTION \n%s in %s \n", pszModule, pszThread); } void LogException(std::exception* pex, const char* pszThread) { std::string message = FormatException(pex, pszThread); printf("\n%s", message.c_str()); } void PrintException(std::exception* pex, const char* pszThread) { std::string message = FormatException(pex, pszThread); printf("\n\n************************\n%s\n", message.c_str()); fprintf(stderr, "\n\n************************\n%s\n", message.c_str()); strMiscWarning = message; throw; } void PrintExceptionContinue(std::exception* pex, const char* pszThread) { std::string message = FormatException(pex, pszThread); printf("\n\n************************\n%s\n", message.c_str()); fprintf(stderr, "\n\n************************\n%s\n", message.c_str()); strMiscWarning = message; } boost::filesystem::path GetDefaultDataDir() { namespace fs = boost::filesystem; // Windows < Vista: C:\Documents and Settings\Username\Application Data\Xedoscoin // Windows >= Vista: C:\Users\Username\AppData\Roaming\Xedoscoin // Mac: ~/Library/Application Support/Xedoscoin // Unix: ~/.xedoscoin #ifdef WIN32 // Windows return GetSpecialFolderPath(CSIDL_APPDATA) / "Xedoscoin"; #else fs::path pathRet; char* pszHome = getenv("HOME"); if (pszHome == NULL || strlen(pszHome) == 0) pathRet = fs::path("/"); else pathRet = fs::path(pszHome); #ifdef MAC_OSX // Mac pathRet /= "Library/Application Support"; fs::create_directory(pathRet); return pathRet / "Xedoscoin"; #else // Unix return pathRet / ".xedoscoin"; #endif #endif } const boost::filesystem::path &GetDataDir(bool fNetSpecific) { namespace fs = boost::filesystem; static fs::path pathCached[2]; static CCriticalSection csPathCached; fs::path &path = pathCached[fNetSpecific]; // This can be called during exceptions by printf, so we cache the // value so we don't have to do memory allocations after that. if (fCachedPath[fNetSpecific]) return path; LOCK(csPathCached); if (mapArgs.count("-datadir")) { path = fs::system_complete(mapArgs["-datadir"]); if (!fs::is_directory(path)) { path = ""; return path; } } else { path = GetDefaultDataDir(); } if (fNetSpecific) path /= Params().DataDir(); fs::create_directories(path); fCachedPath[fNetSpecific] = true; return path; } boost::filesystem::path GetConfigFile() { boost::filesystem::path pathConfigFile(GetArg("-conf", "xedoscoin.conf")); if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile; return pathConfigFile; } void ReadConfigFile(map<string, string>& mapSettingsRet, map<string, vector<string> >& mapMultiSettingsRet) { boost::filesystem::ifstream streamConfig(GetConfigFile()); if (!streamConfig.good()) return; // No xedoscoin.conf file is OK // clear path cache after loading config file fCachedPath[0] = fCachedPath[1] = false; set<string> setOptions; setOptions.insert("*"); for (boost::program_options::detail::config_file_iterator it(streamConfig, setOptions), end; it != end; ++it) { // Don't overwrite existing settings so command line settings override xedoscoin.conf string strKey = string("-") + it->string_key; if (mapSettingsRet.count(strKey) == 0) { mapSettingsRet[strKey] = it->value[0]; // interpret nofoo=1 as foo=0 (and nofoo=0 as foo=1) as long as foo not set) InterpretNegativeSetting(strKey, mapSettingsRet); } mapMultiSettingsRet[strKey].push_back(it->value[0]); } } boost::filesystem::path GetPidFile() { boost::filesystem::path pathPidFile(GetArg("-pid", "xedoscoind.pid")); if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile; return pathPidFile; } void CreatePidFile(const boost::filesystem::path &path, pid_t pid) { FILE* file = fopen(path.string().c_str(), "w"); if (file) { fprintf(file, "%d\n", pid); fclose(file); } } bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest) { #ifdef WIN32 return MoveFileExA(src.string().c_str(), dest.string().c_str(), MOVEFILE_REPLACE_EXISTING); #else int rc = std::rename(src.string().c_str(), dest.string().c_str()); return (rc == 0); #endif /* WIN32 */ } void FileCommit(FILE *fileout) { fflush(fileout); // harmless if redundantly called #ifdef WIN32 _commit(_fileno(fileout)); #else #if defined(__linux__) || defined(__NetBSD__) fdatasync(fileno(fileout)); #else fsync(fileno(fileout)); #endif #endif } int GetFilesize(FILE* file) { int nSavePos = ftell(file); int nFilesize = -1; if (fseek(file, 0, SEEK_END) == 0) nFilesize = ftell(file); fseek(file, nSavePos, SEEK_SET); return nFilesize; } bool TruncateFile(FILE *file, unsigned int length) { #if defined(WIN32) return _chsize(_fileno(file), length) == 0; #else return ftruncate(fileno(file), length) == 0; #endif } // this function tries to raise the file descriptor limit to the requested number. // It returns the actual file descriptor limit (which may be more or less than nMinFD) int RaiseFileDescriptorLimit(int nMinFD) { #if defined(WIN32) return 2048; #else struct rlimit limitFD; if (getrlimit(RLIMIT_NOFILE, &limitFD) != -1) { if (limitFD.rlim_cur < (rlim_t)nMinFD) { limitFD.rlim_cur = nMinFD; if (limitFD.rlim_cur > limitFD.rlim_max) limitFD.rlim_cur = limitFD.rlim_max; setrlimit(RLIMIT_NOFILE, &limitFD); getrlimit(RLIMIT_NOFILE, &limitFD); } return limitFD.rlim_cur; } return nMinFD; // getrlimit failed, assume it's fine #endif } // this function tries to make a particular range of a file allocated (corresponding to disk space) // it is advisory, and the range specified in the arguments will never contain live data void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) { #if defined(WIN32) // Windows-specific version HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(file)); LARGE_INTEGER nFileSize; int64 nEndPos = (int64)offset + length; nFileSize.u.LowPart = nEndPos & 0xFFFFFFFF; nFileSize.u.HighPart = nEndPos >> 32; SetFilePointerEx(hFile, nFileSize, 0, FILE_BEGIN); SetEndOfFile(hFile); #elif defined(MAC_OSX) // OSX specific version fstore_t fst; fst.fst_flags = F_ALLOCATECONTIG; fst.fst_posmode = F_PEOFPOSMODE; fst.fst_offset = 0; fst.fst_length = (off_t)offset + length; fst.fst_bytesalloc = 0; if (fcntl(fileno(file), F_PREALLOCATE, &fst) == -1) { fst.fst_flags = F_ALLOCATEALL; fcntl(fileno(file), F_PREALLOCATE, &fst); } ftruncate(fileno(file), fst.fst_length); #elif defined(__linux__) // Version using posix_fallocate off_t nEndPos = (off_t)offset + length; posix_fallocate(fileno(file), 0, nEndPos); #else // Fallback version // TODO: just write one byte per block static const char buf[65536] = {}; fseek(file, offset, SEEK_SET); while (length > 0) { unsigned int now = 65536; if (length < now) now = length; fwrite(buf, 1, now, file); // allowed to fail; this function is advisory anyway length -= now; } #endif } void ShrinkDebugFile() { // Scroll debug.log if it's getting too big boost::filesystem::path pathLog = GetDataDir() / "debug.log"; FILE* file = fopen(pathLog.string().c_str(), "r"); if (file && GetFilesize(file) > 10 * 1000000) { // Restart the file with some of the end char pch[200000]; fseek(file, -sizeof(pch), SEEK_END); int nBytes = fread(pch, 1, sizeof(pch), file); fclose(file); file = fopen(pathLog.string().c_str(), "w"); if (file) { fwrite(pch, 1, nBytes, file); fclose(file); } } else if (file != NULL) fclose(file); } // // "Never go to sea with two chronometers; take one or three." // Our three time sources are: // - System clock // - Median of other nodes clocks // - The user (asking the user to fix the system clock if the first two disagree) // static int64 nMockTime = 0; // For unit testing int64 GetTime() { if (nMockTime) return nMockTime; return time(NULL); } void SetMockTime(int64 nMockTimeIn) { nMockTime = nMockTimeIn; } static int64 nTimeOffset = 0; int64 GetTimeOffset() { return nTimeOffset; } int64 GetAdjustedTime() { return GetTime() + GetTimeOffset(); } void AddTimeData(const CNetAddr& ip, int64 nTime) { int64 nOffsetSample = nTime - GetTime(); // Ignore duplicates static set<CNetAddr> setKnown; if (!setKnown.insert(ip).second) return; // Add data vTimeOffsets.input(nOffsetSample); printf("Added time data, samples %d, offset %+"PRI64d" (%+"PRI64d" minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60); if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1) { int64 nMedian = vTimeOffsets.median(); std::vector<int64> vSorted = vTimeOffsets.sorted(); // Only let other nodes change our time by so much if (abs64(nMedian) < 70 * 60) { nTimeOffset = nMedian; } else { nTimeOffset = 0; static bool fDone; if (!fDone) { // If nobody has a time different than ours but within 5 minutes of ours, give a warning bool fMatch = false; BOOST_FOREACH(int64 nOffset, vSorted) if (nOffset != 0 && abs64(nOffset) < 5 * 60) fMatch = true; if (!fMatch) { fDone = true; string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong Xedoscoin will not work properly."); strMiscWarning = strMessage; printf("*** %s\n", strMessage.c_str()); uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING); } } } if (fDebug) { BOOST_FOREACH(int64 n, vSorted) printf("%+"PRI64d" ", n); printf("| "); } printf("nTimeOffset = %+"PRI64d" (%+"PRI64d" minutes)\n", nTimeOffset, nTimeOffset/60); } } uint32_t insecure_rand_Rz = 11; uint32_t insecure_rand_Rw = 11; void seed_insecure_rand(bool fDeterministic) { //The seed values have some unlikely fixed points which we avoid. if(fDeterministic) { insecure_rand_Rz = insecure_rand_Rw = 11; } else { uint32_t tmp; do { RAND_bytes((unsigned char*)&tmp, 4); } while(tmp == 0 || tmp == 0x9068ffffU); insecure_rand_Rz = tmp; do { RAND_bytes((unsigned char*)&tmp, 4); } while(tmp == 0 || tmp == 0x464fffffU); insecure_rand_Rw = tmp; } } string FormatVersion(int nVersion) { if (nVersion%100 == 0) return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100); else return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100); } string FormatFullVersion() { return CLIENT_BUILD; } // Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014) std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments) { std::ostringstream ss; ss << "/"; ss << name << ":" << FormatVersion(nClientVersion); if (!comments.empty()) ss << "(" << boost::algorithm::join(comments, "; ") << ")"; ss << "/"; return ss.str(); } #ifdef WIN32 boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate) { namespace fs = boost::filesystem; char pszPath[MAX_PATH] = ""; if(SHGetSpecialFolderPathA(NULL, pszPath, nFolder, fCreate)) { return fs::path(pszPath); } printf("SHGetSpecialFolderPathA() failed, could not obtain requested path.\n"); return fs::path(""); } #endif boost::filesystem::path GetTempPath() { #if BOOST_FILESYSTEM_VERSION == 3 return boost::filesystem::temp_directory_path(); #else // TODO: remove when we don't support filesystem v2 anymore boost::filesystem::path path; #ifdef WIN32 char pszPath[MAX_PATH] = ""; if (GetTempPathA(MAX_PATH, pszPath)) path = boost::filesystem::path(pszPath); #else path = boost::filesystem::path("/tmp"); #endif if (path.empty() || !boost::filesystem::is_directory(path)) { printf("GetTempPath(): failed to find temp path\n"); return boost::filesystem::path(""); } return path; #endif } void runCommand(std::string strCommand) { int nErr = ::system(strCommand.c_str()); if (nErr) printf("runCommand error: system(%s) returned %d\n", strCommand.c_str(), nErr); } void RenameThread(const char* name) { #if defined(PR_SET_NAME) // Only the first 15 characters are used (16 - NUL terminator) ::prctl(PR_SET_NAME, name, 0, 0, 0); #elif 0 && (defined(__FreeBSD__) || defined(__OpenBSD__)) // TODO: This is currently disabled because it needs to be verified to work // on FreeBSD or OpenBSD first. When verified the '0 &&' part can be // removed. pthread_set_name_np(pthread_self(), name); #elif defined(MAC_OSX) && defined(__MAC_OS_X_VERSION_MAX_ALLOWED) // pthread_setname_np is XCode 10.6-and-later #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 pthread_setname_np(name); #endif #else // Prevent warnings for unused parameters... (void)name; #endif }
mit
gabrielzanoni/SGCAV
packages/users/public/controllers/meanUser.js
4281
'use strict'; angular.module('mean.users') .controller('LoginCtrl', ['$scope', '$rootScope', '$http', '$location', function($scope, $rootScope, $http, $location) { // This object will be filled by the form $scope.user = {}; // Register the login() function $scope.login = function() { $http.post('/login', { email: $scope.user.email, password: $scope.user.password }) .success(function(response) { sessionStorage.roles = response.user.roles; sessionStorage._id = response.user._id; // authentication OK console.log(response.user); $scope.loginError = 0; $rootScope.user = response.user; $rootScope.$emit('loggedin'); if (response.redirect) { if (window.location.href === response.redirect) { //This is so an admin user will get full admin page window.location.reload(); } else { window.location = response.redirect; } } else { $location.url('/'); } }) .error(function() { $scope.loginerror = 'Authentication failed.'; }); }; } ]) .controller('RegisterCtrl', ['$scope', '$rootScope', '$http', '$location', function($scope, $rootScope, $http, $location) { $scope.user = {}; $scope.tiposUsuarios = [ {name:'Cliente', value:'cliente'}, {name:'Gerente', value:'gerente'}, ]; $scope.register = function() { $scope.usernameError = null; $scope.registerError = null; $http.post('/register', { email: $scope.user.email, password: $scope.user.password, confirmPassword: $scope.user.confirmPassword, cpf: $scope.user.cpf, phone: $scope.user.phone, name: $scope.user.name, roles: $scope.user.role.value }) .success(function() { // authentication OK $scope.registerError = 0; $rootScope.user = $scope.user; $rootScope.$emit('loggedin'); $location.url('/'); }) .error(function(error) { // Error: authentication failed if (error === 'Username already taken') { $scope.usernameError = error; } else if (error === 'Email already taken') { $scope.emailError = error; } else $scope.registerError = error; }); }; } ]) .controller('ForgotPasswordCtrl', ['$scope', '$rootScope', '$http', '$location', function($scope, $rootScope, $http, $location) { $scope.user = {}; $scope.forgotpassword = function() { $http.post('/forgot-password', { text: $scope.text }) .success(function(response) { $scope.response = response; }) .error(function(error) { $scope.response = error; }); }; } ]) .controller('ResetPasswordCtrl', ['$scope', '$rootScope', '$http', '$location', '$stateParams', function($scope, $rootScope, $http, $location, $stateParams) { $scope.user = {}; $scope.resetpassword = function() { $http.post('/reset/' + $stateParams.tokenId, { password: $scope.user.password, confirmPassword: $scope.user.confirmPassword }) .success(function(response) { $rootScope.user = response.user; $rootScope.$emit('loggedin'); if (response.redirect) { if (window.location.href === response.redirect) { //This is so an admin user will get full admin page window.location.reload(); } else { window.location = response.redirect; } } else { $location.url('/'); } }) .error(function(error) { if (error.msg === 'Token invalid or expired') $scope.resetpassworderror = 'Could not update password as token is invalid or may have expired'; else $scope.validationError = error; }); }; } ]);
mit
trivial-space/renderer
dist/utils/stackgl.d.ts
452
import { Vec } from 'tvs-libs/dist/math/vectors'; import { FormData } from '../painter-types'; export declare const STACK_GL_GEOMETRY_PROP_POSITION = "positions"; export declare const STACK_GL_GEOMETRY_PROP_NORMAL = "normals"; export declare const STACK_GL_GEOMETRY_PROP_UV = "uvs"; export declare const STACK_GL_GEOMETRY_PROP_ELEMENTS = "cells"; export declare function convertStackGLGeometry(stackglGeometry: { [id: string]: Vec[]; }): FormData;
mit
DevlinLiles/VSConsole.PowerPack
VSConsole.PowerPack.Core/IWpfConsole.cs
165
namespace VSConsole.PowerPack.Core { public interface IWpfConsole : IConsole { object Content { get; } object VsTextView { get; } } }
mit
skatsuta/mazes
ruby/cell.rb
1218
require 'distances' class Cell attr_reader :row, :column attr_accessor :north, :south, :east, :west def initialize(row, column) @row, @column = row, column @links = {} end def link(cell, bidi=true) @links[cell] = true cell.link(self, false) if bidi self end def unlink(cell, bidi=true) @links.delete(cell) cell.unlink(self, false) if bidi self end def links @links.keys end def linked?(cell) @links.key?(cell) end def neighbors list = [] list << north if north list << south if south list << east if east list << west if west list end def distances distances = Distances.new(self) frontier = [self] while frontier.any? new_frontier = [] frontier.each do |cell| cell.links.each do |linked| next if distances[linked] distances[linked] = distances[cell] + 1 new_frontier << linked end end frontier = new_frontier end distances end end
mit
JOHNYC23/UIP-PROG2
Tareas/Tarea semana 10/src/Excepciones/Principal.java
773
package Excepciones; public class Principal { public static void main(String[] args) { /* try{ System.out.println("Aqui va el error que arrojaria"); } catch (Exception e){ System.out.println("aqui va el codigo si ocurre el error"); } finally{ System.out.println("Esto igual se imprimira"); }*/ int numerador=10; Integer denominador=null; float division=0; System.out.println("antes del denominador"); try{ division=numerador/denominador; }catch(ArithmeticException ex){ division=0; System.out.println("error"+ex.getMessage()); }catch(NullPointerException e){ division=1; System.out.println("Error"+e.getMessage()); } finally{ System.out.println("division"+division); System.out.println("Despues de la division"); } } }
mit
MurhafSousli/ng-gallery
projects/gallerize/src/lib/gallerize.directive.ts
5657
import { Directive, Input, OnInit, OnDestroy, Inject, Optional, Self, Host, NgZone, ElementRef, Renderer2, PLATFORM_ID } from '@angular/core'; import { DOCUMENT, isPlatformBrowser } from '@angular/common'; import { Gallery, GalleryRef, ImageItem, GalleryComponent, GalleryState, GalleryItem } from '@ngx-gallery/core'; import { Lightbox } from '@ngx-gallery/lightbox'; import { Subject, Subscription, from, EMPTY } from 'rxjs'; import { tap, map, switchMap, finalize, debounceTime } from 'rxjs/operators'; /** * This directive has 2 modes: * 1 - If host element is a HTMLElement, it detects the images and hooks their clicks to lightbox * 2 - If host element is a GalleryComponent, it hooks the images click to the lightbox */ const enum GallerizeMode { Detector = 'detector', Gallery = 'gallery' } @Directive({ selector: '[gallerize]' }) export class GallerizeDirective implements OnInit, OnDestroy { /** Default gallery id */ private _galleryId = 'lightbox'; /** Gallerize mode */ private readonly _mode: GallerizeMode; /** If host element is a HTMLElement, will use the following variables: */ /** Stream that emits to fire the detection stream the image elements has changed */ private _observer$: any; /** Stream that emits when image is discover */ private _detector$: Subject<any>; /** If host element is a GalleryComponent, will use the following variables: */ /** Gallery events (if used on a gallery component) */ private _itemClick$: Subscription; private _itemChange$: Subscription; // ====================================================== /** If set, it will become the gallery id */ @Input() gallerize: string; /** The selector used to query images elements */ @Input() selector = 'img'; constructor(private _zone: NgZone, private _el: ElementRef, private _gallery: Gallery, private _lightbox: Lightbox, private _renderer: Renderer2, @Inject(PLATFORM_ID) platform: Object, @Inject(DOCUMENT) private _document: any, @Host() @Self() @Optional() private _galleryCmp: GalleryComponent) { // Set gallerize mode if (isPlatformBrowser(platform)) { this._mode = _galleryCmp ? GallerizeMode.Gallery : GallerizeMode.Detector; } } ngOnInit() { this._zone.runOutsideAngular(() => { this._galleryId = this.gallerize || this._galleryId; const ref = this._gallery.ref(this._galleryId); switch (this._mode) { case GallerizeMode.Detector: this.detectorMode(ref); break; case GallerizeMode.Gallery: this.galleryMode(ref); } }); } ngOnDestroy() { switch (this._mode) { case GallerizeMode.Detector: this._detector$.complete(); this._observer$.disconnect(); break; case GallerizeMode.Gallery: this._itemClick$.unsubscribe(); this._itemChange$.unsubscribe(); } } /** Gallery mode: means `gallerize` directive is used on `<gallery>` component * Adds a click event to each gallery item so it opens in lightbox */ private galleryMode(galleryRef: GalleryRef) { // Clone its items to the new gallery instance this._itemClick$ = this._galleryCmp.galleryRef.itemClick.subscribe((i: number) => this._lightbox.open(i, this._galleryId)); this._itemChange$ = this._galleryCmp.galleryRef.itemsChanged.subscribe((state: GalleryState) => galleryRef.load(state.items)); } /** Detector mode: means `gallerize` directive is used on a normal HTMLElement * Detects images and adds a click event to each image so it opens in the lightbox */ private detectorMode(galleryRef: GalleryRef) { this._detector$ = new Subject(); // Query image elements this._detector$.pipe( debounceTime(300), switchMap(() => { /** get all img elements from content */ const imageElements = this._el.nativeElement.querySelectorAll(this.selector); if (imageElements && imageElements.length) { const images: GalleryItem[] = []; return from(imageElements).pipe( map((el: any, i) => { // Add click event to the image this._renderer.setStyle(el, 'cursor', 'pointer'); this._renderer.setProperty(el, 'onclick', () => this._zone.run(() => this._lightbox.open(i, this._galleryId)) ); if (el instanceof HTMLImageElement) { // If element is type of img use the src property return { src: el.getAttribute('imageSrc') || el.src, thumb: el.getAttribute('thumbSrc') || el.src }; } else { // Otherwise, use element background-image url const elStyle = el.currentStyle || this._document.defaultView.getComputedStyle(el, null); const background = elStyle.backgroundImage.slice(4, -1).replace(/"/g, ''); return { src: el.getAttribute('imageSrc') || background, thumb: el.getAttribute('thumbSrc') || background }; } }), tap((data: any) => images.push(new ImageItem(data))), finalize(() => galleryRef.load(images)) ); } else { return EMPTY; } }) ).subscribe(); // Observe content changes this._observer$ = new MutationObserver(() => this._detector$.next()); this._observer$.observe(this._el.nativeElement, {childList: true, subtree: true}); } }
mit
elkdanger/Glimpse.Plugins.Bundling
src/Glimpse.Plugins.Bundling/GlimpseBundlePluginHttpModule.cs
685
using System; using System.Web; using System.Web.Optimization; using Microsoft.Web.Infrastructure.DynamicModuleHelper; namespace Glimpse.Plugins.Bundling { public class GlimpseBundlePluginHttpModule : IHttpModule { public void Init(HttpApplication context) { context.BeginRequest += OnBeginRequest; } void OnBeginRequest(object sender, EventArgs e) { if (!(BundleResolver.Current is GlimpsePluginBundleResolver)) { BundleResolver.Current = new GlimpsePluginBundleResolver(BundleResolver.Current); } } public void Dispose() { } } }
mit
MattFoy/Dice_and_Data
Dice_and_Data/Dice/RollPattern.cs
12690
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Text.RegularExpressions; using System.Diagnostics; using Dice_and_Data.Dice; using Dice_and_Data.Data; namespace Dice_and_Data { class RollPattern { private string patternString = ""; private List<RollPlan> rolls = new List<RollPlan>(); private int constant = 0; public int Constant { get { return constant; } set { } } private int max = 0; public int Max { get { return max + constant; } set { } } private int min = 0; public int Min { get { return min + constant; } set { } } private double mean = 0; public double Mean { get { return mean + constant; } set { } } private double variance = 0; public double Variance { get { return variance; } set { } } public double StandardDeviation { get { return Math.Sqrt(variance); } set { } } private long calcTime = 0; public long CalcTime { get { return calcTime; } set { } } private bool validtable; public bool ValidPTable { get { return validtable; } set { } } private Dictionary<int, double> pTable; public RollPattern(String rollString) { this.patternString = rollString; rollString = ValidatePattern(rollString); if (rollString.Length > 0) { Trace.WriteLine(rollString + " is good!"); //matches the "1d4" type strings Regex regex = new Regex("^([0-9]+d[0-9]+)$"); String[] explode = rollString.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries); foreach (string s in explode) { if (regex.IsMatch(s)) { // ie. s == "1d4" String[] rawRollPlan = s.Split(new char[] { 'd' }, StringSplitOptions.RemoveEmptyEntries); int dCount = Int32.Parse(rawRollPlan[0]); int sideCount = Int32.Parse(rawRollPlan[1]); if (dCount > 0 && sideCount > 0) { min += dCount; max += dCount * sideCount; RollPlan replace; if ((replace = rolls.SingleOrDefault(rp => rp.sides == sideCount)) != null) { RollPlan mergedPlan = new RollPlan(replace.diceCount + dCount, replace.sides); rolls.Remove(replace); rolls.Add(mergedPlan); } else { rolls.Add(new RollPlan(dCount, sideCount)); } } } else { // ie. s == "3" constant += Int32.Parse(s); } } rolls = rolls.OrderBy(r => r.sides).ToList(); this.patternString = this.ToString(true); GenerateProbabilityDistribution(); validtable = IsValidPTable(); } else { Trace.WriteLine(rollString + " is BAD!"); throw new DicePatternFormatException("Invalid dice pattern format."); } } public int run() { int result = 0; foreach (RollPlan rp in rolls) { result += rp.execute(); } SQLiteDBWrapper.getReference().RecordRoll(this.ToString(false), result); return result+constant; } public double p(int x) { if (pTable.ContainsKey(x-constant)) { return pTable[x - constant]; } else { return 0.0; } } private void GenerateProbabilityDistribution() { RollPartial partial = SQLiteDBWrapper.getReference().CheckCache(this.ToString(false)); if (partial.IsValid()) { // Load the partial into this instance instead of calculating from scratch Trace.WriteLine("[" + this.ToString(false) + "] Cache HIT! Loading combined probability distribution now..."); this.pTable = partial.pTable; this.variance = Math.Pow(partial.stdDev, 2); this.min = partial.min; this.max = partial.max; this.mean = partial.mean; this.calcTime = partial.calcTime; } else { Trace.WriteLine("[" + this.ToString(false) + "] Cache miss! Generating combined probability distribution now..."); // A Stopwatch to time the execution of the calculation. Stopwatch timer = new Stopwatch(); timer.Start(); // (re)Initialize the table pTable = new Dictionary<int, double>(); if (rolls.Count == 0) { // It's just a constant? pTable.Add(0, 1); } else if (rolls.Count == 1) { //Not a strictly necessary if block, but there's no need to do the whole algorithm on such a simple case for (int i = min; i <= max; i++) { pTable.Add(i, rolls[0].p(i)); } mean = rolls[0].E(); } else { // Step 1: Generate a list of all the list of possible outcomes from each RollPlan. // (Also calculate the mean while we're traversing this collection) List<List<KeyValuePair<int, double>>> sets = new List<List<KeyValuePair<int, double>>>(); double avgSum = 0; foreach (RollPlan rp in rolls) { avgSum += rp.E(); List<KeyValuePair<int, double>> possibilities = new List<KeyValuePair<int, double>>(); for (int k = rp.min; k <= rp.max; k++) { possibilities.Add(new KeyValuePair<int, double>(k, rp.p(k))); } sets.Add(possibilities); } mean = avgSum; // "sets" is now a list of all the probability distributions in the pattern, ie 2d8 + 1d6 would be 2 sets of // probabilities, 5d8 + 2d6 + 2d4 + 5 would be 3 sets, etc // Step 2: Generate the cartesian product of these sets with LINQ magic (See Dice/AdvMath.cs for details) IEnumerable<IEnumerable<KeyValuePair<int, double>>> result = sets .Select(list => list.AsEnumerable()) .CartesianProduct(); // Step 3: Create an array to store combination totals double[] partialProbabilities = Enumerable.Repeat(0.0, max - min + 1).ToArray(); // Looping through each possible combination of RollPlan outcomes, adds up the sum and weights it based on the probability. foreach (IEnumerable<KeyValuePair<int, double>> topLvl in result) { int currentSum = 0; double currentP = 1; foreach (KeyValuePair<int, double> kvp in topLvl) { //Trace.Write(kvp + ", "); currentSum += kvp.Key; currentP *= kvp.Value; } //Trace.WriteLine(""); partialProbabilities[(currentSum - min)] += currentP; } // Step 4: Calculate how many possibilities each value weighs relative to the total number. for (int i = 0; i < partialProbabilities.Length; i++) { pTable.Add(i + min, partialProbabilities[i]); } } // Step 5: Calculate the variance using the forumla SUM(i=min;i<=max): (xi - mean)^2 * p(xi) // (Credit to http://www.stat.yale.edu/Courses/1997-98/101/rvmnvar.htm) variance = 0; foreach (KeyValuePair<int, double> entry in pTable) { variance += Math.Pow(entry.Key - mean, 2) * entry.Value; } //Stop the timer and record it. timer.Stop(); calcTime = timer.ElapsedMilliseconds; // Essentially, if the sum of probabilities add to 1. Anything else is clearly an error // Errors at this stage are usually caused by double/int overflows in the AdvMath functions. (I think!) if (IsValidPTable()) { CacheResults(); } // else, invalid pTable. :( } } public Boolean IsValidPTable() { double pTotal = 0.0; for (int i = min; i <= max; i++) { pTotal += pTable[i]; } if (Math.Abs(1 - pTotal) < 0.01) { return true; } else { return false; } } public static String ValidatePattern(String pattern) { // Matches all whitespace characters Regex regex = new Regex("\\s*"); // Replaces all whitespace characters with nothing; thereby removing them. pattern = regex.Replace(pattern, ""); // This merely simplifies parsing the value later instead of performing additional logic pattern = pattern.Replace("-", "+-"); // Forces all uppercase letters to lowercase pattern = pattern.ToLower(); //matches "1d4", "1d4+3", "2d4+3d5", "2d4+3+5d6+8+1d3", etc regex = new Regex(@"^(([1-9][0-9]*d[0-9]+)|([1-9][0-9]*))(\+(([1-9][0-9]*d[0-9]+)|((-[1-9]|[1-9])[0-9]*)))*$"); if (regex.IsMatch(pattern)) { return pattern; } else { return ""; } } // This is simply used with a breakpoint for debugging purposes to find any instances of "ToString" being called without a boolean parameter public override string ToString() { return base.ToString(); } // The purpose of this is to represent a RollPattern as a string such as "5d4+2d8" // the boolean "withConstant" determines whether or not the constant is appended. // This is because the calculated probabiltiy distribution doesn't change based on the constant // So "10d4+8d6+5d10+5d12+3d20" is the same with or without a "+10" on the end, as far as caching is concerned public String ToString(Boolean withConstant) { StringBuilder sb = new StringBuilder(); String res = ""; foreach (RollPlan rp in rolls) { sb.Append(rp.diceCount).Append("d").Append(rp.sides).Append("+"); } if (rolls.Count > 0) { sb.Remove(sb.Length - 1, 1); } if (withConstant && constant != 0) { if (constant > 0) { sb.Append("+"); } else if (constant < 0) { sb.Append("-"); } sb.Append(Math.Abs(constant)); } res = sb.ToString(); return res; } private void CacheResults() { SQLiteDBWrapper db = SQLiteDBWrapper.getReference(); db.CacheRollPattern(this.ToString(false), min, max, mean, StandardDeviation, JSONconverter_pTables.Dict2JSON(pTable), calcTime); Trace.WriteLine(this.ToString(false) + " cached in SQLite database."); } } }
mit
NShahri/AtomicClock
projects/AtomicClock/Services/Events/IJobEventModel.cs
897
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="IJobEventModel.cs" company="Nima Shahri"> // Copyright (c) Nima Shahri. All rights reserved. // </copyright> // <summary> // Defines the IJobEventModel type. // </summary> // -------------------------------------------------------------------------------------------------------------------- namespace AtomicClock.Services.Events { using AtomicClock.Jobs; using AtomicClock.Schedulers; /// <summary> /// The JobEventModel interface. /// </summary> public interface IJobEventModel { /// <summary> /// Gets the job info. /// </summary> IJobInfo JobInfo { get; } /// <summary> /// Gets the job scheduler. /// </summary> IJobScheduler JobScheduler { get; } } }
mit
timegridio/concierge
migrations/2016_02_01_000000_create_users_table.php
693
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateUsersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->string('username'); // Long enough as to hold an md5 $table->string('name'); $table->string('email'); $table->nullableTimestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::drop('users'); } }
mit
achristoph/angular2-starter
src/app/core/services/constant.ts
587
import { Injectable } from '@angular/core'; /** * This service stores all constants based on environment */ @Injectable() export class Constant { public data: any; constructor() { this.data = {}; } } export interface Project { title: string; description: string; tasks: any; } export interface Task { title: string; id: number; done: boolean; } export interface Action { type: string; payload?: any; } export interface AppState { counter: number; tasks: Task[]; taskFilter: any; } export interface Reducer<T> { (state: T, action: Action): T; }
mit
swaplicado/siie32
src/erp/mtrn/view/SViewDpsStockReturn.java
30214
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package erp.mtrn.view; import erp.data.SDataConstants; import erp.data.SDataConstantsSys; import erp.data.SDataUtilities; import erp.data.SProcConstants; import erp.gui.SModuleUtilities; import erp.lib.SLibConstants; import erp.lib.SLibTimeUtilities; import erp.lib.data.SDataSqlUtilities; import erp.lib.table.STabFilterDateCutOff; import erp.lib.table.STabFilterDatePeriod; import erp.lib.table.STableColumn; import erp.lib.table.STableConstants; import erp.lib.table.STableField; import erp.lib.table.STableSetting; import erp.mtrn.data.SDataDps; import erp.mtrn.data.STrnDiogComplement; import erp.table.SFilterConstants; import erp.table.STabFilterBizPartner; import erp.table.STabFilterCompanyBranch; import erp.table.STabFilterDocumentType; import erp.table.STabFilterFunctionalArea; import java.awt.Dimension; import java.util.Date; import java.util.Vector; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JOptionPane; import sa.gui.util.SUtilConsts; import sa.lib.SLibRpnArgument; import sa.lib.SLibRpnArgumentType; import sa.lib.SLibRpnOperator; /** * * @author Sergio Flores */ public class SViewDpsStockReturn extends erp.lib.table.STableTab implements java.awt.event.ActionListener { private javax.swing.JButton mjbReturn; private javax.swing.JButton mjbClose; private javax.swing.JButton mjbOpen; private javax.swing.JButton mjbViewDps; private javax.swing.JButton mjbViewNotes; private javax.swing.JButton mjbViewLinks; private erp.lib.table.STabFilterDateCutOff moTabFilterDateCutOff; private erp.lib.table.STabFilterDatePeriod moTabFilterDatePeriod; private erp.table.STabFilterCompanyBranch moTabFilterCompanyBranch; private erp.table.STabFilterDocumentType moTabFilterDocumentType; private erp.table.STabFilterBizPartner moTabFilterBizPartner; private erp.table.STabFilterFunctionalArea moTabFilterFunctionalArea; /** * @param client Client interface. * @param tabTitle View tab title. * @param tabType View tab type. Constants defined in SDataConstats (TRNX_DPS_RETURN_PEND, TRNX_DPS_RETURN_PEND_ETY, TRNX_DPS_RETURNED, TRNX_DPS_RETURNED_ETY). * @param auxType01 DPS category. Constats defined in SDataConstatsSys (TRNS_CL_DPS_...[0]). * @param auxType02 DPS class. Constats defined in SDataConstatsSys (TRNS_CT_DPS_...[1]). */ public SViewDpsStockReturn(erp.client.SClientInterface client, java.lang.String tabTitle, int tabType, int auxType01, int auxType02) { super(client, tabTitle, tabType, auxType01, auxType02); initComponents(); } private boolean isViewForDocuments() { return mnTabType == SDataConstants.TRNX_DPS_RETURN_PEND || mnTabType == SDataConstants.TRNX_DPS_RETURNED; } private boolean isViewForDocumentEntries() { return mnTabType == SDataConstants.TRNX_DPS_RETURN_PEND_ETY || mnTabType == SDataConstants.TRNX_DPS_RETURNED_ETY; } private boolean isViewForPurchases() { return mnTabTypeAux01 == SDataConstantsSys.TRNS_CT_DPS_PUR; } private boolean isViewForReturn() { return mnTabType == SDataConstants.TRNX_DPS_RETURN_PEND || mnTabType == SDataConstants.TRNX_DPS_RETURN_PEND_ETY; } private void initComponents() { int i = 0; int cols = 0; int levelRightAllDocs = SDataConstantsSys.UNDEFINED; int levelRightDocTransaction = SDataConstantsSys.UNDEFINED; STableField[] aoKeyFields = null; STableColumn[] aoTableColumns = null; mjbReturn = new JButton(isViewForPurchases() ? new ImageIcon(getClass().getResource("/erp/img/icon_std_dps_stk_out.gif")) : new ImageIcon(getClass().getResource("/erp/img/icon_std_dps_stk_in.gif"))); mjbClose = new JButton(miClient.getImageIcon(SLibConstants.ICON_DOC_CLOSE)); mjbOpen = new JButton(miClient.getImageIcon(SLibConstants.ICON_DOC_OPEN)); mjbViewDps = new JButton(miClient.getImageIcon(SLibConstants.ICON_LOOK)); mjbViewNotes = new JButton(miClient.getImageIcon(SLibConstants.ICON_NOTES)); mjbViewLinks = new JButton(miClient.getImageIcon(SLibConstants.ICON_LINK)); mjbReturn.setPreferredSize(new Dimension(23, 23)); mjbClose.setPreferredSize(new Dimension(23, 23)); mjbOpen.setPreferredSize(new Dimension(23, 23)); mjbViewDps.setPreferredSize(new Dimension(23, 23)); mjbViewNotes.setPreferredSize(new Dimension(23, 23)); mjbViewLinks.setPreferredSize(new Dimension(23, 23)); mjbReturn.addActionListener(this); mjbClose.addActionListener(this); mjbOpen.addActionListener(this); mjbViewDps.addActionListener(this); mjbViewNotes.addActionListener(this); mjbViewLinks.addActionListener(this); mjbReturn.setToolTipText("Devolver"); mjbClose.setToolTipText("Cerrar para devolución"); mjbOpen.setToolTipText("Abrir para devolución"); mjbViewDps.setToolTipText("Ver documento"); mjbViewNotes.setToolTipText("Ver notas"); mjbViewLinks.setToolTipText("Ver vínculos del documento"); if (isViewForReturn()) { moTabFilterDateCutOff = new STabFilterDateCutOff(miClient, this, SLibTimeUtilities.getEndOfYear(miClient.getSessionXXX().getWorkingDate())); moTabFilterDatePeriod = null; } else { moTabFilterDateCutOff = null; moTabFilterDatePeriod = new STabFilterDatePeriod(miClient, this, SLibConstants.GUI_DATE_AS_YEAR_MONTH); } moTabFilterCompanyBranch = new STabFilterCompanyBranch(miClient, this); moTabFilterDocumentType = new STabFilterDocumentType(miClient, this, SDataConstants.TRNU_TP_DPS, new int[] { mnTabTypeAux01, mnTabTypeAux02 }); moTabFilterBizPartner = new STabFilterBizPartner(miClient, this, isViewForPurchases() ? SDataConstantsSys.BPSS_CT_BP_SUP : SDataConstantsSys.BPSS_CT_BP_CUS); moTabFilterFunctionalArea = new STabFilterFunctionalArea(miClient, this); if (isViewForPurchases()) { levelRightAllDocs = miClient.getSessionXXX().getUser().hasRight(miClient, SDataConstantsSys.PRV_PUR_DOC_TRN).Level; levelRightDocTransaction = miClient.getSessionXXX().getUser().hasRight(miClient, SDataConstantsSys.PRV_INV_OUT_PUR).Level; } else { levelRightAllDocs = miClient.getSessionXXX().getUser().hasRight(miClient, SDataConstantsSys.PRV_SAL_DOC_TRN).Level; levelRightDocTransaction = miClient.getSessionXXX().getUser().hasRight(miClient, SDataConstantsSys.PRV_INV_IN_SAL).Level; } removeTaskBarUpperComponent(jbNew); removeTaskBarUpperComponent(jbEdit); removeTaskBarUpperComponent(jbDelete); addTaskBarUpperComponent(mjbReturn); addTaskBarUpperComponent(mjbClose); addTaskBarUpperComponent(mjbOpen); addTaskBarUpperSeparator(); addTaskBarUpperComponent(isViewForReturn() ? moTabFilterDateCutOff : moTabFilterDatePeriod); addTaskBarUpperSeparator(); addTaskBarUpperComponent(moTabFilterCompanyBranch); addTaskBarUpperSeparator(); addTaskBarUpperComponent(moTabFilterBizPartner); addTaskBarUpperSeparator(); addTaskBarUpperComponent(mjbViewDps); addTaskBarUpperComponent(mjbViewNotes); addTaskBarUpperComponent(mjbViewLinks); addTaskBarUpperSeparator(); addTaskBarUpperComponent(moTabFilterDocumentType); addTaskBarUpperComponent(moTabFilterFunctionalArea); mjbReturn.setEnabled(isViewForReturn() && levelRightDocTransaction >= SUtilConsts.LEV_AUTHOR); mjbClose.setEnabled(isViewForReturn() && levelRightDocTransaction >= SUtilConsts.LEV_AUTHOR); mjbOpen.setEnabled(!isViewForReturn() && levelRightDocTransaction >= SUtilConsts.LEV_AUTHOR); mjbViewDps.setEnabled(levelRightAllDocs == SUtilConsts.LEV_MANAGER); mjbViewNotes.setEnabled(true); mjbViewLinks.setEnabled(true); // View primary keys: aoKeyFields = new STableField[isViewForDocuments() ? 2 : 3]; i = 0; aoKeyFields[i++] = new STableField(SLibConstants.DATA_TYPE_INTEGER, "id_year"); aoKeyFields[i++] = new STableField(SLibConstants.DATA_TYPE_INTEGER, "id_doc"); if (isViewForDocumentEntries()) { aoKeyFields[i++] = new STableField(SLibConstants.DATA_TYPE_INTEGER, "id_ety"); } for (i = 0; i < aoKeyFields.length; i++) { moTablePane.getPrimaryKeyFields().add(aoKeyFields[i]); } // View columns: cols = isViewForDocuments() ? 14 : 17; if (levelRightAllDocs == SUtilConsts.LEV_MANAGER) { cols += 2; } aoTableColumns = new STableColumn[cols]; i = 0; if (isViewForPurchases()) { // Purchases & suppliers: if (miClient.getSessionXXX().getParamsErp().getFkSortingSupplierTypeId() == SDataConstantsSys.CFGS_TP_SORT_KEY_NAME) { aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "bp_key", "Clave proveedor", 50); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "bp", "Proveedor", 200); } else { aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "bp", "Proveedor", 200); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "bp_key", "Clave proveedor", 50); } aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "bpb", "Sucursal proveedor", 75); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "f_dt_code", "Tipo doc.", STableConstants.WIDTH_CODE_DOC); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "f_num", "Folio doc.", STableConstants.WIDTH_DOC_NUM); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "num_ref", "Referencia doc.", STableConstants.WIDTH_DOC_NUM_REF); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_DATE, "dt", "Fecha doc.", STableConstants.WIDTH_DATE); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "f_cb_code", "Sucursal empresa", STableConstants.WIDTH_CODE_COB); } else { // Sales & customers: aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "f_dt_code", "Tipo doc.", STableConstants.WIDTH_CODE_DOC); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "f_num", "Folio doc.", STableConstants.WIDTH_DOC_NUM); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "num_ref", "Referencia doc.", STableConstants.WIDTH_DOC_NUM_REF); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_DATE, "dt", "Fecha doc.", STableConstants.WIDTH_DATE); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "f_cb_code", "Sucursal empresa", STableConstants.WIDTH_CODE_COB); if (miClient.getSessionXXX().getParamsErp().getFkSortingCustomerTypeId() == SDataConstantsSys.CFGS_TP_SORT_KEY_NAME) { aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "bp_key", "Clave cliente", 50); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "bp", "Cliente", 200); } else { aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "bp", "Cliente", 200); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "bp_key", "Clave cliente", 50); } aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "bpb", "Sucursal cliente", 75); } if (levelRightAllDocs == SUtilConsts.LEV_MANAGER) { aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_DOUBLE, "tot_cur_r", "Total mon $", STableConstants.WIDTH_VALUE_2X); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "cur_key", "Moneda doc.", STableConstants.WIDTH_CURRENCY_KEY); } if (isViewForDocumentEntries()) { if (miClient.getSessionXXX().getParamsErp().getFkSortingItemTypeId() == SDataConstantsSys.CFGS_TP_SORT_KEY_NAME) { aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "item_key", "Clave ítem", STableConstants.WIDTH_ITEM_KEY); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "item", "Ítem", STableConstants.WIDTH_ITEM_2X); } else { aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "item", "Ítem", STableConstants.WIDTH_ITEM_2X); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "item_key", "Clave ítem", STableConstants.WIDTH_ITEM_KEY); } } aoTableColumns[i] = new STableColumn(SLibConstants.DATA_TYPE_DOUBLE, "f_orig_qty", "Cant. original", STableConstants.WIDTH_QUANTITY_2X); aoTableColumns[i++].setCellRenderer(miClient.getSessionXXX().getFormatters().getTableCellRendererQuantity()); aoTableColumns[i] = new STableColumn(SLibConstants.DATA_TYPE_DOUBLE, "f_ret_orig_qty", "Cant. devuelta", STableConstants.WIDTH_QUANTITY_2X); aoTableColumns[i++].setCellRenderer(miClient.getSessionXXX().getFormatters().getTableCellRendererQuantity()); aoTableColumns[i] = new STableColumn(SLibConstants.DATA_TYPE_DOUBLE, "", "Cant. pendiente", STableConstants.WIDTH_QUANTITY_2X); aoTableColumns[i].setCellRenderer(miClient.getSessionXXX().getFormatters().getTableCellRendererQuantity()); aoTableColumns[i].getRpnArguments().add(new SLibRpnArgument("f_orig_qty", SLibRpnArgumentType.OPERAND)); aoTableColumns[i].getRpnArguments().add(new SLibRpnArgument("f_ret_orig_qty", SLibRpnArgumentType.OPERAND)); aoTableColumns[i++].getRpnArguments().add(new SLibRpnArgument(SLibRpnOperator.SUBTRACTION, SLibRpnArgumentType.OPERATOR)); if (isViewForDocumentEntries()) { aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "f_orig_unit", "Unidad", STableConstants.WIDTH_UNIT_SYMBOL); } aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_BOOLEAN, "b_close", "Cerrado", STableConstants.WIDTH_BOOLEAN); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_STRING, "usr", "Usr. cierre", STableConstants.WIDTH_USER); aoTableColumns[i++] = new STableColumn(SLibConstants.DATA_TYPE_DATE_TIME, "ts_close", "Cierre", STableConstants.WIDTH_DATE_TIME); for (i = 0; i < aoTableColumns.length; i++) { moTablePane.addTableColumn(aoTableColumns[i]); } mvSuscriptors.add(mnTabType); mvSuscriptors.add(SDataConstants.BPSU_BP); mvSuscriptors.add(SDataConstants.BPSU_BP_CT); mvSuscriptors.add(SDataConstants.BPSU_BPB); mvSuscriptors.add(SDataConstants.TRN_DPS); mvSuscriptors.add(SDataConstants.TRN_DIOG); mvSuscriptors.add(SDataConstants.USRU_USR); if (isViewForDocumentEntries()) { mvSuscriptors.add(SDataConstants.ITMU_ITEM); mvSuscriptors.add(SDataConstants.ITMU_UNIT); } moTablePane.setDoubleClickAction(this, "publicActionViewDps"); populateTable(); } private void actionReturnDoc() { if (mjbReturn.isEnabled()) { if (moTablePane.getSelectedTableRow() == null) { miClient.showMsgBoxInformation(SLibConstants.MSG_ERR_GUI_ROW_UNDEF); } else { int[] key = isViewForPurchases() ? SDataConstantsSys.TRNS_TP_IOG_OUT_PUR_PUR : SDataConstantsSys.TRNS_TP_IOG_IN_SAL_SAL; SDataDps dps = (SDataDps) SDataUtilities.readRegistry(miClient, SDataConstants.TRN_DPS, moTablePane.getSelectedTableRow().getPrimaryKey(), SLibConstants.EXEC_MODE_VERBOSE); miClient.getGuiModule(SDataConstants.MOD_INV).setFormComplement(new STrnDiogComplement(key, dps)); if (miClient.getGuiModule(SDataConstants.MOD_INV).showForm(SDataConstants.TRN_DIOG, null) == SLibConstants.DB_ACTION_SAVE_OK) { miClient.getGuiModule(SDataConstants.MOD_INV).refreshCatalogues(SDataConstants.TRN_DIOG); } } } } private void actionCloseDoc() { if (mjbClose.isEnabled()) { if (moTablePane.getSelectedTableRow() == null) { miClient.showMsgBoxInformation(SLibConstants.MSG_ERR_GUI_ROW_UNDEF); } else { if (miClient.showMsgBoxConfirm(SLibConstants.MSG_CNF_DOC_CLOSE) == JOptionPane.YES_OPTION) { Vector<Object> params = new Vector<Object>(); params.add(((int[])moTablePane.getSelectedTableRow().getPrimaryKey())[0]); params.add(((int[])moTablePane.getSelectedTableRow().getPrimaryKey())[1]); params.add(miClient.getSession().getUser().getPkUserId()); params.add(true); // true means "open" params = SDataUtilities.callProcedure(miClient, SProcConstants.TRN_OPEN_CLOSE_DPS, params, SLibConstants.EXEC_MODE_SILENT); miClient.getGuiModule(isViewForPurchases() ? SDataConstants.MOD_PUR : SDataConstants.MOD_SAL).refreshCatalogues(SDataConstants.TRN_DPS); } } } } private void actionOpenDoc() { if (mjbOpen.isEnabled()) { if (moTablePane.getSelectedTableRow() == null) { miClient.showMsgBoxInformation(SLibConstants.MSG_ERR_GUI_ROW_UNDEF); } else { SDataDps oDps = (SDataDps) SDataUtilities.readRegistry(miClient, SDataConstants.TRN_DPS, moTablePane.getSelectedTableRow().getPrimaryKey(), SLibConstants.EXEC_MODE_VERBOSE); if (!oDps.getIsClosed()) { miClient.showMsgBoxInformation("No se puede abrir un documento que no ha sido cerrado de forma manual."); } else { if (miClient.showMsgBoxConfirm(SLibConstants.MSG_CNF_DOC_OPEN) == JOptionPane.YES_OPTION) { Vector<Object> params = new Vector<Object>(); params.add(((int[]) moTablePane.getSelectedTableRow().getPrimaryKey())[0]); params.add(((int[]) moTablePane.getSelectedTableRow().getPrimaryKey())[1]); params.add(miClient.getSession().getUser().getPkUserId()); params.add(false); // false means "close" params = SDataUtilities.callProcedure(miClient, SProcConstants.TRN_OPEN_CLOSE_DPS, params, SLibConstants.EXEC_MODE_SILENT); miClient.getGuiModule(isViewForPurchases() ? SDataConstants.MOD_PUR : SDataConstants.MOD_SAL).refreshCatalogues(SDataConstants.TRN_DPS); } } } } } private void actionViewDps() { if (mjbViewDps.isEnabled()) { if (moTablePane.getSelectedTableRow() == null) { miClient.showMsgBoxInformation(SLibConstants.MSG_ERR_GUI_ROW_UNDEF); } else { int gui = isViewForPurchases() ? SDataConstants.MOD_PUR : SDataConstants.MOD_SAL; SDataDps dps = (SDataDps) SDataUtilities.readRegistry(miClient, SDataConstants.TRN_DPS, moTablePane.getSelectedTableRow().getPrimaryKey(), SLibConstants.EXEC_MODE_VERBOSE); if (dps != null) { miClient.getGuiModule(gui).setFormComplement(dps.getDpsTypeKey()); miClient.getGuiModule(gui).showForm(SDataConstants.TRNX_DPS_RO, dps.getPrimaryKey()); } } } } private void actionViewNotes() { if (mjbViewNotes.isEnabled()) { SModuleUtilities.showDocumentNotes(miClient, SDataConstants.TRN_DPS, moTablePane.getSelectedTableRow()); } } private void actionViewLinks() { if (mjbViewLinks.isEnabled()) { SModuleUtilities.showDocumentLinks(miClient, moTablePane.getSelectedTableRow()); } } public void publicActionViewDps() { actionViewDps(); } @Override @SuppressWarnings("unchecked") public void createSqlQuery() { int[] key = null; String sqlFilter = ""; String sqlDiogPeriod = ""; String sqlBizPartner = ""; String sqlOrderByDoc = ""; String sqlOrderByDocEty = ""; for (STableSetting setting : mvTableSettings) { if (setting.getType() == STableConstants.SETTING_FILTER_PERIOD) { if (isViewForReturn()) { sqlDiogPeriod += setting.getSetting() == null ? "" : "g.dt <= '" + miClient.getSessionXXX().getFormatters().getDbmsDateFormat().format((Date) setting.getSetting()) + "' AND "; } else { sqlFilter += "AND " + SDataSqlUtilities.composePeriodFilter((int[]) setting.getSetting(), "d.dt"); } } else if (setting.getType() == SFilterConstants.SETTING_FILTER_DOC_TP) { key = (int[]) setting.getSetting(); sqlFilter += key == null ? "" : "AND d.fid_ct_dps = " + key[0] + " AND d.fid_cl_dps = " + key[1] + " AND d.fid_tp_dps = " + key[2] + " "; } else if (setting.getType() == SFilterConstants.SETTING_FILTER_COB) { sqlFilter += ((Integer) setting.getSetting() == SLibConstants.UNDEFINED ? "" : "AND d.fid_cob = " + (Integer) setting.getSetting() + " "); } else if (setting.getType() == SFilterConstants.SETTING_FILTER_BP) { sqlFilter += ((Integer) setting.getSetting() == SLibConstants.UNDEFINED ? "" : "AND d.fid_bp_r = " + (Integer) setting.getSetting() + " "); } else if (setting.getType() == SFilterConstants.SETTING_FILTER_FUNC_AREA) { if (!((String) setting.getSetting()).isEmpty()) { sqlFilter += (sqlFilter.length() == 0 ? "" : "AND ") + " d.fid_func IN (" + ((String) setting.getSetting()) + ") "; } } } if (isViewForPurchases()) { // Purchases & suppliers: sqlBizPartner = "AND bc.id_ct_bp = " + SDataConstantsSys.BPSS_CT_BP_SUP + " "; if (miClient.getSessionXXX().getParamsErp().getFkSortingSupplierTypeId() == SDataConstantsSys.CFGS_TP_SORT_KEY_NAME) { sqlOrderByDoc += "bp_key, bp, id_bp, "; sqlOrderByDocEty += "bp_key, bp, id_bp, "; } else { sqlOrderByDoc += "bp, id_bp, bp_key, "; sqlOrderByDocEty += "bp, id_bp, bp_key, "; } sqlOrderByDoc += "f_dt_code, num_ser, CAST(num AS UNSIGNED INTEGER), num, dt "; sqlOrderByDocEty += "f_dt_code, d.num_ser, CAST(d.num AS UNSIGNED INTEGER), d.num, d.dt "; } else { // Sales & customers: sqlBizPartner = "AND bc.id_ct_bp = " + SDataConstantsSys.BPSS_CT_BP_CUS + " "; sqlOrderByDoc += "f_dt_code, num_ser, CAST(num AS UNSIGNED INTEGER), num, dt, "; sqlOrderByDocEty += "f_dt_code, d.num_ser, CAST(d.num AS UNSIGNED INTEGER), d.num, d.dt, "; if (miClient.getSessionXXX().getParamsErp().getFkSortingCustomerTypeId() == SDataConstantsSys.CFGS_TP_SORT_KEY_NAME) { sqlOrderByDoc += "bp_key, bp, id_bp "; sqlOrderByDocEty += "bp_key, bp, id_bp "; } else { sqlOrderByDoc += "bp, id_bp, bp_key "; sqlOrderByDocEty += "bp, id_bp, bp_key "; } } if (isViewForDocumentEntries()) { if (miClient.getSessionXXX().getParamsErp().getFkSortingItemTypeId() == SDataConstantsSys.CFGS_TP_SORT_KEY_NAME) { sqlOrderByDocEty += ", item_key, item, "; } else { sqlOrderByDocEty += ", item, item_key, "; } sqlOrderByDocEty += "fid_item, f_orig_unit, fid_orig_unit, f_orig_qty "; } if (isViewForDocumentEntries()) { msSql = ""; } else { msSql = "SELECT id_year, id_doc, " + "dt, num_ser, num, num_ref, tot_r, tot_cur_r, b_close, ts_close, usr, cur_key, f_num, " + "f_dt_code, f_cb_code, id_bp, bp, bp_key, bpb, " + "SUM(f_qty) AS f_qty, " + "SUM(f_orig_qty) AS f_orig_qty, " + "COALESCE(SUM(f_ret_qty), 0) AS f_ret_qty, " + "COALESCE(SUM(f_ret_orig_qty), 0) AS f_ret_orig_qty " + "FROM ( "; } msSql += "SELECT de.id_year, de.id_doc, de.id_ety, " + "d.dt, d.num_ser, d.num, d.num_ref, d.tot_r, d.tot_cur_r, d.b_close, d.ts_close, uc.usr, c.cur_key, " + "CONCAT(d.num_ser, IF(length(d.num_ser) = 0, '', '-'), d.num) AS f_num, " + "dt.code AS f_dt_code, cb.code AS f_cb_code, b.id_bp, b.bp, bc.bp_key, bb.bpb, " + "de.fid_item, de.fid_unit, de.fid_orig_unit, i.item_key, i.item, u.symbol AS f_unit, uo.symbol AS f_orig_unit, " + "de.qty AS f_qty, " + "de.orig_qty AS f_orig_qty, " + "COALESCE((SELECT SUM(ge.qty) FROM trn_diog_ety AS ge, trn_diog AS g WHERE " + "ge.fid_dps_adj_year_n = de.id_year AND ge.fid_dps_adj_doc_n = de.id_doc AND ge.fid_dps_adj_ety_n = de.id_ety AND " + "ge.id_year = g.id_year AND ge.id_doc = g.id_doc AND " + sqlDiogPeriod + "ge.b_del = 0 AND g.b_del = 0), 0) AS f_ret_qty, " + "COALESCE((SELECT SUM(ge.orig_qty) FROM trn_diog_ety AS ge, trn_diog AS g WHERE " + "ge.fid_dps_adj_year_n = de.id_year AND ge.fid_dps_adj_doc_n = de.id_doc AND ge.fid_dps_adj_ety_n = de.id_ety AND " + "ge.id_year = g.id_year AND ge.id_doc = g.id_doc AND " + sqlDiogPeriod + "ge.b_del = 0 AND g.b_del = 0), 0) AS f_ret_orig_qty " + "FROM trn_dps AS d " + "INNER JOIN erp.trnu_tp_dps AS dt ON d.fid_ct_dps = dt.id_ct_dps AND d.fid_cl_dps = dt.id_cl_dps AND d.fid_tp_dps = dt.id_tp_dps AND " + "d.b_del = 0 AND d.fid_st_dps = " + SDataConstantsSys.TRNS_ST_DPS_EMITED + " AND " + "d.fid_ct_dps = " + mnTabTypeAux01 + " AND d.fid_cl_dps = " + mnTabTypeAux02 + " " + sqlFilter + "INNER JOIN erp.cfgu_cur AS c ON d.fid_cur = c.id_cur " + "INNER JOIN erp.bpsu_bpb AS cb ON d.fid_cob = cb.id_bpb " + "INNER JOIN erp.bpsu_bp AS b ON d.fid_bp_r = b.id_bp " + "INNER JOIN erp.bpsu_bp_ct AS bc ON d.fid_bp_r = bc.id_bp " + sqlBizPartner + "INNER JOIN erp.bpsu_bpb AS bb ON d.fid_bpb = bb.id_bpb " + "INNER JOIN erp.usru_usr AS uc ON d.fid_usr_close = uc.id_usr " + "INNER JOIN trn_dps_ety AS de ON d.id_year = de.id_year AND d.id_doc = de.id_doc AND " + "de.b_del = 0 AND de.qty > 0 AND de.b_inv = 1 AND de.orig_qty > 0 AND de.fid_tp_dps_adj = " + SDataConstantsSys.TRNS_TP_DPS_ADJ_RET + " " + "INNER JOIN erp.itmu_item AS i ON de.fid_item = i.id_item " + "INNER JOIN erp.itmu_unit AS u ON de.fid_unit = u.id_unit " + "INNER JOIN erp.itmu_unit AS uo ON de.fid_orig_unit = uo.id_unit " + "GROUP BY de.id_year, de.id_doc, de.id_ety, " + "d.dt, d.num_ser, d.num, d.num_ref, d.tot_r, d.tot_cur_r, d.b_close, d.ts_close, uc.usr, c.cur_key, " + "dt.code, cb.code, b.id_bp, b.bp, bc.bp_key, bb.bpb, " + "de.fid_item, de.fid_unit, de.fid_orig_unit, i.item_key, i.item, u.symbol, uo.symbol, " + "de.qty, de.orig_qty "; if (mnTabType == SDataConstants.TRNX_DPS_RETURN_PEND || mnTabType == SDataConstants.TRNX_DPS_RETURN_PEND_ETY) { msSql += "HAVING (f_orig_qty - f_ret_orig_qty) <> 0 AND d.b_close = 0 "; } else { msSql += "HAVING (f_orig_qty - f_ret_orig_qty) = 0 OR d.b_close = 1 "; } if (isViewForDocumentEntries()) { msSql += "ORDER BY " + sqlOrderByDocEty + "; "; } else { msSql += ") AS DPS_ETY_TMP " + // derived table "GROUP BY id_year, id_doc, " + "dt, num_ser, num, num_ref, tot_r, tot_cur_r, b_close, ts_close, usr, cur_key, f_num, " + "f_dt_code, f_cb_code, id_bp, bp, bp_key, bpb " + "ORDER BY " + sqlOrderByDoc + "; "; } } @Override public void actionNew() { if (jbNew.isEnabled()) { } } @Override public void actionEdit() { if (jbEdit.isEnabled()) { } } @Override public void actionDelete() { if (jbDelete.isEnabled()) { } } @Override public void actionPerformed(java.awt.event.ActionEvent e) { super.actionPerformed(e); if (e.getSource() instanceof javax.swing.JButton) { JButton button = (javax.swing.JButton) e.getSource(); if (button == mjbReturn) { actionReturnDoc(); } else if (button == mjbClose) { actionCloseDoc(); } else if (button == mjbOpen) { actionOpenDoc(); } else if (button == mjbViewDps) { actionViewDps(); } else if (button == mjbViewNotes) { actionViewNotes(); } else if (button == mjbViewLinks) { actionViewLinks(); } } } }
mit
btcdraft/draftcoin
src/qt/locale/bitcoin_sl_SI.ts
129315
<?xml version="1.0" ?><!DOCTYPE TS><TS language="sl_SI" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About DraftCoin</source> <translation>O DraftCoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;DraftCoin&lt;/b&gt; version</source> <translation>&lt;b&gt;DraftCoin&lt;/b&gt; verzija</translation> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2018 The DraftCoin developers Copyright © 2015-2018 The DraftCoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or &lt;a href=&quot;http://www.opensource.org/licenses/mit-license.php&quot;&gt;http://www.opensource.org/licenses/mit-license.php&lt;/a&gt;. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (&lt;a href=&quot;https://www.openssl.org/&quot;&gt;https://www.openssl.org/&lt;/a&gt;) and cryptographic software written by Eric Young (&lt;a href=&quot;mailto:eay@cryptsoft.com&quot;&gt;eay@cryptsoft.com&lt;/a&gt;) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Imenik</translation> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Dvakrat kliknite za urejanje naslovov ali oznak</translation> </message> <message> <location line="+24"/> <source>Create a new address</source> <translation>Ustvari nov naslov</translation> </message> <message> <location line="+10"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopiraj trenutno izbrani naslov v odložišče</translation> </message> <message> <location line="-7"/> <source>&amp;New Address</source> <translation>&amp;Nov naslov</translation> </message> <message> <location line="-43"/> <source>These are your DraftCoin 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>To so vaši DraftCoin naslovi za prejemanje plačil. Priporočeno je da vsakemu pošiljatelju namenite drugega in tako dobite večji pregled nad svojimi nakazili.</translation> </message> <message> <location line="+53"/> <source>&amp;Copy Address</source> <translation>&amp;Kopiraj naslov</translation> </message> <message> <location line="+7"/> <source>Show &amp;QR Code</source> <translation>Prikaži &amp;QR kodo</translation> </message> <message> <location line="+7"/> <source>Sign a message to prove you own a DraftCoin address</source> <translation>Podpišite sporočilo, kot dokazilo lastništva DraftCoin naslova</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Podpiši &amp;sporočilo</translation> </message> <message> <location line="+17"/> <source>Delete the currently selected address from the list</source> <translation>Izbriši izbran naslov iz seznama</translation> </message> <message> <location line="-10"/> <source>Verify a message to ensure it was signed with a specified DraftCoin address</source> <translation>Potrdi sporočilo, da zagotovite, da je bilo podpisano z izbranim DraftCoin naslovom</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Potrdi sporočilo</translation> </message> <message> <location line="+10"/> <source>&amp;Delete</source> <translation>&amp;Izbriši</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Kopiraj &amp;oznako</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Uredi</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation>Izvozi podatke imenika</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Datoteka s podatki, ločenimi z vejico (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Napaka pri izvozu datoteke</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Napaka pri pisanju na datoteko %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+145"/> <source>Label</source> <translation>Oznaka</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Naslov</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(ni oznake)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Poziv gesla</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Vnesite geslo</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Novo geslo</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Ponovite novo geslo</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation>Služi kot onemogočenje pošiljanja prostega denarja, v primerih okužbe operacijskega sistema. Ne ponuja prave zaščite.</translation> </message> <message> <location line="+3"/> <source>For staking only</source> <translation>Samo za staking.</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+38"/> <source>Encrypt wallet</source> <translation>Šifriraj denarnico</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>To dejanje zahteva geslo za odklepanje vaše denarnice.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Odkleni denarnico</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>To dejanje zahteva geslo za dešifriranje vaše denarnice.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Dešifriraj denarnico</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Zamenjaj geslo</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Vnesite staro in novo geslo denarnice.</translation> </message> <message> <location line="+45"/> <source>Confirm wallet encryption</source> <translation>Potrdi šifriranje denarnice</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation>Opozorilo: Če šifrirate svojo denarnico in izgubite svoje geslo, boste &lt;b&gt; IZGUBILI VSE SVOJE KOVANCE&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Ali ste prepričani, da želite šifrirati vašo denarnico?</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>POMEMBNO: Vsaka predhodna varnostna kopija datoteke denarnice mora biti nadomeščena z novo datoteko šifrirane denarnice. Zaradi varnostnih razlogov bodo namreč prejšnje varnostne kopije datoteke nešifrirane denarnice postale neuporabne takoj ko boste pričeli uporabljati novo, šifrirano denarnico.</translation> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Opozorilo: imate prižgan Cap Lock</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>Denarnica šifrirana</translation> </message> <message> <location line="-140"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>DraftCoin 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>DraftCoin se bo sedaj zaprl, da dokonča proces šifriranje. Pomnite, da tudi šifriranje vaše denarnice ne more v celoti zaščititi vaših kovancev pred krajo z zlonamernimi programi in računalniškimi virusi, če ti okužijo vaš računalnik.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Šifriranje denarnice je spodletelo</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Šifriranje denarnice spodletelo je zaradi notranje napake. Vaša denarnica ni šifrirana.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>Vnešeno geslo se ne ujema</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>Odklep denarnice spodletel</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Geslo za dešifriranje denarnice, ki ste ga vnesli, ni pravilno.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Dešifriranje denarnice je spodletelo</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Geslo denarnice je bilo uspešno spremenjeno.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+297"/> <source>Sign &amp;message...</source> <translation>Podpiši &amp;sporočilo ...</translation> </message> <message> <location line="-64"/> <source>Show general overview of wallet</source> <translation>Pokaži splošen pregled denarnice</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;Transakcije</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Brskaj po zgodovini transakcij</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation>&amp;Imenik</translation> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation>Uredi seznam shranjenih naslovov in oznak</translation> </message> <message> <location line="-18"/> <source>Show the list of addresses for receiving payments</source> <translation>Prikaži seznam naslovov za prejemanje plačil. </translation> </message> <message> <location line="+34"/> <source>E&amp;xit</source> <translation>I&amp;zhod</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Izhod iz aplikacije</translation> </message> <message> <location line="+4"/> <source>Show information about DraftCoin</source> <translation>Pokaži informacije o DraftCoin</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>O &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Prikaži informacije o Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Možnosti ...</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Šifriraj denarnico ...</translation> </message> <message> <location line="+2"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Ustvari varnostno kopijo denarnice ...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Spremeni geslo ...</translation> </message> <message> <location line="+9"/> <source>&amp;Export...</source> <translation>&amp;Izvozi...</translation> </message> <message> <location line="-55"/> <source>Send coins to a DraftCoin address</source> <translation>Pošlji kovance na DraftCoin naslov</translation> </message> <message> <location line="+39"/> <source>Modify configuration options for DraftCoin</source> <translation>Spremeni nastavitve za DraftCoin</translation> </message> <message> <location line="+17"/> <source>Export the data in the current tab to a file</source> <translation>Izvozi podatke v izbranem zavihku v datoteko</translation> </message> <message> <location line="-13"/> <source>Encrypt or decrypt wallet</source> <translation>Šifriraj ali dešifriraj denarnico</translation> </message> <message> <location line="+2"/> <source>Backup wallet to another location</source> <translation>Napravi varnostno kopijo denarnice na drugo lokacijo</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Spremeni šifrirno geslo denarnice</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation>&amp;Razhroščevalno okno</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Odpri razhroščevalno in diagnostično konzolo</translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>%Potrdi sporočilo ...</translation> </message> <message> <location line="-214"/> <location line="+551"/> <source>DraftCoin</source> <translation>DraftCoin</translation> </message> <message> <location line="-551"/> <source>Wallet</source> <translation>Denarnica</translation> </message> <message> <location line="+193"/> <source>&amp;About DraftCoin</source> <translation>&amp;O DraftCoin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Prikaži / Skrij</translation> </message> <message> <location line="+8"/> <source>Unlock wallet</source> <translation>Odkleni denarnico</translation> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation>&amp;Zakleni denarnico</translation> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation>Zakleni denarnico</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Datoteka</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;Nastavitve</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>&amp;Pomoč</translation> </message> <message> <location line="+17"/> <source>Tabs toolbar</source> <translation>Orodna vrstica zavihkov</translation> </message> <message> <location line="+46"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+58"/> <source>DraftCoin client</source> <translation>DraftCoin program</translation> </message> <message numerus="yes"> <location line="+70"/> <source>%n active connection(s) to DraftCoin network</source> <translation><numerusform>%n aktivne povezave na DraftCoin omrežje</numerusform><numerusform>%n aktivnih povezav na DraftCoin omrežje</numerusform><numerusform>%n aktivnih povezav na DraftCoin omrežje</numerusform><numerusform>%n aktivnih povezav na DraftCoin omrežje</numerusform></translation> </message> <message> <location line="+488"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation>Deležeje [Staking].&lt;br&gt;Teža vašega deleženja je %1&lt;br&gt;Teža celotne mreže deleženja je %2&lt;br&gt;Pričakovan čas do prejema nagrade %3</translation> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation>Ne deležite ker je denarnica zakljenjena</translation> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation>Ne deležite ker denarnica ni povezana</translation> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation>Ne deležite ker se denarnica sinhronizira z omrežjem</translation> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation>Ne deležite ker nimate zrelih kovancev. </translation> </message> <message> <location line="-808"/> <source>&amp;Dashboard</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>&amp;Unlock Wallet...</source> <translation>&amp;Odkleni denarnico...</translation> </message> <message> <location line="+273"/> <source>Up to date</source> <translation>Posodobljeno</translation> </message> <message> <location line="+43"/> <source>Catching up...</source> <translation>Pridobivanje ...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Potrdi transakcijsko provizijo</translation> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Odlivi</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Prilivi</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Datum: %1 Količina: %2 Vrsta: %3 Naslov: %4 </translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation>Rokovanje z URI</translation> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid DraftCoin address or malformed URI parameters.</source> <translation>URI ne more biti razčlenjen! To se lahko zgodi zaradi neveljavnega DraftCoin naslova ali slabih parametrov URI.</translation> </message> <message> <location line="+9"/> <source>Wallet is &lt;b&gt;not encrypted&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Denarnica je &lt;b&gt;šifrirana&lt;/b&gt; in trenutno &lt;b&gt;odklenjena&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Denarnica je &lt;b&gt;šifrirana&lt;/b&gt; in trenutno &lt;b&gt;zaklenjena&lt;/b&gt;</translation> </message> <message> <location line="+24"/> <source>Backup Wallet</source> <translation>Napravi varnostno kopijo denarnice</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Datoteka denarnice (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Ustvarjanje varnostne kopije je spodeltelo </translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Prišlo je do napake ob poskušanju shranjevanja datoteke denarnice na novo lokacijo.</translation> </message> <message numerus="yes"> <location line="+91"/> <source>%n second(s)</source> <translation><numerusform>%n sekundo</numerusform><numerusform>%n sekundama</numerusform><numerusform>%n sekund</numerusform><numerusform>%n sekund</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation><numerusform>%n minuto</numerusform><numerusform>%n minutama</numerusform><numerusform>%n minut</numerusform><numerusform>%n minut</numerusform></translation> </message> <message numerus="yes"> <location line="-429"/> <location line="+433"/> <source>%n hour(s)</source> <translation><numerusform>%n ura</numerusform><numerusform>%n uri</numerusform><numerusform>%n ure</numerusform><numerusform>%n ura</numerusform></translation> </message> <message> <location line="-456"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+27"/> <location line="+433"/> <source>%n day(s)</source> <translation><numerusform>%n dan</numerusform><numerusform>%n dneva</numerusform><numerusform>%n dnevi</numerusform><numerusform>%n dni</numerusform></translation> </message> <message numerus="yes"> <location line="-429"/> <location line="+6"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+0"/> <source>%1 and %2</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+0"/> <source>%n year(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+5"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <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="+23"/> <source>Error</source> <translation type="unfinished"/> </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="+69"/> <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="+324"/> <source>Not staking</source> <translation>Ne deležite</translation> </message> <message> <location filename="../bitcoin.cpp" line="+104"/> <source>A fatal error occurred. DraftCoin can no longer continue safely and will quit.</source> <translation>Prišlo je do usodne napake. Program DraftCoin se ne more več varno nadaljevati in se bo zato zaprl. </translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+110"/> <source>Network Alert</source> <translation>Omrežno Opozorilo</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation>Kontrola kovancev</translation> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation>Količina:</translation> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation>Biti:</translation> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Količina:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation>Prednostno mesto:</translation> </message> <message> <location line="+48"/> <source>Fee:</source> <translation>Provizija:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Nizek output:</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="+552"/> <source>no</source> <translation>ne</translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation>Po proviziji:</translation> </message> <message> <location line="+35"/> <source>Change:</source> <translation>Sprememba:</translation> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation>od/obkljukaj vse</translation> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation>Drevo</translation> </message> <message> <location line="+16"/> <source>List mode</source> <translation>Seznam</translation> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Količina</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation>Oznaka</translation> </message> <message> <location line="+5"/> <source>Address</source> <translation>Naslov</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation>Potrdila</translation> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Potrjeno</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation>Prednostno mesto</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>Kopiraj naslov</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopiraj oznako</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Kopiraj količino</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>Kopiraj ID transakcije</translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation>Kopiraj količino</translation> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation>Kopiraj provizijo</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Kopiraj po proviziji</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Kopiraj bite</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Kopiraj prednostno mesto</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Kopiraj nizek output:</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Kopiraj spremembo</translation> </message> <message> <location line="+317"/> <source>highest</source> <translation>najvišja</translation> </message> <message> <location line="+1"/> <source>high</source> <translation>visoka</translation> </message> <message> <location line="+1"/> <source>medium-high</source> <translation>srednje visoka</translation> </message> <message> <location line="+1"/> <source>medium</source> <translation>srednje</translation> </message> <message> <location line="+4"/> <source>low-medium</source> <translation>srednje nizka</translation> </message> <message> <location line="+1"/> <source>low</source> <translation>nizka</translation> </message> <message> <location line="+1"/> <source>lowest</source> <translation>najnižja</translation> </message> <message> <location line="+155"/> <source>DUST</source> <translation>PRAH</translation> </message> <message> <location line="+0"/> <source>yes</source> <translation>da</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>Ta oznakla se obarva rdeče, če je transakcija večja od 10000 bajtov. To pomeni, da je zahtevana provizija vsaj %1 na kb. Lahko variira +/- 1 Bajt na vnos.</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 &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation>Transakcije z višjo prioriteto imajo višjo verjetnost, da so vključene v blok. Ta oznaka se obarva rdeče, če je prioriteta manjša kot &quot;srednja&quot;. To pomeni, da je zahtevana provizija vsaj %1 na kb.</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>Ta oznaka se obarva rdeče, če prejemnik dobi količino manjšo od %1. To pomeni, da je potrebna vsaj %2 provizija. Zneski pod 0.546 krat minimalna transakcijska provizija so prikazani kot PRAH.</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>Ta oznakla se obarva rdeče, če je sprememba manjša od %1. To pomeni, da je zahtevana provizija vsaj %2.</translation> </message> <message> <location line="+36"/> <location line="+66"/> <source>(no label)</source> <translation>(ni oznake)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation>spremeni iz %1 (%2)</translation> </message> <message> <location line="+1"/> <source>(change)</source> <translation>(spremeni)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Uredi naslov</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Oznaka</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Oznaka povezana s tem vnosom v imeniku</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Naslov</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>Naslov povezan s tem vnosom v imeniku. Spremenite ga lahko le za naslove odlivov.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Nov naslov za prilive</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nov naslov za odlive</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Uredi naslov za prilive</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Uredi naslov za odlive</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Vnešeni naslov &quot;&amp;1&quot; je že v imeniku.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid DraftCoin address.</source> <translation>Vneseni naslov &quot;%1&quot; ni veljaven DraftCoin naslov.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Denarnice ni bilo mogoče odkleniti.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Ustvarjanje novega ključa je spodletelo.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+426"/> <location line="+12"/> <source>DraftCoin-Qt</source> <translation>DraftCoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>različica</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Uporaba:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>možnosti ukazne vrstice</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>možnosti uporabniškega vmesnika</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Nastavi jezik, npr. &quot;sl_SI&quot; (privzeto: jezikovna oznaka sistema)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Zaženi pomanjšano</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Prikaži splash screen ob zagonu (default: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Možnosti</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Glavno</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>Izbirne transakcijske provizije za kB, ki pomagajo pri tem, da so vaše transakcije procesirane hitreje. Večina transakcij je velikih 1 kB. Priporočena je provizija 0.01.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Nakazilo plačila &amp; provizija</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation>Rezervirana količina ne deleži in je tako na voljo za potrošnjo.</translation> </message> <message> <location line="+15"/> <source>Reserve</source> <translation>Rezerva</translation> </message> <message> <location line="+31"/> <source>Automatically start DraftCoin after logging in to the system.</source> <translation>Avtomatično zaženi DraftCoin ob zagonu sistema.</translation> </message> <message> <location line="+3"/> <source>&amp;Start DraftCoin on system login</source> <translation>&amp;Zaženi DraftCoin ob prijavi v sistem</translation> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>&amp;Omrežje</translation> </message> <message> <location line="+6"/> <source>Automatically open the DraftCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Avtomatično odpri vrata na routerju za DraftCoin program. To deluje le če vaš router podpira UPnP in je ta omogočen. </translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Začrtaj vrata z &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the DraftCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Poveži se na DraftCoin omrežje skozi SOCKS proxy (npr. ko se povezujete prek Tora)</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Poveži se skozi SOCKS proxy:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>Proxy &amp;IP:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>IP naslov proxy strežnika (npr. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Vrata:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Vrata strežnika (npr.: 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;različica:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>SOCKS različica proxya (npr.: 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Okno</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Ob pomanjšanju okna prikaži le ikono v odlagališču.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Pomanjšaj v odlagališče namesto v opravilno vrstico</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>Pomanjšaj aplikacijo, ko je okno zaprto. Ko je omogočena ta možnost lahko aplikacijo zaprete le tako, da izberete Izhod v meniju.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>P&amp;omanjšaj ko zapreš</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Prikaz</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>Uporabniški vmesnik &amp;jezik:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting DraftCoin.</source> <translation>Tu lahko nastavite jezik uporabniškega vmesnika. Nastavitve bodo pričele delovati ob ponovnem zagonu DraftCoin aplikacije. </translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Enota prikaza količin:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Izberite privzeto delitev enot, ki naj bodo prikazane v vmesniku ob pošiljanju kovancev.</translation> </message> <message> <location line="+9"/> <source>Whether to show coin control features or not.</source> <translation>Izbira prikaza lastnosti kontrole kovancev.</translation> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation>Prikaži lastnosti &amp;kontrole kovancev (samo za strokovnjake!)</translation> </message> <message> <location line="+7"/> <source>Whether to select the coin outputs randomly or with minimal coin age.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Minimize weight consumption (experimental)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use black visual theme (requires restart)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;Potrdi</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Prekini</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Uporabi</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>privzeto</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation>Opozorilo</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting DraftCoin.</source> <translation>Ta nastavitev bo pričela delovati ob ponovnem zagonu DraftCoin aplikacije</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Podan naslov proxy strežnika je neveljaven.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Oblika</translation> </message> <message> <location line="+46"/> <location line="+247"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the DraftCoin network after a connection is established, but this process has not completed yet.</source> <translation>Prikazane informacije so morda zastarele. Vaša denarnica se avtomatično sinhronizira z DraftCoin omrežjem, ko je vzpostavljena povezava, toda ta proces še ni bil zaključen.</translation> </message> <message> <location line="-173"/> <source>Stake:</source> <translation>Deleženje:</translation> </message> <message> <location line="+32"/> <source>Unconfirmed:</source> <translation>Nepotrjeni:</translation> </message> <message> <location line="-113"/> <source>Wallet</source> <translation>Denarnica</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation>Razpoložljivi:</translation> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation>Vaše trenutno razpoložljivo stanje</translation> </message> <message> <location line="+80"/> <source>Immature:</source> <translation>Nezreli:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Z deleženjem pridobljeni kovanci, ki še niso dozoreli.</translation> </message> <message> <location line="+23"/> <source>Total:</source> <translation>Skupaj:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation>Vaše trenutno skupno stanje</translation> </message> <message> <location line="+50"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Pogoste transakcije&lt;/&gt;</translation> </message> <message> <location line="-118"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Znesek transakcij, ki še niso bile potrjene in se še ne upoštevajo v trenutnem stanju na računu.</translation> </message> <message> <location line="-32"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation>Znesek kovancev, ki so bili v deleženju in se še ne upoštevajo v trenutnem stanju na računu.</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>nesinhronizirano</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start DraftCoin: 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>QR koda </translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Zahtevaj plačilo</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Znesek:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Oznaka:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Sporočilo:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Shrani kot...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Napaka pri šifriranju URI v QR kodo.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Vnesen znesek je neveljaven, prosimo preverite vnos.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>URI predolg, skušajte zmanjšati besedilo oznake/sporočila.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Shrani QR kodo</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG slike (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Ime odjemalca</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"/> <source>N/A</source> <translation>Neznano</translation> </message> <message> <location line="-194"/> <source>Client version</source> <translation>Različica odjemalca</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informacije</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>OpenSSL različica v rabi</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Čas zagona</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Omrežje</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Število povezav</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Na testnet</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>veriga blokov</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Trenutno število blokov</translation> </message> <message> <location line="+197"/> <source>&amp;Network Traffic</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Clear</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Totals</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>In:</source> <translation type="unfinished"/> </message> <message> <location line="+80"/> <source>Out:</source> <translation type="unfinished"/> </message> <message> <location line="-383"/> <source>Last block time</source> <translation>Čas zadnjega bloka</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Odpri</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Možnosti ukazne vrstice.</translation> </message> <message> <location line="+7"/> <source>Show the DraftCoin-Qt help message to get a list with possible DraftCoin command-line options.</source> <translation>Prikaži DraftCoin-Qt sporočilo za pomoč , ki prikaže vse možnosti ukazne vrstice DraftCoin aplikacije</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Prikaži</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Konzola</translation> </message> <message> <location line="-237"/> <source>Build date</source> <translation>Datum izgradnje</translation> </message> <message> <location line="-104"/> <source>DraftCoin - Debug window</source> <translation>DraftCoin - okno za odpravljanje napak</translation> </message> <message> <location line="+25"/> <source>DraftCoin Core</source> <translation>DraftCoin jedro</translation> </message> <message> <location line="+256"/> <source>Debug log file</source> <translation>Razhroščevalna dnevniška datoteka</translation> </message> <message> <location line="+7"/> <source>Open the DraftCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Odpri DraftCoin datoteko zapisov odpravljanja napak iz trenutnega direktorija podatkov. Če so datoteke zapisov velike, to lahko traja nekaj sekund.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Počisti konzolo</translation> </message> <message> <location filename="../rpcconsole.cpp" line="+325"/> <source>Welcome to the DraftCoin RPC console.</source> <translation>Dobrodošli v DraftCoin RPC konzoli.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Za navigiranje po zgodovini uporabite puščici gor in dol, in &lt;b&gt;Ctrl-L&lt;/b&gt; za izpraznjenje zaslona.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Vtipkaj &lt;b&gt;pomoč&lt;/b&gt; za vpogled v razpožljive ukaze.</translation> </message> <message> <location line="+127"/> <source>%1 B</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 KB</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 MB</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 GB</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>%1 m</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>%1 h</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 h %2 m</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+181"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Pošlji kovance</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation>Funkcije kontrole kovancev</translation> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation>Vnosi...</translation> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation>samodejno izbran</translation> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation>Premalo sredstev!</translation> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation>Količina:</translation> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation>0</translation> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation>Biti:</translation> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>Znesek:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 DFT</source> <translation>123.456 DFT {0.00 ?}</translation> </message> <message> <location line="-191"/> <source>Priority:</source> <translation>Prednostno mesto:</translation> </message> <message> <location line="+19"/> <source>medium</source> <translation>srednje</translation> </message> <message> <location line="+32"/> <source>Fee:</source> <translation>Provizija:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Nizek output:</translation> </message> <message> <location line="+19"/> <source>no</source> <translation>ne</translation> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation>Po proviziji:</translation> </message> <message> <location line="+35"/> <source>Change</source> <translation>Sprememba</translation> </message> <message> <location line="+50"/> <source>custom change address</source> <translation>izbira spremembe naslova</translation> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>Pošlji več prejemnikom hkrati</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Dodaj &amp;prejemnika</translation> </message> <message> <location line="+16"/> <source>Remove all transaction fields</source> <translation>Odstrani vsa polja transakcij</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Počisti &amp;vse</translation> </message> <message> <location line="+24"/> <source>Balance:</source> <translation>Dobroimetje:</translation> </message> <message> <location line="+16"/> <source>123.456 DFT</source> <translation>123.456 DFT</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Potrdi odlivno dejanje</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>P&amp;ošlji</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a DraftCoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation>Vnesite DraftCoin naslov (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation>Kopiraj količino</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopiraj količino</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation>Kopiraj provizijo</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Kopiraj po proviziji</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Kopiraj bite</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Kopiraj prednostno mesto</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Kopiraj nizek output</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Kopiraj spremembo</translation> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Potrdi odliv kovancev </translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Ali ste prepričani, da želite poslati %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>in</translation> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>Prejemnikov naslov ni veljaven, prosimo če ga ponovno preverite.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Količina za plačilo mora biti večja od 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Količina presega vaše dobroimetje</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Seštevek presega vaše stanje na računu ko je vključen %1 provizije na transakcijo. </translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Najdena kopija naslova, možnost pošiljanja na vsakega izmed naslov le enkrat ob pošiljanju.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Napaka: Transakcija je bila zavrnjena. To se je lahko zgodilo, če so bili kovanci v vaši denarnici že zapravljeni, na primer če ste uporabili kopijo wallet.dat in so bili kovanci zapravljeni v kopiji, a tu še niso bili označeni kot zapravljeni.</translation> </message> <message> <location line="+247"/> <source>WARNING: Invalid DraftCoin address</source> <translation>OPOZORILO: Neveljaven DraftCoin naslov</translation> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(ni oznake)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation>OPOZORILO: neznana sprememba naslova</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Oblika</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>K&amp;oličina:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Prejemnik &amp;plačila:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</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>Vnesite oznako za ta naslov, ki bo shranjena v imenik</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Oznaka:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Izberite naslov iz imenika</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>Prilepi naslov iz odložišča</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>Odstrani tega prejemnika</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a DraftCoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation>Vnesite DraftCoin naslov (npr. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Podpisi - Podpiši/potrdi sporočilo</translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>&amp;Podpiši sporočilo</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>Sporočila lahko podpišete s svojim naslovom, da dokažete lastništvo. Bodite previdni, saj vas lahko phishing napadi skušajo pretentati v to, da jim prepišete svojo identiteto. Podpisujte le jasne in razločne izjave, s katerimi se strinjate.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation>Naslov s katerim želite podpisati sporočilo (npr. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation>Izberite naslov iz imenika</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>Prilepi naslov iz odložišča</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>Vnesite sporočilo, ki ga želite podpisati</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation>Kopiraj trenutno izbrani naslov v odložišče</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this DraftCoin address</source> <translation>Podpišite sporočilo, kot dokazilo lastništva DraftCoin naslova</translation> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation>Ponastavite vse polja sporočila s podpisom</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Počisti &amp;vse </translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>&amp;Potrdi sporočilo</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>Vnesite naslov za podpis, sporočilo (poskribte da točno skopirate presledke med vrsticami, črkami, itd.) in podpis spodaj, da potrdite sporočilo Da se ognete napadom posrednika, bodite pozorni, da ne boste v podpisu ugledali več, kot je v podpisanemu sporočilu samem.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation>Naslov s katerim je bilo podpisano sporočilo (npr. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified DraftCoin address</source> <translation>Potrdite sporočilo, da zagotovite, da je bilo podpisano z izbranim DraftCoin naslovom</translation> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>Ponastavite vse polja sporočila potrditve</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a DraftCoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation>Vnesite DraftCoin naslov (npr. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Kliknite &quot;Podpiši sporočilo&quot; za ustvaritev podpisa</translation> </message> <message> <location line="+3"/> <source>Enter DraftCoin signature</source> <translation>Vnesite DraftCoin podpis</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Vnešeni naslov ni veljaven.</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>Prosimo preverite naslov in poizkusite znova.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Vnešen naslov se ne nanaša na ključ.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Odklepanje denarnice je bilo prekinjeno.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Zasebni ključ vnešenega naslov ni na voljo.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Podpisovanje sporočila spodletelo.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Sporočilo podpisano.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Ni bilo mogoče dešifrirati podpisa.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Prosimo preverite podpis in poizkusite znova.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Podpis se ni ujemal s povzetkom sporočila.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Pregledovanje sporočila spodletelo.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Sporočilo pregledano.</translation> </message> </context> <context> <name>TrafficGraphWidget</name> <message> <location filename="../trafficgraphwidget.cpp" line="+75"/> <source>KB/s</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+25"/> <source>Open until %1</source> <translation>Odpri enoto %1</translation> </message> <message> <location line="+6"/> <source>conflicted</source> <translation>sporen</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/nepotrjeno</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 potrdil</translation> </message> <message> <location line="+17"/> <source>Status</source> <translation>Stanje</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, predvajanje skozi %n vozlišče</numerusform><numerusform>, predvajanje skozi %n vozlišči</numerusform><numerusform>, predvajanje skozi %n vozlišč</numerusform><numerusform>, predvajanje skozi %n vozlišč</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Izvor</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Generirano</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Pošiljatelj</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Prejemnik</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>lasten naslov</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>oznaka</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>dozori čez %n blok</numerusform><numerusform>dozori čez %n bloka</numerusform><numerusform>dozori čez %n blokov</numerusform><numerusform>dozori čez %n blokov</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>ni bilo sprejeto</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Dolg</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Provizija transakcije</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Neto količina</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Sporočilo</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Opomba</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID transakcije</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 51 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 &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Ustvarjeni kovanci morajo zoreti 510 blokov preden so lahko potrošeni. Ko ustvarite ta blok, je predvajan po mreži in nanizan v verigo blokov. Če mu priključitev na verigo spodleti, se bo njegovo stanje spremenilo v &quot;ni sprejet&quot; in ne bo razpoložljiv. To se lahko občasno zgodi, če drugo vozlišče ustvari blok par sekund pred vami. </translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Razhroščevalna informacija</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transakcija</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation>Vnosi</translation> </message> <message> <location line="+21"/> <source>Amount</source> <translation>Količina</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>pravilno</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>nepravilno</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, še ni bil uspešno predvajan</translation> </message> <message numerus="yes"> <location line="-36"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+71"/> <source>unknown</source> <translation>neznano</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Podrobnosti transakcije</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>To podokno prikazuje podroben opis transakcije</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+231"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Vrsta</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Naslov</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Količina</translation> </message> <message> <location line="+52"/> <source>Open until %1</source> <translation>Odpri enoto %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Potrjeno (%1 potrdil)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation><numerusform>Odprt še %n blok</numerusform><numerusform>Odprt še %n bloka</numerusform><numerusform>Odprt še %n blokov</numerusform><numerusform>Odprt še %n blokov</numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation>Nepovezan</translation> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation>Nepotrjeno</translation> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation>Potrjuje (%1 od %2 priporočenih potrditev)</translation> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation>Sporen</translation> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation>Nezrel (%1 potrditev, na voljo bo po %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>Ta blok ni prejelo še nobeno vozlišče. Najverjetneje ne bo sprejet!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Generirano, toda ne sprejeto</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>Prejeto z</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Prejeto od</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Poslano</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Izplačilo sebi</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Minirano</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(ni na voljo)</translation> </message> <message> <location line="+194"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Stanje transakcije. Zapeljite z miško čez to polje za prikaz števila potrdil. </translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Datum in čas, ko je transakcija bila prejeta.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Vrsta transakcije.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Naslov prejemnika transakcije.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Količina odlita ali prilita dobroimetju.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+54"/> <location line="+17"/> <source>All</source> <translation>Vse</translation> </message> <message> <location line="-16"/> <source>Today</source> <translation>Danes</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Ta teden</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Ta mesec</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Prejšnji mesec</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>To leto</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Območje ...</translation> </message> <message> <location line="+12"/> <source>Received with</source> <translation>Prejeto z</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Poslano</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Samemu sebi</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Minirano</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Drugo</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Vnesite naslov ali oznako za iskanje</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Minimalna količina</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Kopiraj naslov</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopiraj oznako</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopiraj količino</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Kopiraj ID transakcije</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Uredi oznako</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Prikaži podrobnosti transakcije</translation> </message> <message> <location line="+138"/> <source>Export Transaction Data</source> <translation>Izvozi podatke transakcij</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Datoteka s podatki, ločenimi z vejico (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Potrjeno</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Vrsta</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Oznaka</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Naslov</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Količina</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Napaka pri izvažanju podatkov</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Napaka pri pisanju na datoteko %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Območje:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>za</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+208"/> <source>Sending...</source> <translation>Pošiljanje...</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+173"/> <source>DraftCoin version</source> <translation>DraftCoin različica</translation> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Uporaba:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or DraftCoind</source> <translation>Pošlji ukaz na -server ali blackoind</translation> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Prikaži ukaze</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Prikaži pomoč za ukaz</translation> </message> <message> <location line="-147"/> <source>Options:</source> <translation>Možnosti:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: DraftCoin.conf)</source> <translation>Določi konfiguracijsko datoteko (privzeto: DraftCoin.conf)</translation> </message> <message> <location line="+1"/> <source>Specify pid file (default: DraftCoind.pid)</source> <translation>Določi pid datoteko (privzeto: DraftCoin.pid)</translation> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation>Določi datoteko denarnice (znotraj imenika s podatki)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Določi podatkovni imenik</translation> </message> <message> <location line="-25"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=DraftCoinrpc 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 &quot;DraftCoin Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Nastavi pomnilnik podatkovne zbirke v megabajtih (privzeto: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation>Nastavi velikost zapisa podatkovne baze na disku v megabajtih (privzeto: 100)</translation> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 20302 or testnet: 27991)</source> <translation>Sprejmi povezave na &lt;port&gt; (privzeta vrata: 20302 ali testnet: 27991) </translation> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Obdrži maksimalno število &lt;n&gt; povezav (privzeto: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Poveži se na vozlišče da pridobiš naslove soležnikov in prekini povezavo</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>Določite vaš lasten javni naslov</translation> </message> <message> <location line="+4"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation>Naveži na dani naslov. Uporabi [host]:port ukaz za IPv6</translation> </message> <message> <location line="+1"/> <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Always query for peer addresses via DNS lookup (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Prag za prekinitev povezav s slabimi odjemalci (privzeto: 1000)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Število sekund preden se ponovno povežejo neodzivni soležniki (privzeto: 86400)</translation> </message> <message> <location line="-37"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Prišlo je do napake pri nastavljanju RPC porta %u za vhodne povezave na IPv4: %s</translation> </message> <message> <location line="+65"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 20304 or testnet: 27992)</source> <translation>Sprejmi povezave na &lt;port&gt; (privzeta vrata: 20302 ali testnet: 27991) </translation> </message> <message> <location line="-17"/> <source>Accept command line and JSON-RPC commands</source> <translation>Sprejmi ukaze iz ukazne vrstice in JSON-RPC</translation> </message> <message> <location line="+1"/> <source>Run in the background as a daemon and accept commands</source> <translation>Teci v ozadju in sprejemaj ukaze</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Uporabi testno omrežje</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Sprejmi zunanje povezave (privzeto: 1 če ni nastavljen -proxy ali -connect)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Prišlo je do napake pri nastavljanju RPC porta %u za vhodne povezave na IPv6: %s</translation> </message> <message> <location line="+96"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Nastavi maksimalno velikost visoke-prioritete/nizke-provizije transakcij v bajtih (privzeto: 27000)</translation> </message> <message> <location line="+12"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Opozorilo: -paytxfee je nastavljen zelo visoko! To je transakcijska provizija, ki jo boste plačali ob pošiljanju transakcije.</translation> </message> <message> <location line="-103"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong DraftCoin will not work properly.</source> <translation>Opozorilo: Prosimo preverite svoj datum in čas svojega računalnika! Če je vaša ura nastavljena napačno DraftCoin ne bo deloval.</translation> </message> <message> <location line="+132"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Opozorilo: napaka pri branju wallet.dat! Vsi ključi so bili pravilno prebrani, podatki o transakciji ali imenik vnešenih naslovov so morda izgubljeni ali nepravilni.</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>Opozorilo: wallet.dat je pokvarjena, podatki rešeni! Originalna wallet.dat je bila shranjena kot denarnica. {timestamp}.bak v %s; če imate napačno prikazano stanje na računu ali v transakcijah prenovite datoteko z varnostno kopijo. </translation> </message> <message> <location line="-31"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Poizkusi rešiti zasebni ključ iz pokvarjene wallet.dat </translation> </message> <message> <location line="+5"/> <source>Block creation options:</source> <translation>Možnosti ustvarjanja blokov:</translation> </message> <message> <location line="-69"/> <source>Connect only to the specified node(s)</source> <translation>Poveži se samo na določena vozlišče(a)</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Odkrij svoj IP naslov (privzeto: 1 ob poslušanju, ko ni aktiviran -externalip)</translation> </message> <message> <location line="+101"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Poslušanje za vrata je spodletelo. Če želite lahko uporabite ukaz -listen=0.</translation> </message> <message> <location line="-91"/> <source>Sync checkpoints policy (default: strict)</source> <translation>Sinhronizacija načina točk preverjanja (privzeto: strogo)</translation> </message> <message> <location line="+89"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Neveljaven -tor naslov: &apos;%s&apos;</translation> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation>Neveljavni znesek za -reservebalance=&lt;amount&gt;</translation> </message> <message> <location line="-88"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Največji sprejemni medpomnilnik glede na povezavo, &lt;n&gt;*1000 bytov (privzeto: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Največji oddajni medpomnilnik glede na povezavo, &lt;n&gt;*1000 bytov (privzeto: 1000)</translation> </message> <message> <location line="-17"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Poveži se samo z vozlišči v omrežju &lt;net&gt; (IPv4, IPv6 in Tor)</translation> </message> <message> <location line="+31"/> <source>Prepend debug output with timestamp</source> <translation>Opremi output rahroščevanja s časovnim žigom. </translation> </message> <message> <location line="+41"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>SSL možnosti: (glejte Bitcoin Wiki za navodla, kako nastaviti SSL)</translation> </message> <message> <location line="-81"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Izberi verzijo socks proxya za uporabo (4-5, privzeto: 5)</translation> </message> <message> <location line="+42"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Pošlji sledilne/razhroščevalne informacije v konzolo namesto jih shraniti v debug.log datoteko</translation> </message> <message> <location line="+5"/> <source>Send trace/debug info to debugger</source> <translation>Pošlji sledilne/razhroščevalne informacije v razhroščevalnik</translation> </message> <message> <location line="+30"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Nastavi največjo velikost bloka v bajtih (privzeto: 250000)</translation> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Nastavi najmanjšo velikost bloka v bajtih (privzeto: 0)</translation> </message> <message> <location line="-35"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Skrči debug.log datoteko ob zagonu aplikacije (privzeto: 1 ko ni aktiviran -debug)</translation> </message> <message> <location line="-43"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Določi čas pavze povezovanja v milisekundah (privzeto: 5000)</translation> </message> <message> <location line="+116"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation>Ni bilo mogoče vpisati točke preverjanja, napačen ključ za točko preverjanja? </translation> </message> <message> <location line="-86"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Uporabi UPnP za mapiranje vrat poslušanja (privzeto: 0)</translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Uporabi UPnP za mapiranje vrat poslušanja (privzeto: 1 med poslušanjem)</translation> </message> <message> <location line="-26"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Uporabi proxy za povezavo s skritimi storitvami tora (privzeto: isto kot -proxy) </translation> </message> <message> <location line="+47"/> <source>Username for JSON-RPC connections</source> <translation>Uporabniško ime za JSON-RPC povezave</translation> </message> <message> <location line="+51"/> <source>Verifying database integrity...</source> <translation>Potrdite neoporečnost baze podatkov...</translation> </message> <message> <location line="+44"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <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>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <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="+7"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation>OPOZORILO: zaznana je bila kršitev s sinhronizirami točkami preverjanja, a je bila izpuščena.</translation> </message> <message> <location line="-1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Opozorilo: ta različica je zastarela, potrebna je nadgradnja!</translation> </message> <message> <location line="-54"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat poškodovana, neuspešna obnova</translation> </message> <message> <location line="-56"/> <source>Password for JSON-RPC connections</source> <translation>Geslo za JSON-RPC povezave</translation> </message> <message> <location line="-32"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation>Sinhroniziraj čas z drugimi vozlišči. Onemogoči, če je čas na vašem sistemu točno nastavljen, npr. sinhroniziranje z NTP (privzeto: 1)</translation> </message> <message> <location line="+13"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation>Ob ustvarjanju transakcij, prezri vnose z manjšo vrednostjo kot (privzeto: 0.01)</translation> </message> <message> <location line="+6"/> <source>Output debugging information (default: 0, supplying &lt;category&gt; is optional)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>If &lt;category&gt; is not supplied, output all debugging information.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&lt;category&gt; can be:</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Dovoli JSON-RPC povezave z določenega IP naslova</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Pošlji ukaze vozlišču na &lt;ip&gt; (privzet: 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Wait for RPC server to start</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Izvrši ukaz, ko se najboljši blok spremeni (%s je v cmd programu nadomeščen z zgoščenimi bloki).</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Izvedi ukaz, ko bo transakcija denarnice se spremenila (V cmd je bil TxID zamenjan za %s)</translation> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation>Zahtevaj potrditve za spremembo (default: 0)</translation> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Izvrši ukaz, ko je prejet relevanten alarm (%s je v cmd programu nadomeščen s sporočilom)</translation> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>Posodobi denarnico v najnovejši zapis</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Nastavi velikost ključa bazena na &lt;n&gt; (privzeto: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Ponovno preglej verigo blokov za manjkajoče transakcije denarnice</translation> </message> <message> <location line="+3"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation>Kako temeljito naj bo preverjanje blokov (0-6, privzeto: 1)</translation> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation>Uvozi bloke iz zunanje blk000?.dat datoteke</translation> </message> <message> <location line="+9"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Uporabi OpenSSL (https) za JSON-RPC povezave</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Datoteka potrdila strežnika (privzeta: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Zasebni ključ strežnika (privzet: server.pem)</translation> </message> <message> <location line="+10"/> <source>Initialization sanity check failed. DraftCoin is shutting down.</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <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="+3"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation>OPOZORILO: Najdene so bile neveljavne točke preverjanja! Prikazane transakcije so morda napačne! Poiščite novo različico aplikacije ali pa obvestite razvijalce.</translation> </message> <message> <location line="-174"/> <source>This help message</source> <translation>To sporočilo pomoči</translation> </message> <message> <location line="+104"/> <source>Wallet %s resides outside data directory %s.</source> <translation>Denarnica %s se nahaja zunaj datotečnega imenika %s.</translation> </message> <message> <location line="+37"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Na tem računalniku je bilo nemogoče vezati na %s (bind returned error %d, %s)</translation> </message> <message> <location line="-133"/> <source>Connect through socks proxy</source> <translation>Poveži se skozi socks proxy</translation> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Omogoči DNS povezave za -addnode, -seednode in -connect</translation> </message> <message> <location line="+126"/> <source>Loading addresses...</source> <translation>Nalaganje naslovov ...</translation> </message> <message> <location line="-12"/> <source>Error loading blkindex.dat</source> <translation>Napaka pri nalaganju blkindex.dat</translation> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Napaka pri nalaganju wallet.dat: denarnica pokvarjena</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of DraftCoin</source> <translation>Napaka pri nalaganju wallet.dat: denarnica zahteva novejšo verzijo DraftCoin</translation> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart DraftCoin to complete</source> <translation>Denarnica mora biti prepisana: ponovno odprite DraftCoin za dokončanje</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Napaka pri nalaganju wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Neveljaven -proxy naslov: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Neznano omrežje določeno v -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Zahtevana neznana -socks proxy različica: %i</translation> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Ni mogoče določiti -bind naslova: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Ni mogoče določiti -externalip naslova: &apos;%s&apos;</translation> </message> <message> <location line="-23"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Neveljavni znesek za -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+60"/> <source>Sending...</source> <translation>Pošiljanje...</translation> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Neveljavna količina</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Premalo sredstev</translation> </message> <message> <location line="-40"/> <source>Loading block index...</source> <translation>Nalaganje indeksa blokov ...</translation> </message> <message> <location line="-110"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Dodaj vozlišče za povezavo nanj in skušaj le to obdržati odprto</translation> </message> <message> <location line="+125"/> <source>Unable to bind to %s on this computer. DraftCoin is probably already running.</source> <translation>Navezava v %s na tem računalniku ni mogoča DraftCoin aplikacija je verjetno že zagnana.</translation> </message> <message> <location line="-101"/> <source>Fee per KB to add to transactions you send</source> <translation>Provizija na KB ki jo morate dodati transakcijam, ki jih pošiljate</translation> </message> <message> <location line="+34"/> <source>Minimize weight consumption (experimental) (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>How many blocks to check at startup (default: 500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Keep at most &lt;n&gt; unconnectable blocks in memory (default: %u)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Neveljavni znesek za -miniput=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. DraftCoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Loading wallet...</source> <translation>Nalaganje denarnice ...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>Ne morem </translation> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>Ni mogoče zapisati privzetega naslova</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>Ponovno pregledovanje ...</translation> </message> <message> <location line="+2"/> <source>Done loading</source> <translation>Nalaganje končano</translation> </message> <message> <location line="-161"/> <source>To use the %s option</source> <translation>Za uporabo %s opcije</translation> </message> <message> <location line="+188"/> <source>Error</source> <translation>Napaka</translation> </message> <message> <location line="-18"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Nastaviti morate rpcpassword=&lt;password&gt; v konfiguracijski datoteki: %s Če datoteka ne obstaja, jo ustvarite z lastniškimi dovoljenji za datoteke.</translation> </message> </context> </TS>
mit
lucky/pedant
lib/pedant.rb
1254
module Pedant class TypeError < StandardError; end class GuardError < StandardError; end module Dummy def self.included(base) base.extend ClassMethods Class.extend ClassMethods end def self.extended(base) base.extend ClassMethods Class.extend ClassMethods end module ClassMethods; def returns(*args, &block); end; end end module Returns def self.included(base) base.extend ClassMethods Class.extend ClassMethods end def self.extended(base) base.extend ClassMethods Class.extend ClassMethods end module ClassMethods def returns(sym, *klasses, &block) old_method = instance_method(sym) self.send(:define_method, sym) do |*args| ret = old_method.bind(self).call(*args) # Type check unless klasses.empty? or klasses.any?{|klass| ret.is_a?(klass) } raise Pedant::TypeError, "Bad return value! Got #{ret.inspect}, " \ "expected instance of #{klasses.inspect}." end # User-defined guard unless block.nil? or block.call(ret) raise Pedant::GuardError, "Did not pass user-defined guard." end ret end end end end end
mit
daftshady/dropbytes-client
dropbytes/option.py
1435
""" dropbytes.option ~~~~~~~~~~~~~~~~ """ class ParseError(Exception): pass class OptionParser(object): """Command-line option parser. Available options are not implemented yet. """ def __init__(self): self._FILENAME_LIMIT = 128 self._available = [] @property def raw(self): return self._options def parse(self, args): if len(args) == 1: raise ParseError('Error: Filename must be provided') global global_option if len(args[-1]) > self._FILENAME_LIMIT: raise ParseError('Filename cannot exceed 128 bytes') if '/' in args[-1]: raise ParseError('DO NOT USE path indentifier / to filename. ') global_option.filename = args[-1] for i in range(1, len(args) - 1): if not args[i].startswith('-'): raise ParseError('Error: Invalid options') global_option.args.append(args[i]) class Option(object): def __init__(self): self._filename = None self._args = None @property def filename(self): return self._filename @filename.setter def filename(self, v): self._filename = v @property def args(self): return self._args @args.setter def args(self, v): self._args = v def process(self): pass global_option = Option() global_parser = OptionParser()
mit
andrisazens/learning-angular
tutorials/tour-of-heroes/src/app/hero-search.component.js
3032
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var core_1 = require('@angular/core'); var router_1 = require('@angular/router'); var Observable_1 = require('rxjs/Observable'); var Subject_1 = require('rxjs/Subject'); // Observable class extensions require('rxjs/add/observable/of'); // Observable operators require('rxjs/add/operator/catch'); require('rxjs/add/operator/debounceTime'); require('rxjs/add/operator/distinctUntilChanged'); var hero_search_service_1 = require('./hero-search.service'); var HeroSearchComponent = (function () { function HeroSearchComponent(heroSearchService, router) { this.heroSearchService = heroSearchService; this.router = router; this.searchTerms = new Subject_1.Subject(); } // Push a search term into the observable stream. HeroSearchComponent.prototype.search = function (term) { this.searchTerms.next(term); }; HeroSearchComponent.prototype.ngOnInit = function () { var _this = this; this.heroes = this.searchTerms .debounceTime(300) // wait 300ms after each keystroke before considering the term .distinctUntilChanged() // ignore if next search term is same as previous .switchMap(function (term) { return term // switch to new observable each time the term changes ? _this.heroSearchService.search(term) : Observable_1.Observable.of([]); }) .catch(function (error) { // TODO: add real error handling console.log(error); return Observable_1.Observable.of([]); }); }; HeroSearchComponent.prototype.gotoDetail = function (hero) { var link = ['/detail', hero.id]; this.router.navigate(link); }; HeroSearchComponent = __decorate([ core_1.Component({ selector: 'hero-search', templateUrl: './app/hero-search.component.html', styleUrls: ['./app/hero-search.component.css'], providers: [hero_search_service_1.HeroSearchService] }), __metadata('design:paramtypes', [hero_search_service_1.HeroSearchService, router_1.Router]) ], HeroSearchComponent); return HeroSearchComponent; }()); exports.HeroSearchComponent = HeroSearchComponent; //# sourceMappingURL=hero-search.component.js.map
mit
malja/cvut-python
cviceni10/01_genealogy.py
3129
import sys def loadFile( filename ): people = [] with open( filename ) as file: for line in file: line = line.replace("\n", "").split(" ") print(line) if len( line ) != 5: return False people.append( line ) return people class Person: def __init__(self, name, sex): self.name = name self.sex = sex self.children = [] self.parents = [] #parents of this node self.partner = None #partner (=husbad/wife of this node) def addChild(self, node): self.children.append(node) def addParent(self, node): self.parents.append(node) def addPartner(self, node): self.partner = node def __repr__(self): s = "Male" if (self.sex == 'F'): s = "Female" return self.name + " " + s def isChildren(self): return len(parents) > 0 class Tree: def __init__( self ): self.people = [] self.root = None def getPersonByName( self, name ): for person in self.people: if person.name == name: return person return None def add( self, name, sex ): person = self.getPersonByName( name ) if person == None: self.people.append( Person( name, sex ) ) return self.people[-1] return person def setRelationship( self, name1, name2 ): person1 = self.getPersonByName( name1 ) person2 = self.getPersonByName( name2 ) if person1 == None or person2 == None: return None # Trochu slušnosti, lidi! if person1.sex == person2.sex: return False person1.addPartner( person2 ) person2.addPartner( person1 ) return True def getAllGrandsons( self, name ): grandsons = [] person = self.getPersonByName( name ) if person != None: for child in person.children: for grandchild in child.children: if grandchild.sex == "M": grandsons.append( grandchild ) else: return None return grandsons data = loadFile( sys.argv[1] ) tree = Tree() for record in data: # Pokud jde o záznam manželů if record[0] == "M": tree.add( record[1], record[3] ) tree.add( record[2], record[4] ) state = tree.setRelationship( record[1], record[2] ) if state == None: print("Osoby neexistují, nejdřív je vložte") exit() elif state == False: print("Trochu slušnosti, lidi!") exit() # Pokud jde o záznam rodičovství elif record[0] == "P": # Rodič parent = tree.add( record[1], record[3] ) # Potomek child = tree.add( record[2], record[4] ) # Pridání rodičovství parent.addChild( child ) child.parents.append( parent ) else: print("ERROR") exit() print( tree.getAllGrandsons("Jana") )
mit
colinmathews/node-workhorse-aws
dist/lib/services/s3-state-manager.js
6890
"use strict"; require('date-format-lite'); var es6_promise_1 = require('es6-promise'); var aws_sdk_1 = require('aws-sdk'); var S3StateManager = (function () { function S3StateManager(config) { this.config = config; aws_sdk_1.config.update({ credentials: new aws_sdk_1.Credentials(config.accessKeyId, config.secretAccessKey), region: config.region }); } S3StateManager.translateNumericIDIntoID = function (id) { var now = new Date(); return now.format('YYYY-MM-DD-') + id.toString(); }; S3StateManager.calculateNextID = function () { if (S3StateManager.nextNumericID) { S3StateManager.nextNumericID++; return S3StateManager.translateNumericIDIntoID(S3StateManager.nextNumericID); } var state = S3StateManager.stateMap; if (!state) { S3StateManager.nextNumericID = 1; } else { var previousID = S3StateManager.nextNumericID; S3StateManager.nextNumericID = Object.keys(state).reduce(function (result, key) { var parsedKey = key.substring('YYYY-MM-DD-'.length); var id = parseInt(parsedKey, 10); if (!isNaN(id) && id >= result) { return id + 1; } return result; }, 1); if (S3StateManager.nextNumericID === previousID) { throw new Error('Expected id to be incremented: ' + S3StateManager.nextNumericID); } } return S3StateManager.translateNumericIDIntoID(S3StateManager.nextNumericID); }; S3StateManager.prototype.save = function (work) { var _this = this; return this.readDB() .then(function () { if (_this.hasChanged(work)) { _this.saveToMap(work); return _this.writeDB(); } }); }; S3StateManager.prototype.saveAll = function (work) { var _this = this; return this.readDB() .then(function () { var anyChanged = work.reduce(function (result, row) { return result || _this.hasChanged(row); }, false); if (anyChanged) { work.forEach(function (row) { _this.saveToMap(row); }); return _this.writeDB(); } }); }; S3StateManager.prototype.saveWorkStarted = function (work) { return this.save(work); }; S3StateManager.prototype.saveWorkEnded = function (work) { return this.save(work); }; S3StateManager.prototype.saveFinalizerStarted = function (work) { return this.save(work); }; S3StateManager.prototype.saveFinalizerEnded = function (work) { return this.save(work); }; S3StateManager.prototype.saveCreatedChildren = function (work) { return this.save(work); }; S3StateManager.prototype.load = function (id) { return this.readDB() .then(function () { return S3StateManager.stateMap[id]; }); }; S3StateManager.prototype.loadAll = function (ids) { return this.readDB() .then(function () { return ids.map(function (id) { return S3StateManager.stateMap[id]; }) .filter(function (row) { return !!row; }); }); }; S3StateManager.prototype.childWorkFinished = function (work, parent) { parent.finishedChildrenIDs.push(work.id); var isDone = parent.finishedChildrenIDs.length === parent.childrenIDs.length; return this.save(parent) .then(function () { return isDone; }); }; S3StateManager.prototype.hasChanged = function (work) { var previous = S3StateManager.stateMap[work.id]; return !previous || JSON.stringify(previous) !== JSON.stringify(work); }; S3StateManager.prototype.saveToMap = function (work) { if (!work.id) { work.id = S3StateManager.nextID; if (!work.id) { throw new Error('Expected work to have an id'); } S3StateManager.nextID = S3StateManager.calculateNextID(); } S3StateManager.stateMap[work.id] = work.copy(); }; S3StateManager.prototype.writeDB = function () { var _this = this; var s3 = new aws_sdk_1.S3(); var key = this.config.s3StateKeyPrefix + ".json"; var json = JSON.stringify(S3StateManager.stateMap, null, 2); var args = { Bucket: this.config.bucket, Key: key, ContentType: 'application/json', Body: new Buffer(json), ACL: 'private' }; return new es6_promise_1.Promise(function (ok, fail) { _this.workhorse.logger.log("Saving state database to " + key + "..."); s3.putObject(args, function (err, data) { if (err) { return fail(err); } ok(); }); }); }; S3StateManager.prototype.readDB = function (force) { var _this = this; if (S3StateManager.stateMap && force !== true) { return es6_promise_1.Promise.resolve(S3StateManager.stateMap); } var s3 = new aws_sdk_1.S3(); var key = this.config.s3StateKeyPrefix + ".json"; var args = { Bucket: this.config.bucket, Key: decodeURIComponent(key.replace(/\+/g, ' ')) }; return new es6_promise_1.Promise(function (ok, fail) { _this.workhorse.logger.log("Loading state database from S3: " + key + "..."); s3.getObject(args, function (err, data) { if (err) { if (err.code === 'NoSuchKey' || err.code === 'AccessDenied') { _this.workhorse.logger.log('State database not found, starting fresh'); S3StateManager.stateMap = {}; S3StateManager.nextID = S3StateManager.calculateNextID(); return ok(S3StateManager.stateMap); } return fail(err); } var raw = data.Body.toString(); S3StateManager.stateMap = JSON.parse(raw); S3StateManager.nextID = S3StateManager.calculateNextID(); _this.workhorse.logger.log('State database loaded'); ok(S3StateManager.stateMap); }); }); }; S3StateManager.stateMap = null; S3StateManager.nextNumericID = 0; return S3StateManager; }()); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = S3StateManager; //# sourceMappingURL=s3-state-manager.js.map
mit
DreadLabs/app-migration-migrator-phinx
tests/Fixture/migrations_some_erroneous/42_some_erroneous_life_the_universe_and_everything.php
643
<?php /* * This file is part of the AppMigration\Migrator\Phinx package. * * (c) Thomas Juhnke <dev@van-tomas.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Phinx\Migration\AbstractMigration; /** * SomeErroneousLifeTheUniverseAndEverything * * @author Thomas Juhnke <dev@van-tomas.de> */ class SomeErroneousLifeTheUniverseAndEverything extends AbstractMigration { /** * Does nothing * * @return void */ public function up() { throw new \PDOException('Life, the universe and everything.'); } }
mit
kpicaza/schooly
src/AppBundle/Document/User/UserGateway.php
1856
<?php namespace AppBundle\Document\User; use AppBundle\Model\User\UserInterface; use AppBundle\Model\User\UserGatewayInterface; use Doctrine\ODM\MongoDB\DocumentRepository; /** * UserGateway. */ class UserGateway extends DocumentRepository implements UserGatewayInterface { /** * @param type $id */ public function find($id) { return parent::find($id); } /** * @param array $criteria * @param array $sort * @param int $limit * @param int $skip */ public function findBy(array $criteria, array $sort = null, $limit = null, $skip = null) { return parent::findBy($criteria, $sort, $limit, $skip); } /** * @param array $criteria */ public function findOneBy(array $criteria) { return parent::findOneBy($criteria); } /** * @param User $user * * @return User */ public function apiInsert(UserInterface $user) { $user ->setEnabled(true) ->setExpired(false) ->setLocked(false) ->addRole('read') ->addRole('view') ->addRole('edit') ->addRole('ROLE_USER') ; return self::insert($user); } /** * @return type */ public function findNew() { return User::fromArray(); } /** * @param User $user * * @return User */ public function insert(UserInterface $user) { $this->dm->persist($user); $this->dm->flush(); return $user; } /** * Update user. */ public function update() { $this->dm->flush(); } /** * @param $id */ public function remove($id) { $user = $this->find($id); $this->dm->remove($user); $this->dm->flush(); } }
mit
Philip-Bachman/Sequential-Generation
MotionRenderers.py
14522
#!/ysr/bin/env python from __future__ import division import utils as utils import numpy as np import numpy.random as npr import theano import theano.tensor as T import time from HelperFuncs import to_fX def my_batched_dot(A, B): """ Compute: [np.dot(A[i,:,:], B[i,:,:]) for i in range(A.shape[0])] """ C = A.dimshuffle([0,1,2,'x']) * B.dimshuffle([0,'x',1,2]) return C.sum(axis=-2) ############################################ ############################################ ## Class for painting objects into images ## ############################################ ############################################ class ObjectPainter(object): def __init__(self, img_height, img_width, obj_type='circle', obj_scale=0.2): """ A class for drawing a few simple objects with subpixel resolution. """ self.img_height = img_height self.img_width = img_width self.obj_type = obj_type self.obj_scale = obj_scale # make coordinate system for points in the object to render obj_x_coords, obj_y_coords = self._construct_obj_coords( \ obj_type=self.obj_type, obj_scale=self.obj_scale) self.obj_x = T.constant(obj_x_coords) self.obj_y = T.constant(obj_y_coords) self.obj_x_range = [np.min(obj_x_coords), np.max(obj_x_coords)] self.obj_y_range = [np.min(obj_y_coords), np.max(obj_y_coords)] # make coordinate system for x and y location in the image. # -- image coordinates for the smallest dimension range over # [-init_scale....init_scale], and coordinates for the largest # dimension are at the same scale, but over a larger range. img_x_coords, img_y_coords = self._construct_img_coords( \ x_dim=self.img_width, y_dim=self.img_height) self.img_x = T.constant(img_x_coords) self.img_y = T.constant(img_y_coords) self.img_x_range = [np.min(img_x_coords), np.max(img_x_coords)] self.img_y_range = [np.min(img_y_coords), np.max(img_y_coords)] return def _construct_obj_coords(self, obj_type='circle', obj_scale=0.2): """ Construct coordinates for circle, square, or cross. """ if obj_type == 'circle': coords = [(-1, 3), (0, 3), (1, 3), (2, 2), \ (3, 1), (3, 0), (3, -1), (2, -2), \ (1, -3), (0, -3), (-1, -3), (-2, -2), \ (-3, -1), (-3, 0), (-3, 1), (-2, 2)] elif obj_type == 'square': coords = [(-2, 2), (-1, 2), (0, 2), (1, 2), \ (2, 2), (2, 1), (2, 0), (2, -1), \ (2, -2), (1, -2), (0, -2), (-1, -2), \ (-2, -2), (-2, -1), (-2, 0), (-2, 1)] elif obj_type == 'cross': coords = [(0, 3), (0, 2), (0, 1), (0, 0), \ (1, 0), (2, 0), (3, 0), (0, -1), \ (0, -2), (0, -3), (-1, 0), (-2, 0), \ (-3, 0)] elif obj_type == 't-up': coords = [(-3, 3), (-2, 3), (-1, 3), (0, 3), \ (1, 3), (2, 3), (3, 3), (0, 2), \ (0, 1), (0, 0), (0, -1), (0, -2), \ (0, -3)] elif obj_type == 't-down': coords = [(-3, -3), (-2, -3), (-1, -3), (0, 3), \ (1, -3), (2, -3), (3, -3), (0, 2), \ (0, 1), (0, 0), (0, -1), (0, -2), \ (0, -3)] elif obj_type == 't-left': coords = [(-3, 3), (-3, 2), (-3, 1), (-3, 0), \ (-3, -1), (-3, -2), (-3, -3), (-2, 0), \ (-1, 0), (0, 0), (1, 0), (2, 0), \ (3, 0)] elif obj_type == 't-right': coords = [(3, 3), (3, 2), (3, 1), (-3, 0), \ (3, -1), (3, -2), (3, -3), (-2, 0), \ (-1, 0), (0, 0), (1, 0), (2, 0), \ (3, 0)] else: coords = [(-1, 1), (0, 1), (1, 1), (1, 0), \ (1, -1), (0, -1), (-1, -1), (-1, 0)] x_coords = np.asarray([float(pt[0]) for pt in coords]) y_coords = np.asarray([float(pt[1]) for pt in coords]) rescale = max(np.max(x_coords), np.max(y_coords)) x_coords = (obj_scale / rescale) * x_coords y_coords = (obj_scale / rescale) * y_coords x_coords = x_coords.astype(theano.config.floatX) y_coords = y_coords.astype(theano.config.floatX) return x_coords, y_coords def _construct_img_coords(self, x_dim=32, y_dim=32): """ Construct coordinates for all points in the base images. """ min_dim = float( min(x_dim, y_dim) ) x_scale = x_dim / min_dim y_scale = y_dim / min_dim xc = x_scale * np.linspace(start=-1., stop=1., num=x_dim) yc = y_scale * np.linspace(start=-1., stop=1., num=y_dim) coords = [] for x_idx in range(x_dim): for y_idx in range(y_dim): coords.append((xc[x_idx], yc[y_idx])) x_coords = np.asarray([float(pt[0]) for pt in coords]) y_coords = np.asarray([float(pt[1]) for pt in coords]) x_coords = x_coords.astype(theano.config.floatX) y_coords = y_coords.astype(theano.config.floatX) return x_coords, y_coords def filterbank_matrices(self, center_y, center_x, delta, sigma): """ Create a Fy and a Fx Parameters ---------- center_y : T.vector (shape: batch_size) center_x : T.vector (shape: batch_size) Y and X center coordinates for the attention window delta : T.vector (shape: batch_size) sigma : T.vector (shape: batch_size) Returns ------- FY, FX """ tol = 1e-4 # construct x and y coordinates for the grid points obj_x = center_x.dimshuffle(0, 'x') + \ (delta.dimshuffle(0, 'x') * self.obj_x) obj_y = center_y.dimshuffle(0, 'x') + \ (delta.dimshuffle(0, 'x') * self.obj_y) # construct unnormalized attention weights for each grid point FX = T.exp( -(self.img_x - obj_x.dimshuffle(0,1,'x'))**2. / \ (2. * sigma.dimshuffle(0,'x','x')**2.) ) FY = T.exp( -(self.img_y - obj_y.dimshuffle([0,1,'x']))**2. / \ (2. * sigma.dimshuffle(0,'x','x')**2.) ) # normalize the attention weights #FX = FX / (FX.sum(axis=-1).dimshuffle(0, 1, 'x') + tol) #FY = FY / (FY.sum(axis=-1).dimshuffle(0, 1, 'x') + tol) FX = FX / (T.max(FX.sum(axis=-1)) + tol) FY = FY / (T.max(FY.sum(axis=-1)) + tol) return FY, FX def write(self, center_y, center_x, delta, sigma): """ Write a batch of objects into full sized images. Parameters ---------- center_y : :class:`~tensor.TensorVariable` Center coordinates for the objects. Expected shape: (batch_size,) center_x : :class:`~tensor.TensorVariable` Center coordinates for the objects. Expected shape: (batch_size,) delta : :class:`~tensor.TensorVariable` Scale for the objects. Expected shape: (batch_size,) sigma : :class:`~tensor.TensorVariable` Std. dev. for Gaussian writing kernel. Expected shape: (batch_size,) Returns ------- images : :class:`~tensor.TensorVariable` images of objects: (batch_size x img_height*img_width) """ # Get separable filterbank FY, FX = self.filterbank_matrices(center_y, center_x, delta, sigma) # apply... FI = FX * FY I_raw = T.sum(FI, axis=1) I = I_raw / T.max(I_raw) return I def get_object_painters(im_dim=None, obj_types=None, obj_scale=0.2): """ Get a dict, keyed by object type, of all available object painters. """ # configure object renderers for the desired object types... OPTRS = {} for obj in obj_types: # configure an object renderer optr = ObjectPainter(im_dim, im_dim, obj_type=obj, obj_scale=obj_scale) # get a Theano function for doing the rendering _center_x = T.vector() _center_y = T.vector() _delta = T.vector() _sigma = T.vector() _W = optr.write(_center_y, _center_x, _delta, _sigma) paint_obj = theano.function(inputs=[_center_y, _center_x, _delta, _sigma], \ outputs=_W) OPTRS[obj] = paint_obj return OPTRS #################################################################### #################################################################### ## Class for generating random trajectories within a bounding box ## #################################################################### #################################################################### class TrajectoryGenerator(object): def __init__(self, x_range=[-1.,1.], y_range=[-1.,1.], max_speed=0.1): """ A class for generating trajectories in box with given x/y range. """ self.x_range = x_range self.y_range = y_range self.x_min, self.x_max = x_range self.y_min, self.y_max = y_range self.max_speed = max_speed return def _rand_pos(self, num_samples, rand_vals=None): """ Generate positions uniformly at random within our bounding box. """ # generate initial positions if rand_vals is None: samp_pos = npr.rand(num_samples,2) else: samp_pos = rand_vals # scale x and y coords samp_pos[:,0] = samp_pos[:,0] * (self.x_range[1] - self.x_range[0]) samp_pos[:,1] = samp_pos[:,1] * (self.y_range[1] - self.y_range[0]) # shift x and y coords samp_pos[:,0] = samp_pos[:,0] + self.x_min samp_pos[:,1] = samp_pos[:,1] + self.y_min return samp_pos def _rand_vel(self, num_samples, randn_vals=None): """ Generate a random velocity under constraint on l2 norm. """ # generate initial velocities if randn_vals is None: samp_vel = npr.randn(num_samples,2) else: samp_vel = randn_vals # rescale initial velocities to be appropriately large vel_norms = np.sqrt(np.sum(samp_vel**2.0, axis=1, keepdims=True)) samp_vel = samp_vel * np.minimum(1.0, (self.max_speed / vel_norms)) return samp_vel def _initial_pos_and_vel(self, num_samples): """ Generate random initial positions and velocities. """ # generate initial positions samp_pos = self._rand_pos(num_samples) # generate initial velocities samp_vel = self._rand_vel(num_samples, randn_vals=None) return samp_pos, samp_vel def _update_pos_and_vel(self, samp_pos, samp_vel): """ Return updated positions and velocities. """ # advance positions new_pos = samp_pos + samp_vel # clip to the required bounding box, and flip velocities when the box # boundary is crossed by a trajectory. x_min_clip = new_pos[:,0] < self.x_min x_max_clip = new_pos[:,0] > self.x_max y_min_clip = new_pos[:,1] < self.y_min y_max_clip = new_pos[:,1] > self.y_max new_pos[x_min_clip,0] = self.x_min new_pos[x_max_clip,0] = self.x_max new_pos[y_min_clip,1] = self.y_min new_pos[y_max_clip,1] = self.y_max # flip velocities for coordinates that were clipped x_clipped = x_min_clip | x_max_clip y_clipped = y_min_clip | y_max_clip new_vel = samp_vel[:,:] new_vel[x_clipped,0] = -samp_vel[x_clipped,0] new_vel[y_clipped,1] = -samp_vel[y_clipped,1] return new_pos, new_vel def generate_trajectories(self, num_samples, traj_len, vel_reset=0.05): """ Generate a set of trajectories with the given length. """ # initialize container arrays traj_pos = np.zeros((traj_len, num_samples, 2)) traj_vel = np.zeros((traj_len, num_samples, 2)) randn_vals = npr.randn(traj_len, num_samples, 2) vel_switches = npr.rand(traj_len, num_samples) < vel_reset # generate and record some trajectories step_pos, step_vel = self._initial_pos_and_vel(num_samples) for i in range(traj_len): rand_vel = self._rand_vel(num_samples, randn_vals[i]) traj_pos[i,:,:] = step_pos traj_vel[i,:,:] = step_vel traj_vel[i,vel_switches[i],:] = rand_vel[vel_switches[i],:] step_pos, step_vel = self._update_pos_and_vel(step_pos, step_vel) traj_pos = traj_pos.astype(theano.config.floatX) traj_vel = traj_vel.astype(theano.config.floatX) return traj_pos, traj_vel if __name__ == "__main__": # configure an object renderer OPTR = ObjectPainter(32, 32, obj_type='circle', obj_scale=0.4) _center_x = T.vector() _center_y = T.vector() _delta = T.vector() _sigma = T.vector() _W = OPTR.write(_center_y, _center_x, _delta, _sigma) write_func = theano.function(inputs=[_center_y, _center_x, _delta, _sigma], \ outputs=_W) # configure a trajectory generator num_samples = 100 traj_len = 64 x_range = [-0.8,0.8] y_range = [-0.8,0.8] max_speed = 0.15 TRAJ = TrajectoryGenerator(x_range=x_range, y_range=y_range, \ max_speed=max_speed) # test the writer function start_time = time.time() batch_count = 50 for i in range(batch_count): # generate a minibatch of trajectories traj_pos, traj_vel = TRAJ.generate_trajectories(num_samples, traj_len) traj_x = traj_pos[:,:,0] traj_y = traj_pos[:,:,1] # draw the trajectories center_x = to_fX( traj_x.T.ravel() ) center_y = to_fX( traj_y.T.ravel() ) delta = to_fX( np.ones(center_x.shape) ) sigma = to_fX( np.ones(center_x.shape) ) W = write_func(center_y, center_x, delta, 0.2*sigma) end_time = time.time() render_time = end_time - start_time render_bps = batch_count / render_time print("RENDER BATCH/SECOND: {0:.2f}".format(render_bps)) W = W[:20*traj_len] utils.visualize_samples(W, "AAAAA.png", num_rows=20)
mit
MineLib/ProtocolModern_1.7.10
Packets/Client/Play/0x09_HeldItemChangePacket.cs
637
using System; using Aragas.Core.Data; using Aragas.Core.IO; using Aragas.Core.Packets; using ProtocolModern.Enum; namespace ProtocolModern.Packets.Client.Play { public class HeldItemChangePacket : ProtobufPacket { public SByte Slot; public override VarInt ID => ClientPlayPacketTypes.HeldItemChange; public override ProtobufPacket ReadPacket(ProtobufDataReader reader) { Slot = reader.Read(Slot); return this; } public override ProtobufPacket WritePacket(ProtobufStream stream) { stream.Write(Slot); return this; } } }
mit
samphippen/srobotickets
config/initializers/secret_token.rb
503
# Be sure to restart your server when you modify this file. # Your secret key for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. Srobotickets::Application.config.secret_token = '37bc5a81417bb35119afc58d74f7b169f862509484e4938e0ecca74b53db09d1a1c39d265b8b9ce6f6877f60647b12a7c03aaceef4a880e91f73c96488c0f1dd'
mit
5mil/Bolt
src/qt/locale/bitcoin_ca_ES.ts
124762
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="ca_ES"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="14"/> <source>About Paris</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/aboutdialog.ui" line="75"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Paris&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/aboutdialog.ui" line="113"/> <source>Copyright © 2014 Paris Developers</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/aboutdialog.ui" line="120"/> <source>Copyright © 2011-2014 Paris Developers</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/aboutdialog.ui" line="133"/> <source>Copyright © 2009-2014 Bitcoin Developers This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file license.txt or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="14"/> <source>Address Book</source> <translation>llibreta d&apos;adreces</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="20"/> <source>These are your Paris 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"></translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="33"/> <source>Double-click to edit address or label</source> <translation>Feu doble clic per editar la direcció o l&apos;etiqueta</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="57"/> <source>Create a new address</source> <translation>Crear una nova adreça</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="60"/> <source>&amp;New Address...</source> <translation>&amp;Nova Adreça ...</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="71"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copieu l&apos;adreça seleccionada al porta-retalls del sistema</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="74"/> <source>&amp;Copy to Clipboard</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="85"/> <source>Show &amp;QR Code</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="96"/> <source>Sign a message to prove you own this address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="99"/> <source>&amp;Sign Message</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="110"/> <source>Delete the currently selected address from the list. Only sending addresses can be deleted.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="113"/> <source>&amp;Delete</source> <translation>&amp;Borrar</translation> </message> <message> <location filename="../addressbookpage.cpp" line="65"/> <source>Copy address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../addressbookpage.cpp" line="66"/> <source>Copy label</source> <translation type="unfinished"></translation> </message> <message> <location filename="../addressbookpage.cpp" line="67"/> <source>Edit</source> <translation type="unfinished"></translation> </message> <message> <location filename="../addressbookpage.cpp" line="68"/> <source>Delete</source> <translation type="unfinished"></translation> </message> <message> <location filename="../addressbookpage.cpp" line="273"/> <source>Export Address Book Data</source> <translation type="unfinished"></translation> </message> <message> <location filename="../addressbookpage.cpp" line="274"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../addressbookpage.cpp" line="287"/> <source>Error exporting</source> <translation type="unfinished"></translation> </message> <message> <location filename="../addressbookpage.cpp" line="287"/> <source>Could not write to file %1.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="79"/> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <location filename="../addresstablemodel.cpp" line="79"/> <source>Address</source> <translation>Direcció</translation> </message> <message> <location filename="../addresstablemodel.cpp" line="115"/> <source>(no label)</source> <translation type="unfinished"></translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="26"/> <source>Dialog</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/askpassphrasedialog.ui" line="94"/> <source>TextLabel</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/askpassphrasedialog.ui" line="47"/> <source>Enter passphrase</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/askpassphrasedialog.ui" line="61"/> <source>New passphrase</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/askpassphrasedialog.ui" line="75"/> <source>Repeat new passphrase</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/askpassphrasedialog.ui" line="114"/> <source>Toggle Keyboard</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="37"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="38"/> <source>Encrypt wallet</source> <translation>Xifrar la cartera</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="41"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="46"/> <source>Unlock wallet</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="49"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="54"/> <source>Decrypt wallet</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="57"/> <source>Change passphrase</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="58"/> <source>Enter the old and new passphrase to the wallet.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="106"/> <source>Confirm wallet encryption</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="116"/> <location filename="../askpassphrasedialog.cpp" line="165"/> <source>Wallet encrypted</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="213"/> <location filename="../askpassphrasedialog.cpp" line="237"/> <source>Warning: The Caps Lock key is on.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="122"/> <location filename="../askpassphrasedialog.cpp" line="129"/> <location filename="../askpassphrasedialog.cpp" line="171"/> <location filename="../askpassphrasedialog.cpp" line="177"/> <source>Wallet encryption failed</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="107"/> <source>WARNING: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR PEERCOINS&lt;/b&gt;! Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="117"/> <source>Paris will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your Pariss from being stolen by malware infecting your computer.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="123"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="130"/> <location filename="../askpassphrasedialog.cpp" line="178"/> <source>The supplied passphrases do not match.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="141"/> <source>Wallet unlock failed</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="142"/> <location filename="../askpassphrasedialog.cpp" line="153"/> <location filename="../askpassphrasedialog.cpp" line="172"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="152"/> <source>Wallet decryption failed</source> <translation type="unfinished"></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="166"/> <source>Wallet passphrase was succesfully changed.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="191"/> <source>&amp;Overview</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="192"/> <source>Show general overview of wallet</source> <translation type="unfinished">Mostra panorama general de la cartera</translation> </message> <message> <location filename="../bitcoingui.cpp" line="197"/> <source>&amp;Transactions</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="198"/> <source>Browse transaction history</source> <translation type="unfinished">Cerca a l&apos;historial de transaccions</translation> </message> <message> <location filename="../bitcoingui.cpp" line="203"/> <source>&amp;Minting</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="204"/> <source>Show your minting capacity</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="209"/> <source>&amp;Address Book</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="210"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished">Edita la llista d&apos;adreces emmagatzemada i etiquetes</translation> </message> <message> <location filename="../bitcoingui.cpp" line="215"/> <source>&amp;Receive coins</source> <translation type="unfinished">&amp;Rebre monedes</translation> </message> <message> <location filename="../bitcoingui.cpp" line="216"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="221"/> <source>&amp;Send coins</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="227"/> <source>Sign/Verify &amp;message</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="228"/> <source>Prove you control an address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="249"/> <source>E&amp;xit</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="250"/> <source>Quit application</source> <translation type="unfinished">Sortir de l&apos;aplicació</translation> </message> <message> <location filename="../bitcoingui.cpp" line="254"/> <source>Show information about Paris</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="256"/> <source>About &amp;Qt</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="257"/> <source>Show information about Qt</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="259"/> <source>&amp;Options...</source> <translation type="unfinished">&amp;Opcions ...</translation> </message> <message> <location filename="../bitcoingui.cpp" line="264"/> <source>&amp;Export...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="265"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="266"/> <source>&amp;Encrypt Wallet</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="267"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="269"/> <source>&amp;Unlock Wallet for Minting Only</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="270"/> <source>Unlock wallet only for minting. Sending coins will still require the passphrase.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="272"/> <source>&amp;Backup Wallet</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="273"/> <source>Backup wallet to another location</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="274"/> <source>&amp;Change Passphrase</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="275"/> <source>Change the passphrase used for wallet encryption</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="276"/> <source>&amp;Debug window</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="277"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="301"/> <source>&amp;File</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="310"/> <source>&amp;Settings</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="317"/> <source>&amp;Help</source> <translation type="unfinished">&amp;Ajuda</translation> </message> <message> <location filename="../bitcoingui.cpp" line="326"/> <source>Tabs toolbar</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="338"/> <source>Actions toolbar</source> <translation type="unfinished">Accions de la barra d&apos;eines</translation> </message> <message> <location filename="../bitcoingui.cpp" line="350"/> <source>[testnet]</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="658"/> <source>This transaction is over the size limit. You can still send it for a fee of %1. Do you want to pay the fee?</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="76"/> <source>Paris Wallet</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="222"/> <source>Send coins to a Paris address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="253"/> <source>&amp;About Paris</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="260"/> <source>Modify configuration options for Paris</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="262"/> <source>Show/Hide &amp;Paris</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="263"/> <source>Show or hide the Paris window</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="415"/> <source>Paris client</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="443"/> <source>p-qt</source> <translation type="unfinished"></translation> </message> <message numerus="yes"> <location filename="../bitcoingui.cpp" line="507"/> <source>%n active connection(s) to Paris network</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message> <location filename="../bitcoingui.cpp" line="531"/> <source>Synchronizing with network...</source> <translation type="unfinished">Sincronització amb la xarxa ...</translation> </message> <message numerus="yes"> <location filename="../bitcoingui.cpp" line="533"/> <source>~%n block(s) remaining</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message> <location filename="../bitcoingui.cpp" line="544"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="556"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"></translation> </message> <message numerus="yes"> <location filename="../bitcoingui.cpp" line="571"/> <source>%n second(s) ago</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message numerus="yes"> <location filename="../bitcoingui.cpp" line="575"/> <source>%n minute(s) ago</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message numerus="yes"> <location filename="../bitcoingui.cpp" line="579"/> <source>%n hour(s) ago</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message numerus="yes"> <location filename="../bitcoingui.cpp" line="583"/> <source>%n day(s) ago</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message> <location filename="../bitcoingui.cpp" line="589"/> <source>Up to date</source> <translation type="unfinished">Al dia</translation> </message> <message> <location filename="../bitcoingui.cpp" line="594"/> <source>Catching up...</source> <translation type="unfinished">Posar-se al dia ...</translation> </message> <message> <location filename="../bitcoingui.cpp" line="602"/> <source>Last received block was generated %1.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="661"/> <source>Sending...</source> <translation type="unfinished">L&apos;enviament de ...</translation> </message> <message> <location filename="../bitcoingui.cpp" line="688"/> <source>Sent transaction</source> <translation type="unfinished">Transacció enviada</translation> </message> <message> <location filename="../bitcoingui.cpp" line="689"/> <source>Incoming transaction</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="690"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="821"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked for block minting only&lt;/b&gt;</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="821"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="831"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="888"/> <source>Backup Wallet</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="888"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="891"/> <source>Backup Failed</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoingui.cpp" line="891"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoin.cpp" line="128"/> <source>A fatal error occured. Paris can no longer continue safely and will quit.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="14"/> <source>Coin Control</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="45"/> <source>Quantity:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="64"/> <location filename="../forms/coincontroldialog.ui" line="96"/> <source>0</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="77"/> <source>Bytes:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="125"/> <source>Amount:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="144"/> <location filename="../forms/coincontroldialog.ui" line="224"/> <location filename="../forms/coincontroldialog.ui" line="310"/> <location filename="../forms/coincontroldialog.ui" line="348"/> <source>0.00 BTC</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="157"/> <source>Priority:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="205"/> <source>Fee:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="240"/> <source>Low Output:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="262"/> <location filename="../coincontroldialog.cpp" line="572"/> <source>no</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="291"/> <source>After Fee:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="326"/> <source>Change:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="395"/> <source>(un)select all</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="408"/> <source>Tree mode</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="424"/> <source>List mode</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="469"/> <source>Amount</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="479"/> <source>Address</source> <translation type="unfinished">Direcció</translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="484"/> <source>Date</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="489"/> <source>Confirmations</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="492"/> <source>Confirmed</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="497"/> <source>Coin days</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="502"/> <source>Priority</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="36"/> <source>Copy address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="37"/> <source>Copy label</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="38"/> <location filename="../coincontroldialog.cpp" line="64"/> <source>Copy amount</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="39"/> <source>Copy transaction ID</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="63"/> <source>Copy quantity</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="65"/> <source>Copy fee</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="66"/> <source>Copy after fee</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="67"/> <source>Copy bytes</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="68"/> <source>Copy priority</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="69"/> <source>Copy low output</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="70"/> <source>Copy change</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="388"/> <source>highest</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="389"/> <source>high</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="390"/> <source>medium-high</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="391"/> <source>medium</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="395"/> <source>low-medium</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="396"/> <source>low</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="397"/> <source>lowest</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="572"/> <source>DUST</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="572"/> <source>yes</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="582"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="583"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="584"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="585"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="622"/> <location filename="../coincontroldialog.cpp" line="688"/> <source>(no label)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="679"/> <source>change from %1 (%2)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="680"/> <source>(change)</source> <translation type="unfinished"></translation> </message> </context> <context> <name>DisplayOptionsPage</name> <message> <location filename="../optionsdialog.cpp" line="275"/> <source>&amp;Unit to show amounts in: </source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="279"/> <source>Choose the default subdivision unit to show in the interface, and when sending coins</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="286"/> <source>&amp;Display addresses in transaction list</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="287"/> <source>Whether to show Paris addresses in the transaction list</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="290"/> <source>Display coin control features (experts only!)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="291"/> <source>Whether to show coin control features or not</source> <translation type="unfinished"></translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="14"/> <source>Edit Address</source> <translation>Editar Adreça</translation> </message> <message> <location filename="../forms/editaddressdialog.ui" line="25"/> <source>&amp;Label</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/editaddressdialog.ui" line="35"/> <source>The label associated with this address book entry</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/editaddressdialog.ui" line="42"/> <source>&amp;Address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/editaddressdialog.ui" line="52"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../editaddressdialog.cpp" line="20"/> <source>New receiving address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../editaddressdialog.cpp" line="24"/> <source>New sending address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../editaddressdialog.cpp" line="27"/> <source>Edit receiving address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../editaddressdialog.cpp" line="31"/> <source>Edit sending address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../editaddressdialog.cpp" line="91"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../editaddressdialog.cpp" line="96"/> <source>The entered address &quot;%1&quot; is not a valid Paris address.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../editaddressdialog.cpp" line="101"/> <source>Could not unlock wallet.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../editaddressdialog.cpp" line="106"/> <source>New key generation failed.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>MainOptionsPage</name> <message> <location filename="../optionsdialog.cpp" line="177"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="178"/> <source>Show only a tray icon after minimizing the window</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="186"/> <source>Map port using &amp;UPnP</source> <translation>Port obert amb &amp;UPnP</translation> </message> <message> <location filename="../optionsdialog.cpp" line="181"/> <source>M&amp;inimize on close</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="182"/> <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"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="187"/> <source>Automatically open the Paris client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="190"/> <source>&amp;Connect through SOCKS4 proxy:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="191"/> <source>Connect to the Bitcon network through a SOCKS4 proxy (e.g. when connecting through Tor)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="196"/> <source>Proxy &amp;IP: </source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="202"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="205"/> <source>&amp;Port: </source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="211"/> <source>Port of the proxy (e.g. 1234)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="217"/> <source>Mandatory network transaction fee per kB transferred. Most transactions are 1 kB and incur a 0.01 Paris fee. Note: transfer size may increase depending on the number of input transactions required to be added together to fund the payment.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="223"/> <source>Additional network &amp;fee:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="234"/> <source>Detach databases at shutdown</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="235"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="172"/> <source>&amp;Start Paris on window system startup</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="173"/> <source>Automatically start Paris after the computer is turned on</source> <translation type="unfinished"></translation> </message> </context> <context> <name>MintingTableModel</name> <message> <location filename="../mintingtablemodel.cpp" line="203"/> <source>Transaction</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="203"/> <source>Address</source> <translation type="unfinished">Direcció</translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="203"/> <source>Age</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="203"/> <source>Balance</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="203"/> <source>CoinDay</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="203"/> <source>MintProbability</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="284"/> <source>minutes</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="291"/> <source>hours</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="295"/> <source>days</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="298"/> <source>You have %1 chance to find a POS block if you mint %2 %3 at current difficulty.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="418"/> <source>Destination address of the output.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="420"/> <source>Original transaction id.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="422"/> <source>Age of the transaction in days.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="424"/> <source>Balance of the output.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="426"/> <source>Coin age in the output.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingtablemodel.cpp" line="428"/> <source>Chance to mint a block within given time interval.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>MintingView</name> <message> <location filename="../mintingview.cpp" line="33"/> <source>transaction is too young</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="40"/> <source>transaction is mature</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="47"/> <source>transaction has reached maximum probability</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="60"/> <source>Display minting probability within : </source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="62"/> <source>10 min</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="63"/> <source>24 hours</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="64"/> <source>30 days</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="65"/> <source>90 days</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="162"/> <source>Export Minting Data</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="163"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="171"/> <source>Address</source> <translation type="unfinished">Direcció</translation> </message> <message> <location filename="../mintingview.cpp" line="172"/> <source>Transaction</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="173"/> <source>Age</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="174"/> <source>CoinDay</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="175"/> <source>Balance</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="176"/> <source>MintingProbability</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="180"/> <source>Error exporting</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mintingview.cpp" line="180"/> <source>Could not write to file %1.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../optionsdialog.cpp" line="81"/> <source>Main</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="86"/> <source>Display</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="106"/> <source>Options</source> <translation type="unfinished"></translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="14"/> <source>Form</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/overviewpage.ui" line="40"/> <source>Balance:</source> <translation>Balanç:</translation> </message> <message> <location filename="../forms/overviewpage.ui" line="54"/> <source>Number of transactions:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/overviewpage.ui" line="61"/> <source>0</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/overviewpage.ui" line="68"/> <source>Unconfirmed:</source> <translation>Sense confirmar:</translation> </message> <message> <location filename="../forms/overviewpage.ui" line="82"/> <source>Stake:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/overviewpage.ui" line="102"/> <source>Wallet</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/overviewpage.ui" line="138"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation type="unfinished"></translation> </message> <message> <location filename="../overviewpage.cpp" line="104"/> <source>Your current balance</source> <translation>El seu balanç actual</translation> </message> <message> <location filename="../overviewpage.cpp" line="109"/> <source>Your current stake</source> <translation type="unfinished"></translation> </message> <message> <location filename="../overviewpage.cpp" line="114"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"></translation> </message> <message> <location filename="../overviewpage.cpp" line="117"/> <source>Total number of transactions in wallet</source> <translation type="unfinished"></translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="14"/> <source>Dialog</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/qrcodedialog.ui" line="32"/> <source>QR Code</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/qrcodedialog.ui" line="55"/> <source>Request Payment</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/qrcodedialog.ui" line="70"/> <source>Amount:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/qrcodedialog.ui" line="105"/> <source>Paris</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/qrcodedialog.ui" line="121"/> <source>Label:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/qrcodedialog.ui" line="144"/> <source>Message:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/qrcodedialog.ui" line="186"/> <source>&amp;Save As...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../qrcodedialog.cpp" line="46"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../qrcodedialog.cpp" line="64"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../qrcodedialog.cpp" line="121"/> <source>Save Image...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../qrcodedialog.cpp" line="121"/> <source>PNG Images (*.png)</source> <translation type="unfinished"></translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="14"/> <source>Paris (Paris) debug window</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="24"/> <source>Information</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="33"/> <source>Client name</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="40"/> <location filename="../forms/rpcconsole.ui" line="60"/> <location filename="../forms/rpcconsole.ui" line="106"/> <location filename="../forms/rpcconsole.ui" line="156"/> <location filename="../forms/rpcconsole.ui" line="176"/> <location filename="../forms/rpcconsole.ui" line="196"/> <location filename="../forms/rpcconsole.ui" line="229"/> <location filename="../rpcconsole.cpp" line="338"/> <source>N/A</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="53"/> <source>Client version</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="79"/> <source>Version</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="92"/> <source>Network</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="99"/> <source>Number of connections</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="119"/> <source>On testnet</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="142"/> <source>Block chain</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="149"/> <source>Current number of blocks</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="169"/> <source>Estimated total blocks</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="189"/> <source>Last block time</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="222"/> <source>Build date</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="237"/> <source>Console</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="270"/> <source>&gt;</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/rpcconsole.ui" line="286"/> <source>Clear console</source> <translation type="unfinished"></translation> </message> <message> <location filename="../rpcconsole.cpp" line="306"/> <source>Welcome to the Paris RPC console.&lt;br&gt;Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.&lt;br&gt;Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="14"/> <location filename="../sendcoinsdialog.cpp" line="176"/> <location filename="../sendcoinsdialog.cpp" line="181"/> <location filename="../sendcoinsdialog.cpp" line="186"/> <location filename="../sendcoinsdialog.cpp" line="191"/> <location filename="../sendcoinsdialog.cpp" line="197"/> <location filename="../sendcoinsdialog.cpp" line="202"/> <location filename="../sendcoinsdialog.cpp" line="207"/> <source>Send Coins</source> <translation>Enviar monedes</translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="90"/> <source>Coin Control Features</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="110"/> <source>Inputs...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="117"/> <source>automatically selected</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="136"/> <source>Insufficient funds!</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="213"/> <source>Quantity:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="235"/> <location filename="../forms/sendcoinsdialog.ui" line="270"/> <source>0</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="251"/> <source>Bytes:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="302"/> <source>Amount:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="324"/> <location filename="../forms/sendcoinsdialog.ui" line="410"/> <location filename="../forms/sendcoinsdialog.ui" line="496"/> <location filename="../forms/sendcoinsdialog.ui" line="528"/> <source>0.00 BTC</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="337"/> <source>Priority:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="356"/> <source>medium</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="388"/> <source>Fee:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="423"/> <source>Low Output:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="442"/> <source>no</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="474"/> <source>After Fee:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="509"/> <source>Change</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="559"/> <source>custom change address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="665"/> <source>Send to multiple recipients at once</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="668"/> <source>&amp;Add recipient...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="685"/> <source>Remove all transaction fields</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="688"/> <source>Clear all</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="707"/> <source>Balance:</source> <translation>Balanç:</translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="714"/> <source>123.456 BTC</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="745"/> <source>Confirm the send action</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsdialog.ui" line="748"/> <source>&amp;Send</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="51"/> <source>Copy quantity</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="52"/> <source>Copy amount</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="53"/> <source>Copy fee</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="54"/> <source>Copy after fee</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="55"/> <source>Copy bytes</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="56"/> <source>Copy priority</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="57"/> <source>Copy low output</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="58"/> <source>Copy change</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="144"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="149"/> <source>Confirm send coins</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="150"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="150"/> <source> and </source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="182"/> <source>The amount to pay must be at least one cent (0.01).</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="457"/> <source>Warning: Invalid Bitcoin address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="466"/> <source>Warning: Unknown change address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="477"/> <source>(no label)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="187"/> <source>Amount exceeds your balance</source> <translation>Import superi el saldo de la seva compte</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="36"/> <source>Enter a Paris address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="177"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="192"/> <source>Total exceeds your balance when the %1 transaction fee is included</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="198"/> <source>Duplicate address found, can only send to each address once in one send operation</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="203"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="208"/> <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"></translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="14"/> <source>Form</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="29"/> <source>A&amp;mount:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="42"/> <source>Pay &amp;To:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="66"/> <location filename="../sendcoinsentry.cpp" line="26"/> <source>Enter a label for this address to add it to your address book</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="75"/> <source>&amp;Label:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="93"/> <source>The address to send the payment to</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="103"/> <source>Choose address from address book</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="113"/> <source>Alt+A</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="120"/> <source>Paste address from clipboard</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="130"/> <source>Alt+P</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="137"/> <source>Remove this recipient</source> <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="25"/> <source>Enter a Paris address</source> <translation type="unfinished"></translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="24"/> <source>&amp;Sign Message</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="30"/> <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"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="48"/> <source>The address to sign the message with</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="55"/> <location filename="../forms/signverifymessagedialog.ui" line="265"/> <source>Choose previously used address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="65"/> <location filename="../forms/signverifymessagedialog.ui" line="275"/> <source>Alt+A</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="75"/> <source>Paste address from clipboard</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="85"/> <source>Alt+P</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="97"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="104"/> <source>Signature</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="131"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="152"/> <source>Sign the message to prove you own this Paris address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="155"/> <source>Sign &amp;Message</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="169"/> <source>Reset all sign message fields</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="172"/> <location filename="../forms/signverifymessagedialog.ui" line="315"/> <source>Clear &amp;All</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="231"/> <source>&amp;Verify Message</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="237"/> <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"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="258"/> <source>The address the message was signed with</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="295"/> <source>Verify the message to ensure it was signed with the specified Paris address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="298"/> <source>Verify &amp;Message</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/signverifymessagedialog.ui" line="312"/> <source>Reset all verify message fields</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="29"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="30"/> <source>Enter the signature of the message</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="31"/> <location filename="../signverifymessagedialog.cpp" line="32"/> <source>Enter a Paris address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="115"/> <location filename="../signverifymessagedialog.cpp" line="195"/> <source>The entered address is invalid.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="115"/> <location filename="../signverifymessagedialog.cpp" line="123"/> <location filename="../signverifymessagedialog.cpp" line="195"/> <location filename="../signverifymessagedialog.cpp" line="203"/> <source>Please check the address and try again.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="123"/> <location filename="../signverifymessagedialog.cpp" line="203"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="131"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="139"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="151"/> <source>Message signing failed.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="156"/> <source>Message signed.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="214"/> <source>The signature could not be decoded.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="214"/> <location filename="../signverifymessagedialog.cpp" line="227"/> <source>Please check the signature and try again.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="227"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="234"/> <source>Message verification failed.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="239"/> <source>Message verified.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="21"/> <source>Open for %1 blocks</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="23"/> <source>Open until %1</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="29"/> <source>%1/offline?</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="31"/> <source>%1/unconfirmed</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="33"/> <source>%1 confirmations</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="51"/> <source>&lt;b&gt;Status:&lt;/b&gt; </source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="56"/> <source>, has not been successfully broadcast yet</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="58"/> <source>, broadcast through %1 node</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="60"/> <source>, broadcast through %1 nodes</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="64"/> <source>&lt;b&gt;Date:&lt;/b&gt; </source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="71"/> <source>&lt;b&gt;Source:&lt;/b&gt; Generated&lt;br&gt;</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="77"/> <location filename="../transactiondesc.cpp" line="94"/> <source>&lt;b&gt;From:&lt;/b&gt; </source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="94"/> <source>unknown</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="95"/> <location filename="../transactiondesc.cpp" line="118"/> <location filename="../transactiondesc.cpp" line="178"/> <source>&lt;b&gt;To:&lt;/b&gt; </source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="98"/> <source> (yours, label: </source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="100"/> <source> (yours)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="136"/> <location filename="../transactiondesc.cpp" line="150"/> <location filename="../transactiondesc.cpp" line="195"/> <location filename="../transactiondesc.cpp" line="212"/> <source>&lt;b&gt;Credit:&lt;/b&gt; </source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="138"/> <source>(%1 matures in %2 more blocks)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="142"/> <source>(not accepted)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="186"/> <location filename="../transactiondesc.cpp" line="194"/> <location filename="../transactiondesc.cpp" line="209"/> <source>&lt;b&gt;Debit:&lt;/b&gt; </source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="200"/> <source>&lt;b&gt;Transaction fee:&lt;/b&gt; </source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="218"/> <source>&lt;b&gt;Net amount:&lt;/b&gt; </source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="220"/> <source>&lt;b&gt;Retained amount:&lt;/b&gt; %1 until %2 more blocks&lt;br&gt;</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="227"/> <source>Message:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="229"/> <source>Comment:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="231"/> <source>Transaction ID:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="234"/> <source>Generated coins must wait 520 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, it will change to &quot;not accepted&quot; and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiondesc.cpp" line="236"/> <source>Staked coins must wait 520 blocks before they can return to balance and be spent. When you generated this proof-of-stake block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to &quot;not accepted&quot; and not be a valid stake. This may occasionally happen if another node generates a proof-of-stake block within a few seconds of yours.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="14"/> <source>Transaction details</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/transactiondescdialog.ui" line="20"/> <source>This pane shows a detailed description of the transaction</source> <translation type="unfinished"></translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="214"/> <source>Date</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="214"/> <source>Type</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="214"/> <source>Address</source> <translation>Direcció</translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="214"/> <source>Amount</source> <translation type="unfinished"></translation> </message> <message numerus="yes"> <location filename="../transactiontablemodel.cpp" line="281"/> <source>Open for %n block(s)</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="284"/> <source>Open until %1</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="287"/> <source>Offline (%1 confirmations)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="290"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="293"/> <source>Confirmed (%1 confirmations)</source> <translation type="unfinished"></translation> </message> <message numerus="yes"> <location filename="../transactiontablemodel.cpp" line="301"/> <source>Mined balance will be available in %n more blocks</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="307"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="310"/> <source>Generated but not accepted</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="353"/> <source>Received with</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="355"/> <source>Received from</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="358"/> <source>Sent to</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="360"/> <source>Payment to yourself</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="362"/> <source>Mined</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="364"/> <source>Mint by stake</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="403"/> <source>(n/a)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="603"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="605"/> <source>Date and time that the transaction was received.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="607"/> <source>Type of transaction.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="609"/> <source>Destination address of transaction.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactiontablemodel.cpp" line="611"/> <source>Amount removed from or added to balance.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="55"/> <location filename="../transactionview.cpp" line="71"/> <source>All</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="56"/> <source>Today</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="57"/> <source>This week</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="58"/> <source>This month</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="59"/> <source>Last month</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="60"/> <source>This year</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="61"/> <source>Range...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="72"/> <source>Received with</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="74"/> <source>Sent to</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="76"/> <source>To yourself</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="77"/> <source>Mined</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="78"/> <source>Mint by stake</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="79"/> <source>Other</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="85"/> <source>Enter address or label to search</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="91"/> <source>Min amount</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="125"/> <source>Copy address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="126"/> <source>Copy label</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="127"/> <source>Copy amount</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="128"/> <source>Edit label</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="129"/> <source>Show details...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="130"/> <source>Clear orphans</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="273"/> <source>Export Transaction Data</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="274"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="282"/> <source>Confirmed</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="283"/> <source>Date</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="284"/> <source>Type</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="285"/> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <location filename="../transactionview.cpp" line="286"/> <source>Address</source> <translation>Direcció</translation> </message> <message> <location filename="../transactionview.cpp" line="287"/> <source>Amount</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="288"/> <source>ID</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="292"/> <source>Error exporting</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="292"/> <source>Could not write to file %1.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="400"/> <source>Range:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../transactionview.cpp" line="408"/> <source>to</source> <translation type="unfinished"></translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="164"/> <source>Sending...</source> <translation>L&apos;enviament de ...</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="11"/> <source>Warning: Disk space is low </source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="13"/> <source>Usage:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="8"/> <source>Unable to bind to port %d on this computer. Paris is probably already running.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="12"/> <source>Paris version</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="14"/> <source>Send command to -server or Parisd</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="15"/> <source>List commands</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="16"/> <source>Get help for a command</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="17"/> <source>Options:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="18"/> <source>Specify configuration file (default: Paris.conf)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="19"/> <source>Specify pid file (default: Parisd.pid)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="20"/> <source>Generate coins</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="21"/> <source>Don&apos;t generate coins</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="22"/> <source>Start minimized</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="23"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="24"/> <source>Specify data directory</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="25"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="26"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="27"/> <source>Specify connection timeout (in milliseconds)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="28"/> <source>Connect through socks4 proxy</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="29"/> <source>Allow DNS lookups for addnode and connect</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="30"/> <source>Listen for connections on &lt;port&gt; (default: 6901 or testnet: 9903)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="31"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="32"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="33"/> <source>Connect only to the specified node</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="34"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="35"/> <source>Accept connections from outside (default: 1)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="36"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="37"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="38"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="39"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="42"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 10000)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="43"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 10000)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="44"/> <source>Use Universal Plug and Play to map the listening port (default: 1)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="45"/> <source>Use Universal Plug and Play to map the listening port (default: 0)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="46"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="47"/> <source>Accept command line and JSON-RPC commands</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="48"/> <source>Run in the background as a daemon and accept commands</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="49"/> <source>Use the test network</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="50"/> <source>Output extra debugging information</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="51"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="52"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="53"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="54"/> <source>Username for JSON-RPC connections</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="55"/> <source>Password for JSON-RPC connections</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="56"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 6902)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="57"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="58"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="59"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="62"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="63"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="64"/> <source>Rescan the block chain for missing wallet transactions</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="65"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="66"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="67"/> <source> SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="70"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="71"/> <source>Server certificate file (default: server.cert)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="72"/> <source>Server private key (default: server.pem)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="73"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="76"/> <source>This help message</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="77"/> <source>Usage</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="78"/> <source>Cannot obtain a lock on data directory %s. Paris is probably already running.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="81"/> <source>Paris</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="88"/> <source>Error loading wallet.dat: Wallet requires newer version of Paris</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="89"/> <source>Wallet needed to be rewritten: restart Paris to complete</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="103"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=peercoinrpc rpcpassword=%s (you do not need to remember this password) If the file does not exist, create it with owner-readable-only file permissions. </source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="119"/> <source>Warning: Please check that your computer&apos;s date and time are correct. If your clock is wrong Paris will not work properly.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="82"/> <source>Loading addresses...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="83"/> <source>Error loading addr.dat</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="84"/> <source>Loading block index...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="85"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="86"/> <source>Loading wallet...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="87"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="90"/> <source>Error loading wallet.dat</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="91"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="92"/> <source>Cannot initialize keypool</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="93"/> <source>Cannot write default address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="94"/> <source>Rescanning...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="95"/> <source>Done loading</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="96"/> <source>Invalid -proxy address</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="97"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="98"/> <source>Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="101"/> <source>Error: CreateThread(StartNode) failed</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="102"/> <source>To use the %s option</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="112"/> <source>Error</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="113"/> <source>An error occured while setting up the RPC port %i for listening: %s</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="114"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="122"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="123"/> <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"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="126"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="127"/> <source>Sending...</source> <translation type="unfinished">L&apos;enviament de ...</translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="128"/> <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"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="132"/> <source>Invalid amount</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoinstrings.cpp" line="133"/> <source>Insufficient funds</source> <translation type="unfinished"></translation> </message> </context> </TS>
mit
gesh123/MyLibrary
src/client/app/poker/connection/protocol/generated/serializers/PokerNetworkInfoDataSerializer.ts
2125
import { ArrayBufferBuilder } from "../../../../utils/ArrayBufferBuilder"; import { BitsReader } from "../../../../utils/BitsReader"; import { SerializerUtils } from "../../../../utils/SerializerUtils"; import { PokerNetworkInfoData } from "../data/PokerNetworkInfoData"; import { PokerServerLocationData } from "../data/PokerServerLocationData"; import { PokerServerLocationDataSerializer } from "../serializers/PokerServerLocationDataSerializer"; export class PokerNetworkInfoDataSerializer { public static serialize(buffer: ArrayBufferBuilder, data: PokerNetworkInfoData): void { var bitsReader = new BitsReader( buffer ); bitsReader.setBits( data.networkID, 7 ); bitsReader.setBit( data.hasInvalidFranchiseID ); if (data.hasInvalidFranchiseID == false){ buffer.setUint32( data.networkFranchiseID ); } buffer.setUint8( data.networkCurrencyType ); buffer.setInt16( data.timeZone ); for (let i = 0, l = data.locationsVect.length , t = buffer.setUint8( l ); i < l; i++){ let temp = data.locationsVect[i]; PokerServerLocationDataSerializer.serialize(buffer, temp); } buffer.setUint16( data.cpRate ); buffer.setFloat64( data.tbRate ); } public static deserialize(buffer: ArrayBufferBuilder, data: PokerNetworkInfoData): void { var bitsReader = new BitsReader( buffer ); data.networkID = bitsReader.getBits( 7 ); data.hasInvalidFranchiseID = bitsReader.getBit() != 0; if (data.hasInvalidFranchiseID == false){ data.networkFranchiseID = buffer.getUint32(); } data.networkCurrencyType = buffer.getUint8(); data.timeZone = buffer.getInt16(); data.locationsVect = []; for (let i = 0, l = buffer.getUint8(); i < l; i++){ let temp = new PokerServerLocationData(data); PokerServerLocationDataSerializer.deserialize(buffer, temp); data.locationsVect.push( temp ); } data.cpRate = buffer.getUint16(); data.tbRate = buffer.getFloat64(); } }
mit
vamone/Slack-Notification-Desktop-App
Slack.Desktop.Application/SolidColorBrushHelper.cs
1553
using System; using System.Windows.Media; namespace Slack.Desktop.Application { public static class SolidColorBrushHelper { private const string AliceBlueHexColor = "#FFF0F8FF"; private const string SlackIconBlueHexColor = "#FF6ec9dc"; private const string SlackIconGreenHexColor = "#FF3eb991"; private const string SlackIconRedHexColor = "#FFe01563"; private const string SlackIconYellowHexColor = "#FFe9a820"; private const string SlackIconDarkBlueHexColor = "#FF0f363e"; public static SolidColorBrush AliceBlue => GetColorFromHex(AliceBlueHexColor); public static SolidColorBrush SlackBlue => GetColorFromHex(SlackIconBlueHexColor); public static SolidColorBrush SlackGreen => GetColorFromHex(SlackIconGreenHexColor); public static SolidColorBrush SlackRed => GetColorFromHex(SlackIconRedHexColor); public static SolidColorBrush SlackYellow => GetColorFromHex(SlackIconYellowHexColor); public static SolidColorBrush SlackDarkBlue => GetColorFromHex(SlackIconDarkBlueHexColor); public static SolidColorBrush GetColorFromHex(string hexColor) { if(hexColor == null) { throw new ArgumentNullException(nameof(hexColor)); } if(string.IsNullOrWhiteSpace(hexColor)) { throw new ArgumentException(nameof(hexColor)); } return (SolidColorBrush)(new BrushConverter().ConvertFrom(hexColor)); } } }
mit
jeremyevans/rodauth
lib/rodauth/features/change_password_notify.rb
809
# frozen-string-literal: true module Rodauth Feature.define(:change_password_notify, :ChangePasswordNotify) do depends :change_password, :email_base translatable_method :password_changed_email_subject, 'Password Changed' auth_value_methods( :password_changed_email_body ) auth_methods( :create_password_changed_email, :send_password_changed_email ) private def send_password_changed_email send_email(create_password_changed_email) end def create_password_changed_email create_email(password_changed_email_subject, password_changed_email_body) end def password_changed_email_body render('password-changed-email') end def after_change_password super send_password_changed_email end end end
mit
crispab/codekvast
product/server/dashboard/src/test/java/io/codekvast/dashboard/dashboard/response/MethodDescriptor1Test.java
4726
package io.codekvast.dashboard.dashboard.response; import static io.codekvast.javaagent.model.v2.SignatureStatus2.EXCLUDED_BY_PACKAGE_NAME; import static io.codekvast.javaagent.model.v2.SignatureStatus2.INVOKED; import static io.codekvast.javaagent.model.v2.SignatureStatus2.NOT_INVOKED; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; import com.fasterxml.jackson.databind.ObjectMapper; import io.codekvast.dashboard.dashboard.model.methods.ApplicationDescriptor; import io.codekvast.dashboard.dashboard.model.methods.EnvironmentDescriptor; import io.codekvast.dashboard.dashboard.model.methods.MethodDescriptor1; import org.junit.jupiter.api.Test; /** @author olle.hallin@crisp.se */ public class MethodDescriptor1Test { private final long days = 24 * 60 * 60 * 1000L; private final long now = System.currentTimeMillis(); private final long twoDaysAgo = now - 2 * days; private final long fourteenDaysAgo = now - 14 * days; private final long never = 0L; private final ObjectMapper objectMapper = new ObjectMapper(); @Test public void should_calculate_min_max_correctly() { // given MethodDescriptor1 md = buildMethodDescriptor(fourteenDaysAgo, twoDaysAgo, never, twoDaysAgo); // when // then assertThat(toDaysAgo(md.getCollectedSinceMillis()), is(toDaysAgo(fourteenDaysAgo))); assertThat(toDaysAgo(md.getCollectedToMillis()), is(toDaysAgo(twoDaysAgo))); assertThat(md.getCollectedDays(), is(12)); assertThat(toDaysAgo(md.getLastInvokedAtMillis()), is(toDaysAgo(twoDaysAgo))); assertThat(md.getTrackedPercent(), is(67)); assertThat( md.getStatuses(), containsInAnyOrder(INVOKED, NOT_INVOKED, EXCLUDED_BY_PACKAGE_NAME)); } private int toDaysAgo(long timestamp) { return Math.toIntExact((now - timestamp) / days); } @Test public void should_serializable_to_JSON() throws Exception { // given MethodDescriptor1 md = buildMethodDescriptor(fourteenDaysAgo, twoDaysAgo, never, twoDaysAgo); long lastInvokedAtMillis = md.getLastInvokedAtMillis(); // when String json = objectMapper.writeValueAsString(md); // then assertThat(json, containsString("\"lastInvokedAtMillis\":" + lastInvokedAtMillis)); System.out.println( "json = " + objectMapper.writer().withDefaultPrettyPrinter().writeValueAsString(md)); } private MethodDescriptor1 buildMethodDescriptor( long collectedSinceMillis, long collectedToMillis, long invokedAtMillis1, long invokedAtMillis2) { return MethodDescriptor1.builder() .id(1L) .declaringType("declaringType") .modifiers("") .occursInApplication( ApplicationDescriptor.builder() .name("app1") .status(EXCLUDED_BY_PACKAGE_NAME) .collectedSinceMillis(collectedSinceMillis) .collectedToMillis(collectedToMillis) .invokedAtMillis(invokedAtMillis1) .build()) .occursInApplication( ApplicationDescriptor.builder() .name("app2") .status(NOT_INVOKED) .collectedSinceMillis(collectedSinceMillis + 10) .collectedToMillis(collectedToMillis - 10) .invokedAtMillis(invokedAtMillis1 - 10) .build()) .occursInApplication( ApplicationDescriptor.builder() .name("app3") .status(INVOKED) .collectedSinceMillis(collectedSinceMillis) .collectedToMillis(collectedToMillis) .invokedAtMillis(invokedAtMillis2) .build()) .collectedInEnvironment( EnvironmentDescriptor.builder() .name("test") .collectedSinceMillis(collectedSinceMillis) .collectedToMillis(collectedToMillis) .invokedAtMillis(invokedAtMillis2) .build() .computeFields()) .collectedInEnvironment( EnvironmentDescriptor.builder() .name("customer1") .collectedSinceMillis(collectedSinceMillis) .collectedToMillis(collectedToMillis) .invokedAtMillis(invokedAtMillis2) .build() .computeFields()) .packageName("packageName") .signature("signature") .visibility("public") .bridge(null) .synthetic(false) .location("location1") .location("location2") .build() .computeFields(); } }
mit
Aliance/Kanchanaburi
source/Error/Exception/UndefinedVariableException.php
182
<?php namespace Aliance\Kanchanaburi\Error\Exception; /** * Exception for PHP "undefined variable" notice errors */ class UndefinedVariableException extends PhpNoticeException {}
mit
Cotidia/cotidia-cms-base
cmsbase/static/admin/js/page.js
2150
$(document).ready(function(){ $('.add-row a').click(function(){ select_language(); setup_redactor(); set_prepopulate(); }); select_language(); set_flag(); set_prepopulate(); related_pages(); }); //Set readactor textarea function setup_redactor(){ var redactor_fields = $('[class*="dynamic-"] .redactor_box textarea.redactor_content').last(); var redactor_fields_boxes = $('[class*="dynamic-"] .redactor_box').last(); $.each(redactor_fields_boxes, function(i, index){ $(index).after(redactor_fields[i]); $(index).next('textarea').redactor({ imageUpload: '/uploads/ajax/photos/upload/', imageGetJson: '/uploads/ajax/photos/recent/', fileUpload: '/uploads/ajax/files/upload/', autoresize: false, minHeight:300, boldTag: 'strong', italicTag: 'em', linkAnchor: true, linkEmail: true }); $(index).remove(); }); //var redactor_fields = $("textarea.redactor_content"); } function select_language(){ // Switch flag accordingly $('.field-language_code select').change(function(e){ name = $(this).attr('name').replace('-language_code',''); if($(this).val()) $('#'+name+' h3 img').attr('src','/static/admin/img/flags/'+$(this).val()+'.png'); }) } function set_flag(){ $.each($('.field-language_code select'), function(i, index){ name = $(index).attr('name').replace('-language_code',''); if($(this).val()) $('#'+name+' h3 img').attr('src','/static/admin/img/flags/'+$(this).val()+'.png'); }) } function set_prepopulate(){ if(!$('body').hasClass('action-change')){ $('.field-title input').keyup(function(){ $(this).parent().parent().parent().next().find('input').val(URLify($(this).val(), 100)); }) } } // Behaviour for related pages function related_pages(){ $('.field-related_pages').hide(); $('.field-related_pages').before('<div class="inner"><a href="#" onclick="$(\'.field-related_pages\').slideDown();$(this).parent().hide();" class="btn btn-small">Show related pages</a><br><br></div>'); }
mit
mangalaman93/nfs
voip/ovsd.go
3024
package voip import ( "crypto/rand" "errors" "fmt" "log" "os/exec" ) const ( OVS_BRIDGE = "ovsbr" INET_PREFIX = "173.16.1." INET = INET_PREFIX + "1" NETMASK = "255.255.255.0" ) var ( ErrOvsNotFound = errors.New("openvswitch is not installed") ) var ( cur_ip = 1 ) func runsh(cmd string) ([]byte, error) { return exec.Command("/bin/sh", "-c", cmd).Output() } func ovsdInit() error { out, err := runsh("which ovs-vsctl") if err != nil || string(out) == "" { return ErrOvsNotFound } out, err = runsh("which ovs-docker") if err != nil || string(out) == "" { return ErrOvsNotFound } out, err = runsh("which ovs-ofctl") if err != nil || string(out) == "" { return ErrOvsNotFound } undo := true _, err = runsh("sudo ovs-vsctl br-exists " + OVS_BRIDGE) if err != nil { _, err = runsh("sudo ovs-vsctl add-br " + OVS_BRIDGE) if err != nil { return err } } defer func() { if undo { ovsdDestroy() } }() _, err = runsh("sudo ifconfig " + OVS_BRIDGE + " " + INET + " netmask " + NETMASK + " up") if err != nil { return err } log.Println("[INFO] created ovs bridge", OVS_BRIDGE) undo = false return nil } func ovsdDestroy() { runsh("sudo ovs-vsctl del-br " + OVS_BRIDGE) log.Println("[INFO] deleted ovs bridge") } func ovsdSetupNetwork(id string) (string, string, error) { mac, err := getMacAddress() if err != nil { return "", "", err } cur_ip += 1 ip := INET_PREFIX + fmt.Sprint(cur_ip) _, err = runsh("sudo ovs-docker add-port " + OVS_BRIDGE + " eth0 " + id + " --ipaddress=" + ip + "/24 --macaddress=" + mac) if err != nil { cur_ip -= 1 } return ip, mac, err } func ovsdUSetupNetwork(id string) { _, err := runsh("sudo ovs-docker del-port " + OVS_BRIDGE + " eth0 " + id) if err != nil { log.Println("[INFO] unable to remove interface from container", id, err) } else { log.Println("[INFO] removed interface from container", id) } } // we only route at client // only works for one host (local) func ovsdRoute(cmac, mac, smac string) error { cmd := "sudo ovs-vsctl --data=bare --no-heading --columns=ofport find interface " + "external_ids:attached-mac=\\\"" + cmac + "\\\"" port, err := runsh(cmd) if err != nil { log.Println("[WARN] unable to find client ofport!") return err } cmd = "sudo ovs-ofctl add-flow " + OVS_BRIDGE + " priority=100,ip,dl_src=" + cmac cmd += ",dl_dst=" + smac + ",actions=mod_dl_dst=" + mac + ",resubmit:" + string(port) _, err = runsh(cmd) if err != nil { log.Println("[WARN] unable to setup route for", mac, err) return err } return nil } func ovsdDeRoute(cmac string) { cmd := "sudo ovs-ofctl del-flows " + OVS_BRIDGE + " dl_src=" + cmac _, err := runsh(cmd) if err != nil { log.Println("[WARN] unable to de-setup route for", cmac, err) } } // TODO: unique mac? func getMacAddress() (string, error) { buf := make([]byte, 3) _, err := rand.Read(buf) if err != nil { return "", err } return fmt.Sprintf("00:16:3e:%02x:%02x:%02x", buf[0], buf[1], buf[2]), nil }
mit
kedarmhaswade/impatiently-j8
src/main/java/practice/ej/ConstantExpression.java
789
package practice.ej; public class ConstantExpression { public static void main(String[] args) { demo1(); } static void demo1() { String s1 = "The integer " + Long.MAX_VALUE + " is mighty big."; String s2 = "The integer " + Long.MAX_VALUE + " is mighty big."; System.out.println(s1 == s2); System.out.println(s1.equals(s2)); } static void demo2() { String[] strings = new String[] {"to ", "be ", "or ", "not ", "to ", "be"}; String hamlet1 = "", hamlet2 = ""; for (String s : strings) { hamlet1 += s; } for (String s : strings) { hamlet2 += s; } System.out.println(hamlet1 == hamlet2); System.out.println(hamlet1.equals(hamlet2)); } }
mit
seriousbusinessbe/java-brusselnieuws-rss
java/brusselnieuws-rss/brusselnieuws-rss-reader-model/src/test/java/be/seriousbusiness/brusselnieuws/rss/reader/model/impl/CreatorImplTest.java
1204
package be.seriousbusiness.brusselnieuws.rss.reader.model.impl; import org.junit.Assert; import org.junit.Test; import be.seriousbusiness.brusselnieuws.rss.reader.model.impl.factory.CreatorImplFactory; /** * {@link CreatorImpl} test case. * @author Serious Business * @author Stefan Borghys * @version 1.0 * @since 1.0 */ public class CreatorImplTest { /** * Tests if a clone of a given {@link CreatorImpl} is equal and non-equal after altering it. * @param creatorImpl */ private static final void assertCloneable(final CreatorImpl creatorImpl) { final CreatorImpl clonedCreatorImpl=(CreatorImpl) creatorImpl.clone(); Assert.assertEquals("The clone should be equal to the one it's cloned from",creatorImpl,clonedCreatorImpl); clonedCreatorImpl.setName(String.valueOf(System.currentTimeMillis())); Assert.assertNotEquals("The clone should not be equal to the one it's cloned from after altering it",creatorImpl,clonedCreatorImpl); } /** * Tests if cloning a {@link CreatorImpl} works as expected. */ @Test public void testCloneable() { assertCloneable(CreatorImplFactory.createBrusselNieuws()); assertCloneable(CreatorImplFactory.createNewBrusselNieuws()); } }
mit