repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
radditude/legislately
test/models/gapi_test.rb
118
require 'test_helper' class GapiTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
mit
Spin42/comptaline
lib/comptaline/accounting_entry/clearance.rb
886
module Comptaline module AccountingEntry class Clearance < GeneralOperation def to_a [ action, operation_type, @reference, @amount, format_date(@date), @communication, @currency_code, @accounting_journal, @match_id, @accounting_writing_number, @index ] end private def action "2" end def operation_type "C" end end end end
mit
threeStone313/auto_web
Ecommerce/src/test/java/KWS/prepare/testdata.java
10731
package KWS.prepare; import java.io.FileInputStream; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import org.openqa.selenium.By; import org.testng.Assert; public class testdata extends basePrepare { static FileInputStream filePath; static String caseid; static int stepid=0; static Statement statement; static PreparedStatement pstate; static ResultSet rs = null ; static String[] actions_arr ={"","GoToUrl","Click","Type","RightClick","Pause","SwicthWindow","SwitchIframe","ReturnToMainFrame","Select","Mouseover","ExecuteJS","ExecuteSqls","VerifyTextPresent","VerifyUrl","VerifRegUrl","VerifyElementPresent","VerifyElementNotPresent","Referenced steps pack"}; static Connection conn ; static String[] locator_arr={"","id","classname","name","xpath","eleRepository"}; static ArrayList<Integer> idList = new ArrayList<Integer>(); public static void readExcel(String caseid ) throws IOException, SQLException{ testdata.caseid=caseid; String driver = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql://localhost/ci_test"; String user = "root"; String password = ""; try { Class.forName(driver); } catch (ClassNotFoundException e1) { e1.printStackTrace(); } conn = DriverManager.getConnection(url, user, password); statement = conn.createStatement(); pstate=conn.prepareStatement("select * from `ci_pack_step` where pack_id=? order by `orderby` asc"); try { String data=null; String ele=null; String locator=null; int time=0; int l_num=0; int a_num=0; ResultSet ru; ResultSet le; try { String sql="select * from `ci_case_step` where cid ="+caseid+" order by `orderby` asc"; ru = statement.executeQuery(sql); while(ru.next()){ int pack_id = ru.getInt("pack_id"); a_num = ru.getInt("action"); String a = actions_arr[a_num]; int step_id=0; switch(a){ case "GoToUrl": data=ru.getString("data").replaceAll("\"", "\'"); autoMan.getUrl(data); break; case "Type": data=ru.getString("data").replaceAll("\"", "\'"); l_num = ru.getInt("locator"); locator = locator_arr[l_num]; step_id = ru.getInt("id"); ele=ru.getString("element"); autoMan.getElement(getlocator(locator,ele,step_id)).sendKeys(data); autoMan.sleep(1000); break; case "Click": l_num = ru.getInt("locator"); locator = locator_arr[l_num]; step_id = ru.getInt("id"); ele=ru.getString("element"); autoMan.getElement(getlocator(locator,ele,step_id)).click(); break; case "Pause": time=Integer.valueOf(ru.getString("data")); autoMan.sleep(time); break; case "Mouseover": l_num = ru.getInt("locator"); locator = locator_arr[l_num]; step_id = ru.getInt("id"); ele=ru.getString("element"); autoMan.moveToElement(getlocator(locator,ele,step_id)); break; case "Select": l_num = ru.getInt("locator"); locator = locator_arr[l_num]; step_id = ru.getInt("id"); ele=ru.getString("element"); data=ru.getString("data").replaceAll("\"", "\'"); autoMan.selectByVisibleText(getlocator(locator,ele,step_id), data); break; case "RightClick": l_num = ru.getInt("locator"); locator = locator_arr[l_num]; step_id = ru.getInt("id"); ele=ru.getString("element"); autoMan.rightClick(getlocator(locator,ele,step_id)); break; case "SwicthWindow": int window=ru.getInt("data"); autoMan.switchWindow(window); break; case "SwitchIframe": l_num = ru.getInt("locator"); locator = locator_arr[l_num]; step_id = ru.getInt("id"); ele=ru.getString("element"); autoMan.swicthToFrame(getlocator(locator,ele,step_id)); break; case "ReturnToMainFrame": autoMan.returnToFrame(); break; case "ExecuteJS": data=ru.getString("data").replaceAll("\"", "\'"); autoMan.JSexecute(data); break; case "ExecuteSqls": data=ru.getString("data").replaceAll("\"", "\'"); autoMan.SqlsOperation(sqlUrl,sqlAccount,sqlPassword,data); break; case "VerifyTextPresent": data=ru.getString("data").replaceAll("\"", "\'"); l_num = ru.getInt("locator"); locator = locator_arr[l_num]; step_id = ru.getInt("id"); ele=ru.getString("element"); String b=autoMan.getElement(getlocator(locator,ele,step_id)).getText().replaceAll("\"", "\'"); autoMan.textEquals(data,b); break; case "VerifyElementNotPresent": l_num = ru.getInt("locator"); locator = locator_arr[l_num]; step_id = ru.getInt("id"); ele=ru.getString("element"); autoMan.falseEquals(getlocator(locator,ele,step_id)); break; case "VerifyUrl": data=ru.getString("data").replaceAll("\"", "\'"); autoMan.UrlEquals(data); break; case "VerifRegUrl": data=ru.getString("data").replaceAll("\"", "\'"); autoMan.partOfUrlEquals(data); break; case "VerifyElementPresent": l_num = ru.getInt("locator"); locator = locator_arr[l_num]; step_id = ru.getInt("id"); ele=ru.getString("element"); autoMan.ElementPresent(getlocator(locator,ele,step_id)); break; case "Referenced steps pack": String locate = null; String element = null; String ac=null; String shuju=null; String name=ru.getString("data"); pstate.setInt(1, pack_id); le=pstate.executeQuery(); while(le.next()){ a_num =le.getInt("action"); ac = actions_arr[a_num]; switch(ac){ case "GoToUrl": shuju=le.getString("data").replaceAll("\"", "\'"); autoMan.getUrl(shuju); break; case "Type": shuju=le.getString("data").replaceAll("\"", "\'"); l_num = le.getInt("locator"); locate=locator_arr[l_num]; element=le.getString("element"); autoMan.getElement(getlocator(locate,element,1)).sendKeys(shuju); autoMan.sleep(1000); break; case "Click": l_num = le.getInt("locator"); locate=locator_arr[l_num]; element=le.getString("element"); autoMan.getElement(getlocator(locate,element,1)).click(); break; case "Pause": time=Integer.valueOf(le.getString("data")); autoMan.sleep(time); break; case "Mouseover": l_num = le.getInt("locator"); locate=locator_arr[l_num]; element=le.getString("element"); autoMan.moveToElement(getlocator(locate,element,1)); break; case "Select": l_num = le.getInt("locator"); locate=locator_arr[l_num]; element=le.getString("element"); shuju=le.getString("data").replaceAll("\"", "\'"); autoMan.selectByVisibleText(getlocator(locate,element,1), shuju); break; case "RightClick": l_num = le.getInt("locator"); locate=locator_arr[l_num]; element=le.getString("element"); autoMan.rightClick(getlocator(locate,element,1)); break; case "SwicthWindow": int window2=le.getInt("data"); autoMan.switchWindow(window2); break; case "SwitchIframe": l_num = le.getInt("locator"); locate=locator_arr[l_num]; element=le.getString("element"); autoMan.swicthToFrame(getlocator(locate,element,1)); break; case "ReturnToMainFrame": autoMan.returnToFrame(); break; case "ExecuteJS": shuju=le.getString("data").replaceAll("\"", "\'"); autoMan.JSexecute(shuju); break; case "ExecuteSqls": shuju=le.getString("data").replaceAll("\"", "\'"); autoMan.SqlsOperation(sqlUrl,sqlAccount,sqlPassword,shuju); break; case "VerifyTextPresent": shuju=le.getString("data").replaceAll("\"", "\'"); l_num = le.getInt("locator"); locate=locator_arr[l_num]; element=le.getString("element"); String c=autoMan.getElement(getlocator(locate,element,1)).getText().replaceAll("\"", "\'"); autoMan.textEquals(shuju,c); break; case "VerifyElementNotPresen": l_num = le.getInt("locator"); locate=locator_arr[l_num]; element=le.getString("element"); autoMan.falseEquals(getlocator(locate,element,1)); case "VerifyUrl": shuju=ru.getString("data").replaceAll("\"", "\'"); autoMan.UrlEquals(shuju); break; case "VerifRegUrl": shuju=ru.getString("data").replaceAll("\"", "\'"); autoMan.partOfUrlEquals(shuju); break; case "VerifyElementPresent": l_num = le.getInt("locator"); locate=locator_arr[l_num]; element=le.getString("element"); autoMan.ElementPresent(getlocator(locate,element,1)); break; } } break; } } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); //Assert.fail("step"+idList.get(i)+"错误"); } }catch(Exception e) { e.printStackTrace(); } conn.close(); } public static By getlocator(String locatorWay,String ele, int step_id) throws IOException, SQLException{ By locator=null; if(locatorWay.equalsIgnoreCase("xpath")){ String elee=ele.replaceAll("\"", "\'"); locator=By.xpath(elee); } else if(locatorWay.equalsIgnoreCase("ClassName")){ locator=By.className(ele); } else if(locatorWay.equalsIgnoreCase("id")){ locator=By.id(ele); } else if(locatorWay.equalsIgnoreCase("LinkText")){ locator=By.linkText(ele); } else if(locatorWay.equalsIgnoreCase("Name")){ locator=By.name(ele); } else if(locatorWay.equalsIgnoreCase("eleRepository")){ PreparedStatement pstate2 = conn.prepareStatement("select el.`locator`,el.`element` from ci_ele_repository el left join ci_case_step cs on el.`alias`=cs.`alias` where cs.id=?"); ResultSet le; String locate = null; String element = null; int l_num=0; try { pstate2.setInt(1, step_id); le=pstate2.executeQuery( ); while(le.next()){ l_num = le.getInt("locator"); locate = locator_arr[l_num]; element=le.getString("element"); } return getlocator(locate, element, 1); } catch (SQLException e) { e.printStackTrace(); } }else{ Assert.fail(""+locatorWay+" wrong"); } return locator; } }
mit
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2020-05-01/generated/azure_mgmt_network/operations.rb
8253
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Network::Mgmt::V2020_05_01 # # Operations # class Operations include MsRestAzure # # Creates and initializes a new instance of the Operations class. # @param client service class for accessing basic functionality. # def initialize(client) @client = client end # @return [NetworkManagementClient] reference to the NetworkManagementClient attr_reader :client # # Lists all of the available Network Rest API operations. # # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [Array<Operation>] operation results. # def list(custom_headers:nil) first_page = list_as_lazy(custom_headers:custom_headers) first_page.get_all_items end # # Lists all of the available Network Rest API operations. # # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # def list_with_http_info(custom_headers:nil) list_async(custom_headers:custom_headers).value! end # # Lists all of the available Network Rest API operations. # # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # def list_async(custom_headers:nil) fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'providers/Microsoft.Network/operations' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2020_05_01::Models::OperationListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end # # Lists all of the available Network Rest API operations. # # @param next_page_link [String] The NextLink from the previous successful call # to List operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [OperationListResult] operation results. # def list_next(next_page_link, custom_headers:nil) response = list_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end # # Lists all of the available Network Rest API operations. # # @param next_page_link [String] The NextLink from the previous successful call # to List operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # def list_next_with_http_info(next_page_link, custom_headers:nil) list_next_async(next_page_link, custom_headers:custom_headers).value! end # # Lists all of the available Network Rest API operations. # # @param next_page_link [String] The NextLink from the previous successful call # to List operation. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # def list_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2020_05_01::Models::OperationListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end # # Lists all of the available Network Rest API operations. # # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [OperationListResult] which provide lazy access to pages of the # response. # def list_as_lazy(custom_headers:nil) response = list_async(custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_next_async(next_page_link, custom_headers:custom_headers) end page end end end end
mit
VALIDproject/DyNetFlowVis
src/datatypes/entityContainer.ts
1909
import Entity from './entity'; import {type} from 'os'; /** * This class is used to store a number of entity objects within a container. This arra yor list contains noraml * entity objects and offers some operations on it, e.g. finiding a specific one by name. For example "Agramarkt Austria". */ export default class EntityContainer { private _entities: Array<Entity> public constructor() { this._entities = new Array<Entity>(); } /** * Adds an entity to the container. * @param ent entity to add. */ public addEntity(ent: Entity): void { this._entities.push(ent); } /** * Finds an entity in the container and returns the object. * @param id of the entity to find which is basically the name. * @returns {Entity} the entity and all it's properties. */ public findEntity(id: String): Entity { for(let ent of this._entities) { if(ent.identifier === id) return ent; } return null; } /** * Removes all entities from a container. */ public clearEntities(): void { this._entities = new Array<Entity>(); } /** * Removes a specific entity from the container. * @param ent to be removed. */ public removeEntity(ent: Entity): void { let index = this._entities.indexOf(ent); this._entities.splice(index, 1); } /** * This filters an entity container by an array that is converted to a Set. The Set allows a iteration and guarantees * that the indices stay as well as the uniqueness of the values. It will remove all entities that are in the passed * array. * @param toRemove array that contains indices that are removed. */ public filterEntityContainer(toRemove: number[]): void { let set = new Set(toRemove); this._entities = this._entities.filter((_, index) => !set.has(index)); } get entities():Array<Entity> { return this._entities; } }
mit
fallenswordhelper/fallenswordhelper
src/modules/notepad/monstorLog/monstorLog.js
4023
import buildHtml from './buildHtml'; import calf from '../../support/calf'; import doSortParams from '../../common/doSortParams'; import getArrayByClassName from '../../common/getArrayByClassName'; import getElementById from '../../common/getElementById'; import hasClass from '../../common/hasClass'; import jQueryPresent from '../../common/jQueryPresent'; import keys from '../../common/keys'; import numberSort from '../../system/numberSort'; import onclick from '../../common/onclick'; import { pCC } from '../../support/layout'; import partial from '../../common/partial'; import setInnerHtml from '../../dom/setInnerHtml'; import stringSort from '../../system/stringSort'; import { get, set } from '../../system/idb'; let content; let monsterAry; function noMobs() { setInnerHtml('<span>No monster information! Please enable entity log ' + 'and travel a bit to see the world</span>', content); } function makeRow(el) { return '<tr>' + `<td class="fshCenter">${el.image}</td>` + `<td>${el.name}</td>` + `<td class="fshCenter">${el.creature_class}</td>` + `<td class="fshCenter">${el.level}</td>` + `<td class="fshCenter">${el.attack}</td>` + `<td class="fshCenter">${el.defense}</td>` + `<td class="fshCenter">${el.armor}</td>` + `<td class="fshCenter">${el.damage}</td>` + `<td class="fshCenter">${el.hp}</td>` + `<td class="fshCenter">${el.enhancements}</td></tr>`; } function mobRows() { return monsterAry.map(makeRow).join(''); } function drawMobs() { const inject = getElementById('entityTableOutput'); if (!monsterAry || !inject) { return; } setInnerHtml(mobRows(), inject); } function findSortType(target) { return target.getAttribute('sortType') || 'string'; } function sortMonsterAry(sortType) { if (sortType === 'string') { monsterAry.sort(stringSort); } else { monsterAry.sort(numberSort); } } function sortCol(target) { doSortParams(target); const sortType = findSortType(target); sortMonsterAry(sortType); drawMobs(); } function isSortHeader(target) { return hasClass('fshLink', target) && target.hasAttribute('sortkey'); } function doHandlers(evt) { const { target } = evt; if (target.id === 'clearEntityLog') { set('fsh_monsterLog', ''); noMobs(); return; } if (isSortHeader(target)) { sortCol(target); } } function drawTable() { if (!monsterAry) { return; } setInnerHtml('<table cellspacing="0" cellpadding="0" border="0" ' + 'width="100%"><tr class="fshBlack fshWhite">' + '<td width="90%" class="fshCenter"><b>Entity Information</b></td>' + '<td width="10%">[<span id="clearEntityLog" class="fshPoint">Clear' + '</span>]</td></tr></table>' + '<table cellspacing="1" cellpadding="2" border="0"><thead>' + '<tr class="fshVerySoftOrange">' + '<th width="25%" class="fshLink" sortkey="name" colspan="2">Entity</th>' + '<th class="fshCenter fshLink" sortkey="creature_class">Class</th>' + '<th class="fshCenter fshLink" sortkey="level" sorttype="number">Lvl</th>' + '<th class="fshCenter">Attack</th>' + '<th class="fshCenter">Defence</th>' + '<th class="fshCenter">Armor</th>' + '<th class="fshCenter">Damage</th>' + '<th class="fshCenter">HP</th>' + '<th class="fshCenter">Enhancements</th>' + '</tr></thead><tbody id="entityTableOutput"></tbody></table>', content); onclick(content, doHandlers); } function prepMonster(data) { monsterAry = keys(data).map(partial(buildHtml, data)); } function prepAry(data) { if (!data) { noMobs(); return; } prepMonster(data); calf.sortBy = 'level'; calf.sortAsc = true; monsterAry.sort(numberSort); drawTable(); drawMobs(); } function haveJquery(injector) { // jQuery.min content = injector || pCC; if (!content) { return; } get('fsh_monsterLog').then(prepAry); getArrayByClassName('ui-dialog-titlebar-close').forEach((e) => e.blur()); } export default function monstorLog(injector) { if (jQueryPresent()) { haveJquery(injector); } }
mit
holyshared/peridot-temporary-plugin
RoboFile.php
976
<?php use \Robo\Tasks; use \coverallskit\robo\loadTasks as CoverallsKitTasks; use \holyshared\peridot\robo\loadTasks as PeridotTasks; /** * Class RoboFile */ class RoboFile extends Tasks { use PeridotTasks; use CoverallsKitTasks; public function specAll() { $result = $this->taskPeridot() ->directoryPath('spec') ->reporter('dot') ->bail() ->run(); return $result; } public function coverallsUpload() { $result = $this->taskCoverallsKit() ->configureBy('.coveralls.toml') ->run(); return $result; } public function exampleBasic() { $result = $this->taskPeridot() ->directoryPath('example/spec') ->configuration('example/peridot.php') ->reporter('dot') ->bail() ->run(); return $result; } }
mit
flyingluscas/Laravel-BugNotifier
tests/MailDriverTest.php
2031
<?php namespace FlyingLuscas\BugNotifier; use Mockery; use MailThief\Testing\InteractsWithMail; use FlyingLuscas\BugNotifier\Drivers\MailDriver; class MailDriverTest extends TestCase { use InteractsWithMail; /** * @test */ public function it_can_send_email_to_multiple_addresses() { $driver = $this->getDriver(); $title = 'Some dummy title'; $body = 'Some dummy message'; $message = $this->getMessage($title, $body); $addresses = config('bugnotifier.mail.to'); $driver->handle($message); foreach ($addresses as $address) { $this->seeMessageFor($address); } $this->seeMessageWithSubject($title); $this->assertTrue($this->lastMessage()->contains($body)); } /** * @test */ public function it_can_send_email_to_one_address() { $driver = $this->getDriver(); $title = 'Some dummy title'; $body = 'Some dummy message'; $message = $this->getMessage($title, $body); config([ 'bugnotifier.mail.to.address' => '[email protected]', ]); $address = config('bugnotifier.mail.to.address'); $driver->handle($message); $this->seeMessageFor($address); $this->seeMessageWithSubject($title); $this->assertTrue($this->lastMessage()->contains($body)); } /** * Get message mock. * * @param string $title * @param string $body * * @return \FlyingLuscas\BugNotifier\Message */ private function getMessage($title, $body) { return Mockery::mock(Message::class, function ($mock) use ($title, $body) { $mock->shouldReceive('getTitle')->andReturn($title); $mock->shouldReceive('getBody')->andReturn($body); }); } /** * Get driver instance. * * @return \FlyingLuscas\BugNotifier\Drivers\MailDriver */ private function getDriver() { return new MailDriver; } }
mit
HungryAnt/AntWpfDemos
AntWpfDemos/Demo07/Properties/AssemblyInfo.cs
2195
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Demo07")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Demo07")] [assembly: AssemblyCopyright("Copyright © Microsoft 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] //若要开始生成可本地化的应用程序,请在 //<PropertyGroup> 中的 .csproj 文件中 //设置 <UICulture>CultureYouAreCodingWith</UICulture>。例如,如果您在源文件中 //使用的是美国英语,请将 <UICulture> 设置为 en-US。然后取消 //对以下 NeutralResourceLanguage 特性的注释。更新 //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //主题特定资源词典所处位置 //(在页面或应用程序资源词典中 // 未找到某个资源的情况下使用) ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 //(在页面、应用程序或任何主题特定资源词典中 // 未找到某个资源的情况下使用) )] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 内部版本号 // 修订号 // // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
Rajagunasekaran/sample
application/models/EILIB/Mdl_eilib_currency_to_word.php
5227
<?php //******************************************CURRENCTY TO WORD********************************************// //DONE BY:SARADAMBAL //VER 5.5-SD:03/06/2015 ED:03/06/2015,CHANGED FILE NAME //VER 0.01-SD:12/05/2015 ED:12/02/2015,COMPLETED CURRENCY TO WORD //*******************************************************************************************************// class Mdl_eilib_currency_to_word extends CI_Model { public function currency_To_Word($amt){ $amtSplit=explode('.',$amt); $dollar= $this->toText($amtSplit[0]); if($amtSplit[1]>0) $cent= $this->toText($amtSplit[1]); if($amtSplit[1]>0) return $dollar.($amtSplit[0]==1?' Dollar and ':' Dollars and ').$cent.($amtSplit[1]==01?' Cent ':' Cents'); else return $dollar.($amtSplit[0]==1?' Dollar and ':' Dollars'); } public function toText($amt) { if (is_numeric($amt)) { $sign = $amt >= 0 ? '' : 'Negative '; return $sign . $this->toQuadrillions(abs($amt)); } else { throw new Exception('Only numeric values are allowed.'); } } private function toOnes($amt) { $words = array( 0 => 'Zero', 1 => 'One', 2 => 'Two', 3 => 'Three', 4 => 'Four', 5 => 'Five', 6 => 'Six', 7 => 'Seven', 8 => 'Eight', 9 => 'Nine' ); if ($amt >= 0 && $amt < 10) return $words[$amt]; else throw new ArrayIndexOutOfBoundsException('Array Index not defined'); } private function toTens($amt) { // handles 10 - 99 $firstDigit = intval($amt / 10); $remainder = $amt % 10; if ($firstDigit == 1) { $words = array( 0 => 'Ten', 1 => 'Eleven', 2 => 'Twelve', 3 => 'Thirteen', 4 => 'Fourteen', 5 => 'Fifteen', 6 => 'Sixteen', 7 => 'Seventeen', 8 => 'Eighteen', 9 => 'Nineteen' ); return $words[$remainder]; } else if ($firstDigit >= 2 && $firstDigit <= 9) { $words = array( 2 => 'Twenty', 3 => 'Thirty', 4 => 'Fourty', 5 => 'Fifty', 6 => 'Sixty', 7 => 'Seventy', 8 => 'Eighty', 9 => 'Ninety' ); $rest = $remainder == 0 ? '' : $this->toOnes($remainder); return $words[$firstDigit] . ' ' . $rest; } else return $this->toOnes($amt); } private function toHundreds($amt) { $ones = intval($amt / 100); $remainder = $amt % 100; if ($ones >= 1 && $ones < 10) { $rest = $remainder == 0 ? '' : $this->toTens($remainder); return $this->toOnes($ones) . ' Hundred ' . $rest; } else return $this->toTens($amt); } private function toThousands($amt) { $hundreds = intval($amt / 1000); $remainder = $amt % 1000; if ($hundreds >= 1 && $hundreds < 1000) { $rest = $remainder == 0 ? '' : $this->toHundreds($remainder); return $this->toHundreds($hundreds) . ' Thousand ' . $rest; } else return $this->toHundreds($amt); } private function toMillions($amt) { $hundreds = intval($amt / pow(1000, 2)); $remainder = $amt % pow(1000, 2); if ($hundreds >= 1 && $hundreds < 1000) { $rest = $remainder == 0 ? '' : $this->toThousands($remainder); return $this->toHundreds($hundreds) . ' Million ' . $rest; } else return $this->toThousands($amt); } private function toBillions($amt) { $hundreds = intval($amt / pow(1000, 3)); /* Note:taking the modulos results in a negative value, but this seems to work pretty fine */ $remainder = $amt - $hundreds * pow(1000, 3); if ($hundreds >= 1 && $hundreds < 1000) { $rest = $remainder == 0 ? '' : $this->toMillions($remainder); return $this->toHundreds($hundreds) . ' Billion ' . $rest; } else return $this->toMillions($amt); } private function toTrillions($amt) { $hundreds = intval($amt / pow(1000, 4)); $remainder = $amt - $hundreds * pow(1000, 4); if ($hundreds >= 1 && $hundreds < 1000) { $rest = $remainder == 0 ? '' : $this->toBillions($remainder); return $this->toHundreds($hundreds) . ' Trillion ' . $rest; } else return $this->toBillions($amt); } private function toQuadrillions($amt) { $hundreds = intval($amt / pow(1000, 5)); $remainder = $amt - $hundreds * pow(1000, 5); if ($hundreds >= 1 && $hundreds < 1000) { $rest = $remainder == 0 ? '' : $this->toTrillions($remainder); return $this->toHundreds($hundreds) . ' Quadrillion ' . $rest; } else return $this->toTrillions($amt); } } ?>
mit
linde002/gstandaard-bundle
Model/GsDailyDefinedDoseQuery.php
210
<?php namespace PharmaIntelligence\GstandaardBundle\Model; use PharmaIntelligence\GstandaardBundle\Model\om\BaseGsDailyDefinedDoseQuery; class GsDailyDefinedDoseQuery extends BaseGsDailyDefinedDoseQuery { }
mit
jeremywrnr/life-of-the-party
SensorKinect-unstable/Source/XnDeviceSensorV2/XnJpegToRGBImageProcessor.cpp
4650
/**************************************************************************** * * * PrimeSense Sensor 5.x Alpha * * Copyright (C) 2011 PrimeSense Ltd. * * * * This file is part of PrimeSense Sensor. * * * * PrimeSense Sensor is free software: you can redistribute it and/or modify* * it under the terms of the GNU Lesser General Public License as published * * by the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * PrimeSense Sensor is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with PrimeSense Sensor. If not, see <http://www.gnu.org/licenses/>.* * * ****************************************************************************/ //--------------------------------------------------------------------------- // Includes //--------------------------------------------------------------------------- #include "XnJpegToRGBImageProcessor.h" #include <XnProfiling.h> //--------------------------------------------------------------------------- // Code //--------------------------------------------------------------------------- XnJpegToRGBImageProcessor::XnJpegToRGBImageProcessor(XnSensorImageStream* pStream, XnSensorStreamHelper* pHelper, XnFrameBufferManager* pBufferManager) : XnImageProcessor(pStream, pHelper, pBufferManager) { SetAllowDoubleSOFPackets(TRUE); } XnJpegToRGBImageProcessor::~XnJpegToRGBImageProcessor() { XnStreamFreeUncompressImageJ(&m_JPEGContext); } XnStatus XnJpegToRGBImageProcessor::Init() { XnStatus nRetVal = XN_STATUS_OK; nRetVal = XnImageProcessor::Init(); XN_IS_STATUS_OK(nRetVal); XN_VALIDATE_BUFFER_ALLOCATE(m_RawData, GetExpectedOutputSize()); nRetVal = XnStreamInitUncompressImageJ(&m_JPEGContext); XN_IS_STATUS_OK(nRetVal); return (XN_STATUS_OK); } void XnJpegToRGBImageProcessor::ProcessFramePacketChunk(const XnSensorProtocolResponseHeader* /*pHeader*/, const XnUChar* pData, XnUInt32 /*nDataOffset*/, XnUInt32 nDataSize) { XN_PROFILING_START_SECTION("XnJpegToRGBImageProcessor::ProcessFramePacketChunk") // append to raw buffer if (m_RawData.GetFreeSpaceInBuffer() < nDataSize) { xnLogWarning(XN_MASK_SENSOR_PROTOCOL_IMAGE, "Bad overflow image! %d", m_RawData.GetSize()); FrameIsCorrupted(); m_RawData.Reset(); } else { m_RawData.UnsafeWrite(pData, nDataSize); } XN_PROFILING_END_SECTION } void XnJpegToRGBImageProcessor::OnStartOfFrame(const XnSensorProtocolResponseHeader* pHeader) { XnImageProcessor::OnStartOfFrame(pHeader); m_RawData.Reset(); } void XnJpegToRGBImageProcessor::OnEndOfFrame(const XnSensorProtocolResponseHeader* pHeader) { XN_PROFILING_START_SECTION("XnJpegToRGBImageProcessor::OnEndOfFrame") // xnOSSaveFile("c:\\temp\\fromSensor.jpeg", m_RawData.GetData(), m_RawData.GetSize()); XnBuffer* pWriteBuffer = GetWriteBuffer(); XnUInt32 nOutputSize = pWriteBuffer->GetMaxSize(); XnStatus nRetVal = XnStreamUncompressImageJ(&m_JPEGContext, m_RawData.GetData(), m_RawData.GetSize(), pWriteBuffer->GetUnsafeWritePointer(), &nOutputSize); if (nRetVal != XN_STATUS_OK) { xnLogWarning(XN_MASK_SENSOR_PROTOCOL_IMAGE, "Failed to uncompress JPEG for frame %d: %s (%d)\n", GetCurrentFrameID(), xnGetStatusString(nRetVal), pWriteBuffer->GetSize()); FrameIsCorrupted(); XnDumpFile* badImageDump = xnDumpFileOpen(XN_DUMP_BAD_IMAGE, "BadImage_%d.jpeg", GetCurrentFrameID()); xnDumpFileWriteBuffer(badImageDump, m_RawData.GetData(), m_RawData.GetSize()); xnDumpFileClose(badImageDump); } pWriteBuffer->UnsafeUpdateSize(nOutputSize); m_RawData.Reset(); XnImageProcessor::OnEndOfFrame(pHeader); XN_PROFILING_END_SECTION }
mit
Azure/azure-sdk-for-ruby
management/azure_mgmt_storage/lib/2018-07-01/generated/azure_mgmt_storage/models/permissions.rb
423
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Storage::Mgmt::V2018_07_01 module Models # # Defines values for Permissions # module Permissions R = "r" D = "d" W = "w" L = "l" A = "a" C = "c" U = "u" P = "p" end end end
mit
durandj/packer
tests/small/cli/test_convert.py
1217
#!/usr/bin/env python """ Tests for the convert command """ import json import tempfile import typing import unittest.mock import yaml import packer.cli from .base import CliTestCase class TestConvert(CliTestCase): """ Tests for the convert command """ def test_malformed_data(self): """ Tests that malformed data is caught """ result = self.cli_runner.invoke( packer.cli.packer_cli, ['convert', 'json', 'yaml'], input='{', ) self.assert_exit_equals( 1, result, 'Command terminated correctly', ) def test_converted(self): """ Tests that the data is converted into the requested format """ data = {'key': 'value'} result = self.cli_runner.invoke( packer.cli.packer_cli, ['convert', 'json', 'yaml'], input=json.dumps(data), ) self.assert_exit_success(result, 'command exited correctly') self.assertEqual( yaml.dump(data, indent=4, default_flow_style=False) + '\n', result.output, 'Data was converted to YAML', )
mit
jjchiw/gelf4net
examples/SimpleConsoleApplication/Program.cs
1414
using log4net; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace SimpleConsoleApplication { internal class Program { protected static readonly ILog log = LogManager.GetLogger(typeof(Program)); private static void Main(string[] args) { var stop = new Stopwatch(); stop.Start(); log4net.Config.XmlConfigurator.Configure(); stop.Stop(); Console.WriteLine(string.Format("Time elapsed configuration {0}", stop.ElapsedMilliseconds)); Console.WriteLine("Write a sentence, q to quit"); var text = Console.ReadLine(); while (text != "q") { stop.Start(); //log.Debug(String.Format("Randomizer Sentence: {0}", text)); log.Debug(new { Message = String.Format("Randomizer Sentence: {0}", text), Open = DateTime.UtcNow }); stop.Stop(); Console.WriteLine(string.Format("Time elapsed configuration {0}", stop.ElapsedMilliseconds)); Console.WriteLine("Sent {0}", text); text = Console.ReadLine(); Console.WriteLine("Sent"); } } } }
mit
dracoapi/nodedracoapi
bin/examples/createUser.js
1994
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const fs = require("fs"); const DracoNode = require("../index"); function generateDeviceId() { return '00000000-0000-4000-8000-000000000000'.replace(/0/g, () => (0 | Math.random() * 16).toString(16)).toUpperCase(); } function generateNickname() { const chars = 'abcdefghijklmnopqrstuvwxyz'; let name = ''; for (let i = 0; i < 8; i++) { name += chars[Math.floor(Math.random() * chars.length)]; } return name; } async function main() { console.log('Starting...'); const draco = new DracoNode.Client({ // proxy: 'http://localhost:8888', }); console.log('Boot...'); await draco.boot({ deviceId: generateDeviceId(), }); console.log('Init login...'); await draco.login(); console.log('Generate nickname...'); let nickname = generateNickname(); let response = await draco.validateNickname(nickname); while (response != null && response.error === DracoNode.enums.FNicknameValidationError.DUPLICATE) { nickname = response.suggestedNickname; response = await this.validateNickname(nickname); } if (response) throw new Error('Unable to register nickname. Error: ' + response.error); console.log(' nickname: ' + nickname); console.log('Accept tos...'); await draco.acceptTos(); console.log('Register account...'); await draco.register(nickname); console.log('Set avatar...'); response = await draco.setAvatar(271891); console.log('Save data into users.json...'); let users = []; if (fs.existsSync('users.json')) { users = JSON.parse(fs.readFileSync('users.json', 'utf8')); } users.push(draco.user); fs.writeFileSync('users.json', JSON.stringify(users, null, 2), 'utf8'); // console.log('Load...'); // await draco.load(); console.log('Done.'); } main() .catch(e => { console.log(e); }); //# sourceMappingURL=createUser.js.map
mit
DeckerCHAN/MaintenanceManagementSystem
Persistence/DataEntityBuilder.cs
827
using System; using System.Collections.Generic; using System.Configuration; using System.Data.Entity; using System.Linq; using System.Text; namespace MMS.Persistence { public static class DataEntityBuilder { public static MMSEntities BuildMmsEntities(String connectString) { return new MMSEntities(connectString); } public static MMSEntities BuildMmsEntities() { var configFileMap = new ExeConfigurationFileMap(); configFileMap.ExeConfigFilename = "Config\\Persistence.config"; Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None); return BuildMmsEntities(config.ConnectionStrings.ConnectionStrings["MMSEntities"].ConnectionString); } } }
mit
chengFeiBlog/angular2Demo
src/app/app.component.ts
1040
/* * Angular 2 decorators and services */ import { Component, ViewEncapsulation } from '@angular/core'; import { AppState } from './app.service'; /* * App Component * Top Level Component */ @Component({ selector: 'app', encapsulation: ViewEncapsulation.None, styleUrls: [ './app.style.css' ], template: ` <router-outlet></router-outlet> ` }) export class App { angularclassLogo = 'assets/img/angularclass-avatar.png'; name = 'Angular 2 Webpack Starter'; url = 'https://twitter.com/AngularClass'; constructor( public appState: AppState) { } ngOnInit() { console.log('Initial App State', this.appState.state); } } /* * Please review the https://github.com/AngularClass/angular2-examples/ repo for * more angular app examples that you may copy/paste * (The examples may not be updated as quickly. Please open an issue on github for us to update it) * For help or questions please contact us at @AngularClass on twitter * or our chat on Slack at https://AngularClass.com/slack-join */
mit
chughgaurav/MostViewedPogFinder
aggregate.lua
186
function count(s) function mapper(rec) return 1 end local function reducer(v1, v2) return v1 + v2 end return s : map(mapper) : reduce(reducer) end
mit
hyrise/hyrise
src/lib/storage/base_segment_encoder.hpp
5353
#pragma once #include <memory> #include <type_traits> #include <boost/hana/type.hpp> #include "all_type_variant.hpp" #include "resolve_type.hpp" #include "storage/abstract_encoded_segment.hpp" #include "storage/abstract_segment.hpp" #include "storage/create_iterable_from_segment.hpp" #include "storage/encoding_type.hpp" #include "storage/vector_compression/vector_compression.hpp" #include "types.hpp" #include "utils/assert.hpp" namespace opossum { namespace hana = boost::hana; class LZ4Encoder; /** * @brief Base class of all segment encoders */ class BaseSegmentEncoder { public: virtual ~BaseSegmentEncoder() = default; /** * @brief Returns true if the encoder supports the given data type. */ virtual bool supports(DataType data_type) const = 0; /** * @brief Encodes a value segment that has the given data type. * * @return encoded segment if data type is supported else throws exception */ virtual std::shared_ptr<AbstractEncodedSegment> encode(const std::shared_ptr<const AbstractSegment>& segment, DataType data_type) = 0; virtual std::unique_ptr<BaseSegmentEncoder> create_new() const = 0; /** * @defgroup Interface for selecting the used vector compression type * * Many encoding schemes use the following principle to compress data: * Replace a set of large integers (or values of any data type) with * a set of mostly smaller integers using an invertible transformation. * Compress the resulting set using vector compression (null suppression). * * @{ */ virtual bool uses_vector_compression() const = 0; virtual void set_vector_compression(VectorCompressionType type) = 0; /**@}*/ }; template <typename Derived> class SegmentEncoder : public BaseSegmentEncoder { public: /** * @defgroup Virtual interface implementation * @{ */ bool supports(DataType data_type) const final { bool result{}; resolve_data_type(data_type, [&](auto data_type_c) { result = this->supports(data_type_c); }); return result; } // Resolves the data type and calls the appropriate instantiation of encode(). std::shared_ptr<AbstractEncodedSegment> encode(const std::shared_ptr<const AbstractSegment>& segment, DataType data_type) final { auto encoded_segment = std::shared_ptr<AbstractEncodedSegment>{}; resolve_data_type(data_type, [&](auto data_type_c) { const auto data_type_supported = this->supports(data_type_c); // clang-format off if constexpr (hana::value(data_type_supported)) { /** * The templated method encode() where the actual encoding happens * is only instantiated for data types supported by the encoding type. */ encoded_segment = this->encode(segment, data_type_c); } else { Fail("Passed data type not supported by encoding."); } // clang-format on }); return encoded_segment; } std::unique_ptr<BaseSegmentEncoder> create_new() const final { return std::make_unique<Derived>(); } bool uses_vector_compression() const final { return Derived::_uses_vector_compression; } void set_vector_compression(VectorCompressionType type) final { Assert(uses_vector_compression(), "Vector compression type can only be set if supported by encoder."); _vector_compression_type = type; } /**@}*/ public: /** * @defgroup Non-virtual interface * @{ */ /** * @return an integral constant implicitly convertible to bool * * Since this method is used in compile-time expression, * it cannot simply return bool. * * Hint: Use hana::value() if you want to use the result * in a constant expression such as constexpr-if. */ template <typename ColumnDataType> auto supports(hana::basic_type<ColumnDataType> data_type) const { return encoding_supports_data_type(Derived::_encoding_type, data_type); } /** * @brief Encodes a value segment with the given data type. * * Compiles only for supported data types. */ template <typename ColumnDataType> std::shared_ptr<AbstractEncodedSegment> encode(const std::shared_ptr<const AbstractSegment>& abstract_segment, hana::basic_type<ColumnDataType> data_type_c) { static_assert(decltype(supports(data_type_c))::value); const auto iterable = create_any_segment_iterable<ColumnDataType>(*abstract_segment); // For now, we allocate without a specific memory source. return _self()._on_encode(iterable, PolymorphicAllocator<ColumnDataType>{}); } /**@}*/ protected: VectorCompressionType vector_compression_type() const { return _vector_compression_type; } private: // LZ4Encoder only supports BitPacking in order to reduce the compile time, see the comment in lz4_encoder.hpp. VectorCompressionType _vector_compression_type = std::is_same_v<Derived, LZ4Encoder> ? VectorCompressionType::BitPacking : VectorCompressionType::FixedWidthInteger; private: Derived& _self() { return static_cast<Derived&>(*this); } const Derived& _self() const { return static_cast<const Derived&>(*this); } }; } // namespace opossum
mit
iand11/boot-on-the-ground
db/migrate/20170717191843_create_companies.rb
404
class CreateCompanies < ActiveRecord::Migration[5.1] def change create_table :companies do |t| t.string :name, null: false t.string :description t.string :location t.string :image t.attachment :logo t.string :url t.timestamps end end def up add_attachment :companies, :logo end def down remove_attachment :companies, :logo end end
mit
awalker/relation
tests/SelectTest.php
6576
<?php namespace Relation; class SelectTest extends \PHPUnit_Framework_TestCase { function testBasicConstruction() { $select = new Select(null, null, null); $this->assertNotNull($select); return $select; } /** * @depends testBasicConstruction */ function testQ($select) { $this->assertEquals('`foo`', $select->q('foo')); $this->assertEquals('|foo|', $select->q('foo', '|')); } /** * @depends testBasicConstruction */ function testAvoidDoubleQuoting($select) { $this->assertEquals("`foo`", $select->q('`foo`')); $this->assertEquals("|foo|", $select->q('|foo|', '|')); } function testLimit() { $select = new Select(null, null, null, null, 't'); $select->limit(30); $this->assertEquals('SELECT * FROM `t` LIMIT 0, 30', (string)$select); $select->limit(30, 60); $this->assertEquals('SELECT * FROM `t` LIMIT 60, 30', (string)$select); $select->offset(90); $this->assertEquals('SELECT * FROM `t` LIMIT 90, 30', (string)$select); } function testOrder() { $select = new Select(null, null, null, null, 't'); $select->order('foo'); $this->assertEquals('SELECT * FROM `t` ORDER BY foo', (string)$select); $select->order('bar ASC'); $this->assertEquals('SELECT * FROM `t` ORDER BY foo, bar ASC', (string)$select); } /** * @depends testOrder */ function testOrderArray() { $select = new Select(null, null, null, null, 't'); $select->order(array('foo ASC','bar DESC')); $this->assertEquals('SELECT * FROM `t` ORDER BY foo ASC, bar DESC', (string)$select); } /** * @depends testOrder */ function testOrderLazyInput() { $select = new Select(null, null, null, 't'); $select->order(' ASC'); $this->assertEquals('SELECT * FROM `t`', (string)$select); $select->order(' DESC'); $this->assertEquals('SELECT * FROM `t`', (string)$select); } function testFields() { $select = new Select(null, null, null, 't'); $select ->fields('t.*') ->field('u.name'); $this->assertEquals('SELECT t.*, u.name FROM `t`', (string)$select); } function testFieldArray() { $select = new Select(null, null, null, 't'); $select ->fields(array('t.steve', $select->fieldName('id'))) ->field($select->fieldName('u.name')); $this->assertEquals('SELECT t.steve, `t`.`id`, `u`.`name` FROM `t`', (string)$select); } function testSub() { $select = new Select(null, null, null, 't'); $select->sub()->equals('foo', 1)->gt('boo', 3); $select->sub(' GLUE ')->lt('baz', 5)->lte('faz', 7); $this->assertEquals("SELECT * FROM `t` WHERE foo = :foo OR boo > :boo OR (baz < :baz GLUE faz <= :faz)", (string)$select); } /** * @depends testLimit * @depends testOrder */ function testComplex() { $select = new Select(null, null, null, 't'); $select ->where('bar', 2) ->isNull('baz') ->sub()->equals('goo','boo')->isNotNull('qoo') ->order('foo ASC') ->leftJoin('user u')->on('u.id = t.user_id')->gte('u.type', 5) ->field('u.name') ->field('t.steve') ->limit(3,6); $this->assertEquals('SELECT u.name, t.steve FROM `t` LEFT JOIN `user` `u` ON u.id = t.user_id AND u.type >= :type WHERE bar = :bar AND baz IS NULL AND (goo = :goo OR qoo IS NOT NULL) ORDER BY foo ASC LIMIT 6, 3', (string)$select); $this->assertEquals(array('bar'=>2, 'goo'=>'boo', 'type'=>5), $select->parameters()); } function testDryForwardEquals() { $select = new Select(null, null, null, 't'); $select->equals('foo', 'bar'); $select->where('4=1'); $select->where('goo', 'bar'); $this->assertEquals('SELECT * FROM `t` WHERE foo = :foo AND 4=1 AND goo = :goo', (string)$select); } function testDryForwardNotEquals() { $select = new Select(null, null, null, 't'); $select->notEquals('foo', 'bar'); $this->assertEquals('SELECT * FROM `t` WHERE foo <> :foo', (string)$select); } function testDryForwardInArray() { $select = new Select(null, null, null, 't'); $select->inArray('foo', array(1, 2, 3)); $this->assertEquals("SELECT * FROM `t` WHERE foo IN (1,2,3)", (string)$select); } function testRowCount() { $pdo = $this->getMock('PDO', array('prepare'), array('sqlite::memory:')); $pdostmt = $this->getMock('PDOStatement'); $pdostmt->expects($this->once()) ->method('execute'); $pdostmt->expects($this->once()) ->method('rowCount') ->will($this->returnValue(1)); $pdo->expects($this->once()) ->method('prepare') ->with($this->equalTo('SELECT * FROM `t`')) ->will($this->returnValue($pdostmt)); $select = new Select($pdo, null, null, 't'); $select->limit(3,5); $r = $select->rowCount(); $this->assertEquals(1, $r); } function testPrepare() { $pdo = $this->getMock('PDO', array('prepare'), array('sqlite::memory:')); $pdostmt = $this->getMock('PDOStatement'); $pdo->expects($this->once()) ->method('prepare') ->with($this->equalTo('SELECT * FROM `t` LIMIT 5, 3')) ->will($this->returnValue($pdostmt)); $select = new Select($pdo, null, null, 't'); $select->limit(3,5); return $select->prepare(); } function testPrepareCount() { $pdo = $this->getMock('PDO', array('prepare'), array('sqlite::memory:')); $pdostmt = $this->getMock('PDOStatement'); $pdo->expects($this->once()) ->method('prepare') ->with($this->equalTo('SELECT COUNT(*) FROM `t`')) ->will($this->returnValue($pdostmt)); $select = new Select($pdo, null, null, 't'); $select->limit(3,5); return $select->prepare(false, true); } function testGetIterator() { $pdo = $this->getMock('PDO', array('prepare'), array('sqlite::memory:')); $pdostmt = $this->getMock('PDOStatement'); $pdostmt->expects($this->once()) ->method('execute') ->with($this->equalTo(array('foo'=>5))) ->will($this->returnValue(true)); $pdo->expects($this->once()) ->method('prepare') ->with($this->equalTo('SELECT * FROM `t` WHERE foo = :foo')) ->will($this->returnValue($pdostmt)); $select = new Select($pdo, 'stdClass', null, 't'); $select->where('foo', 5); $out = array(); // Can't really mock Traversable :( foreach($select as $obj) { $out[] = $obj; } $this->assertEquals(array(), $out); } function testEmptyWhere() { $select = new Select(null, null, null, 't'); $select ->limit(3, 3) ->where(null); $this->assertEquals('SELECT * FROM `t` LIMIT 3, 3', (string)$select); $this->assertNull($select->parameters()); } }
mit
DonHilborn/DataGenerator
faker/providers/lv_LV/person.py
4365
# -*- coding: utf-8 -*- from __future__ import unicode_literals from ..person import Provider as PersonProvider class Provider(PersonProvider): formats = ( '{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}', '{{last_name}}, {{first_name}}' ) first_names = ( 'Ādams', 'Ādolfs', 'Agris', 'Aigars', 'Ainārs', 'Aivars', 'Alberts', 'Aldis', 'Aleksandrs', 'Alfrēds', 'Andrejs', 'Andris', 'Andrešs', 'Ansis', 'Antons', 'Armands', 'Arnis', 'Arnolds', 'Artis', 'Arturs', 'Artūrs', 'Arvīds', 'Augusts', 'Bērends', 'Bērtulis', 'Brencis', 'Dainis', 'Daniels', 'Dāvis', 'Dzintars', 'Edgars', 'Edmunds', 'Eduards', 'Edvīns', 'Egils', 'Elmārs', 'Elvis', 'Emīls', 'Ēriks', 'Ermanis', 'Ernests', 'Ēvalds', 'Fricis', 'Gatis', 'Gunārs', 'Guntars', 'Guntis', 'Ģederts', 'Ģirts', 'Hanss', 'Harijs', 'Henriks', 'Hermanis', 'Igors', 'Ilmārs', 'Imants', 'Indriķis', 'Ivars', 'Ivo', 'Jakobs', 'Janis', 'Jānis', 'Jannis', 'Jāzeps', 'Jēkabs', 'Jēkaubs', 'Jezups', 'Johans', 'Jūlijs', 'Juris', 'Kārlis', 'Kaspars', 'Konradus', 'Kristaps', 'Kristers', 'Krists', 'Krišjānis', 'Krišs', 'Laimonis', 'Lauris', 'Leons', 'Macs', 'Mareks', 'Māris', 'Mārtiņš', 'Matīss', 'Mihels', 'Mikels', 'Miķelis', 'Modris', 'Nikolajs', 'Niks', 'Normunds', 'Oļģerts', 'Oskars', 'Osvalds', 'Oto', 'Pauls', 'Pēteris', 'Raimonds', 'Raivis', 'Reinis', 'Ričards', 'Rihards', 'Roberts', 'Rolands', 'Rūdolfs', 'Sandis', 'Staņislavs', 'Tenis', 'Teodors', 'Toms', 'Uldis', 'Valdis', 'Viesturs', 'Viktors', 'Vilis', 'Vilnis', 'Viļums', 'Visvaldis', 'Vladislavs', 'Voldemārs', 'Ziedonis', 'Žanis', 'Agnese', 'Aiga', 'Aija', 'Aina', 'Alīda', 'Alise', 'Alma', 'Alvīne', 'Amālija', 'Anete', 'Anita', 'Anna', 'Annija', 'Antoņina', 'Antra', 'Ārija', 'Ausma', 'Austra', 'Baba', 'Baiba', 'Berta', 'Biruta', 'Broņislava', 'Dace', 'Daiga', 'Daina', 'Dārta', 'Diāna', 'Doroteja', 'Dzidra', 'Dzintra', 'Eda', 'Edīte', 'Elīna', 'Elita', 'Elizabete', 'Elvīra', 'Elza', 'Emīlija', 'Emma', 'Ērika', 'Erna', 'Eva', 'Evija', 'Evita', 'Gaida', 'Genovefa', 'Grēta', 'Grieta', 'Gunita', 'Gunta', 'Helēna', 'Ieva', 'Ilga', 'Ilona', 'Ilze', 'Ina', 'Ināra', 'Indra', 'Inese', 'Ineta', 'Inga', 'Ingrīda', 'Inguna', 'Inta', 'Irēna', 'Irma', 'Iveta', 'Jana', 'Janina', 'Jūle', 'Jūla', 'Jūlija', 'Karina', 'Karlīna', 'Katarīna', 'Katrīna', 'Krista', 'Kristiāna', 'Laila', 'Laura', 'Lavīze', 'Leontīne', 'Lība', 'Lidija', 'Liene', 'Līga', 'Ligita', 'Lilija', 'Lilita', 'Līna', 'Linda', 'Līza', 'Lizete', 'Lūcija', 'Madara', 'Made', 'Maija', 'Māra', 'Mare', 'Margareta', 'Margrieta', 'Marija', 'Mārīte', 'Marta', 'Maža', 'Milda', 'Minna', 'Mirdza', 'Monika', 'Natālija', 'Olga', 'Otīlija', 'Paula', 'Paulīna', 'Rasma', 'Regīna', 'Rita', 'Rudīte', 'Ruta', 'Rute', 'Samanta', 'Sandra', 'Sanita', 'Santa', 'Sapa', 'Sarmīte', 'Silvija', 'Sintija', 'Skaidrīte', 'Solvita', 'Tekla', 'Trīne', 'Valda', 'Valentīna', 'Valija', 'Velta', 'Veneranda', 'Vera', 'Veronika', 'Vija', 'Vilma', 'Vineta', 'Vita', 'Zane', 'Zelma', 'Zenta', 'Zigrīda' ) last_names = ( 'Ābele', 'Āboliņš', 'Ābols', 'Alksnis', 'Apinis', 'Apsītis', 'Auniņš', 'Auziņš', 'Avotiņš', 'Balodis', 'Baltiņš', 'Bērziņš', 'Birznieks', 'Bite', 'Briedis', 'Caune', 'Celmiņš', 'Celms', 'Cīrulis', 'Dzenis', 'Dūmiņš', 'Eglītis', 'Jaunzems', 'Kalējs', 'Kalniņš', 'Kaņeps', 'Kārkliņš', 'Kauliņš', 'Kļaviņš', 'Krastiņš', 'Krēsliņš', 'Krieviņš', 'Krievs', 'Krūmiņš', 'Krūze', 'Kundziņš', 'Lācis', 'Lagzdiņš', 'Lapsa', 'Līcis', 'Liepa', 'Liepiņš', 'Lukstiņš', 'Lūsis', 'Paegle', 'Pērkons', 'Podnieks', 'Polis', 'Priede', 'Priedītis', 'Puriņš', 'Purmals', 'Riekstiņš', 'Roze', 'Rozītis', 'Rubenis', 'Rudzītis', 'Saulītis', 'Siliņš', 'Skuja', 'Skujiņš', 'Sproģis', 'Strazdiņš', 'Turiņš', 'Vanags', 'Vīksna', 'Vilciņš', 'Vilks', 'Vītoliņš', 'Vītols', 'Zaķis', 'Zālītis', 'Zariņš', 'Zeltiņš', 'Ziemelis', 'Zirnis', 'Zvaigzne', 'Zvirbulis' )
mit
synctv/synctv-ruby-client
lib/synctv/client/resources/ingest/manifests/smooth.rb
219
class Synctv::Client::Resources::Encodes::Smooth < Synctv::Client::Resource include Synctv::Client::Scopes self.element_name = "smooth_manifest" self.prefix = "/api/v2/ingest_videos/:ingest_video_id/" end
mit
phillipmadsen/grace.repo
app/Repositories/Menu/AbstractMenuDecorator.php
971
<?php namespace App\Repositories\Menu; /** * Class AbstractMenuDecorator. * * @author Phillip Madsen <[email protected]> */ abstract class AbstractMenuDecorator implements MenuInterface { /** * @var MenuInterface */ protected $menu; /** * @param MenuInterface $menu */ public function __construct(MenuInterface $menu) { $this->menu = $menu; } /** * @return mixed */ public function all() { return $this->menu->all(); } /** * @param $menu * @param int $parentId * @param bool $starter * * @return mixed */ public function generateFrontMenu($menu, $parentId = 0, $starter = false) { return $this->menu->generateFrontMenu($menu, $parentId, $starter); } /** * @param $id * * @return bool */ public function hasChildItems($id) { $this->menu->hasChildItems($id); } }
mit
CapCaval/ccProjects
01_src/org/capcaval/c3/sample/tutorial04/numberproducer/NumberProducerEvent.java
1287
/* Copyright (C) 2012 by CapCaval.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package org.capcaval.c3.sample.tutorial04.numberproducer; import org.capcaval.c3.component.ComponentEvent; public interface NumberProducerEvent extends ComponentEvent{ public void notifyValueUpdated(int newValue); }
mit
ai-ku/langvis
src/ai/ku/constraint/AIConstraintRules.java
405
package ai.ku.constraint; public class AIConstraintRules { public boolean isXDynamic; public boolean isYDynamic; public boolean ignoreX; public boolean ignoreY; public boolean isWidthDynamic; public boolean isDepthDynamic; public AIConstraintRules() { isXDynamic = false;; isYDynamic = false;; ignoreX = false; ignoreY = false; isWidthDynamic = false; isDepthDynamic = false; } }
mit
shipitjs/ssh-pool
src/commands/tar.js
898
import { joinCommandArgs, requireArgs } from './util' function formatExcludes(excludes) { return excludes.reduce( (args, current) => [...args, '--exclude', `"${current}"`], [], ) } export function formatTarCommand({ file, archive, excludes, mode }) { let args = ['tar'] switch (mode) { case 'compress': { requireArgs(['file', 'archive'], { file, archive }, 'tar') if (excludes) args = [...args, ...formatExcludes(excludes)] args = [...args, '-czf', archive, file] return joinCommandArgs(args) } case 'extract': { requireArgs(['archive'], { file, archive }, 'tar') args = [...args, '--strip-components=1'] args = [...args, '-xzf', archive] return joinCommandArgs(args) } default: throw new Error( `mode "${mode}" is not valid in "tar" command (valid values: ["extract", "compress"])`, ) } }
mit
yanzhihong23/landlord
app/scripts/controllers/recharge.controller.js
6246
'use strict'; angular.module('landlordApp') .controller('RechargeCtrl', function($scope, $rootScope, $state, UserApi, PayApi, userConfig, md5, utils, toaster, $ionicLoading, $ionicActionSheet, $ionicModal) { var accountInfo, sessionId, mId, payMode = 1, // bank payCode = 2, // recharge extRefNo, storablePan, token; var resendCountdown = utils.resendCountdown($scope); $scope.bankCards = []; $scope.recharge = { amount: $rootScope.amount }; var init = function() { console.log('---------- init RechargeCtrl ------'); accountInfo = userConfig.getAccountInfo(); sessionId = userConfig.getSessionId(); mId = accountInfo.m_id; $scope.balanceUsable = accountInfo.balanceUsable; $scope.recharge.name = accountInfo.realname; $scope.recharge.id = accountInfo.idnum; $scope.recharge.phone = accountInfo.mobilenum; if(accountInfo.realname && accountInfo.idnum) { $scope.disableIdEdit = true; } UserApi.generateOrderNo(sessionId) .success(function(data) { if(data.flag === 1) { extRefNo = data.data; } }); UserApi.getBoundBankList(sessionId) .success(function(data) { if(data.flag === 1) { var arr = data.data; for(var i=0; i<arr.length; i++) { var card = { value: arr[i].kuaiq_short_no, // storablePan text: arr[i].banks_cat + '(尾号' + arr[i].banks_account.substr(-4) + ')' }; $scope.bankCards.push(card); } } $scope.bankCards.push({ text: '添加银行卡', value: 'add' }); $scope.recharge.bankCard = $scope.bankCards[0].value; $scope.recharge.bankCardShow = $scope.bankCards[0].text; }); }; // get bank list PayApi.getBankListForKQ(userConfig.getSessionId()) .success(function(data) { if(data.flag === 1) { $scope.bankList = data.data.map(function(obj) { return { text: obj.name, value: obj.id }; }); $scope.recharge.bankCode = $scope.bankList[0].value; $scope.recharge.bankName = $scope.bankList[0].text; } }); $scope.selectBank = function() { if($scope.bankCards.length === 1) { $rootScope.amount = $scope.recharge.amount; $state.go('account.rechargeNew'); return; } var hideSheet = $ionicActionSheet.show({ buttons: $scope.bankCards, cancelText: '取消', buttonClicked: function(index) { if(index === $scope.bankCards.length-1) { $rootScope.amount = $scope.recharge.amount; $state.go('account.rechargeNew'); } else { $scope.recharge.bankCard = $scope.bankCards[index].value; $scope.recharge.bankCardShow = $scope.bankCards[index].text; hideSheet(); } } }); }; $scope.selectBankNew = function() { var hideSheet = $ionicActionSheet.show({ buttons: $scope.bankList, cancelText: '取消', buttonClicked: function(index) { $scope.recharge.bankCode = $scope.bankList[index].value; $scope.recharge.bankName = $scope.bankList[index].text; hideSheet(); } }); } $scope.quickRecharge = function() { $ionicLoading.show(); var password = md5.createHash($scope.recharge.password); PayApi.quickPay(mId, sessionId, extRefNo, $scope.recharge.bankCard, $scope.recharge.amount, null, null, payMode, payCode, password) .success(function(data) { $ionicLoading.hide(); if(data.flag === 1) { $rootScope.$broadcast('rechargeSuc', $scope.recharge.amount); // reset $scope.recharge.amount = null; $rootScope.amount = null; $scope.recharge.password = null; toaster.pop('success', data.msg); utils.goBack(); } else if(/密码错误/.test(data.msg)) { // wrong password $ionicModal.fromTemplateUrl('views/wrong-password.html', { scope: $scope, animation: 'slide-in-up' }).then(function(modal) { $rootScope.alertModal = modal; $rootScope.alertModal.show(); }); } else { toaster.pop('error', data.msg); } }) }; $scope.$on('modal.hidden', function() { // Execute action $scope.recharge.password = null; }); $scope.closeModal = function() { $rootScope.alertModal.hide(); }; $scope.retrievePassword = function() { $rootScope.alertModal.hide(); $state.go('tabs.retrievePayPassword'); }; $scope.sendSms = function() { $scope.clicked = true; PayApi.getPayVcode( extRefNo, $scope.recharge.name, $scope.recharge.id, 0, mId, $scope.recharge.cardNo, $scope.recharge.phone, $scope.recharge.amount, null, null, payCode, payMode) .success(function(data) { $scope.clicked = false; if(data.flag === 1) { resendCountdown(); storablePan = data.storablePan; token = data.token; toaster.pop('success', data.msg); } else { toaster.pop('error', data.msg); } }); }; $scope.rechargeNew = function() { $ionicLoading.show(); // update kyc info if(!accountInfo.realname) { UserApi.updateKycInfo(sessionId, $scope.recharge.name, $scope.recharge.id, accountInfo.mobilenum) .success(function(data) { if(data.flag === 1) { userConfig.autoLogin(); // get new account info pay(); } else { toaster.pop('error', data.msg); } }); } else { pay(); } }; var pay = function() { PayApi.bindAndPay(mId, sessionId, extRefNo, storablePan, $scope.recharge.amount, $scope.recharge.vcode, token, payMode, payCode, null, null, $scope.recharge.name, $scope.recharge.id, $scope.recharge.cardNo, $scope.recharge.bankCode, $scope.recharge.phone) .success(function(data) { $ionicLoading.hide(); if(data.flag === 1) { $rootScope.$broadcast('rechargeSuc', $scope.recharge.amount); // reset $scope.recharge.amount = null; $rootScope.amount = null; $scope.recharge.cardNo = null; $scope.recharge.vcode = null; toaster.pop('success', data.msg); utils.goBack(2); } else { toaster.pop('error', data.msg); } }); }; init(); $rootScope.$on('balanceUpdated', function() { init(); }); })
mit
chicoxyzzy/react
packages/react-reconciler/src/__tests__/ReactMemo-test.js
16140
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @emails react-core * @jest-environment node */ /* eslint-disable no-func-assign */ 'use strict'; let PropTypes; let React; let ReactNoop; let Suspense; let Scheduler; describe('memo', () => { beforeEach(() => { jest.resetModules(); PropTypes = require('prop-types'); React = require('react'); ReactNoop = require('react-noop-renderer'); Scheduler = require('scheduler'); ({Suspense} = React); }); function span(prop) { return {type: 'span', children: [], prop, hidden: false}; } function Text(props) { Scheduler.unstable_yieldValue(props.text); return <span prop={props.text} />; } async function fakeImport(result) { return {default: result}; } it('warns when giving a ref (simple)', async () => { // This test lives outside sharedTests because the wrappers don't forward // refs properly, and they end up affecting the current owner which is used // by the warning (making the messages not line up). function App() { return null; } App = React.memo(App); function Outer() { return <App ref={() => {}} />; } ReactNoop.render(<Outer />); expect(() => expect(Scheduler).toFlushWithoutYielding()).toErrorDev([ 'Warning: Function components cannot be given refs. Attempts to access ' + 'this ref will fail.', ]); }); it('warns when giving a ref (complex)', async () => { // defaultProps means this won't use SimpleMemoComponent (as of this writing) // SimpleMemoComponent is unobservable tho, so we can't check :) function App() { return null; } App.defaultProps = {}; App = React.memo(App); function Outer() { return <App ref={() => {}} />; } ReactNoop.render(<Outer />); expect(() => expect(Scheduler).toFlushWithoutYielding()).toErrorDev([ 'Warning: Function components cannot be given refs. Attempts to access ' + 'this ref will fail.', ]); }); // Tests should run against both the lazy and non-lazy versions of `memo`. // To make the tests work for both versions, we wrap the non-lazy version in // a lazy function component. sharedTests('normal', (...args) => { const Memo = React.memo(...args); function Indirection(props) { return <Memo {...props} />; } return React.lazy(() => fakeImport(Indirection)); }); sharedTests('lazy', (...args) => { const Memo = React.memo(...args); return React.lazy(() => fakeImport(Memo)); }); function sharedTests(label, memo) { describe(`${label}`, () => { it('bails out on props equality', async () => { function Counter({count}) { return <Text text={count} />; } Counter = memo(Counter); ReactNoop.render( <Suspense fallback={<Text text="Loading..." />}> <Counter count={0} /> </Suspense>, ); expect(Scheduler).toFlushAndYield(['Loading...']); await Promise.resolve(); expect(Scheduler).toFlushAndYield([0]); expect(ReactNoop.getChildren()).toEqual([span(0)]); // Should bail out because props have not changed ReactNoop.render( <Suspense> <Counter count={0} /> </Suspense>, ); expect(Scheduler).toFlushAndYield([]); expect(ReactNoop.getChildren()).toEqual([span(0)]); // Should update because count prop changed ReactNoop.render( <Suspense> <Counter count={1} /> </Suspense>, ); expect(Scheduler).toFlushAndYield([1]); expect(ReactNoop.getChildren()).toEqual([span(1)]); }); it("does not bail out if there's a context change", async () => { const CountContext = React.createContext(0); function readContext(Context) { const dispatcher = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED .ReactCurrentDispatcher.current; return dispatcher.readContext(Context); } function Counter(props) { const count = readContext(CountContext); return <Text text={`${props.label}: ${count}`} />; } Counter = memo(Counter); class Parent extends React.Component { state = {count: 0}; render() { return ( <Suspense fallback={<Text text="Loading..." />}> <CountContext.Provider value={this.state.count}> <Counter label="Count" /> </CountContext.Provider> </Suspense> ); } } const parent = React.createRef(null); ReactNoop.render(<Parent ref={parent} />); expect(Scheduler).toFlushAndYield(['Loading...']); await Promise.resolve(); expect(Scheduler).toFlushAndYield(['Count: 0']); expect(ReactNoop.getChildren()).toEqual([span('Count: 0')]); // Should bail out because props have not changed ReactNoop.render(<Parent ref={parent} />); expect(Scheduler).toFlushAndYield([]); expect(ReactNoop.getChildren()).toEqual([span('Count: 0')]); // Should update because there was a context change parent.current.setState({count: 1}); expect(Scheduler).toFlushAndYield(['Count: 1']); expect(ReactNoop.getChildren()).toEqual([span('Count: 1')]); }); it('accepts custom comparison function', async () => { function Counter({count}) { return <Text text={count} />; } Counter = memo(Counter, (oldProps, newProps) => { Scheduler.unstable_yieldValue( `Old count: ${oldProps.count}, New count: ${newProps.count}`, ); return oldProps.count === newProps.count; }); ReactNoop.render( <Suspense fallback={<Text text="Loading..." />}> <Counter count={0} /> </Suspense>, ); expect(Scheduler).toFlushAndYield(['Loading...']); await Promise.resolve(); expect(Scheduler).toFlushAndYield([0]); expect(ReactNoop.getChildren()).toEqual([span(0)]); // Should bail out because props have not changed ReactNoop.render( <Suspense> <Counter count={0} /> </Suspense>, ); expect(Scheduler).toFlushAndYield(['Old count: 0, New count: 0']); expect(ReactNoop.getChildren()).toEqual([span(0)]); // Should update because count prop changed ReactNoop.render( <Suspense> <Counter count={1} /> </Suspense>, ); expect(Scheduler).toFlushAndYield(['Old count: 0, New count: 1', 1]); expect(ReactNoop.getChildren()).toEqual([span(1)]); }); it('supports non-pure class components', async () => { class CounterInner extends React.Component { static defaultProps = {suffix: '!'}; render() { return <Text text={this.props.count + '' + this.props.suffix} />; } } const Counter = memo(CounterInner); ReactNoop.render( <Suspense fallback={<Text text="Loading..." />}> <Counter count={0} /> </Suspense>, ); expect(Scheduler).toFlushAndYield(['Loading...']); await Promise.resolve(); expect(Scheduler).toFlushAndYield(['0!']); expect(ReactNoop.getChildren()).toEqual([span('0!')]); // Should bail out because props have not changed ReactNoop.render( <Suspense> <Counter count={0} /> </Suspense>, ); expect(Scheduler).toFlushAndYield([]); expect(ReactNoop.getChildren()).toEqual([span('0!')]); // Should update because count prop changed ReactNoop.render( <Suspense> <Counter count={1} /> </Suspense>, ); expect(Scheduler).toFlushAndYield(['1!']); expect(ReactNoop.getChildren()).toEqual([span('1!')]); }); it('supports defaultProps defined on the memo() return value', async () => { function Counter({a, b, c, d, e}) { return <Text text={a + b + c + d + e} />; } Counter.defaultProps = { a: 1, }; // Note! We intentionally use React.memo() rather than the injected memo(). // This tests a synchronous chain of React.memo() without lazy() in the middle. Counter = React.memo(Counter); Counter.defaultProps = { b: 2, }; Counter = React.memo(Counter); Counter = React.memo(Counter); // Layer without defaultProps Counter.defaultProps = { c: 3, }; Counter = React.memo(Counter); Counter.defaultProps = { d: 4, }; // The final layer uses memo() from test fixture (which might be lazy). Counter = memo(Counter); ReactNoop.render( <Suspense fallback={<Text text="Loading..." />}> <Counter e={5} /> </Suspense>, ); expect(Scheduler).toFlushAndYield(['Loading...']); await Promise.resolve(); expect(Scheduler).toFlushAndYield([15]); expect(ReactNoop.getChildren()).toEqual([span(15)]); // Should bail out because props have not changed ReactNoop.render( <Suspense> <Counter e={5} /> </Suspense>, ); expect(Scheduler).toFlushAndYield([]); expect(ReactNoop.getChildren()).toEqual([span(15)]); // Should update because count prop changed ReactNoop.render( <Suspense> <Counter e={10} /> </Suspense>, ); expect(Scheduler).toFlushAndYield([20]); expect(ReactNoop.getChildren()).toEqual([span(20)]); }); it('warns if the first argument is undefined', () => { expect(() => memo(), ).toErrorDev( 'memo: The first argument must be a component. Instead ' + 'received: undefined', {withoutStack: true}, ); }); it('warns if the first argument is null', () => { expect(() => memo(null), ).toErrorDev( 'memo: The first argument must be a component. Instead ' + 'received: null', {withoutStack: true}, ); }); it('validates propTypes declared on the inner component', () => { function FnInner(props) { return props.inner; } FnInner.propTypes = {inner: PropTypes.number.isRequired}; const Fn = React.memo(FnInner); // Mount expect(() => { ReactNoop.render(<Fn inner="2" />); expect(Scheduler).toFlushWithoutYielding(); }).toErrorDev( 'Invalid prop `inner` of type `string` supplied to `FnInner`, expected `number`.', ); // Update expect(() => { ReactNoop.render(<Fn inner={false} />); expect(Scheduler).toFlushWithoutYielding(); }).toErrorDev( 'Invalid prop `inner` of type `boolean` supplied to `FnInner`, expected `number`.', ); }); it('validates propTypes declared on the outer component', () => { function FnInner(props) { return props.outer; } const Fn = React.memo(FnInner); Fn.propTypes = {outer: PropTypes.number.isRequired}; // Mount expect(() => { ReactNoop.render(<Fn outer="3" />); expect(Scheduler).toFlushWithoutYielding(); }).toErrorDev( // Outer props are checked in createElement 'Invalid prop `outer` of type `string` supplied to `FnInner`, expected `number`.', ); // Update expect(() => { ReactNoop.render(<Fn outer={false} />); expect(Scheduler).toFlushWithoutYielding(); }).toErrorDev( // Outer props are checked in createElement 'Invalid prop `outer` of type `boolean` supplied to `FnInner`, expected `number`.', ); }); it('validates nested propTypes declarations', () => { function Inner(props) { return props.inner + props.middle + props.outer; } Inner.propTypes = {inner: PropTypes.number.isRequired}; Inner.defaultProps = {inner: 0}; const Middle = React.memo(Inner); Middle.propTypes = {middle: PropTypes.number.isRequired}; Middle.defaultProps = {middle: 0}; const Outer = React.memo(Middle); Outer.propTypes = {outer: PropTypes.number.isRequired}; Outer.defaultProps = {outer: 0}; // No warning expected because defaultProps satisfy both. ReactNoop.render( <div> <Outer /> </div>, ); expect(Scheduler).toFlushWithoutYielding(); // Mount expect(() => { ReactNoop.render( <div> <Outer inner="2" middle="3" outer="4" /> </div>, ); expect(Scheduler).toFlushWithoutYielding(); }).toErrorDev([ 'Invalid prop `outer` of type `string` supplied to `Inner`, expected `number`.', 'Invalid prop `middle` of type `string` supplied to `Inner`, expected `number`.', 'Invalid prop `inner` of type `string` supplied to `Inner`, expected `number`.', ]); // Update expect(() => { ReactNoop.render( <div> <Outer inner={false} middle={false} outer={false} /> </div>, ); expect(Scheduler).toFlushWithoutYielding(); }).toErrorDev([ 'Invalid prop `outer` of type `boolean` supplied to `Inner`, expected `number`.', 'Invalid prop `middle` of type `boolean` supplied to `Inner`, expected `number`.', 'Invalid prop `inner` of type `boolean` supplied to `Inner`, expected `number`.', ]); }); it('does not drop lower priority state updates when bailing out at higher pri (simple)', async () => { const {useState} = React; let setCounter; const Counter = memo(() => { const [counter, _setCounter] = useState(0); setCounter = _setCounter; return counter; }); function App() { return ( <Suspense fallback="Loading..."> <Counter /> </Suspense> ); } const root = ReactNoop.createRoot(); await ReactNoop.act(async () => { root.render(<App />); }); expect(root).toMatchRenderedOutput('0'); await ReactNoop.act(async () => { setCounter(1); ReactNoop.discreteUpdates(() => { root.render(<App />); }); }); expect(root).toMatchRenderedOutput('1'); }); it('does not drop lower priority state updates when bailing out at higher pri (complex)', async () => { const {useState} = React; let setCounter; const Counter = memo( () => { const [counter, _setCounter] = useState(0); setCounter = _setCounter; return counter; }, (a, b) => a.complexProp.val === b.complexProp.val, ); function App() { return ( <Suspense fallback="Loading..."> <Counter complexProp={{val: 1}} /> </Suspense> ); } const root = ReactNoop.createRoot(); await ReactNoop.act(async () => { root.render(<App />); }); expect(root).toMatchRenderedOutput('0'); await ReactNoop.act(async () => { setCounter(1); ReactNoop.discreteUpdates(() => { root.render(<App />); }); }); expect(root).toMatchRenderedOutput('1'); }); }); } });
mit
anara123/school-management-kata
spec/user-registrar.spec.js
1510
'use strict'; var chai = require('chai'); var assert = chai.assert; chai.use(require('chai-shallow-deep-equal')); var UserRepository = require('../src/auth/user-repository'); var UserRegistrarFactory = require('../src/users/user-registrar'); describe.skip('register user test', function () { describe('#generate account', function () { var userRegistrar; var studentRegistrationForm; var expectedUser = { firstName: 'rufet', lastName: 'isayev', idNumber: '5ZJBKRJ', account: { } }; before(function (beforeDone) { studentRegistrationForm = { firstName: 'rufet', lastName: 'isayev', idNumber: '5ZJBKRJ', email: '[email protected]', phone: '0518585529', imageUrl: '[email protected]' }; userRegistrar = UserRegistrarFactory.create(); userRegistrar.register(studentRegistrationForm, function (err, user) { assert.isUndefined(err); assert.shallowDeepEqual(user, expectedUser); beforeDone(); }); }); it('should save a user', function (testDone) { UserRepository.findByIdNumber(studentRegistrationForm.idNumber, function (err, user) { assert.shallowDeepEqual(user, expectedUser); testDone(); }); }) }); });
mit
pmarques/node-turnrestapi
lib/keys.js
556
"use strict"; var SEP = ':'; module.exports.SEP = SEP; var crypto = require('crypto'); module.exports.genLongTermKey = function genLongTermKey( username, realm, password ) { var md5 = crypto.createHash( 'md5' ); var text = username + SEP + realm + SEP + password; md5.update( text ); var hash = md5.digest( 'hex' ); return hash; } module.exports.genSharedKey = function genSharedKey( username, shared_key ) { var hmac = crypto.createHmac( 'sha1', shared_key ); hmac.update( username ); var hash = hmac.digest( 'base64' ); return hash; }
mit
way2muchnoise/fontbox
src/main/java/net/afterlifelochie/fontbox/api/font/IGLFontMetrics.java
438
package net.afterlifelochie.fontbox.api.font; import java.util.Map; public interface IGLFontMetrics { /** * The individual dimensions and u-v locations of each character in the set */ Map<Integer, IGLGlyphMetric> getGlyphs(); /** * The universal width of the font image. */ float getFontImageWidth(); /** * The universal height of the font image. */ float getFontImageHeight(); }
mit
drivefast/node-cipherwallet
cipherwallet/cipherwallet.js
3137
var all_cw_codes = {}; function Cipherwallet(options) { // the id of the (typically) div element that will display the QR code and the "What's this" link underneath this.qrContainer = document.getElementById(options.qrContainerID); if (!this.qrContainer) return; this.tag = options.qrContainerID; // detailsURL is a web page describes cipherwallet from an user perspective this.detailsURL = options.detailsURL || "http://www.cipherwallet.com/wtfcipherwallet.html"; // callback function for successful data transfer; will have as argument the JSON received on the poll response this.onSuccess = options.onSuccess || function(x) {}; // callback function for failed data transfer; will have as argument a number that can be: // 400 = bad parameters, that shouldnt happen if the API code is clean // 401 = the request that transmitted the data was not authorized // 410 = offer expired // 0 = any other screwed up error this.onFailure = options.onFailure || function(x) {}; this.polls = true; all_cw_codes[this.tag] = this; // populate the div that will display the QR code, and activate the longPoll() loop // when the image download completes this.qrContainer.innerHTML = '<a href="' + this.detailsURL + '">' + '<img ' + 'src="/cipherwallet/' + this.tag + '/qr.png?_=' + Date.now() + '" ' + 'onload="all_cw_codes[\'' + this.tag + '\'].longPoll()" ' + '/>' + '<p>What\'s this?</p>' + '</a>' ; } Cipherwallet.prototype.longPoll = function() { // continuously poll the AJAX server waiting for data to be received from the mobile app if (!this.polls) return; var this_tag = this.tag; $.ajax({ url: "/cipherwallet/" + this_tag, cache: false, statusCode: { // user scanned code and posted data successfully, call the onSuccess() function 200: function(user_data) { all_cw_codes[this_tag].polls = false; all_cw_codes[this_tag].onSuccess(user_data); }, // no scanned information received (yet) 202: function() { console.log("..."); }, }, error: function(xhr, textStatus, errorThrown) { // poll function encountered an error, the http status is meaningful console.log("xhr error " + errorThrown); all_cw_codes[this_tag].qrContainer.style.display = "none"; all_cw_codes[this_tag].polls = false; // also call the onFailure() function all_cw_codes[this_tag].onFailure(xhr.status); }, complete: function() { all_cw_codes[this_tag].longPoll(); }, timeout: 10000 }); }; Cipherwallet.prototype.stop = function() { // stop polling this.polls = false; this.qrContainer.innerHTML = ""; }; Cipherwallet.prototype.registerForQRLogin = function(user, cb) { // you may call this to complete a registration procedure $.ajax({ type: "POST", url: "/cipherwallet/" + this.tag, data: { user_id: user }, complete: function(xhr) { cb(xhr.status == 200); }, timeout: 20000 }); };
mit
sasedev/acf-expert
src/Acf/ResBundle/Resources/public/js/bootstrap/datetimepicker/locales/2.3.1.el.js
908
/** * Greek translation for bootstrap-datetimepicker */ ;(function($){ $.fn.datetimepicker.dates['el'] = { days: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο", "Κυριακή"], daysShort: ["Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ", "Κυρ"], daysMin: ["Κυ", "Δε", "Τρ", "Τε", "Πε", "Πα", "Σα", "Κυ"], months: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], monthsShort: ["Ιαν", "Φεβ", "Μαρ", "Απρ", "Μάι", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ"], today: "Σήμερα", suffix: [], meridiem: [] }; }(jQuery));
mit
dechoD/Telerik-Homeworks
Module II Homeworks/PreCourse exercises/Excel Exercises/Excel modificator/Properties/AssemblyInfo.cs
1410
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Excel modificator")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Excel modificator")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("19d0baef-1940-4fdf-b737-ac7c3d16e68c")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
trnglina/Papillon
PapillonEditor/Utils/PixelSnapHelpers.cs
3881
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team // // Permission is hereby granted, free of charge, to any person obtaining a copy of this // software and associated documentation files (the "Software"), to deal in the Software // without restriction, including without limitation the rights to use, copy, modify, merge, // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons // to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. using System; using System.Windows; using System.Windows.Media; namespace PapillonEditor.Utils { /// <summary> /// Contains static helper methods for aligning stuff on a whole number of pixels. /// </summary> public static class PixelSnapHelpers { /// <summary> /// Gets the pixel size on the screen containing visual. /// This method does not take transforms on visual into account. /// </summary> public static Size GetPixelSize(Visual visual) { if (visual == null) throw new ArgumentNullException("visual"); PresentationSource source = PresentationSource.FromVisual(visual); if (source != null) { Matrix matrix = source.CompositionTarget.TransformFromDevice; return new Size(matrix.M11, matrix.M22); } else { return new Size(1, 1); } } /// <summary> /// Aligns <paramref name="value"/> on the next middle of a pixel. /// </summary> /// <param name="value">The value that should be aligned</param> /// <param name="pixelSize">The size of one pixel</param> public static double PixelAlign(double value, double pixelSize) { // 0 -> 0.5 // 0.1 -> 0.5 // 0.5 -> 0.5 // 0.9 -> 0.5 // 1 -> 1.5 return pixelSize * (Math.Round((value / pixelSize) + 0.5, MidpointRounding.AwayFromZero) - 0.5); } /// <summary> /// Aligns the borders of rect on the middles of pixels. /// </summary> public static Rect PixelAlign(Rect rect, Size pixelSize) { rect.X = PixelAlign(rect.X, pixelSize.Width); rect.Y = PixelAlign(rect.Y, pixelSize.Height); rect.Width = Round(rect.Width, pixelSize.Width); rect.Height = Round(rect.Height, pixelSize.Height); return rect; } /// <summary> /// Rounds <paramref name="point"/> to whole number of pixels. /// </summary> public static Point Round(Point point, Size pixelSize) { return new Point(Round(point.X, pixelSize.Width), Round(point.Y, pixelSize.Height)); } /// <summary> /// Rounds val to whole number of pixels. /// </summary> public static Rect Round(Rect rect, Size pixelSize) { return new Rect(Round(rect.X, pixelSize.Width), Round(rect.Y, pixelSize.Height), Round(rect.Width, pixelSize.Width), Round(rect.Height, pixelSize.Height)); } /// <summary> /// Rounds <paramref name="value"/> to a whole number of pixels. /// </summary> public static double Round(double value, double pixelSize) { return pixelSize * Math.Round(value / pixelSize, MidpointRounding.AwayFromZero); } /// <summary> /// Rounds <paramref name="value"/> to an whole odd number of pixels. /// </summary> public static double RoundToOdd(double value, double pixelSize) { return Round(value - pixelSize, pixelSize * 2) + pixelSize; } } }
mit
jakubkulhan/pssh
scripts/flags.php
13062
<?php final class flags implements ArrayAccess, IteratorAggregate { /** @var bool */ private $parsed = FALSE; /** @var array */ private $rest; /** @var string */ private $module = NULL; /** @var array */ private $modules = array(); /** @return void */ private function __construct() {} /** * Create flag instance * @param callback * @return self */ public static function define($callback) { $instance = new self; $instance->module(NULL); call_user_func($callback, $instance); $instance->module(NULL); return $instance; } /** * Process command line arguments * @param self * @return array * */ public static function process($instance) { $ret = $instance->parse(); if (!$ret[0]) { return $ret; } return array(TRUE, NULL, NULL, $instance); } /** * Generate usage message * @return string */ public function generateUsage() { if (is_file($_SERVER['argv'][0]) && !is_executable($_SERVER['argv'][0])) { $linestart = 'php ' . $_SERVER['argv'][0] . ' --'; } else { $linestart = $_SERVER['argv'][0]; } $line = $linestart; $more = ''; foreach ($this->modules[NULL]->usage as $usage) { $params = !empty($usage->params) ? ' <' . implode('>, <', $usage->params) . '>' : ''; $line .= ' [ -' . $usage->short . $params . ' ]'; $more .= "\n -" . $usage->short . $params . ', --' . $usage->long . $params . "\n" . ' ' . implode("\n ", explode("\n", wordwrap($usage->text, 69))) . "\n"; } if (count($this->modules) > 1) { $line .= ' <module> [ <module-args> ]'; $modules = $this->modules; unset($modules[NULL]); $more .= "\n"; foreach ($modules as $name => $module) { $more .= "\n$linestart $name"; foreach ($module->usage as $usage) { $params = !empty($usage->params) ? ' <' . implode('>, <', $usage->params) . '>' : ''; $more .= "\n -" . $usage->short . $params . ', --' . $usage->long . $params . "\n" . ' ' . implode("\n ", explode("\n", wordwrap($usage->text, 69))) . "\n"; } } } return $line . "\n" . $more; } /** @return string */ public function getProgramName() { return $_SERVER['argv'][0]; } /** @return array */ public function getRest() { $this->checkParsed(); return $this->rest; } /** @return string */ public function getModule() { $this->checkParsed(); return $this->module; } /** @return string */ public function getModuleFlags() { $this->checkParsed(); return $this->modules[$this->module]->values; } /** * Set module * @param string */ public function module($module) { $this->checkNotParsed(); if ($module !== NULL) { $module = $this->flagname($module); if (isset($this->modules[$module])) { throw new LogicException('Module ' . $module . ' already defined.'); } } if (!isset($this->modules[$module])) { $this->modules[$module] = (object) array( 'short' => array(), 'long' => array(), 'usage' => array(), 'values' => array(), ); } $this->module = $module; } /** * Add bool flag * @param string * @param bool * @param string */ public function bool($name, $usage = NULL, $default = FALSE) { $this->modules[$this->module]->values[$name] = NULL; return $this->boolVar($this->modules[$this->module]->values[$name], $name, $usage); } /** * Add bool flag * @param string * @param string */ public function boolVar(&$var, $name, $usage = NULL, $default = FALSE) { return $this->add( $var, $name, (bool) $default, array(), $usage, array(__CLASS__, 'parseBool'), NULL ); } /** * Add int flag * @param string * @param string * @param int */ public function int($name, $usage = NULL, $default = NULL) { $this->modules[$this->module]->values[$name] = NULL; return $this->intVar($this->modules[$this->module]->values[$name], $name, $usage, $default); } /** * Add int flag * @param mixed * @param string * @param string */ public function intVar(&$var, $name, $usage = NULL, $default = NULL) { return $this->add( $var, $name, intval($default), array($this->flagname($name)), $usage, array(__CLASS__, 'parseOneArgument'), 'intval' ); } /** * Add float flag * @param string * @param string * @param int */ public function float($name, $usage = NULL, $default = NULL) { $this->modules[$this->module]->values[$name] = NULL; return $this->floatVar($this->modules[$this->module]->values[$name], $name, $usage, $default); } /** * Add float flag * @param mixed * @param string * @param string */ public function floatVar(&$var, $name, $usage = NULL, $default = NULL) { return $this->add( $var, $name, floatval($default), array($this->flagname($name)), $usage, array(__CLASS__, 'parseOneArgument'), 'floatval' ); } /** * Add string flag * @param string * @param string * @param int */ public function string($name, $usage = NULL, $default = NULL) { $this->modules[$this->module]->values[$name] = NULL; return $this->stringVar($this->modules[$this->module]->values[$name], $name, $usage, $default); } /** * Add float flag * @param mixed * @param string * @param string */ public function stringVar(&$var, $name, $usage = NULL, $default = NULL) { return $this->add( $var, $name, (string) $default, array($this->flagname($name)), $usage, array(__CLASS__, 'parseOneArgument'), NULL ); } /** * Add flag * @param mixed * @param string * @param mixed * @param array * @param callback * @param callback */ public function add(&$var, $name, $default, array $params, $usage, $parse, $filter) { $this->checkNotParsed(); $var = $default; $short = $name[0]; $long = $this->flagname($name); if (isset($this->modules[$this->module]->short[$short])) { throw new LogicException('Flag -' . $short . ($this->module !== NULL ? ' in module ' . $this->module : '') . ' already defined.'); } if (isset($this->modules[$this->module]->long[$long])) { throw new LogicException('Flag --' . $long . ($this->module !== NULL ? ' in module ' . $this->module : '') . ' already defined.'); } if (!is_callable($parse)) { throw new LogicException('Given parse callback not callable.'); } if ($filter !== NULL && !is_callable($filter)) { throw new LogicException('Given filter callback not callable.'); } $this->modules[$this->module]->short[$short] = array(&$var, $parse, $filter); $this->modules[$this->module]->long[$long] = array(&$var, $parse, $filter); if ($usage !== NULL) { $this->modules[$this->module]->usage[] = (object) array( 'short' => $short, 'long' => $long, 'params' => $params, 'text' => $usage, ); } } /** @return array */ private function parse() { $this->checkNotParsed(); $args = new ArrayIterator(array_slice($_SERVER['argv'], 1)); $ret = $this->parseFlags(NULL, $args); if (!$ret[0]) { $this->parsed = TRUE; return $ret; } $this->module = NULL; if (count($this->modules) > 1 && $args->valid()) { $this->module = $args->current(); $args->next(); if (!isset($this->modules[$this->module])) { $this->parsed = TRUE; return array(FALSE, $this->module, NULL, NULL); } $ret = $this->parseFlags($this->module, $args); } while ($args->valid()) { $this->rest[] = $args->current(); $args->next(); } $this->parsed = TRUE; return $ret; } /** * Parses flags from given arguments * @param string * @param Iterator */ private function parseFlags($module, Iterator $args) { while ($args->valid()) { $arg = $args->current(); if (!($arg !== '--' && $arg[0] === '-' && isset($arg[1]))) { break; } else { if ($arg[1] === '-') { $names = array(substr($arg, 2)); $opts = $this->modules[$module]->long; } else { $names = str_split(substr($arg, 1)); $opts = $this->modules[$module]->short; } for ($i = 0, $c = count($names), $last = $c - 1; $i < $c; ++$i) { $name = $names[$i]; if (!isset($opts[$name])) { return array(FALSE, $module, $name, NULL); } list($ok, $opts[$name][0]) = call_user_func( $opts[$name][1], $i === $last ? $args : new ArrayIterator(array()) ); if (!$ok) { return array(FALSE, $module, $name, NULL); } if ($opts[$name][2] !== NULL) { $opts[$name][0] = call_user_func($opts[$name][2], $opts[$name][0]); } } } $args->next(); } return array(TRUE, NULL, NULL, NULL); } /** * Flag is present * @param Iterator * @return array [ok, result] */ public static function parseBool(Iterator $args) { return array(TRUE, TRUE); } /** * Get value of flag * @param Iterator * @return string */ public static function parseOneArgument(Iterator $args) { $args->next(); if (!$args->valid()) { return array(FALSE, NULL); } return array(TRUE, $args->current()); } /** * Get parsed flag value * @param string * @return mixed */ public function offsetGet($flagname) { $this->checkParsed(); return $this->modules[NULL]->values[$flagname]; } /** * Get parsed flag value * @param string * @return mixed */ public function __get($flagname) { return $this->offsetGet($flagname); } /** * Check if flag exists * @param string * @return bool */ public function offsetExists($flagname) { $this->checkParsed(); return isset($this->modules[NULL]->values[$flagname]); } /** * Check if flag exists * @param string * @return bool */ public function __isset($flagname) { return $this->offsetExists($flagname); } /** */ public function offsetSet($flagname, $value) { $this->checkParsed(); throw new LogicException('You cannot change parsed flags.'); } /** */ public function offsetUnset($flagname) { $this->checkParsed(); throw new LogicException('You cannot change parsed flags.'); } /** * Iterate over values * @return Iterator */ public function getIterator() { $this->checkParsed(); return new ArrayIterator($this->modules[NULL]->values); } /** @return bool */ private function checkParsed() { if (!$this->parsed) { throw new LogicException('Flags hasn\'t been parsed yet.'); } return TRUE; } /** @return bool */ private function checkNotParsed() { if ($this->parsed) { throw new LogicException('Flags has been already parsed.'); } return TRUE; } /** * @param string * @return string */ private function flagname($name) { return str_replace('_', '-', $name); } }
mit
supperbowen/bowen-crm-app
src/logic/rss.data.svc.js
908
import BaseLogic from '../common/logic'; class rssDataLogic extends BaseLogic { constructor() { super({ uri: 'api/rss', listUri: 'api/rss/list', enablePaging: true, enableSearch: false, pageSize: 20 }); } async loadPageHtml(link){ link = encodeURIComponent(link); let res = await this.httpGet('api/rss/page',{link:link}); if(res.status === 200){ return res.data; }else{ console.error(res.message); } } async afterItemLoaded(item) { //item.pubDate = new Date(item.pubDate); item.isPush = item.isPush || false; item.pushDate = item.pushDate || new Date(); // item.content = item.content || await this.loadPageHtml(item.link); // item.remark = (item.description || item.content).replace(/<[^>]+>/g,"").slice(0,50); } } const dataService = new rssDataLogic(); export default dataService;
mit
ranjib/lxc-extra
lib/lxc/extra/proxy_client_side.rb
3833
require 'lxc/extra/selector' module LXC module Extra # # Proxy server that listens for connections on the client side and sends # the data to the corresponding ProxyServerSide through an Channel. # # == Usage # # # Forward 127.0.0.1:80 in the container to google.com from the host # channel = LXC::Extra::Channel.new # pid = container.attach do # server = TCPServer.new('127.0.0.1', 5559) # proxy = LXC::Extra::ProxyClientSide.new(channel, server) # proxy.start # end # # # Here is the proxy server # proxy = LXC::Extra::ProxyServerSide.new(channel) do # TCPSocket.new('127.0.0.1', 9995) # end # proxy.start # class ProxyClientSide # # Create a new ProxyClientSide. # # == Arguments # channel:: Channel to communicate over # listen_server:: TCPServer to listen to # def initialize(channel, listen_server) @channel = channel @listen_server = listen_server @sockets = {} end attr_reader :channel attr_reader :listen_server # # Start forwarding connections and data. This call will not return until # stop is called. # def start begin begin @selector = Selector.new @selector.on_select(@listen_server, &method(:on_server_accept)) @selector.on_select(@channel.read_fd, &method(:on_channel_response)) @selector.main_loop ensure @sockets.values.each { |socket| socket.close } @sockets = {} @selector = nil end rescue STDERR.puts("Proxy server error on client side: #{$!}\n#{$!.backtrace.join("\n")}") @channel.send_message(:server_error, $!) raise end end # # Stop forwarding connections and data. Existing connections will be closed # and a stop message will be sent to the other side. # def stop @sockets.values.each { |socket| socket.close } @sockets = {} @selector = nil @channel.send_message(:stop) end private def on_server_accept(server) socket = server.accept @selector.on_select(socket, &method(:on_client_data)) @sockets[socket.fileno] = socket @channel.send_message(:open, socket.fileno) end def on_client_data(socket) message, *args = socket.recvmsg if message.length == 0 @channel.send_message(:close, socket.fileno) @selector.delete(socket) @sockets.delete(socket.fileno) socket.close else @channel.send_message(:data, socket.fileno, message) end end def on_channel_response(read_fd) message_type, fileno, *args = @channel.next(:stop) begin case message_type when :data @sockets[fileno].sendmsg(args[0]) when :close, :connection_error @sockets[fileno].close @selector.delete(@sockets[fileno]) @sockets.delete(fileno) when :stop, :server_error return :stop else raise "Unknown message type #{message_type} passed from server to client side proxy" end rescue STDERR.puts("Error in on_channel_response: #{$!}\n#{$!.backtrace.join("\n")}") if fileno @server.send_message(:connection_error, fileno, $!) unless message_type == :close || message_type == :connection_error socket = @sockets[fileno] if socket socket.close @selector.delete(socket) end @sockets.delete(fileno) end end end end end end
mit
BrunoDeNadaiSarnaglia/Chess
src/controller/chessController.java
10703
package controller; import exceptions.InvalidMovimentException; import exceptions.InvalidPlayException; import exceptions.OutOfBoardException; import gamePlace.Board; import gamePlace.Position; import gamePlay.Game; import gamePlay.Player; import gameTracker.GameTracker; import pieces.Piece; import view.ChessInterface; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * Created by Bruno on 2/26/2015. * Innitialize handles for some JComponents in the GUI */ public class chessController { private static Game game; private static Board board; static ChessInterface chessInterface; private static boolean isSelected = false; private static int firstRank; private static int firstFile; private static GameTracker gameTracker = new GameTracker(); /** * Constructor that initializes game and board * @param game */ public chessController(Game game) { this.game = game; this.board = game.getBoard(); defineButtonsReactions(); try { gameTracker.addUndo(game.copy()); } catch (OutOfBoardException e) { } } /** * Change the game that this class is controlling * @param game */ public static void setGame(Game game) { chessController.game = game; board = game.getBoard(); } /** * Take each button in the matrix and defines its method. * There are 3 overriden methods for each button * MouseEntered, MouseExited, MouseClicked */ private static void defineButtonsReactions(){ for (int i = 0; i < board.getBoardSize(); i++) { for (int j = 0; j < board.getBoardSize(); j++) { final JButton button = chessInterface.getJButton(new Position(i, j)); final int rank = i; final int file= j; button.addMouseListener(new MouseAdapter() { /** * If the piece belong to the current team playing, this handle will change the jButton collor * @param e */ @Override public void mouseEntered(MouseEvent e) { if(board.isAnyPieceAt(new Position(rank, file))){ Piece piece = board.getPieceAt(new Position(rank, file)); if(piece.getTeam() == game.getTeamPlaying()){ button.setBackground(new Color(239, 127, 117)); } } } /** * when mouseExited this method will restore the jButtons colors * @param e */ @Override public void mouseExited(MouseEvent e) { if(!(isSelected && file == firstFile && rank == firstRank) ){ if ((rank + file) % 2 == 1) { button.setBackground(new Color(195, 214, 214)); } else { button.setBackground(new Color(142, 156, 156)); } } } /** * When we click in a jButton, this method will test if there is any old position selected * and if not will test if it is a piece where we a clicking and if there is any old position * selected, will test if is a valid movement and will execute movement * @param e */ @Override public void mouseClicked(MouseEvent e) { if(!isSelected){ if(board.isAnyPieceAt(new Position(rank, file))){ Piece piece = board.getPieceAt(new Position(rank, file)); if(piece.getTeam() == game.getTeamPlaying()){ firstRank = rank; firstFile = file; button.setBackground(new Color(239, 127, 117)); isSelected = true; } } }else{ if(file == firstFile && rank == firstRank){ isSelected = false; if((rank + file)%2 == 1){ button.setBackground(new Color(195, 214, 214)); }else{ button.setBackground(new Color(142, 156, 156)); } } try{ game.move(new Position(firstRank,firstFile), new Position(rank, file)); } catch (InvalidMovimentException e1) { return; } catch (InvalidPlayException e1) { return; } catch (OutOfBoardException e1) { return; } try { gameTracker.addUndo(game.copy()); gameTracker.deleteRedo(); } catch (OutOfBoardException e1) { } chessInterface.updateLabels(); isSelected = false; JButton button = chessInterface.getJButton(new Position(firstRank, firstFile)); if((firstRank + firstFile)%2 == 1){ button.setBackground(new Color(195, 214, 214)); }else{ button.setBackground(new Color(142, 156, 156)); } try { if(game.isInCheckMate(game.getTeamPlaying())){ Object[] objects = {"restart"}; JOptionPane.showOptionDialog(null, "CheckMate", "", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, objects, objects[0]); restart(); isSelected = false; chessInterface.updateLabels(); } } catch (OutOfBoardException e1) { e1.printStackTrace(); } } } }); } } } /** * method used in restart jButton to restart the game */ public static void restart(){ try { Game game = new Game(new Player(), new Player(), new Board()); game.initializeBoard(); setGame(game); chessInterface.setGame(game); gameTracker.deleteRedo(); gameTracker.deleteUndo(); gameTracker.addUndo(game.copy()); } catch (OutOfBoardException e) { e.printStackTrace(); } } /** * Will define the handle for the jButtons in the toolbar */ private static void setMenuActions(){ /** * restart the game */ chessInterface.getRestart().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { restart(); isSelected = false; chessInterface.updateLabels(); } } ); /** * Get what was the game state in the past using gametracker class and update * The game that controller is using */ chessInterface.getUndo().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Game game = gameTracker.getLastUndoGame(); if(game == null) return; setGame(game); chessInterface.setGame(game); isSelected = false; chessInterface.updateLabels(); } }); /** * Get what was the game that we undid using gametracker class and update * The game that controller is using */ chessInterface.getRedo().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Game game = gameTracker.getLastRedoGame(); if(game == null) return; setGame(game); chessInterface.setGame(game); isSelected = false; chessInterface.updateLabels(); } }); } /** * Main will pop up the JFrame * @param args */ public static void main(String[] args){ javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { Game game = null; try { game = new Game(new Player(), new Player(),new Board()); } catch (OutOfBoardException e) { e.printStackTrace(); } try { game.initializeBoard(); } catch (OutOfBoardException e) { } chessInterface = new ChessInterface(game); chessInterface.updateLabels(); setGame(game); try { gameTracker.addUndo(game.copy()); } catch (OutOfBoardException e) { } defineButtonsReactions(); setMenuActions(); JFrame frame = new JFrame("Chess Game"); frame.add(chessInterface.getMainPanel()); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setLocationByPlatform(true); frame.pack(); frame.setMinimumSize(frame.getSize()); frame.setVisible(true); } }); } }
mit
MiUishadow/magnum
src/Magnum/DebugTools/Profiler.cpp
4221
/* This file is part of Magnum. Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš <[email protected]> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "Profiler.h" #include <algorithm> #include <numeric> #include <Corrade/Utility/Assert.h> #include <Corrade/Utility/Debug.h> #include "Magnum/Magnum.h" using namespace std::chrono; namespace Magnum { namespace DebugTools { Profiler::Section Profiler::addSection(const std::string& name) { CORRADE_ASSERT(!_enabled, "Profiler: cannot add section when profiling is enabled", 0); _sections.push_back(name); return _sections.size()-1; } void Profiler::setMeasureDuration(std::size_t frames) { CORRADE_ASSERT(!_enabled, "Profiler: cannot set measure duration when profiling is enabled", ); _measureDuration = frames; } void Profiler::enable() { _enabled = true; _frameData.assign(_measureDuration*_sections.size(), high_resolution_clock::duration::zero()); _totalData.assign(_sections.size(), high_resolution_clock::duration::zero()); _frameCount = 0; } void Profiler::disable() { _enabled = false; } void Profiler::start(Section section) { if(!_enabled) return; CORRADE_ASSERT(section < _sections.size(), "Profiler: unknown section passed to start()", ); save(); _currentSection = section; } void Profiler::stop() { if(!_enabled) return; save(); _previousTime = high_resolution_clock::time_point(); } void Profiler::save() { auto now = high_resolution_clock::now(); /* If the profiler is already running, add time to given section */ if(_previousTime != high_resolution_clock::time_point()) _frameData[_currentFrame*_sections.size()+_currentSection] += now-_previousTime; /* Set current time as previous for next section */ _previousTime = now; } void Profiler::nextFrame() { if(!_enabled) return; /* Next frame index */ std::size_t nextFrame = (_currentFrame+1) % _measureDuration; /* Add times of current frame to total */ for(std::size_t i = 0; i != _sections.size(); ++i) _totalData[i] += _frameData[_currentFrame*_sections.size()+i]; /* Subtract times of next frame from total and erase them */ for(std::size_t i = 0; i != _sections.size(); ++i) { _totalData[i] -= _frameData[nextFrame*_sections.size()+i]; _frameData[nextFrame*_sections.size()+i] = high_resolution_clock::duration::zero(); } /* Advance to next frame */ _currentFrame = nextFrame; if(_frameCount < _measureDuration) ++_frameCount; } void Profiler::printStatistics() { if(!_enabled) return; std::vector<std::size_t> totalSorted(_sections.size()); std::iota(totalSorted.begin(), totalSorted.end(), 0); std::sort(totalSorted.begin(), totalSorted.end(), [this](std::size_t i, std::size_t j){return _totalData[i] > _totalData[j];}); Debug() << "Statistics for last" << _measureDuration << "frames:"; for(std::size_t i = 0; i != _sections.size(); ++i) Debug() << " " << _sections[totalSorted[i]] << duration_cast<microseconds>(_totalData[totalSorted[i]]).count()/_frameCount << u8"µs"; } }}
mit
mogey/CodeSamples
Java/AP Computer Science A/Polygon_Comparable/Rhombus.java
898
/** * (1) Have the Scalene class extend Triangles. * (2) Write 2 constructors: (a) the default that calls the super classes default * constructor and (b) One that takes in 2 doubles representing the base and * the height. It should then call the super classes constructor with these * 2 arguments. * (3) Override the method getMyType() that returns "Scalene" */ public class Rhombus extends Parallelogram { // Constructors Rhombus() {} Rhombus(double base1, double height){ super(base1, height); } // Overide abstract method public String getMyType(){ return "Rhombus"; } public void calculateArea(){ setMyArea((getMyBase1() * getMyHeight()) / 2); } public String toString() { return getMyType() + " and I am also a " + super.toString() + " AND my area = " + getMyArea(); } }
mit
stierma1/esi-tester
export.js
988
module.exports = { preprocessor: require("./pre-processor"), DIV_REPORTER:require("./parsers/process-div-reporter").parse, HTML_AST: require("./parsers/process-html-ast").parse, GENERIC: require("./parsers/process-generic-actions").parse, VALIDATOR: require("./parsers/process-validator").parse, TOLERANT_GENERIC: require("./parsers/process-tolerant-generic-actions").parse, TOLERANT_VALIDATOR: require("./parsers/process-tolerant-validator").parse, TOLERANT_HTML_AST: require("./parsers/process-tolerant-html-ast").parse, RAW:{ DIV_REPORTER:require("./parsers/div-reporter").parse, HTML_AST: require("./parsers/html-ast").parse, GENERIC: require("./parsers/generic-actions").parse, VALIDATOR: require("./parsers/validator").parse, TOLERANT_GENERIC: require("./parsers/tolerant-generic-actions").parse, TOLERANT_VALIDATOR: require("./parsers/tolerant-validator").parse, TOLERANT_HTML_AST: require("./parsers/tolerant-html-ast").parse, } }
mit
racaljk/pyann
network/bpnn.py
4545
""" The MIT License (MIT) Copyright (c) 2015 Abstract Operator 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. """ __author__=['racaljk(Abatract Operator);[email protected]'] import random import math class bpnn(object): """back propagation neural network""" def __init__(self,debugMode=False): """ :param debugMode: if printing debug info """ self.debug = debugMode self.iteration = 0 self.convergence =0.01 def init(self,inputLayerNodeNum = 4, hiddenLayerNodeNum = 5, outputLayerNodeNum = 3, maxIteration = 1000, biasRange = [0,1], weightRange = [-1,1], learningRate = 0.15 ): #constant self.inode = inputLayerNodeNum self.hnode = hiddenLayerNodeNum self.onode = outputLayerNodeNum self.maxIter = maxIteration self.lr = learningRate #initial bias self._init_bias(biasRange) #initial inputLayer-hiddenLayer and hiddenLayer-outputLayer weights self._init_Weights(weightRange) #save input and output data self.hdata = [0] * self.hnode self.odata = [0] * self.onode def train(self,trainData): learned = False while not learned: for record in trainData: self.feedForward(record) error = self.backPropagate(record) if error<self.convergence: learned = True def feedForward(self,data): for x in xrange(self.hnode): s = 0 for t in xrange(len(data)-1): s += data[t] * self.hw[t][x] + self.hb[x] self.hdata[x] = [s,self._sigmoid(s)] for x in xrange(self.onode): s = 0 for t in xrange(self.hnode): s += self.hdata[t][1] * self.ow[t][x] +self.ob[x] self.odata[x] = [s,self._sigmoid(s)] def backPropagate(self,data): o_deltas = [0] * self.onode h_deltas = [0] * self.hnode #update hiddenLayer-outputLayer weights for x in xrange(self.onode): o_deltas[x] = self.odata[x][1] * (1-self.odata[x][1]) * (data[-1] - self.odata[x][-1]) for t in xrange(self.hnode): self.ow[t][x] += self.lr * self.hdata[t][1] * o_deltas[x] self.ob[x] += self.lr * o_deltas[x] #update inputLayer-hiddenLayer weights for x in xrange(self.hnode): s =0 for p in xrange(self.onode): s += self.ow[x][p] * o_deltas[p] h_deltas[x] = self.hdata[x][1] * (1-self.hdata[x][1]) * s for t in xrange(self.inode): self.hw[t][x] += self.lr * data[t] * h_deltas[x] self.hb[x] +=self.lr * h_deltas[x] global_err = 0.0 for x in xrange(self.onode): global_err += 0.5 * (data[-1]-self.odata[x][1])**2 return global_err def _sigmoid(self,x): return 1.0/(1.0 + math.exp(-x)) def _init_Weights(self,weightRange): self.hw = [[random.uniform(weightRange[0],weightRange[1]) \ for t in xrange(self.hnode)]for x in xrange(self.inode)] self.ow = [[random.uniform(weightRange[0],weightRange[1]) \ for t in xrange(self.onode)]for x in xrange(self.hnode)] def _init_bias(self,biasRange): self.hb = [random.uniform(biasRange[0],biasRange[1]) for x in xrange(self.hnode)] self.ob = [random.uniform(biasRange[0],biasRange[1]) for x in xrange(self.onode)]
mit
vivienchevallier/Article-AzureWebJobs.JobActivatorUnity
AzureWebJobs.JobActivatorUnity/Functions.cs
851
using System; using System.IO; using AzureWebJobs.JobActivatorUnity.Contracts; using Microsoft.Azure.WebJobs; namespace AzureWebJobs.JobActivatorUnity { public class Functions { private readonly INumberService numberService; public Functions(INumberService numberService) { if (numberService == null) throw new ArgumentNullException("numberService"); this.numberService = numberService; } // This function will get triggered/executed when a new message is written // on an Azure Queue called queue. public void ProcessQueueMessage([QueueTrigger("queue")] string message, TextWriter log) { log.WriteLine("New random number {0} for message: {1}", this.numberService.GetRandomNumber(), message); } } }
mit
ZihadD/matchme
db/pending/20170601202522_create_referrer.rb
387
class CreateReferrer < ActiveRecord::Migration[5.0] def change create_table :referrers do |t| t.string :email, index: true t.string :first_name t.string :last_name t.string :phone t.timestamps end add_reference :offer_soft_skill_values, :referrer, index: true add_reference :candidate_soft_skill_values, :referrer, index: true end end
mit
nicepear/machine-learning
tree.py
2782
from math import log def calcShannonEnt(dataSet): numEntries=len(dataSet) labelCounts={} for featVec in dataSet: currentLabel=featVec[-1] ##print(currentLabel) if currentLabel not in labelCounts.keys(): labelCounts[currentLabel]=0 labelCounts[currentLabel]+=1 shannonEnt=0.0 #for value in labelCounts.values(): # #print(value) for key in labelCounts: ##print(key) prob=float(labelCounts[key])/numEntries shannonEnt-=prob*log(prob,2) return shannonEnt def createDataSet(): dataSet=[[1,1,'yes'],[1,1,'yes'],[1,0,'no'],[0,1,'no'],[0,1,'no']] labels=['no surfacing','flippers'] return dataSet,labels def splitDataSet(dataSet,axis,value): retDataSet=[] for featVec in dataSet: if featVec[axis]==value: reducedFeatVec=featVec[:axis] reducedFeatVec.extend(featVec[axis+1:]) retDataSet.append(reducedFeatVec) return retDataSet def chooseBestFeatureToSplit(dataSet): numFeatures = len(dataSet[0])-1 baseEntropy=calcShannonEnt(dataSet) ##print('baseEntropy'+str(baseEntropy)) bestInfoGain=0.0; bestFeature=-1 #print('numFeatures'+str(numFeatures)) for i in range(numFeatures): featList=[example[i] for example in dataSet] #print('featList'+str(featList)) uniqueVals=set(featList) #print('uniqueValues'+str(uniqueVals)) newEntropy=0.0 for value in uniqueVals: #print('i='+str(i)) #print('value='+str(value)) subDataSet=splitDataSet(dataSet,i,value) #print('subDataSet'+str(subDataSet)) #print('len=') #print(len(subDataSet)) #print('totallen') #print(len(dataSet)) prob=len(subDataSet)/float(len(dataSet)) #print('prob'+str(prob)) newEntropy+=prob*calcShannonEnt(subDataSet) #print(newEntropy) infoGain=baseEntropy-newEntropy #print("infogain"+str(infoGain)) if(infoGain>bestInfoGain): bestInfoGain=infoGain bestFeature=i return bestFeature def majorityCnt(classList): classCount={} for vote in classList: if vote not in classCount.keys(): classCount[vote]=0 classCount[vote]+=1 sortedClassCount=sorted(classCount.items(),key=operator.itemgetter(1),reverse=True) return sortedClassCount[0][0] def createTree(dataSet,labels): classList=[example[-1] for example in dataSet] if classList.count(classList[0]) == len(classList): return classList[0] if len(dataSet[0])==1: return majorityCnt(classList) bestFeat=chooseBestFeatureToSplit(dataSet) bestFeatLabel=labels[bestFeat] myTree={bestFeatLabel:{}} del(labels[bestFeat]) featValues=[example[bestFeat] for example in dataSet] uniqueVals=set(featValues) for value in uniqueVals: subLabels=labels[:] myTree[bestFeatLabel][value]=createTree(splitDataSet(dataSet,bestFeat,value),subLabels) return myTree myDat,labels=createDataSet() print(createTree(myDat,labels)) #print(calcShannonEnt(myDat))
mit
vanjadardic/KiTTY2
src/kitty2/Kernel32.java
779
package kitty2; import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.Pointer; import com.sun.jna.platform.win32.WinBase; import com.sun.jna.platform.win32.WinDef; import com.sun.jna.win32.W32APIOptions; public interface Kernel32 extends Library { public static final Kernel32 INSTANCE = (Kernel32) Native.loadLibrary("kernel32", Kernel32.class, W32APIOptions.DEFAULT_OPTIONS); public boolean CreateProcess(String lpApplicationName, String lpCommandLine, WinBase.SECURITY_ATTRIBUTES lpProcessAttributes, WinBase.SECURITY_ATTRIBUTES lpThreadAttributes, WinDef.BOOL bInheritHandles, WinDef.DWORD dwCreationFlags, Pointer lpEnvironment, String lpCurrentDirectory, WinBase.STARTUPINFO lpStartupInfo, WinBase.PROCESS_INFORMATION lpProcessInformation); }
mit
jerolba/funsteroid
funsteroid-freemarker/src/main/java/com/otogami/freemarker/macro/DoLayoutMacro.java
842
package com.otogami.freemarker.macro; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Map; import freemarker.core.Environment; import freemarker.ext.beans.StringModel; import freemarker.template.TemplateDirectiveBody; import freemarker.template.TemplateDirectiveModel; import freemarker.template.TemplateException; import freemarker.template.TemplateModel; public class DoLayoutMacro implements TemplateDirectiveModel{ public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException { TemplateModel tm=env.getVariable("_doLayout_"); StringModel strModel=(StringModel) tm; ByteArrayOutputStream baos=(ByteArrayOutputStream) strModel.getWrappedObject(); env.getOut().write(new String(baos.toByteArray())); } }
mit
ycabon/presentations
2018-user-conference/arcgis-js-api-road-ahead/demos/gamepad/api-snapshot/esri/widgets/Legend.js
20289
// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.8/esri/copyright.txt for details. //>>built require({cache:{"esri/widgets/Legend/styles/Card":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/i18n!../../../nls/common dojo/i18n!../../Legend/nls/Legend dojox/gfx ../../../core/lang ../../../core/accessorSupport/decorators ../../Widget ../../Legend/support/styleUtils ../../support/colorUtils ../../support/widget".split(" "),function(A,e,x,h,u,n,y,v,w,m,C,d,b){return function(l){function c(a){a=l.call(this)||this;a._hasIndicators= !1;a._selectedSectionName=null;a._sectionNames=[];a._sectionMap=new Map;a.activeLayerInfos=null;a.view=null;return a}x(c,l);c.prototype.render=function(){var a=this;this._sectionNames.length=0;this._hasIndicators=768>=this.view.container.clientWidth;var c=this.activeLayerInfos,c=c&&c.toArray().map(function(b){return a._renderLegendForLayer(b)}).filter(function(a){return!!a});this._hasIndicators?this._selectedSectionName&&-1!==this._sectionNames.indexOf(this._selectedSectionName)||(this._selectedSectionName= this._sectionNames&&this._sectionNames[0]):this._selectedSectionName=null;var f=this._sectionNames.length,g=this._sectionNames.map(function(c,r){r=v.substitute({index:r+1,total:f},u.pagination.pageText);return b.tsx("div",{key:c,"aria-label":r,title:r,tabIndex:0,onclick:a._selectSection,onkeydown:a._selectSection,bind:a,class:a.classes("esri-legend--card__carousel-indicator",(g={},g["esri-legend--card__carousel-indicator--activated"]=a._selectedSectionName===c,g)),"data-section-name":c});var g}), g=this._hasIndicators?b.tsx("div",{class:"esri-legend--card__carousel-indicator-container",key:"carousel-navigation"},g):null,c=this._hasIndicators?this._sectionMap.get(this._selectedSectionName):c&&c.length?c:null;return b.tsx("div",{class:"esri-legend--card esri-widget"},g,c?c:b.tsx("div",{class:"esri-legend--card__message"},n.noLegend))};c.prototype._selectSection=function(a){if(a=a.target.getAttribute("data-section-name"))this._selectedSectionName=a};c.prototype._renderLegendForLayer=function(a){var c= this;if(!a.ready)return null;var f="esri-legend--card__"+a.layer.uid+"-version-"+a.version;if(a.children.length){var g=a.children.map(function(a){return c._renderLegendForLayer(a)}).toArray();this._sectionNames.push(f);return b.tsx("div",{key:a.layer.uid,class:"esri-legend--card__service"},b.tsx("div",{class:"esri-legend--card__service-caption-container"},a.title),g)}if((f=a.legendElements)&&!f.length)return null;f=f.map(function(b){return c._renderLegendForElement(b,a.layer)}).filter(function(a){return!!a}); return f.length?b.tsx("div",{key:a.layer.uid,class:"esri-legend--card__service"},b.tsx("div",{class:"esri-legend--card__service-caption-container"},b.tsx("div",{class:"esri-legend--card__service-caption-text"},a.title)),b.tsx("div",{class:"esri-legend--card__service-content"},f)):null};c.prototype._renderLegendForElement=function(a,c){var f=this,g="color-ramp"===a.type,r="opacity-ramp"===a.type,d="size-ramp"===a.type,p=a.title,l=null;"string"===typeof p?l=p:p&&(l=C.getTitle(p,g||r),l=p.title?p.title+ " ("+l+")":l);var p="esri-legend--card__"+c.uid+"-type-"+a.type,m=this._hasIndicators?b.tsx("p",{class:"esri-legend--card__carousel-title"},c.title):null,k=null;"symbol-table"===a.type?(g=a.infos.map(function(b){return f._renderLegendForElementInfo(b,c,d,a.legendType)}).filter(function(a){return!!a}),this._hasIndicators||g.reverse(),g.length&&(r=g[0].properties.classes&&g[0].properties.classes["esri-legend--card__symbol-row"],r=(z={},z["esri-legend--card__label-container"]=!r,z),k=b.tsx("div",{key:p, class:"esri-legend--card__section"},m,b.tsx("div",{class:"esri-legend--card__layer-caption"},l),b.tsx("div",{class:this.classes(r)},g)))):g||r?k=b.tsx("div",{key:p,class:"esri-legend--card__section"},m,b.tsx("div",{class:"esri-legend--card__layer-caption"},l),this._renderLegendForRamp(a.infos,a.overlayColor,r)):d&&(k=b.tsx("div",{key:p,class:"esri-legend--card__section"},m,b.tsx("div",{class:"esri-legend--card__layer-caption"},l),this._renderSizeRamps(a.infos)));if(!k)return null;this._sectionNames.push(p); this._sectionMap.set(p,k);return k;var z};c.prototype._renderLegendForElementInfo=function(a,c,f,g){if(a.type)return this._renderLegendForElement(a,c);f=C.isImageryStretchedLegend(c,g);if(a.symbol&&a.preview){if(!a.label)return-1===a.symbol.type.indexOf("simple-fill")?b.tsx("div",{bind:a.preview,afterCreate:C.attachToNode}):null;if(-1!==a.symbol.type.indexOf("marker"))return c=(z={},z["esri-legend--card__symbol-cell"]=this._hasIndicators,z),b.tsx("div",{class:this.classes("esri-legend--card__layer-row", (h={},h["esri-legend--card__symbol-row"]=this._hasIndicators,h))},b.tsx("div",{class:this.classes(c),bind:a.preview,afterCreate:C.attachToNode}),b.tsx("div",{class:this.classes("esri-legend--card__image-label",(e={},e["esri-legend--card__label-cell"]=this._hasIndicators,e))},a.label||""));e=h=z=255;c=0;var r=g=f=255,l=0,p=a.symbol.color&&a.symbol.color.a,m=a.symbol.outline&&a.symbol.outline.color.a;p&&(z=a.symbol.color.r,h=a.symbol.color.g,e=a.symbol.color.b,c=a.symbol.color.a);m&&(f=a.symbol.outline.color.r, g=a.symbol.outline.color.g,r=a.symbol.outline.color.b,l=a.symbol.outline.color.a);var u=d.isBright(a.symbol.color),k=u?"rgba(255, 255, 255, .6)":"rgba(0, 0, 0, .6)";return b.tsx("div",{key:a.label,class:"esri-legend--card__label-element",styles:{background:p?"rgba("+z+", "+h+", "+e+", "+c+")":"none",color:u?"black":"white",textShadow:"-1px -1px 0 "+k+",\n 1px -1px 0 "+k+",\n -1px 1px 0 "+k+",\n 1px 1px 0 "+ k,border:m?"1px solid rgba("+f+", "+g+", "+r+", "+l+")":"none"}}," ",a.label," ")}if(a.src)return z=this._renderImage(a,c,f),b.tsx("div",{class:"esri-legend--card__layer-row"},z,b.tsx("div",{class:"esri-legend--card__image-label"},a.label||""));var z,h,e};c.prototype._renderImage=function(a,c,f){var g=a.label,d=a.src,r=a.opacity;f=(l={},l["esri-legend--card__imagery-layer-image--stretched"]=f,l["esri-legend--card__symbol"]=!f,l);c={opacity:""+(null!=r?r:c.opacity)};return b.tsx("img",{alt:g,src:d, border:0,width:a.width,height:a.height,class:this.classes(f),styles:c});var l};c.prototype._renderSizeRamps=function(a){var c=document.createElement("div"),f,g=a[a.length-1].symbol.color,d,l,p=a[0].label,m=a[a.length-1].label,h=a[0].symbol.style&&"circle"===a[0].symbol.style;try{if(this._hasIndicators)if(l=100,h){var k=a[0].symbol.size/2,e=a[a.length-1].symbol.size/2;d=2*k;var u=l-k-e,v=Math.sqrt(Math.pow(u,2)-Math.pow(k-e,2)),n=k*v/u,w=k+n,x=k+Math.sqrt(Math.pow(k,2)-Math.pow(n,2)),B=e*n/k,A=k+B, D=l-(e-Math.sqrt(Math.pow(e,2)-Math.pow(B,2))),n=k-n,B=k-B;f=y.createSurface(c,d,l);f.createCircle({cx:k,cy:k,r:k}).setFill(g).setStroke({color:"#ddd",width:1});f.createCircle({cx:k,cy:l-e,r:e}).setFill(g).setStroke({color:"#ddd",width:1});f.createLine({x1:w,y1:x,x2:A,y2:D}).setStroke({color:"#ddd",width:1});f.createLine({x1:n,y1:x,x2:B,y2:D}).setStroke({color:"#ddd",width:1})}else{var q=Math.max(a[0].symbol.height,a[0].symbol.width),t=Math.max(a[a.length-1].symbol.height,a[a.length-1].symbol.width); d=q;f=y.createSurface(c,d,l);f.createRect({x:0,y:0,height:q,width:q}).setStroke({color:"#ddd",width:1});f.createRect({x:q/2-t/2,y:l-t,height:t,width:t}).setStroke({color:"#ddd",width:1});f.createImage({src:a[0].symbol.url,height:q,width:q});f.createImage({src:a[a.length-1].symbol.url,height:t,width:t,y:l-t,x:q/2-t/2});f.createLine({x1:0,y1:q,x2:q/2-t/2,y2:l-t}).setStroke({color:"#ddd",width:1});f.createLine({x1:d,y1:q,x2:q/2+t/2,y2:l-t}).setStroke({color:"#ddd",width:1})}else d=180,h?(k=a[0].symbol.size/ 2,e=a[a.length-1].symbol.size/2,l=2*k,u=d-k-e,v=Math.sqrt(Math.pow(u,2)-Math.pow(k-e,2)),n=k*v/u,x=k-n,w=d-(k+Math.sqrt(Math.pow(k,2)-Math.pow(n,2))),B=e*n/k,D=k-B,A=e-Math.sqrt(Math.pow(e,2)-Math.pow(B,2)),n=k+n,B=k+B,f=y.createSurface(c,d,l),f.createCircle({cx:d-k,cy:k,r:k}).setFill(g).setStroke({color:"#ddd",width:1}),f.createCircle({cx:e,cy:k,r:e}).setFill(g).setStroke({color:"#ddd",width:1}),f.createLine({x1:w,y1:x,x2:A,y2:D}).setStroke({color:"#ddd",width:1}),f.createLine({x1:w,y1:n,x2:A,y2:B}).setStroke({color:"#ddd", width:1})):(q=Math.max(a[0].symbol.height,a[0].symbol.width),t=Math.max(a[a.length-1].symbol.height,a[a.length-1].symbol.width),f=y.createSurface(c,d,q),f.createRect({x:0,y:q/2-t/2,height:t,width:t}).setStroke({color:"#ddd",width:1}),f.createRect({x:d-q,y:0,height:q,width:q}).setStroke({color:"#ddd",width:1}),f.createImage({src:a[a.length-1].symbol.url,height:t,width:t,y:q/2-t/2}),f.createImage({src:a[0].symbol.url,height:q,width:q,x:d-q}),f.createLine({x1:t,y1:q/2-t/2,x2:d-q,y2:0}).setStroke({color:"#ddd", width:1}),f.createLine({x1:t,y1:q/2+t/2,x2:d-q,y2:q}).setStroke({color:"#ddd",width:1})),g=p,p=m,m=g}catch(G){f.clear(),f.destroy()}return f?b.tsx("div",{class:this.classes("esri-legend--card__layer-row",(E={},E["esri-legend--card__size-ramp-row"]=this._hasIndicators,E))},b.tsx("div",{class:"esri-legend--card__ramp-label"},p),b.tsx("div",{class:"esri-legend--card__size-ramp-container"},b.tsx("div",{bind:c,afterCreate:C.attachToNode})),b.tsx("div",{class:"esri-legend--card__ramp-label"},m)):null;var E}; c.prototype._renderLegendForRamp=function(a,c,f){var d=a.length-1;f=2<d?25*d:100;var l=f+20;c=document.createElement("div");c.style.width=l+"px";var r=y.createSurface(c,l,25),e=a.slice(0).reverse();try{e.forEach(function(a,b){a.offset=b/d}),r.createPath("M0 12.5 L10 0 L10 25 Z").setFill(e[0].color).setStroke(null),r.createRect({x:10,y:0,width:f,height:25}).setFill({type:"linear",x1:10,y1:0,x2:f+10,y2:0,colors:e}).setStroke(null),r.createPath("M"+(f+10)+" 0 L"+l+" 12.5 L"+(f+10)+" 25 Z").setFill(e[e.length- 1].color).setStroke(null)}catch(F){r.clear(),r.destroy()}if(!r)return null;f=e.filter(function(a,b){return!!a.label&&0!==b&&b!==e.length-1}).map(function(a){return b.tsx("div",{class:"esri-legend--card__interval-separators-container"},b.tsx("div",{class:"esri-legend--card__interval-separator"},"|"),b.tsx("div",{class:"esri-legend--card__ramp-label"},a.label))});return b.tsx("div",{class:"esri-legend--card__layer-row"},b.tsx("div",{class:"esri-legend--card__ramp-label"},a[a.length-1].label),b.tsx("div", {class:"esri-legend--card__symbol-container"},b.tsx("div",{bind:c,afterCreate:C.attachToNode}),f),b.tsx("div",{class:"esri-legend--card__ramp-label"},a[0].label))};h([b.renderable(),w.property()],c.prototype,"activeLayerInfos",void 0);h([w.property()],c.prototype,"view",void 0);h([b.accessibleHandler()],c.prototype,"_selectSection",null);return c=h([w.subclass("esri.widgets.Legend.styles.Card")],c)}(w.declared(m))})},"esri/widgets/Legend/support/styleUtils":function(){define(["require","exports", "dojo/i18n!../../Legend/nls/Legend","../../../core/lang"],function(A,e,x,h){Object.defineProperty(e,"__esModule",{value:!0});e.attachToNode=function(e){e.appendChild(this)};e.getTitle=function(e,n){var u=null;n?u=e.ratioPercentTotal?"showRatioPercentTotal":e.ratioPercent?"showRatioPercent":e.ratio?"showRatio":e.normField?"showNormField":e.field?"showField":null:n||(u=e.normField?"showNormField":e.normByPct?"showNormPct":e.field?"showField":null);return u?h.substitute({field:e.field,normField:e.normField}, x[u]):null};e.isRendererTitle=function(e,h){return!h};e.isImageryStretchedLegend=function(e,h){return!!(h&&"Stretched"===h&&10.3<=e.version&&"esri.layers.ImageryLayer"===e.declaredClass)}})},"esri/widgets/support/colorUtils":function(){define(["require","exports","../../Color"],function(A,e,x){function h(d){return new x(d)}function u(d){return!!d&&4===d.length&&m.test(d)}function n(d){return!!d&&7===d.length&&C.test(d)}function y(d){return 127<=.299*d.r+.587*d.g+.114*d.b}function v(d,b){void 0=== b&&(b=1);b=Math.pow(.7,b);return new x([Math.round(d.r*b),Math.round(d.g*b),Math.round(d.b*b),d.a])}function w(d,b){void 0===b&&(b=1);b=Math.pow(.7,b);var e=d.r,c=d.g,a=d.b;30>e&&(e=30);30>c&&(c=30);30>a&&(a=30);return new x([Math.min(255,Math.round(e/b)),Math.min(255,Math.round(c/b)),Math.min(255,Math.round(a/b)),d.a])}Object.defineProperty(e,"__esModule",{value:!0});var m=/^#[0-9A-F]{3}$/i,C=/^#[0-9A-F]{6}$/i;e.equal=function(d,b){return d&&b&&d.r===b.r&&d.g===b.g&&d.b===b.b&&d.a===b.a};e.normalizeHex= function(d){return d?"#"+d.trim().replace(/#/g,"").substr(0,6):""};e.normalizeColor=h;e.isValidHex=function(d){return u(d)||n(d)};e.isShorthandHex=u;e.isLonghandHex=n;e.toHex=function(d){return h(d).toHex()};e.getContrastingColor=function(d){return y(d)?v(d):w(d,3)};e.isBright=y;e.darker=v;e.brighter=w})},"esri/widgets/Legend/styles/Classic":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/i18n!../../Legend/nls/Legend dojox/gfx ../../../core/accessorSupport/decorators ../../Widget ../../Legend/support/styleUtils ../../support/widget".split(" "), function(A,e,x,h,u,n,y,v,w,m){return function(e){function d(b){b=e.call(this)||this;b.activeLayerInfos=null;return b}x(d,e);d.prototype.render=function(){var b=this,d=this.activeLayerInfos,c=this.classes("esri-legend esri-widget--panel","esri-widget"),d=d&&d.toArray().map(function(a){return b._renderLegendForLayer(a)}).filter(function(a){return!!a});return m.tsx("div",{class:c},d&&d.length?d:m.tsx("div",{class:"esri-legend__message"},u.noLegend))};d.prototype._renderLegendForLayer=function(b){var d= this;if(!b.ready)return null;var c=!!b.children.length,a="esri-legend__"+b.layer.uid+"-version-"+b.version,e=b.title?m.tsx("div",{class:"esri-legend__service-label"},b.title):null;if(c){var f=b.children.map(function(a){return d._renderLegendForLayer(a)}).toArray(),c=(g={},g["esri-legend__group-layer"]=c,g);return m.tsx("div",{key:a,class:this.classes("esri-legend__service",c)},e,f)}if((c=b.legendElements)&&!c.length)return null;g=c.map(function(a){return d._renderLegendForElement(a,b.layer)}).filter(function(a){return!!a}); if(!g.length)return null;c=(f={},f["esri-legend__group-layer-child"]=!!b.parent,f);return m.tsx("div",{key:a,class:this.classes("esri-legend__service",c)},e,m.tsx("div",{class:"esri-legend__layer"},g));var g};d.prototype._renderLegendForElement=function(b,d,c){var a=this,e="color-ramp"===b.type,f="opacity-ramp"===b.type,g="size-ramp"===b.type,l=null;if("symbol-table"===b.type||g){var h=b.infos.map(function(c){return a._renderLegendForElementInfo(c,d,g,b.legendType)}).filter(function(a){return!!a}); h.length&&(l=m.tsx("div",{class:"esri-legend__layer-body"},h))}else if(e||f)l=this._renderLegendForRamp(b.infos,b.overlayColor,f);if(!l)return null;var h=b.title,p=null;"string"===typeof h?p=h:h&&(p=w.getTitle(h,e||f),p=w.isRendererTitle(h,e||f)&&h.title?h.title+" ("+p+")":p);e=c?"esri-legend__layer-child-table":"esri-legend__layer-table";f=p?m.tsx("div",{class:"esri-legend__layer-caption"},p):null;c=(n={},n["esri-legend__layer-table--size-ramp"]=g||!c,n);return m.tsx("div",{class:this.classes(e, c)},f,l);var n};d.prototype._renderLegendForRamp=function(b,d,c){var a=b.length-1,e=null;2<a?e=25*a:e=50;var f=document.createElement("div");f.className="esri-legend__color-ramp "+(c?"esri-legend__opacity-ramp":"");f.style.height=e+"px";c=n.createSurface(f,"100%",e);try{b.forEach(function(b,c){b.offset=c/a}),c.createRect({x:0,y:0,width:"100%",height:e}).setFill({type:"linear",x1:0,y1:0,x2:0,y2:e,colors:b}).setStroke(null),d&&0<d.a&&c.createRect({x:0,y:0,width:"100%",height:e}).setFill(d).setStroke(null)}catch(g){c.clear(), c.destroy()}if(!c)return null;b=b.filter(function(a){return!!a.label}).map(function(a){return m.tsx("div",{class:"esri-legend__ramp-label"},a.label)});e={height:e+"px"};return m.tsx("div",{class:"esri-legend__layer-row"},m.tsx("div",{class:"esri-legend__layer-cell esri-legend__layer-cell--symbols",styles:{width:"24px"}},m.tsx("div",{class:"esri-legend__ramps",bind:f,afterCreate:w.attachToNode})),m.tsx("div",{class:"esri-legend__layer-cell esri-legend__layer-cell--info"},m.tsx("div",{class:"esri-legend__ramp-labels", styles:e},b)))};d.prototype._renderLegendForElementInfo=function(b,d,c,a){if(b.type)return this._renderLegendForElement(b,d,!0);var e=null;a=w.isImageryStretchedLegend(d,a);b.symbol&&b.preview?e=m.tsx("div",{class:"esri-legend__symbol",bind:b.preview,afterCreate:w.attachToNode}):b.src&&(e=this._renderImage(b,d,a));if(!e)return null;d=(f={},f["esri-legend__imagery-layer-info--stretched"]=a,f);c=(g={},g["esri-legend__imagery-layer-info--stretched"]=a,g["esri-legend__size-ramp"]=!a&&c,g);return m.tsx("div", {class:"esri-legend__layer-row"},m.tsx("div",{class:this.classes("esri-legend__layer-cell esri-legend__layer-cell--symbols",c)},e),m.tsx("div",{class:this.classes("esri-legend__layer-cell esri-legend__layer-cell--info",d)},b.label||""));var f,g};d.prototype._renderImage=function(b,d,c){var a=b.label,e=b.src,f=b.opacity;c=(g={},g["esri-legend__imagery-layer-image--stretched"]=c,g["esri-legend__symbol"]=!c,g);d={opacity:""+(null!=f?f:d.opacity)};return m.tsx("img",{alt:a,src:e,border:0,width:b.width, height:b.height,class:this.classes(c),styles:d});var g};h([m.renderable(),y.property()],d.prototype,"activeLayerInfos",void 0);return d=h([y.subclass("esri.widgets.Legend.styles.Classic")],d)}(y.declared(v))})},"*now":function(A){A(['dojo/i18n!*preload*esri/widgets/nls/Legend*["ar","ca","cs","da","de","el","en-gb","en-us","es-es","fi-fi","fr-fr","he-il","hu","it-it","ja-jp","ko-kr","nl-nl","nb","pl","pt-br","pt-pt","ru","sk","sl","sv","th","tr","zh-tw","zh-cn","ROOT"]'])},"*noref":1}}); define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./Legend/nls/Legend ../core/Handles ../core/watchUtils ../core/accessorSupport/decorators ./Widget ./Legend/LegendViewModel ./Legend/styles/Card ./Legend/styles/Classic ./support/widget".split(" "),function(A,e,x,h,u,n,y,v,w,m,C,d,b){return function(e){function c(a){a=e.call(this)||this;a._handles=new n;a._styleRenderer=null;a.activeLayerInfos=null;a.basemapLegendVisible=!1;a.groundLegendVisible= !1;a.iconClass="esri-icon-layer-list";a.label=u.widgetLabel;a.layerInfos=null;a.view=null;a.viewModel=new m;return a}x(c,e);c.prototype.postInitialize=function(){var a=this;this._updateStyleRenderer(this.style);this.own(y.on(this,"activeLayerInfos","change",function(){return a._refreshActiveLayerInfos(a.activeLayerInfos)}))};c.prototype.destroy=function(){this._handles.destroy();this._handles=null};Object.defineProperty(c.prototype,"style",{get:function(){return this._get("style")},set:function(a){this._updateStyleRenderer(a); this._set("style",a)},enumerable:!0,configurable:!0});c.prototype.render=function(){return this._styleRenderer.render()};c.prototype._updateStyleRenderer=function(a){this._styleRenderer&&this._styleRenderer.destroy();this._styleRenderer="card"===a?new C({activeLayerInfos:this.activeLayerInfos,view:this.view}):new d({activeLayerInfos:this.activeLayerInfos})};c.prototype._refreshActiveLayerInfos=function(a){var b=this;this._handles.removeAll();a.forEach(function(a){return b._renderOnActiveLayerInfoChange(a)}); this.scheduleRender()};c.prototype._renderOnActiveLayerInfoChange=function(a){var b=this,c=y.init(a,"version",function(){return b.scheduleRender()});this._handles.add(c,"version_"+a.layer.uid);a.children.forEach(function(a){return b._renderOnActiveLayerInfoChange(a)})};h([v.aliasOf("viewModel.activeLayerInfos"),b.renderable()],c.prototype,"activeLayerInfos",void 0);h([v.aliasOf("viewModel.basemapLegendVisible"),b.renderable()],c.prototype,"basemapLegendVisible",void 0);h([v.aliasOf("viewModel.groundLegendVisible"), b.renderable()],c.prototype,"groundLegendVisible",void 0);h([v.property()],c.prototype,"iconClass",void 0);h([v.property()],c.prototype,"label",void 0);h([v.aliasOf("viewModel.layerInfos"),b.renderable()],c.prototype,"layerInfos",void 0);h([v.property({value:"classic",dependsOn:["activeLayerInfos"]}),b.renderable()],c.prototype,"style",null);h([v.aliasOf("viewModel.view"),b.renderable()],c.prototype,"view",void 0);h([v.property(),b.renderable(["view.size"])],c.prototype,"viewModel",void 0);return c= h([v.subclass("esri.widgets.Legend")],c)}(v.declared(w))});
mit
thp44/delphin_6_automation
sphinx/conf.py
5539
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Delphin Automation documentation build configuration file, created by # sphinx-quickstart on Mon Feb 26 10:42:44 2018. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import os import sys source_folder = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0, source_folder) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.imgmath', 'sphinx.ext.viewcode', 'sphinx.ext.githubpages'] # Add any paths that contain templates here, relative to this directory. templates_path = ['.templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = 'Delphin Automation' copyright = '2018, Christian Kongsgaard, Thomas Perkov' author = 'Christian Kongsgaard, Thomas Perkov' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.0' # The full version, including alpha/beta/rc tags. release = '0.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['.build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {'page_width': 800,} #'sidebar_width': 200} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['.static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. # # This is required for the alabaster theme # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars html_sidebars = { '**': [ 'relations.html', # needs 'show_related': True theme option to display 'searchbox.html', ] } # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. htmlhelp_basename = 'DelphinAutomationdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'DelphinAutomation.tex', 'Delphin Automation Documentation', 'Christian Kongsgaard, Thomas Perkov', 'manual'), ] # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'delphinautomation', 'Delphin Automation Documentation', [author], 1) ] # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'DelphinAutomation', 'Delphin Automation Documentation', author, 'DelphinAutomation', 'One line description of project.', 'Miscellaneous'), ]
mit
JohnnyCrazy/SpotifyAPI-NET
SpotifyAPI.Web/Models/Response/SavedShow.cs
171
using System; namespace SpotifyAPI.Web { public class SavedShow { public DateTime AddedAt { get; set; } public FullShow Show { get; set; } = default!; } }
mit
jaroslavtyc/drd-plus-properties
DrdPlus/Properties/Derived/FatigueBoundary.php
998
<?php declare(strict_types = 1); declare(strict_types=1); namespace DrdPlus\Properties\Derived; use DrdPlus\Codes\Properties\PropertyCode; use DrdPlus\Properties\Derived\Partials\AbstractDerivedProperty; use DrdPlus\Tables\Measurements\Fatigue\FatigueBonus; use DrdPlus\Tables\Tables; /** * @method FatigueBoundary add(int | \Granam\Integer\IntegerInterface $value) * @method FatigueBoundary sub(int | \Granam\Integer\IntegerInterface $value) */ class FatigueBoundary extends AbstractDerivedProperty { public static function getIt(Endurance $endurance, Tables $tables): FatigueBoundary { return new static( $tables->getFatigueTable()->toFatigue( new FatigueBonus( $endurance->getValue() + 10, $tables->getFatigueTable() ) )->getValue() ); } public function getCode(): PropertyCode { return PropertyCode::getIt(PropertyCode::FATIGUE_BOUNDARY); } }
mit
RadoChervenkov/Football-League-Management-System
Source/FootballLeagueManagementSystem/Data/FLMS.Data.Models/Match.cs
990
namespace FLMS.Data.Models { using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using FLMS.Data.Common.Models; public class Match : AuditInfo, IDeletableEntity { [Key] public int Id { get; set; } public DateTime Date { get; set; } public int HomeTeamId { get; set; } [ForeignKey("HomeTeamId")] public virtual Team HomeTeam { get; set; } public int AwayTeamId { get; set; } [ForeignKey("AwayTeamId")] public virtual Team AwayTeam { get; set; } public int LeagueId { get; set; } public virtual League League { get; set; } public int HomeGoals { get; set; } public int AwayGoals { get; set; } public MatchResult Result { get; set; } public MatchState State { get; set; } public bool IsDeleted { get; set; } public DateTime? DeletedOn { get; set; } } }
mit
8BitRick/tweet_it
app/controllers/application_controller.rb
2996
class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception include TwitterClient require 'twitter' require 'pp' def welcome if(current_user) redirect_to '/tweet_it' end end def tweet_it # Influencers will only be established once # TODO - add some way to refresh the leader list, esp if we make it dynamic update_influencers if Influencer.count <= 0 @users = User.all @influencers = Influencer.all @tweets = Tweet.latest_tweets @display_user = Tweet.display_name #@tweets = statuses end def update_tweets @tweets = Tweet.where(user: params[:user]) end def post_tweet client.update(params[:tweet_to_post]) # Invalidate our cache for user current_user.last_tweet_request = nil current_user.save respond_to do |format| format.html { redirect_to '/tweet_it' } format.js end end def update_influencers influencer_list = %w( fakegrimlock kimjongnumberun thepresobama elbloombito Queen_UK DarthVader NotZuckerberg Lord_Voldemort7 BoredElonMusk ItsWillyFerrell Charles_HRH FakeScience Plaid_Gaddafi) # Save off our influencers influencer_list.each do |influencer| user_data = client.user(influencer) Influencer.where( name: user_data[:name], handle: user_data[:screen_name], description: user_data[:description], id_str: user_data[:id_str], pic: user_data[:profile_image_url], raw: user_data.to_json).first_or_create end end # TODO - move these into models def followers @followers ||= client.followers @followers.attrs[:users].map{|f| f[:name]} end def friends @friends ||= client.friends @friends.attrs[:users].map{|f| f[:name]} end def timeline @timeline ||= client.home_timeline @timeline.map{|t| t.full_text} end def mentions @mentions ||= client.mentions_timeline @mentions.map{|m| m.full_text} end def statuses # TODO - HACKING TO prevent hitting twitter api too often @statuses = Tweet.where(user: current_user.name) return @statuses if @statuses raw_tweets = client.user_timeline(client.current_user)#.map{|t| t.full_text} save_tweets(raw_tweets) @statuses = Tweet.where(user: current_user.name) end def temp fo = 'followers are ' + followers.to_s fr = 'friends are ' + friends.to_s ti = 'timeline is ' + timeline.to_s me = 'mentions ' + mentions.to_s st = 'statuses: ' + statuses.to_s str = [fo,fr,ti,me,st].join("\n") #str = client.methods.select{|t| t.to_s.downcase.include? 'tw'} #str = st puts str #render plain: str end def current_user @current_user ||= User.find(session[:user_id]) if (session && session[:user_id]) end helper_method :current_user end
mit
MelissaChan/SFJSRMJD
src/HDU/P5327.java
873
package HDU; import java.util.Scanner; /** * @author MelissaChan * * 2016-1-28 下午12:37:10 */ public class P5327 { /** * 数组前缀和 */ public static int isButifulNumber(int num){ int[] temp = new int[10]; int count = 0; while(num > 0){ temp[count] = num % 10; num /= 10; count++; } for(int i = 0; i < count; i++) for(int j = 0; j < count; j++) if(i != j && temp[i] == temp[j]) return 0; return 1; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] nums = new int[100100]; for(int i = 1; i < 100100;i++){ nums[i] = isButifulNumber(i); } for(int j = 1; j <100100;j++){ nums[j] = nums[j] + nums[j-1]; } int n = sc.nextInt(); while(n-- > 0){ int a = sc.nextInt(); int b = sc.nextInt(); System.out.println(nums[b] - nums[a-1]); } sc.close(); } }
mit
gjungb/angular
packages/platform-browser/test/dom/events/event_manager_spec.ts
14157
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {NgZone} from '@angular/core/src/zone/ng_zone'; import {beforeEach, describe, expect, it} from '@angular/core/testing/src/testing_internal'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; import {DomEventsPlugin} from '@angular/platform-browser/src/dom/events/dom_events'; import {EventManager, EventManagerPlugin} from '@angular/platform-browser/src/dom/events/event_manager'; import {el} from '../../../testing/src/browser_util'; export function main() { let domEventPlugin: DomEventsPlugin; let doc: any; let zone: NgZone; describe('EventManager', () => { beforeEach(() => { doc = getDOM().supportsDOMEvents() ? document : getDOM().createHtmlDocument(); zone = new NgZone({}); domEventPlugin = new DomEventsPlugin(doc, zone); }); it('should delegate event bindings to plugins that are passed in from the most generic one to the most specific one', () => { const element = el('<div></div>'); const handler = (e: any /** TODO #9100 */) => e; const plugin = new FakeEventManagerPlugin(doc, ['click']); const manager = new EventManager([domEventPlugin, plugin], new FakeNgZone()); manager.addEventListener(element, 'click', handler); expect(plugin.eventHandler['click']).toBe(handler); }); it('should delegate event bindings to the first plugin supporting the event', () => { const element = el('<div></div>'); const clickHandler = (e: any /** TODO #9100 */) => e; const dblClickHandler = (e: any /** TODO #9100 */) => e; const plugin1 = new FakeEventManagerPlugin(doc, ['dblclick']); const plugin2 = new FakeEventManagerPlugin(doc, ['click', 'dblclick']); const manager = new EventManager([plugin2, plugin1], new FakeNgZone()); manager.addEventListener(element, 'click', clickHandler); manager.addEventListener(element, 'dblclick', dblClickHandler); expect(plugin2.eventHandler['click']).toBe(clickHandler); expect(plugin1.eventHandler['dblclick']).toBe(dblClickHandler); }); it('should throw when no plugin can handle the event', () => { const element = el('<div></div>'); const plugin = new FakeEventManagerPlugin(doc, ['dblclick']); const manager = new EventManager([plugin], new FakeNgZone()); expect(() => manager.addEventListener(element, 'click', null !)) .toThrowError('No event manager plugin found for event click'); }); it('events are caught when fired from a child', () => { const element = el('<div><div></div></div>'); // Workaround for https://bugs.webkit.org/show_bug.cgi?id=122755 getDOM().appendChild(doc.body, element); const child = getDOM().firstChild(element); const dispatchedEvent = getDOM().createMouseEvent('click'); let receivedEvent: any /** TODO #9100 */ = null; const handler = (e: any /** TODO #9100 */) => { receivedEvent = e; }; const manager = new EventManager([domEventPlugin], new FakeNgZone()); manager.addEventListener(element, 'click', handler); getDOM().dispatchEvent(child, dispatchedEvent); expect(receivedEvent).toBe(dispatchedEvent); }); it('should add and remove global event listeners', () => { const element = el('<div><div></div></div>'); getDOM().appendChild(doc.body, element); const dispatchedEvent = getDOM().createMouseEvent('click'); let receivedEvent: any /** TODO #9100 */ = null; const handler = (e: any /** TODO #9100 */) => { receivedEvent = e; }; const manager = new EventManager([domEventPlugin], new FakeNgZone()); const remover = manager.addGlobalEventListener('document', 'click', handler); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvent).toBe(dispatchedEvent); receivedEvent = null; remover(); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvent).toBe(null); }); it('should keep zone when addEventListener', () => { const Zone = (window as any)['Zone']; const element = el('<div><div></div></div>'); getDOM().appendChild(doc.body, element); const dispatchedEvent = getDOM().createMouseEvent('click'); let receivedEvent: any /** TODO #9100 */ = null; let receivedZone: any = null; const handler = (e: any /** TODO #9100 */) => { receivedEvent = e; receivedZone = Zone.current; }; const manager = new EventManager([domEventPlugin], new FakeNgZone()); let remover = null; Zone.root.run(() => { remover = manager.addEventListener(element, 'click', handler); }); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvent).toBe(dispatchedEvent); expect(receivedZone.name).toBe(Zone.root.name); receivedEvent = null; remover && remover(); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvent).toBe(null); }); it('should keep zone when addEventListener multiple times', () => { const Zone = (window as any)['Zone']; const element = el('<div><div></div></div>'); getDOM().appendChild(doc.body, element); const dispatchedEvent = getDOM().createMouseEvent('click'); let receivedEvents: any[] /** TODO #9100 */ = []; let receivedZones: any[] = []; const handler1 = (e: any /** TODO #9100 */) => { receivedEvents.push(e); receivedZones.push(Zone.current.name); }; const handler2 = (e: any /** TODO #9100 */) => { receivedEvents.push(e); receivedZones.push(Zone.current.name); }; const manager = new EventManager([domEventPlugin], new FakeNgZone()); let remover1 = null; let remover2 = null; Zone.root.run(() => { remover1 = manager.addEventListener(element, 'click', handler1); }); Zone.root.fork({name: 'test'}).run(() => { remover2 = manager.addEventListener(element, 'click', handler2); }); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvents).toEqual([dispatchedEvent, dispatchedEvent]); expect(receivedZones).toEqual([Zone.root.name, 'test']); receivedEvents = []; remover1 && remover1(); remover2 && remover2(); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvents).toEqual([]); }); it('should support event.stopImmediatePropagation', () => { const Zone = (window as any)['Zone']; const element = el('<div><div></div></div>'); getDOM().appendChild(doc.body, element); const dispatchedEvent = getDOM().createMouseEvent('click'); let receivedEvents: any[] /** TODO #9100 */ = []; let receivedZones: any[] = []; const handler1 = (e: any /** TODO #9100 */) => { receivedEvents.push(e); receivedZones.push(Zone.current.name); e.stopImmediatePropagation(); }; const handler2 = (e: any /** TODO #9100 */) => { receivedEvents.push(e); receivedZones.push(Zone.current.name); }; const manager = new EventManager([domEventPlugin], new FakeNgZone()); let remover1 = null; let remover2 = null; Zone.root.run(() => { remover1 = manager.addEventListener(element, 'click', handler1); }); Zone.root.fork({name: 'test'}).run(() => { remover2 = manager.addEventListener(element, 'click', handler2); }); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvents).toEqual([dispatchedEvent]); expect(receivedZones).toEqual([Zone.root.name]); receivedEvents = []; remover1 && remover1(); remover2 && remover2(); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvents).toEqual([]); }); it('should handle event correctly when one handler remove itself ', () => { const Zone = (window as any)['Zone']; const element = el('<div><div></div></div>'); getDOM().appendChild(doc.body, element); const dispatchedEvent = getDOM().createMouseEvent('click'); let receivedEvents: any[] /** TODO #9100 */ = []; let receivedZones: any[] = []; let remover1: any = null; let remover2: any = null; const handler1 = (e: any /** TODO #9100 */) => { receivedEvents.push(e); receivedZones.push(Zone.current.name); remover1 && remover1(); }; const handler2 = (e: any /** TODO #9100 */) => { receivedEvents.push(e); receivedZones.push(Zone.current.name); }; const manager = new EventManager([domEventPlugin], new FakeNgZone()); Zone.root.run(() => { remover1 = manager.addEventListener(element, 'click', handler1); }); Zone.root.fork({name: 'test'}).run(() => { remover2 = manager.addEventListener(element, 'click', handler2); }); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvents).toEqual([dispatchedEvent, dispatchedEvent]); expect(receivedZones).toEqual([Zone.root.name, 'test']); receivedEvents = []; remover1 && remover1(); remover2 && remover2(); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvents).toEqual([]); }); it('should only add same callback once when addEventListener', () => { const Zone = (window as any)['Zone']; const element = el('<div><div></div></div>'); getDOM().appendChild(doc.body, element); const dispatchedEvent = getDOM().createMouseEvent('click'); let receivedEvents: any[] /** TODO #9100 */ = []; let receivedZones: any[] = []; const handler = (e: any /** TODO #9100 */) => { receivedEvents.push(e); receivedZones.push(Zone.current.name); }; const manager = new EventManager([domEventPlugin], new FakeNgZone()); let remover1 = null; let remover2 = null; Zone.root.run(() => { remover1 = manager.addEventListener(element, 'click', handler); }); Zone.root.fork({name: 'test'}).run(() => { remover2 = manager.addEventListener(element, 'click', handler); }); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvents).toEqual([dispatchedEvent]); expect(receivedZones).toEqual([Zone.root.name]); receivedEvents = []; remover1 && remover1(); remover2 && remover2(); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvents).toEqual([]); }); it('should be able to remove event listener which was added inside of ngZone', () => { const Zone = (window as any)['Zone']; const element = el('<div><div></div></div>'); getDOM().appendChild(doc.body, element); const dispatchedEvent = getDOM().createMouseEvent('click'); let receivedEvents: any[] /** TODO #9100 */ = []; let receivedZones: any[] = []; const handler1 = (e: any /** TODO #9100 */) => { receivedEvents.push(e); receivedZones.push(Zone.current.name); }; const handler2 = (e: any /** TODO #9100 */) => { receivedEvents.push(e); receivedZones.push(Zone.current.name); }; const manager = new EventManager([domEventPlugin], new FakeNgZone()); let remover1 = null; let remover2 = null; // handler1 is added in root zone Zone.root.run(() => { remover1 = manager.addEventListener(element, 'click', handler1); }); // handler2 is added in 'angular' zone Zone.root.fork({name: 'fakeAngularZone', properties: {isAngularZone: true}}).run(() => { remover2 = manager.addEventListener(element, 'click', handler2); }); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvents).toEqual([dispatchedEvent, dispatchedEvent]); expect(receivedZones).toEqual([Zone.root.name, 'fakeAngularZone']); receivedEvents = []; remover1 && remover1(); remover2 && remover2(); getDOM().dispatchEvent(element, dispatchedEvent); // handler1 and handler2 are added in different zone // one is angular zone, the other is not // should still be able to remove them correctly expect(receivedEvents).toEqual([]); }); it('should run blackListedEvents handler outside of ngZone', () => { const Zone = (window as any)['Zone']; const element = el('<div><div></div></div>'); getDOM().appendChild(doc.body, element); const dispatchedEvent = getDOM().createMouseEvent('scroll'); let receivedEvent: any /** TODO #9100 */ = null; let receivedZone: any = null; const handler = (e: any /** TODO #9100 */) => { receivedEvent = e; receivedZone = Zone.current; }; const manager = new EventManager([domEventPlugin], new FakeNgZone()); let remover = manager.addEventListener(element, 'scroll', handler); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvent).toBe(dispatchedEvent); expect(receivedZone.name).toBe(Zone.root.name); receivedEvent = null; remover && remover(); getDOM().dispatchEvent(element, dispatchedEvent); expect(receivedEvent).toBe(null); }); }); } /** @internal */ class FakeEventManagerPlugin extends EventManagerPlugin { eventHandler: {[event: string]: Function} = {}; constructor(doc: any, public supportedEvents: string[]) { super(doc); } supports(eventName: string): boolean { return this.supportedEvents.indexOf(eventName) > -1; } addEventListener(element: any, eventName: string, handler: Function) { this.eventHandler[eventName] = handler; return () => { delete (this.eventHandler[eventName]); }; } } class FakeNgZone extends NgZone { constructor() { super({enableLongStackTrace: false}); } run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T { return fn(); } runOutsideAngular(fn: Function) { return fn(); } }
mit
mrorii/gastroglot
sort_recipes.py
416
#!/usr/bin/env python import argparse import json import utils def main(): parser = argparse.ArgumentParser(description='Sort recipes') parser.add_argument('recipes', help='recipes.json') args = parser.parse_args() recipes = utils.load_data(args.recipes) for recipe in sorted(recipes, key=lambda recipe: recipe['id']): print(json.dumps(recipe)) if __name__ == '__main__': main()
mit
product-definition-center/pdc-ruby-gem
spec/pdc/v1/multi_destination_spec.rb
1081
require 'spec_helper' # WebMock.disable! # enable to re-record describe PDC::V1::MultiDestination do before do VCR.insert_cassette fixture_name end after do VCR.eject_cassette end let(:multi_destinations) { PDC::V1::MultiDestination } describe 'simple test case' do it 'destination returns count' do count = multi_destinations.count count.must_equal 1 end it 'destination works with where' do count = multi_destinations.where(active: false).count count.must_equal 0 end it 'return empty data for specific global component and origin repo release' do multi_destinations.where(active: true, global_component: 'ceph', origin_repo_release_id: 'ceph-1.3').all!.must_equal [] end it 'return real data with query params' do mappings = multi_destinations.where(active: true, global_component: 'ceph', origin_repo_release_id: 'rhceph-2.1@rhel-7').all! mappings.map(&:destination_repo).map(&:release_id).uniq.sort.must_equal ['ceph-2.0@rhel-7', 'rhceph-2.1-updates@rhel-7'] end end end
mit
alexandernesbitt/BCFier
Bcfier.Revit/Data/RevitUtils.cs
3410
using System; using Autodesk.Revit.DB; using Bcfier.Bcf.Bcf2; using Point = Bcfier.Bcf.Bcf2.Point; namespace Bcfier.Revit.Data { public static class RevitUtils { /// <summary> //MOVES THE CAMERA ACCORDING TO THE PROJECT BASE LOCATION //function that changes the coordinates accordingly to the project base location to an absolute location (for BCF export) //if the value negative is set to true, does the opposite (for opening BCF views) /// </summary> /// <param name="c">center</param> /// <param name="view">view direction</param> /// <param name="up">up direction</param> /// <param name="negative">convert to/from</param> /// <returns></returns> public static ViewOrientation3D ConvertBasePoint(Document doc, XYZ c, XYZ view, XYZ up, bool negative) { double angle = 0; double x = 0; double y = 0; double z = 0; //VERY IMPORTANT //BuiltInParameter.BASEPOINT_EASTWEST_PARAM is the value of the BASE POINT LOCATION //position is the location of the BPL related to Revit's absolute origin //if BPL is set to 0,0,0 not always it corresponds to Revit's origin XYZ origin = new XYZ(0, 0, 0); ProjectPosition position = doc.ActiveProjectLocation.get_ProjectPosition(origin); int i = (negative) ? -1 : 1; x = i * position.EastWest; y = i * position.NorthSouth; z = i * position.Elevation; angle = i * position.Angle; if (negative) // I do the addition BEFORE c = new XYZ(c.X + x, c.Y + y, c.Z + z); //rotation double centX = (c.X * Math.Cos(angle)) - (c.Y * Math.Sin(angle)); double centY = (c.X * Math.Sin(angle)) + (c.Y * Math.Cos(angle)); XYZ newC = new XYZ(); if (negative) newC = new XYZ(centX, centY, c.Z); else // I do the addition AFTERWARDS newC = new XYZ(centX + x, centY + y, c.Z + z); double viewX = (view.X * Math.Cos(angle)) - (view.Y * Math.Sin(angle)); double viewY = (view.X * Math.Sin(angle)) + (view.Y * Math.Cos(angle)); XYZ newView = new XYZ(viewX, viewY, view.Z); double upX = (up.X * Math.Cos(angle)) - (up.Y * Math.Sin(angle)); double upY = (up.X * Math.Sin(angle)) + (up.Y * Math.Cos(angle)); XYZ newUp = new XYZ(upX, upY, up.Z); return new ViewOrientation3D(newC, newUp, newView); } public static XYZ GetRevitXYZ(double X, double Y, double Z) { return new XYZ(X.ToFeet(), Y.ToFeet(), Z.ToFeet()); } public static XYZ GetRevitXYZ(Direction d) { return new XYZ(d.X.ToFeet(),d.Y.ToFeet(),d.Z.ToFeet()); } public static XYZ GetRevitXYZ(Point d) { return new XYZ(d.X.ToFeet(), d.Y.ToFeet(), d.Z.ToFeet()); } /// <summary> /// Converts feet units to meters /// </summary> /// <param name="feet">Value in feet to be converted to meters</param> /// <returns></returns> public static double ToMeters(this double feet) { return UnitUtils.ConvertFromInternalUnits(feet, DisplayUnitType.DUT_METERS); } /// <summary> /// Converts meters units to feet /// </summary> /// <param name="meters">Value in feet to be converted to feet</param> /// <returns></returns> public static double ToFeet(this double meters) { return UnitUtils.ConvertToInternalUnits(meters, DisplayUnitType.DUT_METERS); } } }
mit
argos-ci/argos
apps/app/src/pages/Repository/ToggleButton.js
671
import React from 'react' import { Button } from '@smooth-ui/core-sc' import { useRepository, useToggleRepository } from './RepositoryContext' export function ToggleButton() { const repository = useRepository() const { toggleRepository, loading } = useToggleRepository() const { enabled } = repository return ( <Button disabled={loading} variant={enabled ? 'danger' : 'success'} onClick={() => toggleRepository({ variables: { enabled: !repository.enabled, repositoryId: repository.id, }, }) } > {enabled ? 'Deactivate' : 'Activate'} Repository </Button> ) }
mit
geiru/nodepod-app
app/express/express.js
1684
var modExpress = require('express'), modHttp = require('http'), modPath = require('path'), app_core = require(global.buildAppPath('app/core/core.js')), route_index = require('./routes/index.js'), route_client = require('./routes/client.js'), route_master = require('./routes/master.js'); var app = modExpress(), server = modHttp.createServer(app); // configure express app.configure(function(){ app.set('core', {config: app_core.config}), app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.use(modExpress.cookieParser()); app.use(modExpress.session(app_core.config.express.session)); app.use(modExpress.favicon()); app.use(modExpress.bodyParser()); app.use(modExpress.methodOverride()); app.use(app.router); app.use(modExpress.static(modPath.join(__dirname, 'public'))); }); app.configure('development', function(){ app.use(modExpress.logger('dev')); app.use(modExpress.errorHandler()); }); // routes // index app.get('/', function(req, res) { route_index.index(req, res, false); }); app.get('/index', function(req, res) { route_index.index(req, res, false); }); app.get('/json/index', function(req, res) { route_index.json.index(req, res, false); }); // client: redirect to current url app.get('/client/:clientPort', route_client.client); // master // createMaster app.post('/json/createMaster', route_master.json.createMaster); // status page app.get('/master/:token/:clientPort', route_master.master); // start express server server.listen(app_core.config.port, app_core.config.host); // export server exports.server = server; // export app exports.app = app;
mit
doodersrage/CheapLocalDeals.com
mobile/includes/pages/custAdmin/passSub.php
1542
<?PHP // check if customer is logged in if (!empty($_POST['password'])) { // check password length if (strlen($_POST['password']) < MINIMUM_PASSWORD_LENGTH) { $error_message = '<center><font color="red"><strong>Password must be atleast '.MINIMUM_PASSWORD_LENGTH.' characters in length.</strong></font></center>'; } else { if ($_POST['password'] != $_POST['repassword']) { $error_message = '<center><font color="red"><strong>Password fields do not match.</strong></font></center>'; } else { // update password $customer_info_table->id = $_SESSION['customer_id']; $customer_info_table->password = $_POST['password']; $customer_info_table->change_password_check(); $error_message = '<center><font color="red"><strong>Password Updated</strong></font></center>'; } } } $login_form = '<div id="custLoginFrm"> <h1>Change Password</h1>'; $login_form .= (!empty($error_message) ? '<center><strong><font color="red">'.$error_message.'</font></strong></center>' : ''); $login_form .= '<form name="login_form" method="post">'; $login_form .= '<label>Password:</label><input name="password" id="password" type="password" size="30" maxlength="50" value="'.$_POST['password'].'">'; $login_form .= '<label>Confirm Password:</label><input name="repassword" id="repassword" type="password" size="30" maxlength="50" value="'.$_POST['repassword'].'">'; $login_form .= '<input class="submit_btn" id="" type="submit" name="Submit" value="Change Password" />'; $login_form .= '</form></div>'; $page_output = $login_form; ?>
mit
davidchase/fn.js
src/curry.js
606
var fnToArray = require('./toArray'); // fn.curry module.exports = function (handler, arity) { 'use strict'; if (handler.curried) { return handler; } arity = arity || handler.length; var curry = function curry() { var args = fnToArray(arguments); if (args.length >= arity) { return handler.apply(null, args); } var inner = function () { return curry.apply(null, args.concat(fnToArray(arguments))); }; inner.curried = true; return inner; }; curry.curried = true; return curry; };
mit
pygeo/pycmbs
docs/source/figures/fig_map_difference.py
695
# -*- coding: utf-8 -*- """ This file is part of pyCMBS. (c) 2012- Alexander Loew For COPYING and LICENSE details, please refer to the LICENSE files """ from pycmbs.data import Data from pycmbs.plots import map_difference import matplotlib.pyplot as plt file_name = '../../../pycmbs/examples/example_data/air.mon.mean.nc' A = Data(file_name, 'air', lat_name='lat', lon_name='lon', read=True, label='air temperature') B = A.copy() B.mulc(2.3, copy=False) a = A.get_climatology(return_object=True) b = B.get_climatology(return_object=True) # a quick plot as well as a projection plot f1 = map_difference(a, b, show_stat=False, vmin=-30., vmax=30., dmin=-60., dmax=60.) # unprojected plt.show()
mit
perfectsearch/sandman
code/buildscripts/codescan/check_pep8.py
6192
#!/usr/bin/env python # # $Id: check_pep8.py 9319 2011-06-10 02:59:43Z nathan_george $ # # Proprietary and confidential. # Copyright $Date:: 2011#$ Perfect Search Corporation. # All rights reserved. # import sys import os import subprocess buildscriptDir = os.path.dirname(__file__) buildscriptDir = os.path.abspath(os.path.join(buildscriptDir, os.path.pardir)) sys.path.append(buildscriptDir) import re import sandbox import metadata import subprocess import optparse import xmail from ioutil import * parser = optparse.OptionParser( 'Usage: %prog [options] [path]\n\nSee whether python files pass a ' + 'pep8 check. Optionally, email report.' ) xmail.addMailOptions(parser) def hasPep8(): try: import pep8 return True except ImportError: return False def runPep8(filename, options="--select=W601,E111,E701,W191 -r"): return os.system("pep8 %s %s" % (options, filename)) def checkFile(root, name, relativePath, warn=True): path = os.path.join(root, name) if (not path.endswith('.py')) or os.path.getsize(path) == 0: return 0 answer = runPep8(path) if answer != 0: if warn: print(' %s: Warning: file fails pep8 check.' % os.path.join( relativePath, name)) return 1 else: pass # print('%s pep errors = %s' % (name, answer)) return 0 class KeywordCheckVisitor: def __init__(self, warn): self.warn = warn self.badFiles = [] def visit(self, folder, item, relativePath): #print('visited %s' % item) err = checkFile(folder, item, relativePath, self.warn) if err: self.badFiles.append(folder + item) def check(path, warn=True): if not os.path.isdir(path): sys.stderr.write('%s is not a valid folder.\n' % path) return 1 path = norm_folder(path) print('Checking pep8 compliance in %s...\n' % path) visitor = KeywordCheckVisitor(warn) checkedFiles, checkedFolders = metadata.visit(path, visitor) print('Checked %d files in %d folders; found %d errors.' % ( checkedFiles, checkedFolders, len(visitor.badFiles))) return visitor.badFiles def main(warn, folder, options=None): badFiles = [] exitCode = 0 if not hasPep8(): print("Warning: This machine does not have pep8 installed.") if sys.platform.startswith('linux'): print(" install it using: yum install python-pep8") else: print(" install it using: easy_install pep8") return 0 if not folder: folder = sandbox.current.get_code_root() oldStdout = None sendEmail = xmail.hasDest(options) if sendEmail: oldStdout = sys.stdout sys.stdout = FakeFile() try: badFiles = check(folder, warn) if sendEmail: msg = sys.stdout.txt #print(msg) sys.stdout = oldStdout oldStdout = None xmail.sendmail(msg, sender='Pep8 Scanner <[email protected]>', subject='pep8 scan on %s' % metadata.get_friendly_name_for_path(folder), options=options) finally: if oldStdout: sys.stdout = oldStdout return badFiles def _is_potential_python_component(sb, c): code_dir = sb.get_component_path(c, 'code') # Eliminate classic java projects (ant or maven). if os.path.isdir(os.path.join(code_dir, 'src')): return False # Eliminate top-level and non-top-level C++ components. if os.path.isfile(os.path.join(code_dir, '.if_top', 'CMakeLists.txt')): return False if os.path.isfile(os.path.join(code_dir, 'CMakeLists.txt')): return False return True def _has_clean_bzr_status(folder): txt = subprocess.check_output('bzr status "%s"' % folder, shell=True) txt = txt.strip() return not bool(txt) if __name__ == '__main__': (options, args) = parser.parse_args() folder = None if args: folder = args[0] if not folder: badFiles = [] sb = sandbox.current # We're going to some effort to make this scan fast, because in many # sandboxes this test was taking 30-90 seconds before optimization. # The main ways we make it fast are: # - Don't scan directories unlikely to contain python code. # - In experimental sandboxes, skip any folders that don't have code # checked out. # - Don't scan buildscripts in complex sandboxes (buildscripts scans # will only happen in simple sandboxes like tika, appliance-base, # and so forth). checked_folders = 0 code_components = [c for c in sb.get_on_disk_components() if sb.get_component_reused_aspect(c) == 'code'] skip_buildscripts = len(code_components) > 4 potential_python_components = [c for c in code_components if _is_potential_python_component(sb, c)] skip_checked_in = sb.get_sandboxtype().supports_checkouts() for c in potential_python_components: if c != 'buildscripts' or (not skip_buildscripts): folder = os.path.join(sb.get_code_root(), c) if (not skip_checked_in) or (not _has_clean_bzr_status(folder)): checked_folders += 1 badFiles += main(True, os.path.join(sandbox.current.get_code_root(), c), options) tr = sb.get_test_root() for item in os.listdir(tr): if item != 'buildscripts' or (not skip_buildscripts): folder = os.path.join(tr, item) if os.path.isdir(folder): if (not skip_checked_in) or (not _has_clean_bzr_status(folder)): checked_folders += 1 badFiles += main(True, folder, options) if not checked_folders: print('No checked out python code found; scan skipped to optimize dev time.\nScan will be done by automated build.') else: badFiles = main(True, folder, options) exitCode = 0 if len(badFiles) > 0: exitCode = len(badFiles) sys.exit(exitCode)
mit
rande/sfSolrPlugin
test/unit/helper/sfLuceneHelperTest.php
2574
<?php /* * This file is part of the sfLucenePlugin package * (c) 2007 - 2008 Carl Vondrick <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * @package sfLucenePlugin * @subpackage Test * @author Carl Vondrick * @version SVN: $Id$ */ require dirname(__FILE__) . '/../../bootstrap/unit.php'; require dirname(__FILE__) . '/../../../lib/helper/sfLuceneHelper.php'; $t = new limeade_test(7, limeade_output::get()); $t->diag('testing highlighting'); $t->is(highlight_result_text('Hello. This is a pretty <em class="thing">awesome</em> thing to be talking about.', 'thing talking'), 'Hello. This is a pretty awesome <strong class="highlight">thing</strong> to be <strong class="highlight">talking</strong> about.', 'highlight_result_text() highlights text and strips out HTML'); $t->is(highlight_result_text('Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. This is a pretty <em class="thing">awesome</em> thing to be talking about. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. Foo bar. ', 'thing talking', 50), '...is is a pretty awesome <strong class="highlight">thing</strong> to be <strong class="highlight">talking</strong> about....', 'highlight_result_text() highlights and truncates text'); $t->is(highlight_keywords('Hello. This is a pretty <em class="thing">awesome</em> thing to be talking about.', 'thing talking'), 'Hello. This is a pretty <em class="thing">awesome</em> <strong class="highlight">thing</strong> to be <strong class="highlight">talking</strong> about.', 'highlight_kewyords() highlights text'); $t->diag('testing query string manipulation'); $t->is(add_highlight_qs('test/model', 'foo bar'), 'test/model?sf_highlight=foo bar', 'add_highlight_qs() adds a query string correctly'); $t->is(add_highlight_qs('test/model?a=b', 'foo bar'), 'test/model?a=b&sf_highlight=foo bar', 'add_highlight_qs() handles existing query strings'); $t->is(add_highlight_qs('test/model#anchor', 'foo bar'), 'test/model?sf_highlight=foo bar#anchor', 'add_highlight_qs() handles anchors'); $t->is(add_highlight_qs('test/model?a=b#anchor', 'foo bar'), 'test/model?a=b&sf_highlight=foo bar#anchor', 'add_highlight_qs() handles anchors and existing query strings');
mit
jquintus/spikes
ConsoleApps/FunWithSpikes/FunWithNinject.Web/App_Start/RouteConfig.cs
588
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; namespace FunWithNinject.Web { public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } } }
mit
emstlk/nacl4s
src/main/scala/com/emstlk/nacl4s/crypto/scalarmult/Curve25519.scala
10448
package com.emstlk.nacl4s.crypto.scalarmult object Curve25519 { val bytes = 32 val scalarBytes = 32 val two54m152 = (1L << 54) - 152 val two54m8 = (1L << 54) - 8 private val basepoint = { val bp = new Array[Byte](32) bp(0) = 9 bp } @inline def loadLong(in: Array[Byte], offset: Int): Long = { (in(offset).toLong & 0xff) | ((in(offset + 1).toLong & 0xff) << 8) | ((in(offset + 2).toLong & 0xff) << 16) | ((in(offset + 3).toLong & 0xff) << 24) | ((in(offset + 4).toLong & 0xff) << 32) | ((in(offset + 5).toLong & 0xff) << 40) | ((in(offset + 6).toLong & 0xff) << 48) | ((in(offset + 7).toLong & 0xff) << 56) } @inline def storeLong(out: Array[Byte], offset: Int, in: Long) = { out(offset) = (in & 0xff).toByte out(offset + 1) = ((in >>> 8) & 0xff).toByte out(offset + 2) = ((in >>> 16) & 0xff).toByte out(offset + 3) = ((in >>> 24) & 0xff).toByte out(offset + 4) = ((in >>> 32) & 0xff).toByte out(offset + 5) = ((in >>> 40) & 0xff).toByte out(offset + 6) = ((in >>> 48) & 0xff).toByte out(offset + 7) = ((in >>> 56) & 0xff).toByte } @inline def sum(out: Array[Long], in: Array[Long]) = { out(0) += in(0) out(1) += in(1) out(2) += in(2) out(3) += in(3) out(4) += in(4) } @inline def differenceBackwards(out: Array[Long], in: Array[Long]) = { out(0) = in(0) + two54m152 - out(0) out(1) = in(1) + two54m8 - out(1) out(2) = in(2) + two54m8 - out(2) out(3) = in(3) + two54m8 - out(3) out(4) = in(4) + two54m8 - out(4) } @inline def scalarProduct(out: Array[Long], in: Array[Long], scalar: Long) = { var a = BigInt(in(0)) * scalar out(0) = a.toLong & 0x7ffffffffffffL a = BigInt(in(1)) * scalar + (a >> 51).toLong out(1) = a.toLong & 0x7ffffffffffffL a = BigInt(in(2)) * scalar + (a >> 51).toLong out(2) = a.toLong & 0x7ffffffffffffL a = BigInt(in(3)) * scalar + (a >> 51).toLong out(3) = a.toLong & 0x7ffffffffffffL a = BigInt(in(4)) * scalar + (a >> 51).toLong out(4) = a.toLong & 0x7ffffffffffffL out(0) += ((a >> 51) * 19).toLong } def multiply(out: Array[Long], in2: Array[Long], in: Array[Long]) = { val t = new Array[BigInt](5) var r0 = BigInt(in(0)) var r1 = BigInt(in(1)) var r2 = BigInt(in(2)) var r3 = BigInt(in(3)) var r4 = BigInt(in(4)) val s0 = in2(0) val s1 = in2(1) val s2 = in2(2) val s3 = in2(3) val s4 = in2(4) t(0) = r0 * s0 t(1) = r0 * s1 + r1 * s0 t(2) = r0 * s2 + r2 * s0 + r1 * s1 t(3) = r0 * s3 + r3 * s0 + r1 * s2 + r2 * s1 t(4) = r0 * s4 + r4 * s0 + r3 * s1 + r1 * s3 + r2 * s2 r1 *= 19 r2 *= 19 r3 *= 19 r4 *= 19 t(0) += r4 * s1 + r1 * s4 + r2 * s3 + r3 * s2 t(1) += r4 * s2 + r2 * s4 + r3 * s3 t(2) += r4 * s3 + r3 * s4 t(3) += r4 * s4 r0 = t(0) & 0x7ffffffffffffL t(1) += t(0) >> 51 & 0xffffffffffffffffL r1 = t(1) & 0x7ffffffffffffL t(2) += t(1) >> 51 & 0xffffffffffffffffL r2 = t(2) & 0x7ffffffffffffL t(3) += t(2) >> 51 & 0xffffffffffffffffL r3 = t(3) & 0x7ffffffffffffL t(4) += t(3) >> 51 & 0xffffffffffffffffL r4 = t(4) & 0x7ffffffffffffL var c = t(4) >> 51 & 0xffffffffffffffffL r0 += c * 19 c = r0 >> 51 r0 = r0 & 0x7ffffffffffffL r1 += c c = r1 >> 51 r1 = r1 & 0x7ffffffffffffL r2 += c out(0) = r0.toLong out(1) = r1.toLong out(2) = r2.toLong out(3) = r3.toLong out(4) = r4.toLong } def squareTimes(out: Array[Long], in: Array[Long], count: Int) = { val t = new Array[BigInt](5) var r0 = BigInt(in(0)) var r1 = BigInt(in(1)) var r2 = BigInt(in(2)) var r3 = BigInt(in(3)) var r4 = BigInt(in(4)) var i = 0 while (i < count) { val d0 = r0 * 2 val d1 = r1 * 2 val d2 = r2 * 2 * 19 val d419 = r4 * 19 val d4 = d419 * 2 t(0) = r0 * r0 + d4 * r1 + d2 * r3 t(1) = d0 * r1 + d4 * r2 + r3 * r3 * 19 t(2) = d0 * r2 + r1 * r1 + d4 * r3 t(3) = d0 * r3 + d1 * r2 + r4 * d419 t(4) = d0 * r4 + d1 * r3 + r2 * r2 r0 = t(0) & 0x7ffffffffffffL t(1) += t(0) >> 51 & 0xffffffffffffffffL r1 = t(1) & 0x7ffffffffffffL t(2) += t(1) >> 51 & 0xffffffffffffffffL r2 = t(2) & 0x7ffffffffffffL t(3) += t(2) >> 51 & 0xffffffffffffffffL r3 = t(3) & 0x7ffffffffffffL t(4) += t(3) >> 51 & 0xffffffffffffffffL r4 = t(4) & 0x7ffffffffffffL var c = t(4) >> 51 & 0xffffffffffffffffL r0 = r0 + c * 19 c = r0 >> 51 r0 = r0 & 0x7ffffffffffffL r1 += c c = r1 >> 51 r1 = r1 & 0x7ffffffffffffL r2 += c i += 1 } out(0) = r0.toLong out(1) = r1.toLong out(2) = r2.toLong out(3) = r3.toLong out(4) = r4.toLong } @inline def expand(out: Array[Long], in: Array[Byte]) = { out(0) = loadLong(in, 0) & 0x7ffffffffffffL out(1) = (loadLong(in, 6) >>> 3) & 0x7ffffffffffffL out(2) = (loadLong(in, 12) >>> 6) & 0x7ffffffffffffL out(3) = (loadLong(in, 19) >>> 1) & 0x7ffffffffffffL out(4) = (loadLong(in, 24) >>> 12) & 0x7ffffffffffffL } def contract(out: Array[Byte], in: Array[Long]) = { val t = new Array[BigInt](5) t(0) = in(0) t(1) = in(1) t(2) = in(2) t(3) = in(3) t(4) = in(4) @inline def doReduce() = { t(1) += t(0) >> 51 t(0) &= 0x7ffffffffffffL t(2) += t(1) >> 51 t(1) &= 0x7ffffffffffffL t(3) += t(2) >> 51 t(2) &= 0x7ffffffffffffL t(4) += t(3) >> 51 t(3) &= 0x7ffffffffffffL t(0) += (t(4) >> 51) * 19 t(4) &= 0x7ffffffffffffL } doReduce() doReduce() t(0) += 19 doReduce() t(0) += 0x8000000000000L - 19 t(1) += 0x8000000000000L - 1 t(2) += 0x8000000000000L - 1 t(3) += 0x8000000000000L - 1 t(4) += 0x8000000000000L - 1 t(1) += t(0) >> 51 t(0) &= 0x7ffffffffffffL t(2) += t(1) >> 51 t(1) &= 0x7ffffffffffffL t(3) += t(2) >> 51 t(2) &= 0x7ffffffffffffL t(4) += t(3) >> 51 t(3) &= 0x7ffffffffffffL t(4) &= 0x7ffffffffffffL storeLong(out, 0, (t(0) | (t(1) << 51)).toLong) storeLong(out, 8, ((t(1) >> 13) | (t(2) << 38)).toLong) storeLong(out, 16, ((t(2) >> 26) | (t(3) << 25)).toLong) storeLong(out, 24, ((t(3) >> 39) | (t(4) << 12)).toLong) } def monty(x2: Array[Long], z2: Array[Long], x3: Array[Long], z3: Array[Long], x: Array[Long], z: Array[Long], xprime: Array[Long], zprime: Array[Long], qmqp: Array[Long]) = { val origx = new Array[Long](5) Array.copy(x, 0, origx, 0, 5) sum(x, z) differenceBackwards(z, origx) val origxprime = new Array[Long](5) Array.copy(xprime, 0, origxprime, 0, 5) sum(xprime, zprime) differenceBackwards(zprime, origxprime) val xxprime = new Array[Long](5) multiply(xxprime, xprime, z) val zzprime = new Array[Long](5) multiply(zzprime, x, zprime) Array.copy(xxprime, 0, origxprime, 0, 5) sum(xxprime, zzprime) differenceBackwards(zzprime, origxprime) squareTimes(x3, xxprime, 1) val zzzprime = new Array[Long](5) squareTimes(zzzprime, zzprime, 1) multiply(z3, zzzprime, qmqp) val xx = new Array[Long](5) squareTimes(xx, x, 1) val zz = new Array[Long](5) squareTimes(zz, z, 1) multiply(x2, xx, zz) differenceBackwards(zz, xx) val zzz = new Array[Long](5) scalarProduct(zzz, zz, 121665) sum(zzz, xx) multiply(z2, zz, zzz) } @inline def swapConditional(a: Array[Long], b: Array[Long]) = { var i = 0 while (i < 5) { val x = a(i) a(i) = b(i) b(i) = x i += 1 } } def cmultiply(resultx: Array[Long], resultz: Array[Long], n: Array[Byte], q: Array[Long]) = { var nqpqx = new Array[Long](5) Array.copy(q, 0, nqpqx, 0, 5) var nqpqz = new Array[Long](5) nqpqz(0) = 1 var nqx = new Array[Long](5) nqx(0) = 1 var nqz = new Array[Long](5) var nqx2 = new Array[Long](5) var nqz2 = new Array[Long](5) nqz2(0) = 1 var nqpqx2 = new Array[Long](5) var nqpqz2 = new Array[Long](5) nqpqz2(0) = 1 var i = 0 while (i < 32) { var byte = n(31 - i) var j = 0 while (j < 8) { val swapNeeded = (byte >>> 7 & 1) == 1 if (swapNeeded) { swapConditional(nqx, nqpqx) swapConditional(nqz, nqpqz) } monty(nqx2, nqz2, nqpqx2, nqpqz2, nqx, nqz, nqpqx, nqpqz, q) if (swapNeeded) { swapConditional(nqx2, nqpqx2) swapConditional(nqz2, nqpqz2) } var t = nqx nqx = nqx2 nqx2 = t t = nqz nqz = nqz2 nqz2 = t t = nqpqx nqpqx = nqpqx2 nqpqx2 = t t = nqpqz nqpqz = nqpqz2 nqpqz2 = t byte = (byte << 1).toByte j += 1 } i += 1 } Array.copy(nqx, 0, resultx, 0, 5) Array.copy(nqz, 0, resultz, 0, 5) } def crecip(out: Array[Long], z: Array[Long]) = { val a = new Array[Long](5) val t0 = new Array[Long](5) val b = new Array[Long](5) val c = new Array[Long](5) squareTimes(a, z, 1) squareTimes(t0, a, 2) multiply(b, t0, z) multiply(a, b, a) squareTimes(t0, a, 1) multiply(b, t0, b) squareTimes(t0, b, 5) multiply(b, t0, b) squareTimes(t0, b, 10) multiply(c, t0, b) squareTimes(t0, c, 20) multiply(t0, t0, c) squareTimes(t0, t0, 10) multiply(b, t0, b) squareTimes(t0, b, 50) multiply(c, t0, b) squareTimes(t0, c, 100) multiply(t0, t0, c) squareTimes(t0, t0, 50) multiply(t0, t0, b) squareTimes(t0, t0, 5) multiply(out, t0, a) } def cryptoScalarmultBase(q: Array[Byte], n: Array[Byte]) = cryptoScalarmult(q, n, basepoint) def cryptoScalarmult(public: Array[Byte], secret: Array[Byte], basepoint: Array[Byte]) = { val e = new Array[Byte](32) var i = 0 while (i < 32) { e(i) = secret(i) i += 1 } e(0) = (e(0) & 248).toByte e(31) = (e(31) & 127).toByte e(31) = (e(31) | 64).toByte val bp = new Array[Long](5) expand(bp, basepoint) val x = new Array[Long](5) val z = new Array[Long](5) cmultiply(x, z, e, bp) val zmone = new Array[Long](5) crecip(zmone, z) multiply(z, x, zmone) contract(public, z) } }
mit
jiuyuedeyu/201509gitstudy
免费课/js第二周全日制/index.js
34
console.log("welcome to beijing");
mit
AamuLumi/sanic.js
bench/array/forEach.js
1342
'use strict'; const sanicForEach = require('../../index').Library.Array.forEach; module.exports = function (computeSuite, fileWriter, suiteOptions) { const little = (new Array(10)).fill(0).map((e, i) => i % 2); const medium = (new Array(1000)).fill(0).map((e, i) => i % 2); const big = (new Array(1000000)).fill(0).map((e, i) => i % 2); if (fileWriter) fileWriter.writeTableElement('Square'); console.log(`\t10 elements`); computeSuite() .add('Array.prototype.forEach()', function () { return little.forEach((e) => e * e); }) .add('Sanic forEach()', function () { return sanicForEach(little, (e) => e * e); }) .run(suiteOptions); console.log(`\t1k elements`); computeSuite() .add('Array.prototype.forEach()', function () { return medium.forEach((e) => e * e); }) .add('Sanic forEach()', function () { return sanicForEach(medium, (e) => e * e); }) .run(suiteOptions); console.log(`\t1M elements`); computeSuite() .add('Array.prototype.forEach()', function () { return big.forEach((e) => e * e); }) .add('Sanic forEach()', function () { return sanicForEach(big, (e) => e * e); }) .run(suiteOptions); };
mit
space-wizards/space-station-14
Content.Server/AI/Utility/Considerations/Clothing/ClothingInSlotCon.cs
753
using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States.Clothing; using Content.Shared.Inventory; namespace Content.Server.AI.Utility.Considerations.Clothing { public class ClothingInSlotCon : Consideration { public ClothingInSlotCon Slot(string slot, Blackboard context) { context.GetState<ClothingSlotConState>().SetValue(slot); return this; } protected override float GetScore(Blackboard context) { var slot = context.GetState<ClothingSlotConState>().GetValue(); var inventory = context.GetState<EquippedClothingState>().GetValue(); return slot != null && inventory.ContainsKey(slot) ? 1.0f : 0.0f; } } }
mit
samjohnduke/freshly
lib/freshly/ticket.rb
153
module Freshly class Ticket attr_accessor :id def initialize id @id = id end def path "tickets/#{id}" end end end
mit
tomyf/ccg-sandbox
src/card/error/PlayingCardError.js
148
const AbstractError = require('../../error/AbstractError.js'); class PlayingCardError extends AbstractError { } module.exports = PlayingCardError;
mit
elixirhub/events-portal-scraping-scripts
DeleteDataTest.py
121
__author__ = 'chuqiao' import EventsPortal EventsPortal.deleteDataInSolr("http://139.162.217.53:8983/solr/eventsportal")
mit
keverage/customform
gulpfile.js
1064
const packagejson = require('./package.json'); const plugins = require('gulp-load-plugins')({ pattern: ['*'], scope: ['devDependencies'] }); // Compilation SASS function sass(pumpCallback) { return plugins.pump([ plugins.gulp.src('./src/**/*.scss'), plugins.sass(packagejson.sass), plugins.postcss([ plugins.autoprefixer(packagejson.autoprefixer), plugins.postcssPxtorem(packagejson.pxtorem) ]), plugins.gulp.dest('./dist/') ], pumpCallback); } // Watch SASS function watchsass() { plugins.gulp.watch('./src/**/*.scss', plugins.gulp.parallel(sass)) } // Minify function minify(pumpCallback) { return plugins.pump([ plugins.gulp.src('./src/**/*.js'), plugins.uglify(), plugins.rename(function (path) { path.extname = '.min.js' }), plugins.gulp.dest('./dist/') ], pumpCallback); } // Alias exports.sass = sass; exports.default = plugins.gulp.series(sass, watchsass); exports.prod = plugins.gulp.parallel(sass, minify);
mit
proximitybbdomu/mb-boilerplate
app/tasks/build/build-css.js
1190
'use strict'; module.exports = function (gulp, $, gutil, opt) { return function () { // Remove .min and .map before to re-generate .min and .map opt.del(opt.build.cssEach); if (opt.argv.l !== undefined) { // If -l is specified return gulp.src(opt.build.cssLgSpecified) // .pipe($.shorthand()) .pipe($.base64(opt.opts.base64.options)) .pipe($.cmq({ log: false })) .pipe($.minify()) .pipe($.rename({ suffix: '.min' })) .pipe($.size({ showFiles: true, gzip: true })) .pipe(gulp.dest(opt.dev.css)); } else { // If -l is not specified return gulp.src(opt.build.cssNoSpecified) .pipe($.foreach(function(stream, file){ return stream // .pipe($.shorthand()) .pipe($.base64(opt.opts.base64.options)) .pipe($.cmq({ log: false })) .pipe($.minify()) .pipe($.rename({ suffix: '.min' })) .pipe($.sourcemaps.write('/')) // Write sourcemaps for CSS in the same folde .pipe($.size({ showFiles: true, gzip: true })) .pipe(gulp.dest(opt.build.cssProgram)) })); } }; };
mit
TOLegalHackers/StonePaper
app/js/index.js
20296
/*globals $, SimpleStorage, document*/ var addToLog = function(id, txt) { $(id + " .logs").append("<br>" + txt); }; var serverAddress = "http://stonepapergaestorage.appspot.com"; //var serverAddress = "http://localhost:41080"; var signaturePad; var signaturePadS; var signaturePadB; var signaturePadL; function enthalpy(dataLength) { var text = ""; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for( var i=0; i < dataLength; i++ ) text += possible.charAt(Math.floor(Math.random() * possible.length)); return text; } function resizeCanvas(){ var ratio = Math.max(window.devicePixelRatio || 1,1); //canvas.width = canvas.offsetWidth * ratio; //canvas.height = canvas.offsetHeight * ratio; //canvas.getContext("2d").scale(ratio,ratio); canvasS = document.getElementById('SellerC'); canvasB = document.getElementById('BuyerC'); canvasL = document.getElementById('WitnessC'); var allCanvas = [canvasS,canvasB,canvasL]; for (var i =0; i<allCanvas.length;i++){ if (!allCanvas[i]){continue;} allCanvas[i].width=allCanvas[i].offsetWidth * ratio; allCanvas[i].height = allCanvas[i].offsetHeight * ratio; allCanvas[i].getContext("2d").scale(ratio,ratio); } } function changeData(){ canvasS = document.getElementById('SellerC'); canvasB = document.getElementById('BuyerC'); canvasL = document.getElementById('WitnessC'); signaturePadS = new SignaturePad(canvasS); signaturePadB = new SignaturePad(canvasB); signaturePadL = new SignaturePad(canvasL); } // =========================== // Blockchain example // =========================== $(document).ready(function() { var allAccounts; $( ".HasSigniture" ).click(function( event ) { setTimeout(resizeCanvas, 1000); setTimeout(changeData,900); resizeCanvas(); }); window.onresize = resizeCanvas; $( "#clearContract" ).click(function( event ) { event.preventDefault(); signaturePad.clear(); }); $("#clearSeller").click(function() { signaturePadS.clear(); }); $("#clearBuyer").click(function() { signaturePadB.clear(); }); $("#clearWitness").click(function() { signaturePadL.clear(); }); $("#fileAffidavit").click(function() { aData = JSON.stringify( { Title:$('#nameA').val(), Affidavit:$('#ContractA').val(), DateCreated:Date(), Enthalpy:enthalpy(32) } ); $.post( serverAddress+"/GrabInfo", { ID:aData,Key:web3.sha3(aData) }, function(data){ var name = $('#nameA').val(); var hash = web3.sha3(aData); StonePaper.createPaper(name,hash, 0, [],54321,[], {gas: 3000000}).then(function(){ clearAllPaper(); }, function(){ alert("Error creating document"); }); $(".theReturnA").html("Your Affidavit has been saved in the Blockchain, you can read is Briefcase."); } ); }); $("#fileContractLawyer").click(function() { aData = JSON.stringify( { Title:$('nameC').val(), ContractText:$('#ContractC').val(), SignitureSeller:signaturePadS.toDataURL(), SignitureBuyer:signaturePadB.toDataURL(), SignitureLawyer:signaturePadL.toDataURL(), DateCreated:Date(), Enthalpy:enthalpy(32) } ); $.post( serverAddress+"/GrabInfo", { ID:aData,Key:web3.sha3(aData) }, function(data){ var name = $('#nameC').val(); var sellGo = $(".WalletG option:selected").val(); var buyGo = $(".WalletH option:selected").val(); var lawyerGo = $(".WalletF option:selected").val(); var hash = web3.sha3(aData); StonePaper.createPaper(name,hash, 0, [],12345,[], {gas: 3000000}).then(function(){clearAllPaper();}); $(".theReturnC").html("Your contract has been saved in the Blockchain, you can read it in your briefcase" ); } ); }); function generateContractNoSigHTML(data){ return "<div>"+ data.Title+ "</div>" +"<div>"+ data.ContractText+ "</div><div>Contract Created On - "+ data.DateCreated+ "</div>"; } function generateContractHTML(data){ return "<div>"+ data.Title+ "</div>" +"<div>"+ data.ContractText+ "</div><div><p>Seller Signiture</p><br><img width=600 src='"+ data.SignitureSeller+ "'></div><div><p>Seller Buyer</p><br><img width=600 src='"+ data.SignitureBuyer+ "'></div><div><p>Seller Laywer</p><br><img width=600 src='"+ data.SignitureLawyer+ "'></div><div>Contract Created On - "+ data.DateCreated+ "</div>"; } function generateAffidavit(data){ return "<div>"+ data.Title+ "</div>" + "<div>"+ data.Affidavit+ "</div>" + "<div>Contract Created On - "+ data.DateCreated+ "</div>"; } $("#getByToken").click(function() { $.get( serverAddress+"/GrabInfo?Key="+$('#lookUpToken').val(), {}, function(data){ var targetData = $("#resultContract"); targetData.empty(); targetData.append("<div>"+ data.ContractText+ "</div>"); targetData.append("<div><p>Seller Signiture</p><br><img width=600 src='"+ data.SignitureSeller+ "'></div>"); targetData.append("<div><p>Seller Signiture</p><br><img width=600 src='"+ data.SignitureBuyer+ "'></div>"); targetData.append("<div><p>Seller Signiture</p><br><img width=600 src='"+ data.SignitureLawyer+ "'></div>"); targetData.append("<div>Contract Created On - "+ data.DateCreated+ "</div>"); }); }); $("#getByAddressAndIndexC").click(function() { var index = $("#indexC").val(); var targetAddress = $("getByAddressAndIndexC").val(); StonePaper.getPapers(index,{from: targetAddress}).then(function(value) { var aHash = value[1]; var aContract = value[6]; if (aContract=="0x0000000000000000000000000000000000003039"){ $.get( serverAddress+"/GrabInfo?Key="+aHash, {}, function(data){ var targetData = $("#resultContract"); targetData.empty(); targetData.append("<div>"+ data.ContractText+ "</div>"); targetData.append("<div><p>Seller Signiture</p><br><img width=600 src='"+ data.SignitureSeller+ "'></div>"); targetData.append("<div><p>Seller Signiture</p><br><img width=600 src='"+ data.SignitureBuyer+ "'></div>"); targetData.append("<div><p>Seller Signiture</p><br><img width=600 src='"+ data.SignitureLawyer+ "'></div>"); targetData.append("<div>Contract Created On - "+ data.DateCreated+ "</div>"); }); } }); }); var newContractToBeSigned; $("#fileContractLawyerNL").click(function() { var buyerAddress = $(".WalletI option:selected").val(); var sellerAddress = $(".WalletJ option:selected").val(); var aData = JSON.stringify( { Title:$('#nameNL').val(), ContractText:$('#ContractNL').val(), AddressSeller:sellerAddress, AddressBuyer:buyerAddress, DateCreated:Date(), Enthalpy:enthalpy(32) } ); $.post( serverAddress+"/GrabInfo", { ID:aData,Key:web3.sha3(aData) }, function(data){ TwoPersonContract.deploy([buyerAddress,sellerAddress,web3.sha3(aData)], {}).then(function(newContract) { newContractToBeSigned = newContract; StonePaper.createPaper($('#nameNL').val(),web3.sha3(aData), 0,[],newContract.address,[buyerAddress,sellerAddress], {gas: 3000000}).then(function(){ alert("Contract Placed into Blockchain"); clearAllPaper(); },function(){ alert("Something Went Wrong"); }); $(".theReturnNL").html("Your contract has been saved 'unsigned' in the Blockchain, you can download the contract <a href=http://stonepapergaestorage.appspot.com/GrabInfo?Key="+web3.sha3(aData)+">here</a> and in your briefcase."); }); } ); }); $("#signBNL").click(function() { var buyerAddress = $(".WalletK option:selected").val(); if (newContractToBeSigned){ newContractToBeSigned.signOne({from:buyerAddress}).then(function(){ }); } }); $("#signSNL").click(function() { var sellerAddress = $(".WalletL option:selected").val(); if (newContractToBeSigned){ newContractToBeSigned.signTwo({from:sellerAddress}).then(function(){ }); } }); $("#isSignedSNL").click(function() { if (newContractToBeSigned){ newContractToBeSigned.isSigned({}).then(function(data){ if (data==3){ var name = $('#nameNL').val(); var buyerAddress = $(".WalletK option:selected").val(); var sellerAddress = $(".WalletL option:selected").val(); //var hash = web3.sha3(aData); newContractToBeSigned.getInfo({}).then(function(data){ var name = $('#nameNL').val(); StonePaper.createPaper(name,data[0], 0,[],data[3],[data[1],data[2]], {from:data[1],gas: 3000000}).then(function(){ clearAllPaper(); alert("Contract Signed and has been placed into briefcase of both accounts"); },function(){ alert("Something Went Wrong"); }); }); }else if (data==2){ alert("Only Seller Signed"); } else if (data == 1){ alert("Only Buyer Signed"); } else if (data == 0){ alert("No one Signed"); } }); } }); ///End // //UserSocieties UserSocietiesAdd UserSocietiesRemove //Run At Start up to set up all the wallets var countMe=0; var getAllUsers = function(index){ StonePaper.getUser(index).then(function(value){ if (value[0]=="0x0000000000000000000000000000000000000000"){ console.log(value[2].toNumber()); //End Loop } else { $(".UserSocieties").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".UserSocietiesAdd").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".UserSocietiesRemove").append($('<option></option>').attr("value",value[0]).text(value[1])); /* $(".WalletA").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".WalletB").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".WalletLawyer").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".WalletLawyerGet").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".FromAddress").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".ToAddress").append($('<option></option>').attr("value",value[0]).text(value[1]));*/ $(".WalletF").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".WalletG").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".WalletH").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".WalletI").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".WalletJ").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".WalletK").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".WalletL").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".LookUpAddress").append($('<option></option>').attr("value",value.userAddress).text(value.userName)); countMe++; getAllUsers(countMe); } },function(value){ }); }; var clearAllUsers =function(){ $(".UserSocieties").empty(); $(".UserSocietiesAdd").empty(); $(".UserSocietiesRemove").empty(); /* $(".WalletA").empty(); $(".WalletB").empty(); $(".WalletLawyer").empty(); $(".WalletLawyerGet").empty(); $(".FromAddress").empty(); $(".ToAddress").empty(); */ $(".WalletF").empty(); $(".WalletG").empty(); $(".WalletH").empty(); $(".WalletI").empty(); $(".WalletJ").empty(); $(".WalletK").empty(); $(".WalletL").empty(); $(".LookUpAddress").empty(); countMe = 0; getAllUsers(0); }; //Run At Start Up to Get All Papers var countPaper=0; var papers = {}; var getAllPapers= function(index){ StonePaper.getPaper(index).then(function(value){ if (value[0]==""){ //End Loop } else { papers[countPaper]=value; $(".PapersPlease").append($('<option></option>').attr("value",countPaper).text(value[0])); countPaper++; getAllPapers(countPaper); } },function(value){ }); }; var clearAllPaper = function(){ countPaper=0; papers = {}; $(".PapersPlease").empty(); $(".PapersPlease").append($('<option></option>').attr("value","Ninja").text("Briefcase")); getAllPapers(0); }; var countSocieties=0; var getAllSocieties = function(index){ SocietyList.getSociety(index).then(function(value){ if (value[1]==""){ console.log(value[2].toNumber()); //End Loop } else { $(".Societies").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".SocietiesAdd").append($('<option></option>').attr("value",value[0]).text(value[1])); $(".SocietiesRemove").append($('<option></option>').attr("value",value[0]).text(value[1])); countSocieties++; getAllSocieties(countSocieties); } },function(value){ }); }; function startUp(){ clearAllPaper(); getAllSocieties(0); getAllUsers(0); } //startUp(); $("#verifyUser").click(function(){ var sAddress = $(".Societies option:selected").val(); var userAddress = $(".UserSocieties option:selected").val(); var aSociety = web3.eth.contract(Society.abi); var aSocietyInstance = aSociety.at(sAddress); var result = aSocietyInstance.isVerified(userAddress); if (result){ $("#Verifier").html("User Verified"); } else { $("#Verifier").html("User Not Verified"); } }); $("#setSociety").click(function(){ var value = $("#societyName").val(); SocietyList.createNewSociety(value,{gas: 3000000}).then(function(){console.log('success');},function(){console.log('Fail');}); }); $("#SocietiesAddB").click(function(){ var sAddress = $(".SocietiesAdd option:selected").val(); var userAddress = $(".UserSocietiesAdd option:selected").val(); var aSociety = web3.eth.contract(Society.abi); var aSocietyInstance = aSociety.at(sAddress); var result = aSocietyInstance.verify(userAddress); }); $("#SocietiesRemoveB").click(function(){ var sAddress = $(".SocietiesRemove option:selected").val(); var userAddress = $(".UserSocietiesRemove option:selected").val(); var aSociety = web3.eth.contract(Society.abi); var aSocietyInstance = aSociety.at(sAddress); var result = aSocietyInstance.deVerify(userAddress); }); $("#addSomeTests").click(function() { startUp(); /* web3.eth.getAccounts(function(error, result){ var allAccounts = result; var names = ['Andrew','Betsy','Calvin','Danny','Edgar','Farah','Greg','Heather','Ian','Julie']; for (var counter = 0; counter< allAccounts.length; counter++){ StonePaper.assignLawyer(names[counter],{from:allAccounts[counter]}).then(function(){ }); } StonePaper.setDatabase("http://localhost:41080/GrabInfo?Key=",0,{}); SocietyList.createNewSociety("Member of Legal Hackers",{}).then(function(){console.log('success');},function(){console.log('Fail');}); SocietyList.createNewSociety("International Refugee",{}).then(function(){console.log('success');},function(){console.log('Fail');}); SocietyList.createNewSociety("Local Member of Credit Union",{}).then(function(){console.log('success');},function(){console.log('Fail');}); }); */ }); $("#setLawyerName").click(function() { var value = $("#lawyerName").val(); var checkThis = $("#lawyerName"); StonePaper.assignLawyer(value,{gas: 3000000}).then( function(){ clearAllUsers(0); alert("You name has been changed"); }, function(){ alert("For security reasons the name can not be blank"); }); }); $('.PapersPlease').on('change', function(){ var theIndex = this.value; if (this.value=="Ninja"){ var targetData = $("#HumanRead"); targetData.empty(); return; } var thePaper = papers[theIndex]; $("#NameV").html(thePaper[0]); $("#HashV").html(thePaper[1]); StonePaper.getDatabase(thePaper[2].toNumber()).then(function(value3) { $("#UrlV").html(value3+thePaper[1]); }); var data = new Date(thePaper[3].toNumber()*1000); $("#TimeV").html(data); StonePaper.getLawyer(thePaper[4]).then(function(value4) { $("#LawyerV").html(value4); }); if (thePaper[6]==54321){ $.get(serverAddress+"/GrabInfo?Key="+thePaper[1], {}, function(data){ var targetData = $("#HumanRead"); targetData.empty(); targetData.html(generateAffidavit(data)); }); }else if (thePaper[6]==12345){ $.get(serverAddress+"/GrabInfo?Key="+thePaper[1], {}, function(data){ var targetData = $("#HumanRead"); targetData.empty(); targetData.html(generateContractHTML(data)); }); }else{ $.get(serverAddress+"/GrabInfo?Key="+thePaper[1], {}, function(data){ var targetData = $("#HumanRead"); targetData.empty(); targetData.html(generateContractNoSigHTML(data)); }); } }); $("#blockchain button.setUrl").click(function() { var value = $("#blockchain input.urlName").val(); StonePaper.assignDatabase(value,0).then( function(){ addToLog("#blockchain", "Database URL set" ); }, function(){ alert("You can't change the database URL once it's been assigned"); }); }); $("#blockchain button.getUrl").click(function() { StonePaper.getDatabase(0).then(function(value3) { $("#blockchain .urlValue").html(value3); addToLog("#blockchain", "Database URL Gotten"); }); }); $("#blockchain button.setPaper").click(function() { var value1 = $("#blockchain input.docName").val(); var value2 = $("#blockchain input.docText").val(); var fromAddress = $(".FromAddress option:selected").val(); var targetAddress = $(".ToAddress option:selected").val(); StonePaper.createPaper(value1,web3.sha3(value2), 0, [],0 ,[targetAddress], {gas: 3000000}); clearAllPaper(); addToLog("#blockchain", "Paper saved to URL" ); }); $(".setGasRecipt").click(function() { var targetAddress = $(".WalletA option:selected").val(); var value2 = $(".ReciptName").val(); GasReceipt.createReceipt(targetAddress,value2, {}).then(function(){ StonePaper.getLastPaperFromContract(targetAddress,GasReceipt.address,{}).then(function(result){ if (result){ }else { } },function(){ var indexV = new web3.BigNumber(123); StonePaper.getMeta(indexV).then(function(result){ if (result){ }else{ var indexV = new web3.BigNumber(123); StonePaper.assignMeta("Gas Recipts",indexV,{}).then(function(){ },function(){ }); } }); StonePaper.getDatabase(indexV, function(err, result) { if (result){ } else { var indexV = new web3.BigNumber(123); StonePaper.assignDatabase("Gas Recipt",indexV,{}).then(function(){ },function(){ } ); } }); StonePaper.createPaper("Gas Recipt",0, indexV, [indexV],GasReceipt.address,[targetAddress], {gas: 3000000}); }); }); }); $(".WalletB").change(function() { var targetAddress = $(".WalletB option:selected").val(); var indexCount = -1; var data = []; var circularCall = function(recived){ indexCount++; if (recived){ data.push(recived); } GasReceipt.getReceipt(targetAddress,indexCount,{}).then(circularCall,function(){ $(".Results").empty(); for (var counter = 0; counter<data.length; counter++){ $(".Results").append($('<option></option>').attr("value",data[counter]).text(data[counter])); } }); }; circularCall(); }); });
mit
nbonamy/doctrine-0.10.4
lib/Doctrine/Query/Groupby.php
1870
<?php /* * $Id: Groupby.php 3884 2008-02-22 18:26:35Z jwage $ * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see * <http://www.phpdoctrine.org>. */ Doctrine::autoload('Doctrine_Query_Part'); /** * Doctrine_Query_Groupby * * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3884 $ * @author Konsta Vesterinen <[email protected]> */ class Doctrine_Query_Groupby extends Doctrine_Query_Part { /** * DQL GROUP BY PARSER * parses the group by part of the query string * * @param string $str * @return void */ public function parse($str, $append = false) { $r = array(); foreach (explode(',', $str) as $reference) { $reference = trim($reference); $r[] = $this->query->parseClause($reference); } return implode(', ', $r); } }
mit
Eden-06/CROM
org.rosi.crom.toformal/src/org/rosi/crom/toformal/popup/actions/GenerateScrollCodeAction.java
272
package org.rosi.crom.toformal.popup.actions; import org.rosi.crom.toformal.generator.ScrollCodeGenerator; public class GenerateScrollCodeAction extends AbstractGenerateAction { public GenerateScrollCodeAction(){ super(); generator=new ScrollCodeGenerator(); } }
mit
fpt-software/SENTestKit-Server
ats/src/ATS/ENTITY/Model.java
4216
package ATS.ENTITY; import java.io.Serializable; import javax.persistence.*; import com.fasterxml.jackson.annotation.JsonIgnore; import COMMON.ENUM.Platform; import java.util.List; /** * The persistent class for the MODEL database table. * */ @Entity public class Model implements Serializable { public enum ModelType { Tablet,Mobile } private static final long serialVersionUID = 1L; @Id @Column(name="MODEL_ID", length=255) private String modelId; @Column(name="MODEL_NAME", length=255) private String modelName; @Column(name="MODEL_CODE", length=50) private String modelCode; @Column(name="MODEL_DESC", length=500) private String modelDesc; @Column(name="MODEL_TYPE", length=50) private ModelType modelType; @Column(name="PHOTO_PATH_URL", length=255) private String photoPathUrl; @Column(name="SCREEN_RESOLUTION", length=50) private String screenResolution; @Column(name="SCREEN_SIZE", length=50) private float screenSize; @Column(name="PLATFORM") private Platform platform; @ManyToOne @JoinColumn(name="CPU_ID") private Cpu cpu; //bi-directional many-to-one association to Manufacturer @ManyToOne @JoinColumn(name="MANUFACTORER_ID") private Manufacturer manufacturer; //bi-directional many-to-one association to ModelTesting @OneToMany(mappedBy="model", cascade=CascadeType.PERSIST) private List<ModelTesting> modelTestings; public Model() { } public Model(String modelId) { // TODO Auto-generated constructor stub setModelId(modelId); } public Model(String modelName, String modelCode, String modelDesc, ModelType modelType, String screenResolution, float screenSize, Platform platform, String cpuId, String manufacturerId) { // TODO Auto-generated constructor stub setModelId(modelName.toLowerCase().trim().replace(" ", "")); setModelName(modelName); setModelCode(modelCode); setModelDesc(modelDesc); setModelType(modelType); setScreenResolution(screenResolution); setScreenSize(screenSize); setPlatform(platform); setCpu(new Cpu(cpuId)); setManufacturer(new Manufacturer(manufacturerId)); } public String getModelCode() { return this.modelCode; } public void setModelCode(String modelCode) { this.modelCode = modelCode; } public String getModelDesc() { return this.modelDesc; } public void setModelDesc(String modelDesc) { this.modelDesc = modelDesc; } public ModelType getModelType() { return modelType; } public void setModelType(ModelType modelType) { this.modelType = modelType; } public String getScreenResolution() { return this.screenResolution; } public void setScreenResolution(String screenResolution) { this.screenResolution = screenResolution; } public float getScreenSize() { return this.screenSize; } public void setScreenSize(float screenSize) { this.screenSize = screenSize; } public Manufacturer getManufacturer() { return this.manufacturer; } public void setManufacturer(Manufacturer manufacturer) { this.manufacturer = manufacturer; } public Platform getPlatform() { return platform; } public void setPlatform(Platform platform) { this.platform = platform; } @JsonIgnore public List<ModelTesting> getModelTestings() { return this.modelTestings; } public void setModelTestings(List<ModelTesting> modelTestings) { this.modelTestings = modelTestings; } public ModelTesting addModelTesting(ModelTesting modelTesting) { getModelTestings().add(modelTesting); modelTesting.setModel(this); return modelTesting; } public ModelTesting removeModelTesting(ModelTesting modelTesting) { getModelTestings().remove(modelTesting); modelTesting.setModel(null); return modelTesting; } public Cpu getCpu() { return cpu; } public void setCpu(Cpu cpu) { this.cpu = cpu; } public String getModelName() { return modelName; } public void setModelName(String modelName) { this.modelName = modelName; } public String getPhotoPathUrl() { return photoPathUrl; } public void setPhotoPathUrl(String photoPathUrl) { this.photoPathUrl = photoPathUrl; } public String getModelId() { return modelId; } public void setModelId(String modelId) { this.modelId = modelId; } }
mit
michaellihs/golab
cmd/branches.go
8701
// Copyright © 2017 Michael Lihs // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. package cmd import ( "errors" . "github.com/michaellihs/golab/cmd/helpers" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" ) // see https://docs.gitlab.com/ce/api/branches.html#branches-api var branchesCmd = &golabCommand{ Parent: RootCmd, Cmd: &cobra.Command{ Use: "branches", Aliases: []string{"branch"}, Short: "Branches", Long: `Manage repository branches`, }, Run: func(cmd golabCommand) error { return errors.New("cannot use this command without further sub-commands") }, } // see https://docs.gitlab.com/ce/api/branches.html#list-repository-branches type branchesListFlags struct { Id *string `flag_name:"id" short:"i" type:"string" required:"yes" description:"The ID or URL-encoded path of the project owned by the authenticated user"` } var branchesListCmd = &golabCommand{ Parent: branchesCmd.Cmd, Flags: &branchesListFlags{}, Opts: &gitlab.ListBranchesOptions{}, Cmd: &cobra.Command{ Use: "list", Short: "List repository branches", Long: `Get a list of repository branches from a project, sorted by name alphabetically. This endpoint can be accessed without authentication if the repository is publicly accessible.`, }, Run: func(cmd golabCommand) error { flags := cmd.Flags.(*branchesListFlags) opts := cmd.Opts.(*gitlab.ListBranchesOptions) branches, _, err := gitlabClient.Branches.ListBranches(*flags.Id, opts) if err != nil { return err } return OutputJson(branches) }, } // see https://docs.gitlab.com/ce/api/branches.html#get-single-repository-branch type branchesGetSingleFlags struct { Id *string `flag_name:"id" short:"i" type:"string" required:"yes" description:"The ID or URL-encoded path of the project owned by the authenticated user"` Branch *string `flag_name:"branch" short:"b" type:"string" required:"yes" description:"The name of the branch"` } var branchesGetSingleCmd = &golabCommand{ Parent: branchesCmd.Cmd, Flags: &branchesGetSingleFlags{}, Cmd: &cobra.Command{ Use: "get", Short: "Get single repository branch", Long: `Get a single project repository branch. This endpoint can be accessed without authentication if the repository is publicly accessible.`, }, Run: func(cmd golabCommand) error { flags := cmd.Flags.(*branchesGetSingleFlags) branch, _, err := gitlabClient.Branches.GetBranch(*flags.Id, *flags.Branch) if err != nil { return err } return OutputJson(branch) }, } // see https://docs.gitlab.com/ce/api/branches.html#protect-repository-branch type branchesProtectFlags struct { Id *string `flag_name:"id" short:"i" type:"integer/string" required:"yes" description:"The ID or URL-encoded path of the project owned by the authenticated user"` Branch *string `flag_name:"branch" short:"b" type:"string" required:"yes" description:"The name of the branch"` DevelopersCanPush *bool `flag_name:"developers_can_push" short:"p" type:"boolean" required:"no" description:"Flag if developers can push to the branch"` DevelopersCanMerge *bool `flag_name:"developers_can_merge" short:"m" type:"boolean" required:"no" description:"Flag if developers can merge to the branch"` } var branchesProtectCmd = &golabCommand{ Parent: branchesCmd.Cmd, Flags: &branchesProtectFlags{}, Opts: &gitlab.ProtectBranchOptions{}, Cmd: &cobra.Command{ Use: "protect", Short: "Protect repository branch", Long: `Protects a single project repository branch. This is an idempotent function, protecting an already protected repository branch still returns a 200 OK status code.`, }, Run: func(cmd golabCommand) error { flags := cmd.Flags.(*branchesProtectFlags) opts := cmd.Opts.(*gitlab.ProtectBranchOptions) branch, _, err := gitlabClient.Branches.ProtectBranch(*flags.Id, *flags.Branch, opts) if err != nil { return err } return OutputJson(branch) }, } // see https://docs.gitlab.com/ce/api/branches.html#unprotect-repository-branch type branchesUnprotectFlags struct { Id *string `flag_name:"id" short:"i" type:"string" required:"yes" description:"The ID or URL-encoded path of the project"` Branch *string `flag_name:"branch" short:"b" type:"string" required:"yes" description:"The name of the branch"` } var branchesUnprotectCmd = &golabCommand{ Parent: branchesCmd.Cmd, Flags: &branchesUnprotectFlags{}, Cmd: &cobra.Command{ Use: "unprotect", Short: "Unprotect repository branch", Long: `Unprotects a single project repository branch. This is an idempotent function, unprotecting an already unprotected repository branch still returns a 200 OK status code.`, }, Run: func(cmd golabCommand) error { flags := cmd.Flags.(*branchesUnprotectFlags) branch, _, err := gitlabClient.Branches.UnprotectBranch(*flags.Id, *flags.Branch) if err != nil { return err } return OutputJson(branch) }, } // see https://docs.gitlab.com/ce/api/branches.html#create-repository-branch type branchesCreateFlags struct { Id *string `flag_name:"id" short:"i" type:"string" required:"yes" description:"The ID or URL-encoded path of the project"` Branch *string `flag_name:"branch" short:"b" type:"string" required:"yes" description:"The name of the branch"` Ref *string `flag_name:"ref" short:"r" type:"string" required:"yes" description:"The branch name or commit SHA to create branch from"` } var branchesCreateCmd = &golabCommand{ Parent: branchesCmd.Cmd, Flags: &branchesCreateFlags{}, Opts: &gitlab.CreateBranchOptions{}, Cmd: &cobra.Command{ Use: "create", Short: "Create repository branch", Long: `Create repository branch`, }, Run: func(cmd golabCommand) error { flags := cmd.Flags.(*branchesCreateFlags) opts := cmd.Opts.(*gitlab.CreateBranchOptions) branch, _, err := gitlabClient.Branches.CreateBranch(*flags.Id, opts) if err != nil { return err } return OutputJson(branch) }, } // see https://docs.gitlab.com/ce/api/branches.html#delete-repository-branch type branchesDeleteFlags struct { Id *string `flag_name:"id" short:"i" type:"string" required:"yes" description:"The ID or URL-encoded path of the project"` Branch *string `flag_name:"branch" short:"b" type:"string" required:"yes" description:"The name of the branch"` } var branchesDeleteCmd = &golabCommand{ Parent: branchesCmd.Cmd, Flags: &branchesDeleteFlags{}, Cmd: &cobra.Command{ Use: "delete", Short: "Delete repository branch", Long: `Delete repository branch`, }, Run: func(cmd golabCommand) error { flags := cmd.Flags.(*branchesDeleteFlags) _, err := gitlabClient.Branches.DeleteBranch(*flags.Id, *flags.Branch) return err }, } // see https://docs.gitlab.com/ce/api/branches.html#delete-merged-branches type branchesDeleteMergedFlags struct { Id *string `flag_name:"id" short:"i" type:"string" required:"yes" description:"The ID or URL-encoded path of the project"` } var branchesDeleteMergedCmd = &golabCommand{ Parent: branchesCmd.Cmd, Flags: &branchesDeleteMergedFlags{}, Cmd: &cobra.Command{ Use: "delete-merged", Short: "Delete merged branches", Long: `Will delete all branches that are merged into the project's default branch. Protected branches will not be deleted as part of this operation.`, }, Run: func(cmd golabCommand) error { flags := cmd.Flags.(*branchesDeleteMergedFlags) _, err := gitlabClient.Branches.DeleteMergedBranches(*flags.Id) return err }, } func init() { branchesCmd.Init() branchesListCmd.Init() branchesGetSingleCmd.Init() branchesProtectCmd.Init() branchesUnprotectCmd.Init() branchesDeleteCmd.Init() branchesCreateCmd.Init() branchesDeleteMergedCmd.Init() }
mit
Azure/azure-sdk-for-java
sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsGetByResourceGroupSamples.java
972
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerservice.generated; import com.azure.core.util.Context; /** Samples for Snapshots GetByResourceGroup. */ public final class SnapshotsGetByResourceGroupSamples { /* * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-10-01/examples/SnapshotsGet.json */ /** * Sample code: Get Snapshot. * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void getSnapshot(com.azure.resourcemanager.AzureResourceManager azure) { azure .kubernetesClusters() .manager() .serviceClient() .getSnapshots() .getByResourceGroupWithResponse("rg1", "snapshot1", Context.NONE); } }
mit
pdrobek/polcoin-new
src/rpcmining.cpp
15461
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "main.h" #include "db.h" #include "init.h" #include "bitcoinrpc.h" using namespace json_spirit; using namespace std; Value getgenerate(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( "getgenerate\n" "Returns true or false."); return GetBoolArg("-gen"); } Value setgenerate(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "setgenerate <generate> [genproclimit]\n" "<generate> is true or false to turn generation on or off.\n" "Generation is limited to [genproclimit] processors, -1 is unlimited."); bool fGenerate = true; if (params.size() > 0) fGenerate = params[0].get_bool(); if (params.size() > 1) { int nGenProcLimit = params[1].get_int(); mapArgs["-genproclimit"] = itostr(nGenProcLimit); if (nGenProcLimit == 0) fGenerate = false; } mapArgs["-gen"] = (fGenerate ? "1" : "0"); GenerateBitcoins(fGenerate, pwalletMain); return Value::null; } Value gethashespersec(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( "gethashespersec\n" "Returns a recent hashes per second performance measurement while generating."); if (GetTimeMillis() - nHPSTimerStart > 8000) return (boost::int64_t)0; return (boost::int64_t)dHashesPerSec; } Value getmininginfo(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( "getmininginfo\n" "Returns an object containing mining-related information."); Object obj; obj.push_back(Pair("blocks", (int)nBestHeight)); obj.push_back(Pair("currentblocksize",(uint64_t)nLastBlockSize)); obj.push_back(Pair("currentblocktx",(uint64_t)nLastBlockTx)); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("errors", GetWarnings("statusbar"))); obj.push_back(Pair("generate", GetBoolArg("-gen"))); obj.push_back(Pair("genproclimit", (int)GetArg("-genproclimit", -1))); obj.push_back(Pair("hashespersec", gethashespersec(params, false))); obj.push_back(Pair("networkhashps", getnetworkhashps(params, false))); obj.push_back(Pair("pooledtx", (uint64_t)mempool.size())); obj.push_back(Pair("testnet", fTestNet)); return obj; } Value getwork(const Array& params, bool fHelp) { if (fHelp || params.size() > 1) throw runtime_error( "getwork [data]\n" "If [data] is not specified, returns formatted hash data to work on:\n" " \"midstate\" : precomputed hash state after hashing the first half of the data (DEPRECATED)\n" // deprecated " \"data\" : block data\n" " \"hash1\" : formatted hash buffer for second hash (DEPRECATED)\n" // deprecated " \"target\" : little endian hash target\n" "If [data] is specified, tries to solve the block and returns true if it was successful."); if (vNodes.empty()) throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Polcoin is not connected!"); if (IsInitialBlockDownload()) throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Polcoin is downloading blocks..."); typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t; static mapNewBlock_t mapNewBlock; // FIXME: thread safety static vector<CBlockTemplate*> vNewBlockTemplate; if (params.size() == 0) { // Update block static unsigned int nTransactionsUpdatedLast; static CBlockIndex* pindexPrev; static int64 nStart; static CBlockTemplate* pblocktemplate; if (pindexPrev != pindexBest || (nTransactionsUpdated != nTransactionsUpdatedLast && GetTime() - nStart > 60)) { if (pindexPrev != pindexBest) { // Deallocate old blocks since they're obsolete now mapNewBlock.clear(); BOOST_FOREACH(CBlockTemplate* pblocktemplate, vNewBlockTemplate) delete pblocktemplate; vNewBlockTemplate.clear(); } // Clear pindexPrev so future getworks make a new block, despite any failures from here on pindexPrev = NULL; // Store the pindexBest used before CreateNewBlock, to avoid races nTransactionsUpdatedLast = nTransactionsUpdated; CBlockIndex* pindexPrevNew = pindexBest; nStart = GetTime(); // Create new block pblocktemplate = CreateNewBlock(*pMiningKey); if (!pblocktemplate) throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); vNewBlockTemplate.push_back(pblocktemplate); // Need to update only after we know CreateNewBlock succeeded pindexPrev = pindexPrevNew; } CBlock* pblock = &pblocktemplate->block; // pointer for convenience // Update nTime pblock->UpdateTime(pindexPrev); pblock->nNonce = 0; // Update nExtraNonce static unsigned int nExtraNonce = 0; IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); // Save mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig); // Pre-build hash buffers char pmidstate[32]; char pdata[128]; char phash1[64]; FormatHashBuffers(pblock, pmidstate, pdata, phash1); uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); Object result; result.push_back(Pair("midstate", HexStr(BEGIN(pmidstate), END(pmidstate)))); // deprecated result.push_back(Pair("data", HexStr(BEGIN(pdata), END(pdata)))); result.push_back(Pair("hash1", HexStr(BEGIN(phash1), END(phash1)))); // deprecated result.push_back(Pair("target", HexStr(BEGIN(hashTarget), END(hashTarget)))); return result; } else { // Parse parameters vector<unsigned char> vchData = ParseHex(params[0].get_str()); if (vchData.size() != 128) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter"); CBlock* pdata = (CBlock*)&vchData[0]; // Byte reverse for (int i = 0; i < 128/4; i++) ((unsigned int*)pdata)[i] = ByteReverse(((unsigned int*)pdata)[i]); // Get saved block if (!mapNewBlock.count(pdata->hashMerkleRoot)) return false; CBlock* pblock = mapNewBlock[pdata->hashMerkleRoot].first; pblock->nTime = pdata->nTime; pblock->nNonce = pdata->nNonce; pblock->vtx[0].vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second; pblock->hashMerkleRoot = pblock->BuildMerkleTree(); return CheckWork(pblock, *pwalletMain, *pMiningKey); } } Value getblocktemplate(const Array& params, bool fHelp) { if (fHelp || params.size() > 1) throw runtime_error( "getblocktemplate [params]\n" "Returns data needed to construct a block to work on:\n" " \"version\" : block version\n" " \"previousblockhash\" : hash of current highest block\n" " \"transactions\" : contents of non-coinbase transactions that should be included in the next block\n" " \"coinbaseaux\" : data that should be included in coinbase\n" " \"coinbasevalue\" : maximum allowable input to coinbase transaction, including the generation award and transaction fees\n" " \"target\" : hash target\n" " \"mintime\" : minimum timestamp appropriate for next block\n" " \"curtime\" : current timestamp\n" " \"mutable\" : list of ways the block template may be changed\n" " \"noncerange\" : range of valid nonces\n" " \"sigoplimit\" : limit of sigops in blocks\n" " \"sizelimit\" : limit of block size\n" " \"bits\" : compressed target of next block\n" " \"height\" : height of the next block\n" "See https://en.polcoin.it/wiki/BIP_0022 for full specification."); std::string strMode = "template"; if (params.size() > 0) { const Object& oparam = params[0].get_obj(); const Value& modeval = find_value(oparam, "mode"); if (modeval.type() == str_type) strMode = modeval.get_str(); else if (modeval.type() == null_type) { /* Do nothing */ } else throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode"); } if (strMode != "template") throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode"); if (vNodes.empty()) throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Polcoin is not connected!"); if (IsInitialBlockDownload()) throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Polcoin is downloading blocks..."); // Update block static unsigned int nTransactionsUpdatedLast; static CBlockIndex* pindexPrev; static int64 nStart; static CBlockTemplate* pblocktemplate; if (pindexPrev != pindexBest || (nTransactionsUpdated != nTransactionsUpdatedLast && GetTime() - nStart > 5)) { // Clear pindexPrev so future calls make a new block, despite any failures from here on pindexPrev = NULL; // Store the pindexBest used before CreateNewBlock, to avoid races nTransactionsUpdatedLast = nTransactionsUpdated; CBlockIndex* pindexPrevNew = pindexBest; nStart = GetTime(); // Create new block if(pblocktemplate) { delete pblocktemplate; pblocktemplate = NULL; } pblocktemplate = CreateNewBlock(*pMiningKey); if (!pblocktemplate) throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); // Need to update only after we know CreateNewBlock succeeded pindexPrev = pindexPrevNew; } CBlock* pblock = &pblocktemplate->block; // pointer for convenience // Update nTime pblock->UpdateTime(pindexPrev); pblock->nNonce = 0; Array transactions; map<uint256, int64_t> setTxIndex; int i = 0; BOOST_FOREACH (CTransaction& tx, pblock->vtx) { uint256 txHash = tx.GetHash(); setTxIndex[txHash] = i++; if (tx.IsCoinBase()) continue; Object entry; CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); ssTx << tx; entry.push_back(Pair("data", HexStr(ssTx.begin(), ssTx.end()))); entry.push_back(Pair("hash", txHash.GetHex())); Array deps; BOOST_FOREACH (const CTxIn &in, tx.vin) { if (setTxIndex.count(in.prevout.hash)) deps.push_back(setTxIndex[in.prevout.hash]); } entry.push_back(Pair("depends", deps)); int index_in_template = i - 1; entry.push_back(Pair("fee", pblocktemplate->vTxFees[index_in_template])); entry.push_back(Pair("sigops", pblocktemplate->vTxSigOps[index_in_template])); transactions.push_back(entry); } Object aux; aux.push_back(Pair("flags", HexStr(COINBASE_FLAGS.begin(), COINBASE_FLAGS.end()))); uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); static Array aMutable; if (aMutable.empty()) { aMutable.push_back("time"); aMutable.push_back("transactions"); aMutable.push_back("prevblock"); } Object result; result.push_back(Pair("version", pblock->nVersion)); result.push_back(Pair("previousblockhash", pblock->hashPrevBlock.GetHex())); result.push_back(Pair("transactions", transactions)); result.push_back(Pair("coinbaseaux", aux)); result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue)); result.push_back(Pair("target", hashTarget.GetHex())); result.push_back(Pair("mintime", (int64_t)pindexPrev->GetMedianTimePast()+1)); result.push_back(Pair("mutable", aMutable)); result.push_back(Pair("noncerange", "00000000ffffffff")); result.push_back(Pair("sigoplimit", (int64_t)MAX_BLOCK_SIGOPS)); result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_SIZE)); result.push_back(Pair("curtime", (int64_t)pblock->nTime)); result.push_back(Pair("bits", HexBits(pblock->nBits))); result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1))); return result; } Value submitblock(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "submitblock <hex data> [optional-params-obj]\n" "[optional-params-obj] parameter is currently ignored.\n" "Attempts to submit new block to network.\n" "See https://en.polcoin.it/wiki/BIP_0022 for full specification."); vector<unsigned char> blockData(ParseHex(params[0].get_str())); CDataStream ssBlock(blockData, SER_NETWORK, PROTOCOL_VERSION); CBlock pblock; try { ssBlock >> pblock; } catch (std::exception &e) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed"); } CValidationState state; bool fAccepted = ProcessBlock(state, NULL, &pblock); if (!fAccepted) return "rejected"; // TODO: report validation state return Value::null; } Value GetNetworkHashPS(int lookup, int height) { CBlockIndex *pb = pindexBest; if (height >= 0 && height < nBestHeight) pb = FindBlockByHeight(height); if (pb == NULL || !pb->nHeight) return 0; // If lookup is -1, then use blocks since last difficulty change. if (lookup <= 0) lookup = pb->nHeight % 2016 + 1; // If lookup is larger than chain, then set it to chain length. if (lookup > pb->nHeight) lookup = pb->nHeight; CBlockIndex *pb0 = pb; int64 minTime = pb0->GetBlockTime(); int64 maxTime = minTime; for (int i = 0; i < lookup; i++) { pb0 = pb0->pprev; int64 time = pb0->GetBlockTime(); minTime = std::min(time, minTime); maxTime = std::max(time, maxTime); } // In case there's a situation where minTime == maxTime, we don't want a divide by zero exception. if (minTime == maxTime) return 0; uint256 workDiff = pb->nChainWork - pb0->nChainWork; int64 timeDiff = maxTime - minTime; return (boost::int64_t)(workDiff.getdouble() / timeDiff); } Value getnetworkhashps(const Array& params, bool fHelp) { if (fHelp || params.size() > 2) throw runtime_error( "getnetworkhashps [blocks] [height]\n" "Returns the estimated network hashes per second based on the last 120 blocks.\n" "Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n" "Pass in [height] to estimate the network speed at the time when a certain block was found."); return GetNetworkHashPS(params.size() > 0 ? params[0].get_int() : 120, params.size() > 1 ? params[1].get_int() : -1); }
mit
TakuyaNoguchi/aizu_online_judge
volume_0/answers/0015_national_budget.rb
141
n = gets.to_i n.times do x = gets.to_i y = gets.to_i if (x + y).to_s.length > 80 puts 'overflow' else puts x + y end end
mit
rahatarmanahmed/UTD-CS-SE-Assignments
CS 4361 - Computer Graphics/assignment5/curves.java
9525
// curves.java import java.io.*; import java.awt.*; import java.awt.event.*; public class curves extends Frame { public static void main(String[] args) { if (args.length == 0) System.out.println("Use filename as program argument."); else new curves(args[0]); } curves(String fileName) { super("Click left or right mouse button to change the level"); addWindowListener(new WindowAdapter() {public void windowClosing( WindowEvent e){System.exit(0);}}); setSize (800, 600); add("Center", new Cvcurves(fileName)); show(); } } class Cvcurves extends Canvas { String fileName, axiom, strF, strf, strX, strY; int maxX, maxY, level = 1; double xLast, yLast, dir, lastDir, rotation, dirStart, fxStart, fyStart, lengthFract, reductFact; void error(String str) { System.out.println(str); System.exit(1); } Cvcurves(String fileName) { Input inp = new Input(fileName); if (inp.fails()) error("Cannot open input file."); axiom = inp.readString(); inp.skipRest(); strF = inp.readString(); inp.skipRest(); strf = inp.readString(); inp.skipRest(); strX = inp.readString(); inp.skipRest(); strY = inp.readString(); inp.skipRest(); rotation = inp.readFloat(); inp.skipRest(); dirStart = inp.readFloat(); inp.skipRest(); fxStart = inp.readFloat(); inp.skipRest(); fyStart = inp.readFloat(); inp.skipRest(); lengthFract = inp.readFloat(); inp.skipRest(); reductFact = inp.readFloat(); if (inp.fails()) error("Input file incorrect."); addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent evt) { if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) != 0) { level--; // Right mouse button decreases level if (level < 1) level = 1; } else level++; // Left mouse button increases level repaint(); } }); } Graphics g; int iX(double x){return (int)Math.round(x);} int iY(double y){return (int)Math.round(maxY-y);} void onlyDraw(Graphics g, double dx, double dy) { g.drawLine(iX(xLast), iY(yLast), iX(xLast + dx ) ,iY(yLast + dy)); } void drawTo(Graphics g, double dx, double dy) { g.drawLine(iX(xLast), iY(yLast), iX(xLast + dx) ,iY(yLast + dy)); xLast = xLast + dx; yLast = yLast + dy; } void moveTo(Graphics g, double x, double y) { xLast = x; yLast = y; } public void paint(Graphics g) { Dimension d = getSize(); maxX = d.width - 1; maxY = d.height - 1; xLast = fxStart * maxX; yLast = fyStart * maxY; dir = dirStart; // Initial direction in degrees lastDir = dirStart; String instructions = axiom; double finalLen = lengthFract * maxY; // We need to have the final instruction string // instead of recursively interpreting it // Because we need the context of previous and next // characters which isn't available when you do it recursively // So just expand the string for however many levels we need for(int k=0;k<level;k++) { String newInstructions = ""; for(int j=0;j<instructions.length();j++) { char c = instructions.charAt(j); switch(c) { case 'F': newInstructions += strF; break; case 'f': newInstructions += strf; break; case 'X': newInstructions += strX; break; case 'Y': newInstructions += strY; break; default: newInstructions += c; break; } } instructions = newInstructions; finalLen *= lengthFract; } // Remove anything that's not F, f, +, -, [, or ] instructions = instructions.replaceAll("[^Ff\\+\\-\\]\\[]", ""); // Remove angles that cancel each other out, makes coding corners easier instructions = instructions.replaceAll("\\+\\-|\\-\\+", ""); turtleGraphics(g, instructions, level, finalLen); } private static final double CORNER_FRACTION = .3; // Modified to not be recursive public void turtleGraphics(Graphics g, String instruction, int depth, double len) { double xMark=0, yMark=0, dirMark=0; // TODO: stack these double rad, dx, dy; for (int i=0;i<instruction.length();i++) { char ch = instruction.charAt(i), nextCh = (instruction.length() > i+1) ? instruction.charAt(i+1) : '_', prevCh = (i > 0) ? instruction.charAt(i-1) : '_'; switch(ch) { case 'F': // Step forward and draw // Start: (xLast, yLast), direction: dir, steplength: len rad = Math.PI/180 * dir; // Degrees -> radians dx = len * Math.cos(rad); dy = len * Math.sin(rad); if((nextCh != '_' && (nextCh == '+' || nextCh == '-')) || (prevCh != '_' && (prevCh == '+' || prevCh == '-'))) { drawTo(g, dx*(1-CORNER_FRACTION), dy*(1-CORNER_FRACTION)); } else { drawTo(g, dx, dy); } // drawTo(g, dx, dy); break; case 'f': // Step forward without drawing // Start: (xLast, yLast), direction: dir, steplength: len rad = Math.PI/180 * dir; // Degrees -> radians dx = len * Math.cos(rad); dy = len * Math.sin(rad); moveTo(g, xLast + dx, yLast + dy); break; case '+': // Turn right if((rotation == 90 || rotation == -90) && prevCh != '_' && prevCh == 'F' && nextCh != '_' && nextCh == 'F') { double cornerLen = len * Math.sqrt(CORNER_FRACTION*CORNER_FRACTION + CORNER_FRACTION*CORNER_FRACTION); rad = Math.PI/180 * ((dir-rotation/2) % 360); // Degrees -> radians dx = cornerLen * Math.cos(rad); dy = cornerLen * Math.sin(rad); drawTo(g, dx, dy); } dir -= rotation; break; case '-': // Turn left if((rotation == 90 || rotation == -90) && prevCh != '_' && prevCh == 'F' && nextCh != '_' && nextCh == 'F') { double cornerLen = len * Math.sqrt(CORNER_FRACTION*CORNER_FRACTION + CORNER_FRACTION*CORNER_FRACTION); rad = Math.PI/180 * ((dir+rotation/2) % 360); // Degrees -> radians dx = cornerLen * Math.cos(rad); dy = cornerLen * Math.sin(rad); drawTo(g, dx, dy); } dir += rotation; break; case '[': // Save position and direction xMark = xLast; yMark = yLast; dirMark = dir; break; case ']': // Back to saved position and direction xLast = xMark; yLast = yMark; dir = dirMark; break; } } } } class Input { private PushbackInputStream pbis; private boolean ok = true; private boolean eoFile = false; Input(){pbis = new PushbackInputStream(System.in);} Input(String fileName) { try { InputStream is = new FileInputStream(fileName); pbis = new PushbackInputStream(is); } catch(IOException ioe){ok = false;} } int readInt() { boolean neg = false; char ch; do {ch = readChar();}while (Character.isWhitespace(ch)); if (ch == '-'){neg = true; ch = readChar();} if (!Character.isDigit(ch)) { pushBack(ch); ok = false; return 0; } int x = ch - '0'; for (;;) { ch = readChar(); if (!Character.isDigit(ch)){pushBack(ch); break;} x = 10 * x + (ch - '0'); } return (neg ? -x : x); } float readFloat() { char ch; int nDec = -1; boolean neg = false; do { ch = readChar(); } while (Character.isWhitespace(ch)); if (ch == '-'){neg = true; ch = readChar();} if (ch == '.'){nDec = 1; ch = readChar();} if (!Character.isDigit(ch)){ok = false; pushBack(ch); return 0;} float x = ch - '0'; for (;;) { ch = readChar(); if (Character.isDigit(ch)) { x = 10 * x + (ch - '0'); if (nDec >= 0) nDec++; } else if (ch == '.' && nDec == -1) nDec = 0; else break; } while (nDec > 0){x *= 0.1; nDec--;} if (ch == 'e' || ch == 'E') { int exp = readInt(); if (!fails()) { while (exp < 0){x *= 0.1; exp++;} while (exp > 0){x *= 10; exp--;} } } else pushBack(ch); return (neg ? -x : x); } char readChar() { int ch=0; try { ch = pbis.read(); if (ch == -1) {eoFile = true; ok = false;} } catch(IOException ioe){ok = false;} return (char)ch; } String readString() // Read first string between quotes ("). { String str = " "; char ch; do ch = readChar(); while (!(eof() || ch == '"')); // Initial quote for (;;) { ch = readChar(); if (eof() || ch == '"') // Final quote (end of string) break; str += ch; } return str; } void skipRest() // Skip rest of line { char ch; do ch = readChar(); while (!(eof() || ch == '\n')); } boolean fails(){return !ok;} boolean eof(){return eoFile;} void clear(){ok = true;} void close() { if (pbis != null) try {pbis.close();}catch(IOException ioe){ok = false;} } void pushBack(char ch) { try {pbis.unread(ch);}catch(IOException ioe){} } }
mit
TileDB-Inc/TileDB
examples/cmake_project/src/main.cc
1693
/** * @file main.cc * * @section LICENSE * * The MIT License * * @copyright Copyright (c) 2018-2021 TileDB, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * @section DESCRIPTION * * This is a part of the CMake example project for TileDB. */ #include <cassert> // Include the TileDB C++ API headers #include <tiledb/tiledb> int main(int argc, char** argv) { // Create a TileDB context tiledb::Context ctx; // Print the version auto version = tiledb::version(); std::cout << "You are using TileDB version " << std::get<0>(version) << "." << std::get<1>(version) << "." << std::get<2>(version) << std::endl; return 0; }
mit
BristolPound/cyclos-mobile-3-TownPound
src/component/common/Overlay.js
656
import React from 'react'; import { StyleSheet, TouchableHighlight, View } from 'react-native' import NetworkConnection from '../NetworkConnection' import Colors from '@Colors/colors' const overlayStyle = { visible: { ...StyleSheet.absoluteFillObject, backgroundColor: 'white', opacity: 0.5 }, hidden: { position: 'absolute', height: 0 } } export const Overlay = props => <TouchableHighlight style={props.overlayVisible ? overlayStyle.visible : overlayStyle.hidden} onPress={props.onPress} underlayColor={Colors.transparent}> <View/> </TouchableHighlight>
mit
Na0ki/mikutter_slack
model/user.rb
1153
# -*- frozen_string_literal: true -*- module Plugin::Slack # Userクラス # @see https://toshia.github.io/writing-mikutter-plugin/model/2016/09/30/model-usermixin.html # @see https://toshia.github.io/writing-mikutter-plugin/model/2016/09/30/model-field.html # @see https://api.slack.com/methods/users.info class User < Diva::Model include Diva::Model::UserMixin field.string :id, required: true field.string :name, required: true field.bool :deleted field.string :color # TODO: implement # field.has :profile, Plugin::Slack::Profile, required: true field.bool :is_admin field.bool :is_owner field.bool :has_2fa field.has :team, Plugin::Slack::Team, required: true def idname name end def icon _, photos = Plugin.filtering(:photo_filter, self[:profile][:image_48], []) photos.first rescue => err #error err Skin['notfound.png'] end def perma_link Diva::URI("https://#{team.domain}.slack.com/team/#{name}") end def to_s name end def inspect "#{self.class}(id = #{id}, name = #{name})" end end end
mit
floriandejonckheere/thalariond
config/spring.rb
385
# frozen_string_literal: true Spring.watch( '.ruby-version', '.rbenv-vars', 'tmp/restart.txt', 'tmp/caching-dev.txt' ) Spring.after_fork do if ENV['DEBUGGER_STORED_RUBYLIB'] ENV['DEBUGGER_STORED_RUBYLIB'].split(File::PATH_SEPARATOR).each do |path| next unless path =~ /ruby-debug-ide/ load path + '/ruby-debug-ide/multiprocess/starter.rb' end end end
mit
jakubka/Huerate
Huerate.Services/Settings/SettingsService.cs
2509
/* Huerate - Mobile System for Customer Feedback Collection Master Thesis at BUT FIT (http://www.fit.vutbr.cz), 2013 Available at http://huerate.cz Author: Bc. Jakub Kadlubiec, [email protected] or [email protected] */ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using Huerate.Configuration; using Huerate.Domain.Entities; using Huerate.Services.Translations; namespace Huerate.Services.Settings { internal class SettingsService : ISettingsService { private ITranslationService TranslationService { get; set; } public SettingsService(ITranslationService translationService) { TranslationService = translationService; } public bool SendEmails { get { return HuerateConfiguration.GetSetting<bool>("SendEmails"); } } public SmtpSettings SmtpSettings { get { return new SmtpSettings() { FromAddress = "[email protected]", ServerAddress = "smtp.live.com", EnableSsl = true, ServerPort = 587, Username = "[email protected]", Password = "Hu3R4t3J4KUB", }; } } public SendGridSettings SendGridSettings { get { return new SendGridSettings() { FromAddress = "[email protected]", FromName = "Jakub Kadlubiec", Password = "ZcZMm75sazM97qOYzQSe", Username = "jakubk", }; } } public string DefaultLanguage { get { return "cs"; } } public IList<string> MonitoringEmailAddresses { get { return new[] {"[email protected]"}; } } public bool ContentFilesOnBlob { get { return HuerateConfiguration.GetSetting<bool>("ContentFilesOnBlob"); } } public string ContentFilesBlobUri { get { return HuerateConfiguration.GetSetting<string>("ContentFilesBlobUri"); } } } }
mit
Azure/azure-sdk-for-java
sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/RankingsResponseTablesItem.java
2166
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.cdn.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The RankingsResponseTablesItem model. */ @Fluent public final class RankingsResponseTablesItem { @JsonIgnore private final ClientLogger logger = new ClientLogger(RankingsResponseTablesItem.class); /* * The ranking property. */ @JsonProperty(value = "ranking") private String ranking; /* * The data property. */ @JsonProperty(value = "data") private List<RankingsResponseTablesPropertiesItemsItem> data; /** * Get the ranking property: The ranking property. * * @return the ranking value. */ public String ranking() { return this.ranking; } /** * Set the ranking property: The ranking property. * * @param ranking the ranking value to set. * @return the RankingsResponseTablesItem object itself. */ public RankingsResponseTablesItem withRanking(String ranking) { this.ranking = ranking; return this; } /** * Get the data property: The data property. * * @return the data value. */ public List<RankingsResponseTablesPropertiesItemsItem> data() { return this.data; } /** * Set the data property: The data property. * * @param data the data value to set. * @return the RankingsResponseTablesItem object itself. */ public RankingsResponseTablesItem withData(List<RankingsResponseTablesPropertiesItemsItem> data) { this.data = data; return this; } /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (data() != null) { data().forEach(e -> e.validate()); } } }
mit
nodeca/nodeca.forum
server/admin/nntp/update/forum/forum.js
707
// Show edit form for a group // 'use strict'; const sanitize_section = require('nodeca.forum/lib/sanitizers/section'); module.exports = function (N, apiPath) { N.validate(apiPath, { _id: { format: 'mongo', required: true } }); N.wire.on(apiPath, async function group_edit(env) { let group = await N.models.nntp.Group.findById(env.params._id).lean(true); if (!group || group.type !== 'forum') throw N.io.NOT_FOUND; env.res.current_group = group; env.res.head.title = env.t('title', { name: group.name }); let section = await N.models.forum.Section.findById(group.source).lean(true); env.res.section = await sanitize_section(N, section, env.user_info); }); };
mit
abcdef506819/zyCMS
client/main.js
918
//meteor entry file //create an mantra app and initialize it import { createApp } from 'mantra-core'; import initContext from './configs/context'; // modules import activityModule from './modules/activity'; import coreModule from './modules/core'; import menusModule from './modules/menus'; import userModule from './modules/users'; import footerModule from './modules/footer'; //backend import adminModule from './modules/admin'; // init context const context = initContext(); // create app const app = createApp(context); // load module app.loadModule(activityModule); app.loadModule(coreModule); app.loadModule(menusModule); app.loadModule(userModule); app.loadModule(footerModule); app.loadModule(adminModule); // init app app.init(); //状态初始化 const { LocalState } = context; // //最新资讯初始状态 // LocalState.set("NEWS_PAGE", 1); LocalState.set("PAGE_LIMIT", 5); // console.log(app);
mit
koriym/Koriym.Now
src/Exception/RuntimeException.php
221
<?php /** * This file is part of the Koriym.Now * * @license http://opensource.org/licenses/MIT MIT */ namespace Koriym\Now\Exception; class RuntimeException extends \LogicException implements ExceptionInterface { }
mit
pedrogpimenta/dropmarks
app/config/routes.js
258
const React = require('react'); const Main = require('../components/Main'); const Home = require('../components/Home'); const Router = require('react-router'); const Route = Router.Route; module.exports = ( <Route path='/' component={Main}> </Route> );
mit
Icy-Dragon/QuantumSmash
Assets/Scripts/CoinDrop.cs
511
using UnityEngine; using System.Collections; public class CoinDrop : MonoBehaviour { public int value; // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Ship") { other.gameObject.SendMessage("GiveCoins", value); Destroy(gameObject); //TODO: display message of how much gold was received } } }
mit
grumpycoin/grumpycoin-v.1.2
src/qt/locale/bitcoin_zh_CN.ts
136453
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="zh_CN"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+26"/> <source>Dialog</source> <translation>对话</translation> </message> <message> <location line="+125"/> <source>Information about program</source> <translation>显示相关信息</translation> </message> <message> <location line="+91"/> <source>&lt;b&gt;GrumpyCoin&lt;/b&gt; version</source> <translation>&lt;b&gt;美卡币&lt;/b&gt;版本</translation> </message> <message> <location line="+170"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source> <translation> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</translation> </message> <message> <location line="+105"/> <source>OK</source> <translation>确定</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+21"/> <source>Copyright</source> <translation>版权</translation> </message> <message> <location line="+0"/> <source>Dr. Kimoto Chan</source> <translation>GrumpyCoin-qt 客户端开发团队</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+159"/> <location line="+137"/> <source>Address Book</source> <translation>通讯录</translation> </message> <message> <location line="+48"/> <source>Double-click to edit address or label</source> <translation>双击以编辑地址或标签</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+74"/> <source>&amp;Copy Address</source> <translation>&amp;复制地址</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+219"/> <source>Show &amp;QR Code</source> <translation>显示二维码</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+4"/> <source>Sign &amp;Message</source> <translation>对消息签名</translation> </message> <message> <location line="+1"/> <source>&amp;Verify Message</source> <translation>&amp;验证消息</translation> </message> <message> <location line="+1"/> <source>&amp;Delete</source> <translation>&amp;删除</translation> </message> <message> <location line="-5"/> <source>Copy &amp;Label</source> <translation>复制 &amp;标签</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;编辑</translation> </message> <message> <location line="-10"/> <source>Adress for receiving GrumpyCoins</source> <translation>接收美卡币地址</translation> </message> <message> <location line="+272"/> <source>Export Address Book Data</source> <translation>导出通讯录数据</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>逗号分隔文件 (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>导出错误</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>无法写入文件 %1。</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+146"/> <source>Label</source> <translation>标签</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>地址</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(没有标签)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>密码对话框</translation> </message> <message> <location line="+162"/> <source>Change password</source> <translation>修改密码</translation> </message> <message> <location line="+111"/> <source>Enter passphrase</source> <translation>输入密码</translation> </message> <message> <location line="+27"/> <source>New passphrase</source> <translation>新密码</translation> </message> <message> <location line="+27"/> <source>Repeat new passphrase</source> <translation>重复新密码</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+38"/> <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>输入钱包的新密码。&lt;br/&gt;使用的密码请至少包含&lt;b&gt;10个以上随机字符&lt;/&gt;,或者是&lt;b&gt;8个以上的单词&lt;/b&gt;。</translation> </message> <message> <location line="+1"/> <location line="+1"/> <source>Encrypt wallet</source> <translation>加密钱包</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>该操作需要您首先使用密码解锁钱包。</translation> </message> <message> <location line="+6"/> <location line="+1"/> <source>Unlock wallet</source> <translation>解锁钱包</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>该操作需要您首先使用密码解密钱包。</translation> </message> <message> <location line="+6"/> <location line="+1"/> <source>Decrypt wallet</source> <translation>解密钱包</translation> </message> <message> <location line="+4"/> <location line="+1"/> <source>Change passphrase</source> <translation>修改密码</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>请输入钱包的旧密码与新密码。</translation> </message> <message> <location line="+50"/> <source>Confirm wallet encryption</source> <translation>确认加密钱包</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR GRUMPYCOINS&lt;/b&gt;!</source> <translation>警告:如果您加密了您的钱包,但是忘记了密码,你将会&lt;b&gt;丢失所有的美卡币&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>您确定需要为钱包加密吗?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>重要提示:您以前备份的钱包文件应该替换成最新生成的加密钱包文件(重新备份)。从安全性上考虑,您以前备份的未加密的钱包文件,在您使用新的加密钱包后将无效,请重新备份。</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>警告:大写锁定键处于打开状态!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>钱包已加密</translation> </message> <message> <location line="-56"/> <source>GrumpyCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your grumpycoins from being stolen by malware infecting your computer.</source> <translation>将关闭软件以完成加密过程。 请您谨记:钱包加密并不是万能的,电脑中毒,您的美卡币还是有可能丢失。</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>钱包加密失败</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>由于一个本地错误,加密钱包操作已经失败。您的钱包没有被加密。</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>密码不匹配。</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>钱包解锁失败</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>用于解密钱包的密码不正确。</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>钱包解密失败。</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>修改钱包密码成功。</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>网络警报</translation> </message> <message> <location line="+16"/> <source>Incoming News</source> <translation>流入信息</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+171"/> <source>Edit record</source> <translation>编辑记录</translation> </message> <message> <location line="+89"/> <source>&amp;Label</source> <translation>&amp;标签</translation> </message> <message> <location line="+78"/> <source>The label associated with this address book entry</source> <translation>与此地址条目关联的标签</translation> </message> <message> <location line="+14"/> <source>&amp;Address</source> <translation>&amp;地址</translation> </message> <message> <location line="+25"/> <source>Paste from clipboard</source> <translation>从剪贴板粘贴</translation> </message> <message> <location line="+24"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-122"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>该地址与地址簿中的条目已关联,无法作为发送地址编辑。</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+26"/> <location line="+1"/> <source>New receiving address</source> <translation>新接收地址</translation> </message> <message> <location line="+7"/> <location line="+1"/> <source>New sending address</source> <translation>新发送地址</translation> </message> <message> <location line="+5"/> <location line="+1"/> <source>Edit receiving address</source> <translation>编辑接收地址</translation> </message> <message> <location line="+7"/> <location line="+1"/> <source>Edit sending address</source> <translation>编辑发送地址</translation> </message> <message> <location line="+81"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>输入的地址 &quot;%1&quot; 已经存在于地址簿。</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid GrumpyCoin address.</source> <translation>您输入的 &quot;%1&quot; 不是合法的美卡币地址.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>无法解锁钱包</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>密钥创建失败.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+442"/> <location line="+12"/> <source>GrumpyCoin-Qt</source> <translation>GrumpyCoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>版本</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>使用:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>命令行选项</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>UI选项</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>设置语言, 例如 &quot;de_DE&quot; (缺省: 系统语言)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>启动时最小化 </translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>启动时显示版权页 (缺省: 1)</translation> </message> </context> <context> <name>MainWindow</name> <message> <location filename="../forms/mainwindow.ui" line="+19"/> <source>MainWindow</source> <translation>主页</translation> </message> <message> <location line="+266"/> <source>Messages from GrumpyCoin</source> <translation>美卡币信息</translation> </message> <message> <location line="+85"/> <source>GrumpyCoin</source> <translation>美卡币</translation> </message> <message> <location line="+17"/> <source>global wallet</source> <translation>钱包</translation> </message> <message> <location line="+51"/> <source>File</source> <translation>文件</translation> </message> <message> <location line="+52"/> <source>Operations</source> <translation>选项</translation> </message> <message> <location line="+52"/> <source>Settings</source> <translation>设置</translation> </message> <message> <location line="+156"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Welcome to GrumpyCoin. This is your personal account&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;欢迎来到美卡币,这是你的个人账户&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation> </message> <message> <location line="+62"/> <source>Overview</source> <translation>概况</translation> </message> <message> <location line="+110"/> <source>Mining</source> <translation>挖矿</translation> </message> <message> <location line="+53"/> <source>Send Coins</source> <translation>发送货币</translation> </message> <message> <location line="+47"/> <source>Transactions</source> <translation>交易记录</translation> </message> <message> <location line="+47"/> <source>Sign Message</source> <translation>签名消息</translation> </message> <message> <location line="+47"/> <source>Receive Coins</source> <translation>接受货币</translation> </message> <message> <location line="+47"/> <source>Address Book</source> <translation>通讯录</translation> </message> <message> <location line="+47"/> <source>Verify Message</source> <translation>验证消息</translation> </message> <message> <location line="+200"/> <source>Synchronization</source> <translation>同步</translation> </message> <message> <location line="+45"/> <source>10549874 blocks</source> <translation>10549874区块</translation> </message> </context> <context> <name>GrumpyCoinGUI</name> <message> <location filename="../grumpycoingui.cpp" line="+366"/> <location line="+753"/> <source>Sign &amp;message...</source> <translation>对&amp;消息签名...</translation> </message> <message> <location line="-487"/> <source>Synchronizing with network...</source> <translation>正在与网络同步...</translation> </message> <message> <location line="-343"/> <location line="+780"/> <source>&amp;Overview</source> <translation>&amp;概况</translation> </message> <message> <location line="-779"/> <source>Show general overview of wallet</source> <translation>显示钱包概况</translation> </message> <message> <location line="+20"/> <location line="+804"/> <source>&amp;Transactions</source> <translation>&amp;交易记录</translation> </message> <message> <location line="-803"/> <source>Browse transaction history</source> <translation>查看交易历史</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>修改存储的地址和标签列表</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>显示接收支付的地址列表</translation> </message> <message> <location line="-8"/> <source>&amp;Send coins</source> <translation>&amp;发送货币</translation> </message> <message> <location line="+7"/> <source>&amp;Receive coins</source> <translation>&amp;接受货币</translation> </message> <message> <location line="+14"/> <location line="+798"/> <source>&amp;Address Book</source> <translation>&amp;通讯录</translation> </message> <message> <location line="-778"/> <location line="+735"/> <source>E&amp;xit</source> <translation>退出</translation> </message> <message> <location line="-734"/> <source>Quit application</source> <translation>退出程序</translation> </message> <message> <location line="+7"/> <source>Show information about GrumpyCoin</source> <translation>显示美卡币的相关信息</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>关于 &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>显示Qt相关信息</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;选项...</translation> </message> <message> <location line="+9"/> <location line="+757"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;加密钱包...</translation> </message> <message> <location line="-754"/> <source>&amp;Backup Wallet...</source> <translation>&amp;备份钱包...</translation> </message> <message> <location line="+2"/> <location line="+754"/> <source>&amp;Change Passphrase...</source> <translation>&amp;修改密码...</translation> </message> <message> <location line="-747"/> <location line="+700"/> <source>&amp;Export...</source> <translation>&amp;端口:</translation> </message> <message> <location line="-699"/> <source>Export the data in the current tab to a file</source> <translation>导出当前数据到文件</translation> </message> <message> <location line="+59"/> <source>Actions toolbar</source> <translation>工具栏</translation> </message> <message> <location line="+204"/> <source>Importing blocks from disk...</source> <translation>正在从磁盘导入数据块...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>正在为数据块建立索引...</translation> </message> <message> <location line="-341"/> <source>Send coins to a GrumpyCoin address</source> <translation>向一个美卡币地址发送美卡币</translation> </message> <message> <location line="+54"/> <source>Modify configuration options for GrumpyCoin</source> <translation>设置选项</translation> </message> <message> <location line="+12"/> <source>Backup wallet to another location</source> <translation>备份钱包到其它文件夹</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>修改钱包加密口令</translation> </message> <message> <location line="+9"/> <location line="+800"/> <source>&amp;Debug window</source> <translation>&amp;调试窗口</translation> </message> <message> <location line="-799"/> <source>Open debugging and diagnostic console</source> <translation>在诊断控制台调试</translation> </message> <message> <location line="-7"/> <location line="+752"/> <source>&amp;Verify message...</source> <translation>&amp;验证消息...</translation> </message> <message> <location line="-1014"/> <location line="+6"/> <location line="+619"/> <source>GrumpyCoin</source> <translation>美卡币</translation> </message> <message> <location line="-625"/> <location line="+6"/> <source>Wallet</source> <translation>钱包</translation> </message> <message> <location line="+230"/> <location line="+2"/> <location line="+831"/> <source>&amp;About GrumpyCoin</source> <translation>&amp;关于美卡币</translation> </message> <message> <location line="-821"/> <location line="+2"/> <source>&amp;Show / Hide</source> <translation>&amp;显示 / 隐藏</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>显示或隐藏主窗口</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>对钱包中的私钥加密</translation> </message> <message> <location line="+7"/> <source>Sign messages with your GrumpyCoin addresses to prove you own them</source> <translation>用美卡币地址关联的私钥为消息签名,以证明您拥有这个美卡币地址</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified GrumpyCoin addresses</source> <translation>校验消息,确保该消息是由指定的美卡币地址所有者签名的</translation> </message> <message> <location line="+31"/> <source>&amp;File</source> <translation>&amp;文件</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;设置</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;帮助</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>分页工具栏</translation> </message> <message> <location line="-311"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+385"/> <source>GrumpyCoin client</source> <translation>美卡币客户端</translation> </message> <message numerus="yes"> <location line="+109"/> <source>%n active connection(s) to GrumpyCoin network</source> <translation> <numerusform>到美卡币网络的连接共有%n条</numerusform> </translation> </message> <message> <location line="+57"/> <source>Processed %1 blocks of transaction history.</source> <translation>已处理 %1 个交易历史数据块。</translation> </message> <message> <location line="+77"/> <source>Error</source> <translation>错误</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>信息</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>该交易的字节数超标。您可以选择支付%1的交易费给处理您的交易的网络节点,有助于美卡币网络的运行。您愿意支付这笔交易费用吗?</translation> </message> <message> <location line="-121"/> <source>Up to date</source> <translation>最新状态</translation> </message> <message numerus="yes"> <location line="-47"/> <source>~%n block(s) remaining</source> <translation> <numerusform>~%n 剩余区块</numerusform> </translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n blocks</source> <translation> <numerusform>%n 区块</numerusform> </translation> </message> <message> <location line="+3"/> <source>Processed %1 of %2 blocks of transaction history (%3% done).</source> <translation>已处理 %1 之 %2 交易历史数据块 (%3% 完成).</translation> </message> <message numerus="yes"> <location line="+22"/> <source>%n second(s) ago</source> <translation> <numerusform>%n 秒之前</numerusform> </translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s) ago</source> <translation> <numerusform>%n 分钟之前</numerusform> </translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation> <numerusform>%n 小时之前</numerusform> </translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation> <numerusform>%n 天之前</numerusform> </translation> </message> <message> <location line="+13"/> <source>Catching up...</source> <translation>更新中...</translation> </message> <message> <location line="+16"/> <source>Last received block was generated %1.</source> <translation>产出最后接收区块 %1.</translation> </message> <message> <location line="+102"/> <source>Confirm transaction fee</source> <translation>确认交易费</translation> </message> <message> <location line="+38"/> <source>Sent transaction</source> <translation>已发送交易</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>流入交易</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>日期: %1 金额: %2 类别: %3 地址: %4 </translation> </message> <message> <location line="+123"/> <location line="+80"/> <source>URI handling</source> <translation>URI 处理</translation> </message> <message> <location line="-80"/> <location line="+80"/> <source>URI can not be parsed! This can be caused by an invalid GrumpyCoin address or malformed URI parameters.</source> <translation>URI无法解析!原因可能是美卡币地址不正确,或者URI参数错误。</translation> </message> <message> <location line="+8"/> <source>Service messages</source> <translation>服务器信息</translation> </message> <message> <location line="+42"/> <source>Send GrumpyCoins</source> <translation>发送货币</translation> </message> <message> <location line="+1"/> <source>Receive GrumpyCoins</source> <translation>接受货币</translation> </message> <message> <location line="+4"/> <source>Mining</source> <translation>挖矿</translation> </message> <message> <location line="+56"/> <source>Common, Network</source> <translation>普通,网络</translation> </message> <message> <location line="+38"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>钱包已被&lt;b&gt;加密&lt;/b&gt;,当前为&lt;b&gt;解锁&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>钱包已被&lt;b&gt;加密&lt;/b&gt;,当前为&lt;b&gt;锁定&lt;/b&gt;状态</translation> </message> <message> <location line="+23"/> <source>Backup Wallet</source> <translation>备份钱包</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>钱包文件(*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>备份失败</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>备份钱包到其它文件夹失败.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>备份成功</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>钱包数据成功存储到新位置</translation> </message> <message> <location filename="../grumpycoin.cpp" line="+109"/> <source>A fatal error occurred. GrumpyCoin can no longer continue safely and will quit.</source> <translation>发生严重错误。</translation> </message> </context> <context> <name>MessageBoxDialog</name> <message> <location filename="../forms/message_box_dialog.ui" line="+374"/> <source>OK</source> <translation>确定</translation> </message> <message> <location line="+82"/> <source>Yes</source> <translation>是</translation> </message> <message> <location line="+51"/> <source>No</source> <translation>否</translation> </message> <message> <location line="+76"/> <source>Don&apos;t show again</source> <translation>不再显示</translation> </message> </context> <context> <name>MiningPage</name> <message> <location filename="../forms/miningpage.ui" line="+159"/> <source>Form</source> <translation>表单</translation> </message> <message> <location line="+107"/> <source>Mining coins</source> <translation>挖币</translation> </message> <message> <location line="+378"/> <source>Stop</source> <translation>停止</translation> </message> <message> <location line="+38"/> <source>Start</source> <translation>启动</translation> </message> <message> <location filename="../miningpage.cpp" line="+66"/> <source>Mining coins started!</source> <translation>启动挖币</translation> </message> <message> <location line="+2"/> <source>Used threads %1</source> <translation>已使用线程 %1</translation> </message> <message> <location line="+3"/> <source>Mining coins stopped!</source> <translation>挖币停止</translation> </message> <message> <location line="+46"/> <source>Running mining coins...</source> <translation>挖币进行中</translation> </message> <message> <location line="+7"/> <source>Start error!</source> <translation>运行错误:</translation> </message> <message> <location line="+11"/> <source>Stop mining coins...</source> <translation>停止挖币</translation> </message> <message> <location line="+7"/> <source>Stop error!</source> <translation>错误:</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>选项</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;主要的</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>可选的交易费 每kB 有助于确保快速处理您的交易。大多数的交易 1 kB.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>支付交易 &amp;费用</translation> </message> <message> <location line="+31"/> <source>Automatically start GrumpyCoin after logging in to the system.</source> <translation>登录系统后自动开启美卡币客户端</translation> </message> <message> <location line="+3"/> <source>&amp;Start GrumpyCoin on system login</source> <translation>启动时&amp;运行</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>恢复客户端的缺省设置</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>恢复缺省设置</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;网络</translation> </message> <message> <location line="+6"/> <source>Automatically open the GrumpyCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>自动在路由器中打开美卡币端口。只有当您的路由器开启 UPnP 选项时此功能才有效。</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>使用 &amp;UPnP 映射端口</translation> </message> <message> <location line="+7"/> <source>Connect to the GrumpyCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>通过代理服务器连接美卡币网络(例如:通过Tor连接)</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;通过Socks代理连接:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>代理服务器&amp;IP:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>代理服务器IP (如 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;端口:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>代理端口(例如 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>Socks &amp;版本</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Socks代理版本 (例如 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;窗口</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>最小化窗口后仅显示托盘图标</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;最小化到托盘</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>当窗口关闭时程序最小化而不是退出。当使用该选项时,程序只能通过在菜单中选择退出来关闭</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>单击关闭按钮最小化</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;显示</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>用户界面&amp;语言:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting GrumpyCoin.</source> <translation>在这里设置用户界面的语言。设置将在客户端重启后生效。</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;美卡币金额单位:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>选择美卡币单位。</translation> </message> <message> <location line="+9"/> <source>Whether to show GrumpyCoin addresses in the transaction list or not.</source> <translation>是否需要在交易清单中显示美卡币地址。</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>在交易清单中&amp;显示美卡币地址</translation> </message> <message> <location line="+21"/> <source>Mining</source> <translation>挖矿</translation> </message> <message> <location line="+9"/> <source>&amp;Start mining GrumpyCoins on application start</source> <translation>启动时运行程序</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;确定</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;取消</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;应用</translation> </message> <message> <location filename="../optionspage.cpp" line="+56"/> <source>default</source> <translation>缺省</translation> </message> <message> <location line="+43"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Fee 0.01 recommended.</source> <translation>可选的交易费 每kB 有助于确保快速处理您的交易。建议费用0.01</translation> </message> <message> <location line="+112"/> <source>Confirm options reset</source> <translation>确认恢复缺省设置</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>某些设置选项需要重启客户端才能生效</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>您希望继续吗?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting GrumpyCoin.</source> <translation>需要重启客户端软件才能生效。</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>提供的代理服务器地址无效。</translation> </message> </context> <context> <name>OptionsPage</name> <message> <location filename="../forms/optionspage.ui" line="+159"/> <source>Form</source> <translation>表单</translation> </message> <message> <location line="+110"/> <source>Common settings, Network</source> <translation>普通设置,网络</translation> </message> <message> <location line="+103"/> <source>Common</source> <translation>普通</translation> </message> <message> <location line="+29"/> <source>Automatically start GrumpyCoin after logging in to the system.</source> <translation>登录系统后自动开启美卡币客户端</translation> </message> <message> <location line="+3"/> <source>&amp;Start GrumpyCoin on system login</source> <translation>启动时&amp;运行</translation> </message> <message> <location line="+17"/> <source>&amp;Start mining grumpycoins on start application</source> <translation>启动时运行程序</translation> </message> <message> <location line="+14"/> <source>Show only a tray icon after minimizing the window.</source> <translation>最小化窗口后仅显示托盘图标</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;最小化到托盘</translation> </message> <message> <location line="+14"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>当窗口关闭时程序最小化而不是退出。当使用该选项时,程序只能通过在菜单中选择退出来关闭</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>单击关闭按钮最小化</translation> </message> <message> <location line="+17"/> <source>&amp;Allow sounds</source> <translation>&amp;开启声音</translation> </message> <message> <location line="+20"/> <source>&amp;Check updates at startup</source> <translation>&amp;开启时检测更新</translation> </message> <message> <location line="+36"/> <source>Display</source> <translation>显示</translation> </message> <message> <location line="+60"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;美卡币金额单位:</translation> </message> <message> <location line="+18"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>选择美卡币单位。</translation> </message> <message> <location line="+45"/> <source>User Interface &amp;language:</source> <translation>用户界面&amp;语言:</translation> </message> <message> <location line="+31"/> <source>The user interface language can be set here. This setting will take effect after restarting GrumpyCoin.</source> <translation>在这里设置用户界面的语言。设置将在客户端重启后生效。</translation> </message> <message> <location line="+17"/> <source>Whether to show GrumpyCoin addresses in the transaction list or not.</source> <translation>是否需要在交易清单中显示美卡币地址。</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>在交易清单中&amp;显示美卡币地址</translation> </message> <message> <location line="+59"/> <source>Pay transaction fee</source> <translation>支付交易 费用</translation> </message> <message> <location line="+56"/> <source>Network</source> <translation>网络</translation> </message> <message> <location line="+32"/> <source>Automatically open the GrumpyCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>自动在路由器中打开美卡币端口。只有当您的路由器开启 UPnP 选项时此功能才有效。</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>使用 &amp;UPnP 映射端口</translation> </message> <message> <location line="+23"/> <source>Connect to the GrumpyCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>通过代理服务器连接美卡币网络(例如:通过Tor连接)</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;通过Socks代理连接:</translation> </message> <message> <location line="+42"/> <source>Proxy &amp;IP:</source> <translation>代理服务器&amp;IP:</translation> </message> <message> <location line="+27"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>代理服务器IP (如 127.0.0.1)</translation> </message> <message> <location line="+30"/> <source>&amp;Port:</source> <translation>&amp;端口:</translation> </message> <message> <location line="+27"/> <source>Port of the proxy (e.g. 9050)</source> <translation>代理端口(例如 9050)</translation> </message> <message> <location line="+48"/> <source>SOCKS &amp;Version:</source> <translation>Socks &amp;版本</translation> </message> <message> <location line="+33"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Socks代理版本 (例如 5)</translation> </message> <message> <location line="+128"/> <source>Reset all client options to default.</source> <translation>恢复客户端的缺省设置</translation> </message> <message> <location line="+22"/> <source>&amp;Reset Options</source> <translation>恢复缺省设置</translation> </message> <message> <location line="+51"/> <source>&amp;Apply</source> <translation>&amp;应用</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+159"/> <source>Form</source> <translation>表单</translation> </message> <message> <location line="+128"/> <source>Account status</source> <translation>账户状态</translation> </message> <message> <location line="+35"/> <location line="+46"/> <location line="+46"/> <source>0 Lrks</source> <translation>0 Mec</translation> </message> <message> <location line="+64"/> <source>Balance:</source> <translation>余额:</translation> </message> <message> <location line="+47"/> <source>Unconfirmed:</source> <translation>未确认:</translation> </message> <message> <location line="+175"/> <source>Last transactions</source> <translation>最后一次交易记录</translation> </message> <message> <location line="-128"/> <source>Immature:</source> <translation>未成熟的:</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+110"/> <source>Cannot start grumpycoin: click-to-pay handler</source> <translation>暂时无法启动美卡币:点击支付功能</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>二维码对话框</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>请求付款</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>金额:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>标签:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>消息:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;另存为</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+64"/> <source>Error encoding URI into QR Code.</source> <translation>将 URI 转换成二维码失败.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>输入的金额非法,请检查。</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>URI 太长, 请试着精简标签/消息的内容.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>保存二维码</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG图像文件(*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>客户端名称</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+365"/> <source>N/A</source> <translation>不可用</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>客户端版本</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;信息</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>使用OpenSSL版本</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>启动时间</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>网络</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>连接数</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>当前为美卡币测试网络</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>数据链</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>当前数据块数量</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>预计数据块数量</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>上一数据块时间</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;打开</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>命令行选项</translation> </message> <message> <location line="+7"/> <source>Show the GrumpyCoin-Qt help message to get a list with possible GrumpyCoin command-line options.</source> <translation>显示GrumpyCoin命令行选项帮助信息</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;显示</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;控制台</translation> </message> <message> <location line="+72"/> <source>Send network alert</source> <translation>发送网络警报</translation> </message> <message> <location line="+5"/> <source>Send news</source> <translation>发送信息</translation> </message> <message> <location line="+22"/> <source>Header</source> <translation>标题</translation> </message> <message> <location line="+33"/> <source>Tray</source> <translation>最小化窗口</translation> </message> <message> <location line="+13"/> <source>Text</source> <translation>信息</translation> </message> <message> <location line="+23"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+13"/> <source>Expires On</source> <translation>过期</translation> </message> <message> <location line="+33"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+13"/> <source>Language</source> <translation>语言</translation> </message> <message> <location line="+26"/> <source>Signature</source> <translation>签名</translation> </message> <message> <location line="+23"/> <source>Send</source> <translation>发送</translation> </message> <message> <location line="-536"/> <source>Build date</source> <translation>创建时间</translation> </message> <message> <location line="-104"/> <source>GrumpyCoin - Debug window</source> <translation>美卡币 - 调试窗口</translation> </message> <message> <location line="+25"/> <source>GrumpyCoin Core</source> <translation>美卡币核心</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>调试日志文件</translation> </message> <message> <location line="+7"/> <source>Open the GrumpyCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>打开当前目录中的调试日志文件。日志文件大的话可能要等上几秒钟。</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>清空控制台</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the GrumpyCoin RPC console.</source> <translation>欢迎来到 RPC 控制台.</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>使用上下方向键浏览历史, &lt;b&gt;Ctrl-L&lt;/b&gt;清除屏幕.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>使用 &lt;b&gt;help&lt;/b&gt; 命令显示帮助信息.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+105"/> <location filename="../sendcoinsdialog.cpp" line="+130"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>发送货币</translation> </message> <message> <location line="+278"/> <source>Remove all transaction fields</source> <translation>移除所有交易项</translation> </message> <message> <location line="+22"/> <source>Clear &amp;All</source> <translation>清除 &amp;所有</translation> </message> <message> <location line="-75"/> <source>Balance:</source> <translation>余额:</translation> </message> <message> <location line="-115"/> <source>Send GrumpyCoins</source> <translation>发送货币</translation> </message> <message> <location line="+137"/> <source>123.456 MEC</source> <translation>123.456 MEC</translation> </message> <message> <location line="+75"/> <source>Confirm the send action</source> <translation>确认并发送货币</translation> </message> <message> <location line="+22"/> <source>S&amp;end</source> <translation>发送</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-62"/> <location line="+2"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; 到 %2 (%3)</translation> </message> <message> <location line="+6"/> <source>Confirm send coins</source> <translation>确认发送货币</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>确定您要发送 %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> 和 </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>收款人地址不合法,请检查。</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>支付金额必须大于0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>金额超出您的账上余额。</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>计入 %1 交易费后的金额超出您的账上余额。</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>发现重复的地址, 每次只能对同一地址发送一次.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>错误:创建交易失败!</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>错误: 交易被拒绝. 如果您使用的是备份钱包,可能存在两个钱包不同步的情况,另一个钱包中的美卡币已经被使用,但本地的这个钱包尚没有记录。</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+116"/> <source>A&amp;mount:</source> <translation>金额</translation> </message> <message> <location line="-40"/> <source>Pay &amp;To:</source> <translation>付款&amp;给:</translation> </message> <message> <location line="+86"/> <source>The address to send the payment to (e.g. 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>付款给这个地址 (例如 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="-13"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>为这个地址输入一个标签,以便将它添加到您的地址簿</translation> </message> <message> <location line="-53"/> <source>&amp;Label:</source> <translation>&amp;标签:</translation> </message> <message> <location line="+94"/> <source>Send to multiple recipients at once</source> <translation>一次发送给多个接收者</translation> </message> <message> <location line="+92"/> <source>Choose address from address book</source> <translation>从地址簿选择地址</translation> </message> <message> <location line="-22"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-24"/> <source>Paste address from clipboard</source> <translation>从剪贴板粘贴地址</translation> </message> <message> <location line="-22"/> <location line="+92"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+22"/> <source>Remove this recipient</source> <translation>移除此接收者</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a GrumpyCoin address (e.g. 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>请输入美卡币地址 (例如: 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> </context> <context> <name>ServiceMessagesPage</name> <message> <location filename="../forms/servicemessagespage.ui" line="+159"/> <source>Form</source> <translation>表单</translation> </message> <message> <location line="+107"/> <source>Messages from GrumpyCoin</source> <translation>美卡币信息</translation> </message> <message> <location line="+60"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+20"/> <source>Message content</source> <translation>信息</translation> </message> <message> <location filename="../servicemessagespage.cpp" line="+33"/> <source>17:56, 01.03.2012</source> <translation>17:56, 01.03.2012</translation> </message> </context> <context> <name>SignMessagePage</name> <message> <location filename="../forms/signmessagepage.ui" line="+159"/> <source>Form</source> <translation>表单</translation> </message> <message> <location line="+110"/> <source>Sign Message</source> <translation>签名消息</translation> </message> <message> <location line="+73"/> <source>Signature</source> <translation>签名</translation> </message> <message> <location line="+25"/> <source>Choose an address from the address book</source> <translation>从地址簿选择地址</translation> </message> <message> <location line="+21"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+22"/> <source>Paste address from clipboard</source> <translation>从剪贴板粘贴地址</translation> </message> <message> <location line="+21"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+22"/> <source>Address</source> <translation>地址</translation> </message> <message> <location line="+24"/> <source>The address to sign the message with (e.g. 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>用于签名消息的地址(例如: 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="+22"/> <source>Text</source> <translation>信息</translation> </message> <message> <location line="+18"/> <source>Enter the message you want to sign here</source> <translation>请输入您要发送的签名消息</translation> </message> <message> <location line="+30"/> <source>Copy the current signature to the system clipboard</source> <translation>复制当前签名至剪切板</translation> </message> <message> <location line="+110"/> <source>Reset all sign message fields</source> <translation>清空所有签名消息栏</translation> </message> <message> <location line="+22"/> <source>Clear &amp;All</source> <translation>清除 &amp;所有</translation> </message> <message> <location line="+16"/> <source>Sign the message to prove you own this GrumpyCoin address</source> <translation>签名消息,证明这个地址属于您。</translation> </message> <message> <location line="+22"/> <source>Sign &amp;Message</source> <translation>对消息签名</translation> </message> <message> <location filename="../signmessagepage.cpp" line="+28"/> <source>Enter a GrumpyCoin address (e.g. 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>请输入美卡币地址 (例如: 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="+1"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>单击“签名消息“产生签名。</translation> </message> <message> <location line="+12"/> <location line="+53"/> <source>The entered address is invalid.</source> <translation>输入的地址非法。</translation> </message> <message> <location line="-53"/> <location line="+53"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>请检查地址后重试。</translation> </message> <message> <location line="+0"/> <source>The entered address does not refer to a key.</source> <translation>输入的地址没有关联的公私钥对。</translation> </message> <message> <location line="+8"/> <source>Wallet unlock was cancelled.</source> <translation>钱包解锁动作取消。</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>找不到输入地址关联的私钥。</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>消息签名失败。</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>消息已签名。</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <location filename="../signverifymessagedialog.cpp" line="+30"/> <source>Signatures - Sign / Verify a Message</source> <translation>签名 - 为消息签名/验证签名消息</translation> </message> <message> <location line="+105"/> <source>Edit record</source> <translation>编辑记录</translation> </message> <message> <location line="+49"/> <source>&amp;Sign Message</source> <translation>&amp;签名消息</translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>您可以用你的地址对消息进行签名,以证明您是该地址的所有人。注意不要对模棱两可的消息签名,以免遭受钓鱼式攻击。请确保消息内容准确的表达了您的真实意愿。</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>用于签名消息的地址(例如: 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>从地址簿选择地址</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>从剪贴板粘贴地址</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>请输入您要发送的签名消息</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>签名</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>复制当前签名至剪切板</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this GrumpyCoin address</source> <translation>签名消息,证明这个地址属于您。</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>消息签名</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>清空所有签名消息栏</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>清除 &amp;所有</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;验证消息</translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>在下面输入签名地址,消息(请确保换行符、空格符、制表符等等一个不漏)和签名以验证消息。请确保签名信息准确,提防中间人攻击。</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>用于签名消息的地址(例如: 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified GrumpyCoin address</source> <translation>验证消息,确保消息是由指定的美卡币地址签名过的。</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>验证消息签名</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>清空所有验证消息栏</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+4"/> <location line="+3"/> <source>Enter a GrumpyCoin address (e.g. 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>请输入美卡币地址 (例如: 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>单击“签名消息“产生签名。</translation> </message> <message> <location line="+3"/> <source>Enter GrumpyCoin signature</source> <translation>输入美卡币签名</translation> </message> <message> <location line="+92"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>输入的地址非法。</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>请检查地址后重试。</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>输入的地址没有关联的公私钥对。</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>钱包解锁动作取消。</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>找不到输入地址关联的私钥。</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>消息签名失败。</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>消息已签名。</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>签名无法解码。</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>请检查签名后重试。</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>签名与消息摘要不匹配。</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>消息验证失败。</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>消息验证成功。</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+24"/> <source>Dr. Kimoto Chan</source> <translation>GrumpyCoin-qt 客户端开发团队</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>至 %1 个数据块时开启</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1 / 离线</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/未确认</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 确认项</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>状态</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation> <numerusform>通过 %n 个节点广播</numerusform> </translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>源</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>生成</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>来自</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>到</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>自己的地址</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>标签</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>收入</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation> <numerusform>将在 %n 个数据块后成熟</numerusform> </translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>未被接受</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>支出</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>交易费</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>净额</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>消息</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>备注</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>交易ID</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &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>新挖出的美卡币必须等确120个确认才能使用。您生产出的数据块,将被广播到全网并添加到数据块链。如果入链失败,状态将变为“未被接受”,意味着您的数据块竞争失败,挖出的美卡币将不能使用。当某个节点先于你几秒生产出新的数据块,这种情况会偶尔发生。</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>调试信息</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>交易</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>输入</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>金额</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>正确</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>错误</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, 未被成功广播</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation> <numerusform>Open for %n more block</numerusform> </translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>未知</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+105"/> <source>Transaction details</source> <translation>交易明细</translation> </message> <message> <location line="+76"/> <source>This pane shows a detailed description of the transaction</source> <translation>当前面板显示了交易的详细信息</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+230"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>类型</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>地址</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>数量</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation> <numerusform>Open for %n more block</numerusform> </translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>至 %1 个数据块时开启</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>离线 (%1 个确认项)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>未确认 (%1 / %2 条确认信息)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>已确认 (%1 条确认信息)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation> <numerusform>挖矿收入余额将在 %n 个数据块后可用</numerusform> </translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>此数据块未被其他节点接收,并可能不被接受!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>已生成但未被接受</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>接收于</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>收款来自</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>发送到</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>付款给自己</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>挖矿所得</translation> </message> <message> <location line="+40"/> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <location line="+201"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>交易状态。 鼠标移到此区域上可显示确认消息项的数目。</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>接收美卡币的时间</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>交易类别。</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>交易目的地址。</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>从余额添加或移除的金额。</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+62"/> <location line="+17"/> <source>All</source> <translation>全部</translation> </message> <message> <location line="-16"/> <source>Today</source> <translation>今天</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>本周</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>本月</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>上月</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>今年</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>范围...</translation> </message> <message> <location line="+12"/> <source>Received with</source> <translation>接收于</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>发送到</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>到自己</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>挖矿所得</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>其他</translation> </message> <message> <location line="+9"/> <source>Enter address or label to search</source> <translation>输入地址或标签进行搜索</translation> </message> <message> <location line="+8"/> <source>Min amount</source> <translation>最小金额</translation> </message> <message> <location line="+37"/> <source>Copy address</source> <translation>复制地址</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>复制标签</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>复制金额</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>复制交易编号</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>编辑标签</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>显示交易详情</translation> </message> <message> <location line="+150"/> <source>Export Transaction Data</source> <translation>导出交易数据</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>逗号分隔文件(*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>已确认</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>类别</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>标签</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>地址</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>金额</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>导出错误</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>无法写入文件 %1。</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>范围:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>到</translation> </message> </context> <context> <name>TransactionsPage</name> <message> <location filename="../forms/transactionspage.ui" line="+159"/> <source>Form</source> <translation>表单</translation> </message> <message> <location line="+101"/> <source>Transactions</source> <translation>交易记录</translation> </message> </context> <context> <name>VerifyMessagePage</name> <message> <location filename="../forms/verifymessagepage.ui" line="+159"/> <source>Form</source> <translation>表单</translation> </message> <message> <location line="+110"/> <source>Verify Message</source> <translation>验证消息</translation> </message> <message> <location line="+93"/> <source>Signature</source> <translation>签名</translation> </message> <message> <location line="+43"/> <source>Text</source> <translation>信息</translation> </message> <message> <location line="+45"/> <source>Address</source> <translation>地址</translation> </message> <message> <location line="+24"/> <source>The address the message was signed with (e.g. 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>用于签名消息的地址(例如: 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="+22"/> <source>Choose an address from the address book</source> <translation>从地址簿选择地址</translation> </message> <message> <location line="+21"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+101"/> <source>Reset all verify message fields</source> <translation>清空所有验证消息栏</translation> </message> <message> <location line="+22"/> <source>Clear &amp;All</source> <translation>清除 &amp;所有</translation> </message> <message> <location line="+16"/> <source>Verify the message to ensure it was signed with the specified GrumpyCoin address</source> <translation>验证消息,确保消息是由指定的美卡币地址签名过的。</translation> </message> <message> <location line="+22"/> <source>Verify &amp;Message</source> <translation>验证消息签名</translation> </message> <message> <location filename="../verifymessagepage.cpp" line="+28"/> <source>Enter a GrumpyCoin address (e.g. 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>请输入美卡币地址 (例如: 7NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="+1"/> <source>Enter GrumpyCoin signature</source> <translation>输入美卡币签名</translation> </message> <message> <location line="+12"/> <location line="+45"/> <source>The entered address is invalid.</source> <translation>输入的地址非法。</translation> </message> <message> <location line="-45"/> <location line="+45"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>请检查地址后重试。</translation> </message> <message> <location line="+0"/> <source>The entered address does not refer to a key.</source> <translation>输入的地址没有关联的公私钥对。</translation> </message> <message> <location line="+11"/> <source>The signature could not be decoded.</source> <translation>签名无法解码。</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>请检查签名后重试。</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>签名与消息摘要不匹配。</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>消息验证失败。</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>消息验证成功。</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>发送美卡币</translation> </message> </context> <context> <name>grumpycoin-core</name> <message> <location filename="../grumpycoinstrings.cpp" line="+94"/> <source>GrumpyCoin version</source> <translation>美卡币版本</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>使用:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or grumpycoind</source> <translation>发送命令到服务器或者 grumpycoind </translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>列出命令 </translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>获得某条命令的帮助 </translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>选项: </translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: grumpycoin.conf)</source> <translation>指定配置文件 (默认为 grumpycoin.conf) </translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: grumpycoind.pid)</source> <translation>指定 pid 文件 (默认为 grumpycoind.pid) </translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>指定数据目录 </translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>设置数据库缓冲区大小 (缺省: 25MB)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 55904 or testnet: 45999)</source> <translation>监听端口连接 &lt;port&gt; (缺省: 55904 or testnet: 45999)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>最大连接数 &lt;n&gt; (缺省: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>连接一个节点并获取对端地址, 然后断开连接</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>指定您的公共地址</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Threshold for disconnecting misbehaving peers (缺省: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Number of seconds to keep misbehaving peers from reconnecting (缺省: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>设置RPC监听端口%u时发生错误, IPv4:%s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 55903 or testnet: 45998)</source> <translation>JSON-RPC连接监听端口&lt;port&gt; (缺省:55903 testnet:45998)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>接受命令行和 JSON-RPC 命令 </translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>在后台运行并接受命令 </translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>使用测试网络 </translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>接受来自外部的连接 (缺省: 如果不带 -proxy or -connect 参数设置为1)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=grumpycoinrpc 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;GrumpyCoin Alert&quot; [email protected] </source> <translation>%s, 您必须在配置文件设置rpcpassword: %s 建议您使用下面的随机密码: rpcuser=grumpycoinrpc rpcpassword=%s (您无需记住此密码) 用户名和密码 必! 须! 不一样。 如果配置文件不存在,请自行建立一个只有所有者拥有只读权限的文件。 推荐您开启提示通知以便收到错误通知, 像这样: alertnotify=echo %%s | mail -s &quot;GrumpyCoin Alert&quot; [email protected] </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>在IPv6模式下设置RPC监听端口 %u 失败,返回到IPv4模式: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>绑定指定的IP地址开始监听。IPv6地址请使用[host]:port 格式</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. GrumpyCoin is probably already running.</source> <translation>无法给数据目录 %s上锁。本软件可能已经在运行。</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>错误:该交易被拒绝!发生这种错误的原因可能是:钱包中的美卡币已经被用掉,有可能您复制了wallet.dat钱包文件,然后用复制的钱包文件支付了美卡币,但是这个钱包文件中没有记录。</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>错误:因为该交易的数量、复杂度或者动用了刚收到不久的资金,您需要支付不少于%s的交易费用。</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>当收到相关通知时执行命令(命令行中的 %s 的替换为消息)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>当最佳区块变化时执行命令 (命令行中的 %s 会被替换成区块哈希值)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>这是测试用的预发布版本 - 请谨慎使用 - 不要用来挖矿,或者在正式商用环境下使用</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>警告:-paytxfee 交易费设置得太高了!每笔交易都将支付交易费。</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>警告:显示的交易可能不正确!您需要升级客户端软件,或者网络上的其他节点需要升级。</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong GrumpyCoin will not work properly.</source> <translation>警告:请检查电脑的日期时间设置是否正确!时间错误可能会导致美卡币客户端运行异常。</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>警告:钱包文件wallet.dat读取失败!最重要的公钥、私钥数据都没有问题,但是交易记录或地址簿数据不正确,或者存在数据丢失。</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>警告:钱包文件wallet.dat损坏! 原始的钱包文件已经备份到%s目录下并重命名为{timestamp}.bak 。如果您的账户余额或者交易记录不正确,请使用您的钱包备份文件恢复。</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>尝试从损坏的钱包文件wallet.dat中恢复私钥</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>数据块创建选项:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>仅连接到指定节点</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>检测发现数据块数据库损坏。请使用 -reindex参数重启客户端。</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>发现自己的IP地址(缺省:不带 -externalip 参数监听时设置为1)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>你想现在就重建块数据库吗?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>初始化数据块数据库出错</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Error initializing wallet database environment %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>导入数据块数据库出错</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>导入数据块数据库出错</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>错误:磁盘剩余空间低!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>错误:钱包被锁定,无法创建交易!</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>错误:系统出错。</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>监听端口失败。请使用 -listen=0 参数。</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>无法读取数据块信息</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>读取数据块失败</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>无法同步数据块索引</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>无法写入数据块索引</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>无法写入数据块信息</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>无法写数据块</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>无法写入文件信息</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>无法写入coin数据库</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>无法写入交易索引</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>无法写入回滚信息</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>通过DNS查找节点(缺省:1 除非使用 -connect 选项)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>产出货币(默认:0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>启动时检测多少个数据块(缺省:288,0=所有)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>How thorough the block verification is (0-4, default: 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation>没有足够可用的文件描述符。</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>重新为当前的blk000??.dat文件建立索引</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>设置使用调用服务 RPC 的线程数量(默认:4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>正在验证数据库的完整性...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>正在检测钱包的完整性...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>从blk000??.dat文件导入数据块</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>设置脚本的数量核查线程 (不大于 16, 0 = 自动, &lt;0 = 许多核心自由的离开, 默认: 0)</translation> </message> <message> <location line="+77"/> <source>Information</source> <translation>信息</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>非法的 -tor 地址:&apos;%s&apos; </translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>非法金额 -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>非法金额 -mintxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>维护一份完整的交易索引(缺省:0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>每个连接的最大接收缓存,&lt;n&gt;*1000 字节(缺省:5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>每个连接的最大发送缓存,&lt;n&gt;*1000 字节(缺省:1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>仅接受符合客户端检查点设置的数据块文件</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>仅连接至指定网络的节点&lt;net&gt;(IPv4, IPv6 或者 Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>输出额外的调试信息。打开所有 -debug* 开关</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>输出额外的网络调试信息</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>为调试输出信息添加时间戳</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the GrumpyCoin Wiki for SSL setup instructions)</source> <translation>SSL选项:(参见GrumpyCoin Wiki关于SSL设置栏目)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>请选择Socks代理服务器版本 (4 或 5, 缺省: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>跟踪/调试信息输出到控制台,不输出到debug.log文件</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>跟踪/调试信息输出到 调试器debugger</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>设置最大数据块大小(缺省:250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>设置最小数据块大小(缺省:0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>客户端启动时压缩debug.log文件(缺省:no-debug模式时为1)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>交易签名失败</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>设置连接超时时间(缺省:5000毫秒)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>系统错误:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation>交易金额太少</translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>交易金额必须为正数</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>交易金额太大</translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>使用UPnp映射监听端口(缺省: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>使用UPnp映射监听端口(缺省: 监听状态设为1)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>使用代理服务器访问隐藏服务(缺省:同 -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>JSON-RPC连接用户名 </translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>警告:该软件版本已过时,请升级!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>You need to rebuild the databases using -reindex to change -txindex</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>钱包文件wallet.dat损坏,抢救备份失败</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>JSON-RPC连接密码 </translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>允许从指定IP接受到的JSON-RPC连接 </translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>向IP地址为 &lt;ip&gt; 的节点发送指令 (缺省: 127.0.0.1) </translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>当最佳数据块变化时执行命令 (命令行中的 %s 会被替换成数据块哈希值)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>将钱包升级到最新的格式</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>设置密钥池大小为 &lt;n&gt; (缺省: 100) </translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>重新扫描数据链以查找遗漏的交易 </translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>为 JSON-RPC 连接使用 OpenSSL (https)连接</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>服务器证书 (默认为 server.cert) </translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>服务器私钥 (默认为 server.pem) </translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>可接受的加密器 (默认为 TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH) </translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>该帮助信息 </translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>无法绑定本机端口 %s (返回错误消息 %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>通过 socks 代理连接</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>使用 -addnode, -seednode 和 -connect选项时允许DNS查找</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>正在加载地址...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>wallet.dat钱包文件加载错误:钱包损坏</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of GrumpyCoin</source> <translation>wallet.dat钱包文件加载错误:请升级到最新GrumpyCoin客户端</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart GrumpyCoin to complete</source> <translation>钱包文件需要重写:请退出并重新启动GrumpyCoin客户端</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>wallet.dat钱包文件加载错误</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>非法的代理地址: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>被指定的是未知网络 -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>被指定的是未知socks代理版本: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>无法解析 -bind 端口地址: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>无法解析 -externalip 地址: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>非法金额 -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>金额不对</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>金额不足</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>加载数据块索引...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>添加节点并与其保持连接</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. GrumpyCoin is probably already running.</source> <translation>无法在本机绑定 %s 端口 . 美卡币客户端软件可能已经在运行.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>每发送1KB交易所需的费用</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>正在加载钱包...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>无法降级钱包格式</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>无法写入缺省地址</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>正在重新扫描...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>加载完成</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>使用 %s 选项</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>错误</translation> </message> <message> <location line="-31"/> <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>您必须在配置文件中加入选项 rpcpassword : %s 如果配置文件不存在,请新建,并将文件权限设置为仅允许文件所有者读取.</translation> </message> </context> </TS>
mit
TeamSecret/SecretCoin
src/qt/locale/bitcoin_hr.ts
114508
<?xml version="1.0" ?><!DOCTYPE TS><TS language="hr" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About SecretCoin</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;SecretCoin&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The SecretCoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Dvostruki klik za uređivanje adrese ili oznake</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Dodajte novu adresu</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopiraj trenutno odabranu adresu u međuspremnik</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your SecretCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation>&amp;Kopirati adresu</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a SecretCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified SecretCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Brisanje</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Kopirati &amp;oznaku</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Izmjeniti</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Datoteka vrijednosti odvojenih zarezom (*. csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Oznaka</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresa</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(bez oznake)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Unesite lozinku</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nova lozinka</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Ponovite novu lozinku</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&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>Unesite novi lozinku za novčanik. &lt;br/&gt; Molimo Vas da koristite zaporku od &lt;b&gt;10 ili više slučajnih znakova,&lt;/b&gt; ili &lt;b&gt;osam ili više riječi.&lt;/b&gt;</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Šifriranje novčanika</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Ova operacija treba lozinku vašeg novčanika kako bi se novčanik otključao.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Otključaj novčanik</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Ova operacija treba lozinku vašeg novčanika kako bi se novčanik dešifrirao.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Dešifriranje novčanika.</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Promjena lozinke</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Unesite staru i novu lozinku za novčanik.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Potvrdi šifriranje novčanika</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 type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Jeste li sigurni da želite šifrirati svoj novčanik?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Upozorenje: Tipka Caps Lock je uključena!</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>Novčanik šifriran</translation> </message> <message> <location line="-58"/> <source>SecretCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Šifriranje novčanika nije uspjelo</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Šifriranje novčanika nije uspjelo zbog interne pogreške. Vaš novčanik nije šifriran.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>Priložene lozinke se ne podudaraju.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>Otključavanje novčanika nije uspjelo</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Lozinka za dešifriranje novčanika nije točna.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Dešifriranje novčanika nije uspjelo</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Lozinka novčanika je uspješno promijenjena.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+282"/> <source>Sign &amp;message...</source> <translation>&amp;Potpišite poruku...</translation> </message> <message> <location line="+251"/> <source>Synchronizing with network...</source> <translation>Usklađivanje s mrežom ...</translation> </message> <message> <location line="-319"/> <source>&amp;Overview</source> <translation>&amp;Pregled</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Prikaži opći pregled novčanika</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>Pretraži povijest transakcija</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation>&amp;Izlaz</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Izlazak iz programa</translation> </message> <message> <location line="+6"/> <source>Show information about SecretCoin</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Više 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;Postavke</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Šifriraj novčanik...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Backup novčanika...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Promijena lozinke...</translation> </message> <message numerus="yes"> <location line="+259"/> <source>~%n block(s) remaining</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation type="unfinished"/> </message> <message> <location line="-256"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Send coins to a SecretCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Modify configuration options for SecretCoin</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation>Napravite sigurnosnu kopiju novčanika na drugoj lokaciji</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Promijenite lozinku za šifriranje novčanika</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>&amp;Potvrdite poruku...</translation> </message> <message> <location line="-202"/> <source>SecretCoin</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation>Novčanik</translation> </message> <message> <location line="+180"/> <source>&amp;About SecretCoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>&amp;File</source> <translation>&amp;Datoteka</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;Konfiguracija</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>&amp;Pomoć</translation> </message> <message> <location line="+12"/> <source>Tabs toolbar</source> <translation>Traka kartica</translation> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+60"/> <source>SecretCoin client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+75"/> <source>%n active connection(s) to SecretCoin network</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+413"/> <source>Staking.&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 type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-403"/> <source>%n second(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="-312"/> <source>About SecretCoin card</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about SecretCoin card</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+297"/> <source>%n minute(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation>Ažurno</translation> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation>Ažuriranje...</translation> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Poslana transakcija</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Dolazna transakcija</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Datum:%1 Iznos:%2 Tip:%3 Adresa:%4 </translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid SecretCoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Novčanik je &lt;b&gt;šifriran&lt;/b&gt; i trenutno &lt;b&gt;otključan&lt;/b&gt;</translation> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Novčanik je &lt;b&gt;šifriran&lt;/b&gt; i trenutno &lt;b&gt;zaključan&lt;/b&gt;</translation> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. SecretCoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Iznos:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change:</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>List mode</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Iznos</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>Adresa</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Potvrđeno</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>Kopirati adresu</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopirati oznaku</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Kopiraj iznos</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+317"/> <source>highest</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium-high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>low-medium</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>low</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>lowest</source> <translation type="unfinished"/> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation>(bez oznake)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Izmjeni adresu</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 type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Adresa</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation>Nova adresa za primanje</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nova adresa za slanje</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Uredi adresu za primanje</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Uredi adresu za slanje</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Upisana adresa &quot;%1&quot; je već u adresaru.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid SecretCoin address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Ne mogu otključati novčanik.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Stvaranje novog ključa nije uspjelo.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>SecretCoin-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Postavke</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 type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Plati &amp;naknadu za transakciju</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start SecretCoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start SecretCoin on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>&amp;Mreža</translation> </message> <message> <location line="+6"/> <source>Automatically open the SecretCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapiraj port koristeći &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the SecretCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Port od proxy-a (npr. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;Verzija:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Prozor</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Prikaži samo ikonu u sistemskoj traci nakon minimiziranja prozora</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimiziraj u sistemsku traku umjesto u traku programa</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>Minimizirati umjesto izaći iz aplikacije kada je prozor zatvoren. Kada je ova opcija omogućena, aplikacija će biti zatvorena tek nakon odabira Izlaz u izborniku.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimiziraj kod zatvaranja</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 type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting SecretCoin.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Jedinica za prikazivanje iznosa:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Izaberite željeni najmanji dio bitcoina koji će biti prikazan u sučelju i koji će se koristiti za plaćanje.</translation> </message> <message> <location line="+9"/> <source>Whether to show SecretCoin addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Prikaži adrese u popisu transakcija</translation> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;U redu</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Odustani</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation>standardne vrijednosti</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting SecretCoin.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Oblik</translation> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the SecretCoin network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-160"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Wallet</source> <translation>Novčanik</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Total:</source> <translation>Ukupno:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Nedavne transakcije&lt;/b&gt;</translation> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Ime klijenta</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation>N/A</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Verzija klijenta</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informacija</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Koristim OpenSSL verziju</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation>Mreža</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Broj konekcija</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Lanac blokova</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Trenutni broj blokova</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Procjenjeni ukupni broj blokova</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Posljednje vrijeme bloka</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Otvori</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the SecretCoin-Qt help message to get a list with possible SecretCoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Konzola</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>SecretCoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>SecretCoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the SecretCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Očisti konzolu</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the SecretCoin RPC console.</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Slanje novca</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>Iznos:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 hack</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>Pošalji k nekoliko primatelja odjednom</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>&amp;Dodaj primatelja</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Obriši &amp;sve</translation> </message> <message> <location line="+28"/> <source>Balance:</source> <translation>Stanje:</translation> </message> <message> <location line="+16"/> <source>123.456 hack</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Potvrdi akciju slanja</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Pošalji</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a SecretCoin address (e.g. SecretCoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopiraj iznos</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Potvrdi slanje novca</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>Adresa primatelja je nevaljala, molimo provjerite je ponovo.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Iznos mora biti veći od 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Iznos je veći od stanja računa.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Iznos je veći od stanja računa kad se doda naknada za transakcije od %1.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Pronašli smo adresu koja se ponavlja. U svakom plaćanju program može svaku adresu koristiti samo jedanput.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid SecretCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(bez oznake)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Iznos:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>&amp;Primatelj plaćanja:</translation> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation>Unesite oznaku za ovu adresu kako bi ju dodali u vaš adresar</translation> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation>&amp;Oznaka:</translation> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. SecretCoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Zalijepi adresu iz međuspremnika</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a SecretCoin address (e.g. SecretCoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>&amp;Potpišite poruku</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>Možete potpisati poruke sa svojom adresom kako bi dokazali da ih posjedujete. Budite oprezni da ne potpisujete ništa mutno, jer bi vas phishing napadi mogli na prevaru natjerati da prepišete svoj identitet njima. Potpisujte samo detaljno objašnjene izjave sa kojima se slažete.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. SecretCoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>Zalijepi adresu iz međuspremnika</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>Upišite poruku koju želite potpisati ovdje</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this SecretCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Obriši &amp;sve</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>&amp;Potvrdite poruku</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 type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. SecretCoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified SecretCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a SecretCoin address (e.g. SecretCoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter SecretCoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Otključavanje novčanika je otkazano.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Poruka je potpisana.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation>Otvoren do %1</translation> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%1 nije dostupan</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/nepotvrđeno</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 potvrda</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></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>Generiran</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Od</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Za</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>vlastita adresa</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>Uplaćeno</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>Nije prihvaćeno</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Zaduženje</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Naknada za transakciju</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Neto iznos</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Poruka</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Komentar</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID transakcije</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 510 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &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 type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transakcija</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation>Unosi</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Iznos</translation> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation>, još nije bio uspješno emitiran</translation> </message> <message> <location line="+35"/> <source>unknown</source> <translation>nepoznato</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Detalji transakcije</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Ova panela prikazuje detaljni opis transakcije</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tip</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresa</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Iznos</translation> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation>Otvoren do %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Potvrđen (%1 potvrda)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Generirano - Upozorenje: ovaj blok nije bio primljen od strane bilo kojeg drugog noda i vjerojatno neće biti prihvaćen!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Generirano, ali nije prihvaćeno</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>Primljeno s</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Primljeno od</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Poslano za</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Plaćanje samom sebi</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Rudareno</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/d)</translation> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status transakcije</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Datum i vrijeme kad je transakcija primljena</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>Odredište transakcije</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Iznos odbijen od ili dodan k saldu.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation>Sve</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Danas</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Ovaj tjedan</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Ovaj mjesec</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Prošli mjesec</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Ove godine</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Raspon...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Primljeno s</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Poslano za</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Tebi</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Rudareno</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Ostalo</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Unesite adresu ili oznaku za pretraživanje</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Min iznos</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Kopirati adresu</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopirati oznaku</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopiraj iznos</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Izmjeniti oznaku</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Datoteka podataka odvojenih zarezima (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Potvrđeno</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tip</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Oznaka</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Adresa</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Iznos</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Raspon:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>za</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>SecretCoin version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Upotreba:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or SecretCoind</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Prikaži komande</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Potraži pomoć za komandu</translation> </message> <message> <location line="+2"/> <source>Options:</source> <translation>Postavke:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: SecretCoin.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: SecretCoind.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Odredi direktorij za datoteke</translation> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Postavi cache za bazu podataka u MB (zadano:25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 15714 or testnet: 25714)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Održavaj najviše &lt;n&gt; veza sa članovima (default: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Prag za odspajanje članova koji se čudno ponašaju (default: 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Broj sekundi koliko se članovima koji se čudno ponašaju neće dopustiti da se opet spoje (default: 86400)</translation> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 15715 or testnet: 25715)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation>Prihvati komande iz tekst moda i JSON-RPC</translation> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation>Izvršavaj u pozadini kao uslužnik i prihvaćaj komande</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Koristi test mrežu</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Upozorenje: -paytxfee je podešen na preveliki iznos. To je iznos koji ćete platiti za obradu transakcije.</translation> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong SecretCoin will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation>Opcije za kreiranje bloka:</translation> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation>Poveži se samo sa određenim nodom</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>SSL postavke: (za detalje o podešavanju SSL opcija vidi Bitcoin Wiki)</translation> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Šalji trace/debug informacije na konzolu umjesto u debug.log datoteku</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Podesite minimalnu veličinu bloka u bajtovima (default: 0)</translation> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Odredi vremenski prozor za spajanje na mrežu u milisekundama (ugrađeni izbor: 5000)</translation> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Pokušaj koristiti UPnP da otvoriš port za uslugu (default: 0)</translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Pokušaj koristiti UPnP da otvoriš port za uslugu (default: 1 when listening)</translation> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation>Korisničko ime za JSON-RPC veze</translation> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation>Lozinka za JSON-RPC veze</translation> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=SecretCoinrpc 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;SecretCoin Alert&quot; [email protected] </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Dozvoli JSON-RPC povezivanje s određene IP adrese</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Pošalji komande nodu na adresi &lt;ip&gt; (ugrađeni izbor: 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Izvršite naredbu kada se najbolji blok promjeni (%s u cmd je zamjenjen sa block hash)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>Nadogradite novčanik u posljednji format.</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Podesi memorijski prostor za ključeve na &lt;n&gt; (ugrađeni izbor: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Ponovno pretraži lanac blokova za transakcije koje nedostaju</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Koristi OpenSSL (https) za JSON-RPC povezivanje</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Uslužnikov SSL certifikat (ugrađeni izbor: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Uslužnikov privatni ključ (ugrađeni izbor: server.pem)</translation> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation>Ova poruka za pomoć</translation> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. SecretCoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>SecretCoin</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Program ne može koristiti %s na ovom računalu (bind returned error %d, %s)</translation> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Dozvoli DNS upite za dodavanje nodova i povezivanje</translation> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation>Učitavanje adresa...</translation> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Greška kod učitavanja wallet.dat: Novčanik pokvaren</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of SecretCoin</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart SecretCoin to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Greška kod učitavanja wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Nevaljala -proxy adresa: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Nevaljali iznos za opciju -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Nevaljali iznos za opciju</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Nedovoljna sredstva</translation> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation>Učitavanje indeksa blokova...</translation> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Unesite nod s kojim se želite spojiti and attempt to keep the connection open</translation> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. SecretCoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation>Učitavanje novčanika...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>Nije moguće novčanik vratiti na prijašnju verziju.</translation> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>Nije moguće upisati zadanu adresu.</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>Rescaniranje</translation> </message> <message> <location line="+5"/> <source>Done loading</source> <translation>Učitavanje gotovo</translation> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Error</source> <translation>Greška</translation> </message> <message> <location line="+6"/> <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"/> </message> </context> </TS>
mit