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
package org.vitrivr.cineast.standalone.run; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vitrivr.cineast.standalone.config.Config; import org.vitrivr.cineast.standalone.config.IngestConfig; import java.io.File; import java.io.IOException; /** * @author rgasser * @version 1.0 * @created 13.01.17 */ public class ExtractionDispatcher { private static final Logger LOGGER = LogManager.getLogger(); /** * ExtractionContextProvider used to setup the extraction. */ private IngestConfig context; /** * List of files due for extraction. */ private ExtractionContainerProvider pathProvider; /** * Reference to the thread that is being used to run the ExtractionFileHandler. */ private Thread fileHandlerThread; private ExtractionItemProcessor handler; private volatile boolean threadRunning = false; public boolean initialize(ExtractionContainerProvider pathProvider, IngestConfig context) throws IOException { File outputLocation = Config.sharedConfig().getExtractor().getOutputLocation(); if (outputLocation == null) { LOGGER.error("invalid output location specified in config"); return false; } outputLocation.mkdirs(); if (!outputLocation.canWrite()) { LOGGER.error("cannot write to specified output location: '{}'", outputLocation.getAbsolutePath()); return false; } this.pathProvider = pathProvider; this.context = context; if (this.fileHandlerThread == null) { this.handler = new GenericExtractionItemHandler(this.pathProvider, this.context, this.context.getType()); this.fileHandlerThread = new Thread((GenericExtractionItemHandler) handler); } else { LOGGER.warn("You cannot initialize the current instance of ExtractionDispatcher again!"); } return this.pathProvider.isOpen(); } /** * Starts extraction by dispatching a new ExtractionFileHandler thread. * * @throws IOException If an error occurs during pre-processing of the files. */ public synchronized void start() throws IOException { if (fileHandlerThread != null && !threadRunning) { this.fileHandlerThread.setName("extraction-file-handler-thread"); this.fileHandlerThread.start(); threadRunning = true; } else { LOGGER.warn("You cannot start the current instance of ExtractionDispatcher again!"); } } /** * Blocks until the extraction process thread is completed. */ public synchronized void block() { if (fileHandlerThread == null) { LOGGER.warn("Tried to wait for extraction thread before extraction thread was initialized!"); return; } try { fileHandlerThread.join(); } catch (InterruptedException e) { LOGGER.error("Interrupted while waiting for extraction thread to complete!"); } } public void registerListener(ExtractionCompleteListener listener) { if (this.fileHandlerThread == null) { LOGGER.error("Could not register listener, no thread available"); throw new RuntimeException(); } LOGGER.debug("Registering Listener {}", listener.getClass().getSimpleName()); handler.addExtractionCompleteListener(listener); } }
dbisUnibas/cineast
cineast-runtime/src/main/java/org/vitrivr/cineast/standalone/run/ExtractionDispatcher.java
Java
mit
3,242
// Author: Daniele Giardini - http://www.demigiant.com // Created: 2015/02/05 10:28 using DG.Tweening.Core.Enums; using UnityEngine; #pragma warning disable 1591 namespace DG.Tweening.Core { public class DOTweenSettings : ScriptableObject { public const string AssetName = "DOTweenSettings"; public bool useSafeMode = true; public float timeScale = 1; public bool useSmoothDeltaTime; public float maxSmoothUnscaledTime = 0.15f; // Used if useSmoothDeltaTime is TRUE public RewindCallbackMode rewindCallbackMode = RewindCallbackMode.FireIfPositionChanged; public bool showUnityEditorReport; public LogBehaviour logBehaviour = LogBehaviour.Default; public bool drawGizmos = true; public bool defaultRecyclable; public AutoPlay defaultAutoPlay = AutoPlay.All; public UpdateType defaultUpdateType; public bool defaultTimeScaleIndependent; public Ease defaultEaseType = Ease.OutQuad; public float defaultEaseOvershootOrAmplitude = 1.70158f; public float defaultEasePeriod = 0; public bool defaultAutoKill = true; public LoopType defaultLoopType = LoopType.Restart; // Editor-only public enum SettingsLocation { AssetsDirectory, DOTweenDirectory, DemigiantDirectory } public SettingsLocation storeSettingsLocation = SettingsLocation.AssetsDirectory; // Editor-Only ► DOTween Inspector public bool showPlayingTweens, showPausedTweens; } }
winddyhe/knight
knight-client/Packages/Knight-Lib/Knight.Framework.Tweening/Runtime/DOTween/Core/DOTweenSettings.cs
C#
mit
1,589
from . import _version __version__ = _version.__version__ import os, math, pysam from clint.textui import progress, puts_err import sqlite3 as lite import tempfile, warnings, pickle def example_reads(): """ returns the path to the example BAM file """ return os.path.join(os.path.join(os.path.dirname(__file__), "data"),"example.bam") def example_regions(): """ returns the path to the example BED file """ return os.path.join(os.path.join(os.path.dirname(__file__), "data"),"example.bed") class BAMHandler(object): """ The object that provides the interface to DNase-seq data help in a BAM file """ def __init__(self, filePath, caching=True, chunkSize=1000, ATAC=False): """Initializes the BAMHandler with a BAM file Args: filePath (str): the path of a sorted, indexed BAM file from a DNase-seq experiment Kwargs: chunkSize (int): and int of the size of the regions to load if caching (default: 1000) caching (bool): enables or disables read caching (default: True) Raises: IOError """ try: self.samfile = pysam.Samfile(filePath) except IOError: errorString = "Unable to load BAM file:{0}".format(filePath) raise IOError(errorString) #Initialise the empty DNase cut cache with the chromosome names from the BAM file self.purge_cache() #Do not change the CHUNK_SIZE after object instantiation! self.CHUNK_SIZE = chunkSize self.CACHING = caching if ATAC: self.loffset = -5 self.roffset = +4 else: self.loffset = 0 self.roffset = 0 def __addCutsToCache(self,chrom,start,end): """Loads reads from the BAM file into the cutCache. Will not check if reads are already there. Args: chrom (str): The chromosome start (int): The start of the interval end (int): The end of the interval """ for alignedread in self.samfile.fetch(chrom, max(start, 0), end): if not alignedread.is_unmapped: if alignedread.is_reverse: a = int(alignedread.reference_end) if a <= end +1: self.cutCache[chrom]["-"][a] = self.cutCache[chrom]["-"].get(a, 0) + 1 else: a = int(alignedread.reference_start) -1 if a >= start: self.cutCache[chrom]["+"][a] = self.cutCache[chrom]["+"].get(a, 0) + 1 self.lookupCache[chrom].append(start) def __lookupReadsUsingCache(self,startbp,endbp,chrom): """Looks up the DNase cut information from the cutCache and returns as a dictionary (private method) Args: startbp (int): The start of the interval endbp (int): The end of the interval chrom (str): The chromosome """ #Expand the region to the nearest CHUNK_SIZE and load these reads if they aren't in the cache lbound = int(math.floor(startbp / float(self.CHUNK_SIZE)) * float(self.CHUNK_SIZE)) ubound = int(math.ceil(endbp / float(self.CHUNK_SIZE)) * float(self.CHUNK_SIZE)) for i in range(lbound,ubound,self.CHUNK_SIZE): if i not in self.lookupCache[chrom]: self.__addCutsToCache(chrom,i,i+self.CHUNK_SIZE) #Fills in with zeroes where the hash table contains no information for each strand. fwCutArray = [self.cutCache[chrom]["+"].get(i, 0) for i in range(startbp + self.loffset ,endbp + self.loffset)] revCutArray = [self.cutCache[chrom]["-"].get(i, 0) for i in range(startbp + self.roffset, endbp + self.roffset)] return {"+":fwCutArray,"-":revCutArray} def __lookupReadsWithoutCache(self,startbp,endbp,chrom): """Loads reads from the BAM file directly from disk, ignoring the cache (private method) Args: startbp (int): The start of the interval endbp (int): The end of the interval chrom (str): The chromosome """ tempcutf = {} tempcutr = {} for alignedread in self.samfile.fetch(chrom, max(startbp, 0), endbp): if not alignedread.is_unmapped: if alignedread.is_reverse: a = int(alignedread.reference_end) if a <= endbp +1: tempcutr[a] = tempcutr.get(a, 0) + 1 else: a = int(alignedread.reference_start) - 1 if a >= startbp: tempcutf[a] = tempcutf.get(a, 0) + 1 fwCutArray = [tempcutf.get(i, 0) for i in range(startbp + self.loffset ,endbp + self.loffset)] revCutArray = [tempcutr.get(i, 0) for i in range(startbp + self.roffset, endbp + self.roffset)] return {"+":fwCutArray,"-":revCutArray} def purge_cache(self): """ Wipes the internal cache - useful if you need finer grain control over caching. """ #Initialise the empty DNase cut cache with the chromosome names from the BAM file self.cutCache = {} #This helps us differentiate between what's been looked up and when there's just no reads self.lookupCache = {} for i in self.samfile.references: self.cutCache[i] = {"+":{},"-":{}} self.lookupCache[i] = [] def get_cut_values(self,vals): """Return a dictionary with the cut counts. Can be used in two different ways: You can either use a string or a GenomicInterval to query for cuts. Returns reads dict with "+" corresponding to the +ve strand and "-" has the data with the -ve strand (rotated 180 degrees) Args: vals: either a string with the format "chr18,500:600,+" or a GenomicInterval object >>> BAMHandler(example_reads())["chr6,170863142,170863150,+"] {'+': array([ 1, 0, 0, 0, 1, 11, 1, 0]), '-': array([0, 1, 0, 0, 1, 0, 0, 1])} >>> BAMHandler(example_reads())["chr6,170863142,170863150,-"] {'+': array([1, 0, 0, 1, 0, 0, 1, 0]), '-': array([ 0, 1, 11, 1, 0, 0, 0, 1])} """ if isinstance(vals, GenomicInterval): chrom = vals.chromosome startbp = vals.startbp endbp = vals.endbp flip = vals.strand elif isinstance(vals, str): try: chrom,startbp,endbp,flip = vals.split(",") startbp = int(startbp) endbp = int(endbp) assert(flip in ["+", "-"]) except: raise ValueError("Malformed query string") else: raise TypeError("Lookup must be a string or a GenomicInterval") if self.CACHING: retval = self.__lookupReadsUsingCache(startbp,endbp,chrom) else: retval = self.__lookupReadsWithoutCache(startbp,endbp,chrom) if flip is "-": retval["+"], retval["-"] = retval["-"][::-1], retval["+"][::-1] return retval def __getitem__(self,vals): """ Wrapper for get_cut_values """ return self.get_cut_values(vals) def FOS(self,interval,bgsize=35): """Calculates the Footprint Occupancy Score (FOS) for a Genomicinterval. See Neph et al. 2012 (Nature) for full details. Args: interval (GenomicInterval): The interval that you want the FOS for Kwargs: bgsize (int): The size of the flanking region to use when calculating the FOS (default: 35) Returns: A float with the FOS - returns -1 if it can't calculate it """ cuts = self["{0},{1},{2},{3}".format(interval.chromosome,interval.startbp-bgsize,interval.endbp+bgsize,interval.strand)] forwardArray, backwardArray = cuts["+"], cuts["-"] cutArray = [forwardArray[i] + backwardArray[i] for i in range(len(forwardArray))] leftReads = float(sum(cutArray[:bgsize])) centreReads = float(sum(cutArray[bgsize:-bgsize])) rightReads = float(sum(cutArray[-bgsize:])) #Here we normalise by region length leftReads /= (bgsize * 1.0) centreReads /= (len(interval) * 1.0) rightReads /= (bgsize * 1.0) try: return ( (centreReads+1.0) / (leftReads + 1.0) ) + ( (centreReads+1.0)/(rightReads + 1.0)) except BaseException: #If it can't calculate the score, return a sentinel value return -1 class GenomicIntervalSet(object): """Container class which stores and allow manipulations of large numbers of GenomicInterval objects. Essentially a way of storing and sorting BED files. """ def __init__(self,filename = None): """ Inits GenomicIntervalSet. You can also specify a BED file path to load the intervals from Kwargs: filename (str): the path to a BED file to initialize the intervals with If no ``filename`` provided, then the set will be empty """ self.intervals = {} if filename: self.loadBEDFile(filename) def loadBEDFile(self,filename): """ Adds all the intervals in a BED file to this GenomicIntervalSet. We're quite naughty here and allow some non-standard BED formats (along with the official one): chrom chromStart chromEnd chrom chromStart chromEnd strand chrom chromStart chromEnd name score strand Any whitespace (tabs or spaces) will be considered separators, so spaces in names cause a problem! .. note:: If you don't supply a strand, we infer that it's +ve. Args: filename: the path to a BED file to load Raises: IOError """ try: BEDfile = open(filename, 'r') except IOError: errorString = "Cannot load BED file: {0}".format(filename) raise IOError(errorString) puts_err("Reading BED File...") #This is done so that if a malformed BED record is detected, no intervals are loaded. records = [] intervalCount = max(enumerate(open(filename)))[0] + 1 for _ in progress.bar(list(range(intervalCount))): line = BEDfile.readline() if line: #Skip lines in the bed files which are UCSC track metadata or comments if not self.__isBEDHeader(line): records.append(self.__parseBEDString(line)) for i in records: self.__addInterval(GenomicInterval(i[0], i[1], i[2], i[3], i[4], i[5])) BEDfile.close() def __malformedBEDline(self,BEDString): """ Raises an exception and prints the offending BED string Raises: Exception """ #TODO: Make a new exception class, something like malformedBEDException? exceptionString = "Malformed BED line: {0}".format(BEDString) raise Exception(exceptionString) def __isBEDHeader(self,string): """ Returns True/False whether a line in a bed file should be ignored according to http://genome.ucsc.edu/goldenPath/help/customTrack.html#TRACK """ if string[0] == "#": return True headers = ["name","description","type","visibility","color","itemRgb","useScore","group", "priority","db","offset","maxItems","url","htmlUrl","bigDataUrl","track","browser"] for each in headers: if string.startswith(each): return True return False def __parseBEDString(self,BEDString): """ Parses the following BED formats We're quite naughty here and allow some non-standard BED formats (along with the official one): chrom chromStart chromEnd chrom chromStart chromEnd strand chrom chromStart chromEnd name score strand Returns: (chrom,startbp,endbp,label,score,strand) Raises: Exception """ BEDSplit = BEDString.split() #Sanity check if len(BEDSplit) not in [3,4,6]: self.__malformedBEDline(BEDString) #Default if only Chrom Start End is detected try: chrom = BEDSplit[0] startbp = int(BEDSplit[1]) endbp = int(BEDSplit[2]) except: self.__malformedBEDline(BEDString) label = 0 score = 0 strand = "+" if len(BEDSplit) is 4: if BEDSplit[3] in ["+", "-"]: strand = BEDSplit[3] else: self.__malformedBEDline(BEDString) if len(BEDSplit) is 6: label = BEDSplit[3] try: score = float(BEDSplit[4]) except ValueError: self.__malformedBEDline(BEDString) if BEDSplit[5] in ["+", "-"]: strand = BEDSplit[5] else: self.__malformedBEDline(BEDString) return chrom,startbp,endbp,label,score,strand def __len__(self): """ Return the number of intervals in the set """ intervals = 0 for each in list(self.intervals.values()): intervals += len(each) return intervals def __iter__(self): """ Iterates over the intervals in the order that the intervals were generated """ for each in sorted(sum(list(self.intervals.values()),[]), key=lambda peak: peak.importorder): yield each def __getitem__(self, i): """ Indexes the intervals in the order that the intervals were generated """ return sorted(sum(list(self.intervals.values()),[]), key=lambda peak: peak.importorder)[i] def __delitem__(self,i): """ Deletes an interval from the set using the position i """ pos = self.intervals[self[i].chromosome].index(self[i]) del self.intervals[self[i].chromosome][pos] def __iadd__(self, other): """ Adds all the intervals from an other GenomicIntervalSet or GenomicInterval to this one. Args: other: either a GenomicInterval or GenomicIntervalSet to be added Raises: TypeError: A GenomicInterval or GenomicIntervalSet wasn't supplied. """ if isinstance(other,GenomicIntervalSet): for i in other: self.__addInterval(i) elif isinstance(other,GenomicInterval): self.__addInterval(other) else: raise TypeError("Can only add GenomicInterval or GenomicIntervalSet objects to existing GenomicIntervalSet") return self def __addInterval(self, other): """ Adds a GenomicInterval to the set Args: other (GenomicInterval): The GenomicInterval to be added. """ if other.chromosome not in self.intervals: self.intervals[other.chromosome] = [] self.intervals[other.chromosome].append(other) def resizeRegions(self,toSize): """ Resized all GenomicIntervals to a specific size Args: toSize: an int of the size to resize all intervals to """ if not type(toSize) == int: ValueError("Can only resize intervals to integers") for i in self: xamount = toSize-(i.endbp-i.startbp)//2 i.startbp -= xamount i.endbp += xamount if (i.endbp-i.startbp) > toSize*2: i.endbp -= 1 def __str__(self): return ''.join(str(i) +"\n" for i in self) class GenomicInterval(object): """ Basic Object which describes reads region of the genome """ #This counts how many GenomicInterval objects have been created counter = 0 def __init__(self, chrom, start, stop, label = 0,score = 0,strand="+"): """ Initialization routine Args: chrom (str): the chromosome start (int): the start of the interval stop (int): the end of the interval Kwargs: label: The name of the interval (will be given an automatic name if none entered) score (float): the score of the interval (default: 0) strand (str): the strand the interval is on (default: "+") """ self.__class__.counter += 1 self.importorder = self.__class__.counter self.chromosome = str(chrom) self.startbp = int(start) self.endbp = int(stop) self.strand = str(strand) self.score = float(score) if self.startbp > self.endbp: raise Exception("Start location of GenomicInterval is larger than end location!") # This is from reads bygone era where we ordered the intervals by import order # self.score = self.__class__.counter #This makes up reads fake name if one doesn't exist in the BED file if label: self.label = str(label) else: self.label = "Unnamed{0}".format(self.__class__.counter) #This contains anything else you want to store about the interval self.metadata = {} def __str__(self): """ BED representation of the interval """ return "{0}\t{1}\t{2}\t{3}\t{4}\t{5}".format(self.chromosome, self.startbp, self.endbp, self.label, self.score, self.strand) def __len__(self): """ Returns the length of the GenomicInterval in basepairs """ return self.endbp - self.startbp def __lt__(self, other): """ Implements foo < bar """ if self.chromosome == other.chromosome: if self.startbp < other.startbp: return True elif self.startbp == other.startbp: if self.endbp < other.endbp: return True else: return False else: return False elif self.chromosome < other.chromosome: return True else: return False def __le__(self, other): """ Implements foo <= bar """ if self.chromosome == other.chromosome: if self.startbp < other.startbp: return True elif self.startbp == other.startbp: if self.endbp <= other.endbp: return True else: return False else: return False elif self.chromosome < other.chromosome: return True else: return False def __eq__(self, other): """ Implements foo == bar """ if self.chromosome == other.chromosome and \ self.startbp == other.startbp and \ self.endbp == other.endbp: return True return False def __gt__(self, other): """ Implements foo > bar """ if self.chromosome == other.chromosome: if self.startbp > other.startbp: return True elif self.startbp == other.startbp: if self.endbp > other.endbp: return True else: return False else: return False elif self.chromosome > other.chromosome: return True else: return False def __ge__(self, other): """ Implements foo >= bar """ if self.chromosome == other.chromosome: if self.startbp > other.startbp: return True elif self.startbp == other.startbp: if self.endbp >= other.endbp: return True else: return False else: return False elif self.chromosome > other.chromosome: return True else: return False class FASTAHandler(object): def __init__(self, fasta_file, vcf_file = None): self.ffile = pysam.Fastafile(fasta_file) self.conn = None if vcf_file: self.conn = lite.connect(tempfile.NamedTemporaryFile().name) with open(vcf_file, 'r') as f: records = [(x[0],x[1],x[3],x[4]) for x in (x.split() for x in f if x[0] != "#")] with self.conn: cur = self.conn.cursor() cur.execute("CREATE TABLE SNPS(chr TEXT,pos INT, ref TEXT, mut TEXT)") cur.executemany("INSERT INTO SNPS VALUES(?,?,?,?)",records) #Manually remove these, as they potentially could be large in memory del(records) def sequence(self,interval): sequence_string = self.ffile.fetch(interval.chromosome,interval.startbp,interval.endbp).upper() if not self.conn: # if interval.strand != "+": # sequence_string = sequence_string[::-1] return str(sequence_string) else: query_string = "SELECT chr, pos - ? - 1 as offset,ref,mut FROM SNPS WHERE chr=? and pos BETWEEN ? and ?" snps = self.conn.cursor().execute(query_string,(interval.startbp,interval.chromosome,interval.startbp,interval.endbp)).fetchall() sequence_list = [i for i in sequence_string] for i in snps: if sequence_list[i[1]] != i[2]: warnings.warn("MISMATCH IN REF TO SNP - WHAT HAVE YOU DONE?") else: #str needed as sqlite returns unicode sequence_list[i[1]] = str(i[3]) return "".join(sequence_list) class BiasCalculator(object): def __init__(self,bias_file=None): if bias_file is None: #Load the genomic IMR90 bias from Shirley bias_file = open(os.path.join(os.path.join(os.path.dirname(__file__), "data"),"IMR90_6mer.pickle")) self.biasdict = pickle.load(bias_file) def bias(self,sequence): """ NOTE: Because bias is calculated from the centre of a 6-mer, the data will be missing the values for the first and last 3 bases """ #Split sequence into consituent 6-mers sequence_chunks = [sequence[i:i+6] for i in range(len(sequence)-5)] #Look up values of these 6-mers in the precomputed bias database fw_bias = [float(self.biasdict[i]["forward"])for i in sequence_chunks] rv_bias = [float(self.biasdict[i]["reverse"])for i in sequence_chunks] #FIXME: Pickled data should use "+" and "-" and not forward and reverse to prevent confusion here #FIXME: Fix the pickled data - the reverse positions are off by one! return {"+": fw_bias, "-":rv_bias} class BAMHandlerWithBias(BAMHandler): def __init__(self, sequence_object, *args, **kwargs): super(BAMHandlerWithBias, self).__init__(*args, **kwargs) self.sequence_data = sequence_object self.bias_data = BiasCalculator() def __getitem__(self,interval): if not isinstance(interval,GenomicInterval): raise TypeError("Sorry, but we only support GenomicInterval querying for the Bias Handler at the moment") #Note: This is pretty Hacky! interval.startbp -= 3 interval.endbp += 3 #Get the sequence data bias_values = self.bias_data.bias(self.sequence_data.sequence(interval)) interval.startbp += 3 interval.endbp -= 3 bias_values["+"] = bias_values["+"][1:] bias_values["-"] = bias_values["-"][:-1] cuts = self.get_cut_values(interval) #Nomenclature used below is that in the He. et al Nature Methods Paper #These are N_i^s - note we are using an entire hypersensitive site, and not 50bp like the paper N_i = {"+":sum(cuts["+"]) ,"-":sum(cuts["-"])} #bias_values are y_i for dir in ("-","+"): bias_values[dir] = [float(i)/sum(bias_values[dir]) for i in bias_values[dir]] #Stupid pass-by-reference predicted_cuts = {"+":cuts["+"][:],"-":cuts["-"][:]} #Calculate the predicted counts (nhat_i, which is N_i * y_i) based on n-mer cutting preference for dir in ("-","+"): #For each base for num, val in enumerate(predicted_cuts[dir]): #Multiply the total number of observed cuts by the bias value predicted_cuts[dir][num] = bias_values[dir][num] * N_i[dir] #Now we normalised the observed cuts by the expected for dir in ("-","+"): #For each base for num, val in enumerate(predicted_cuts[dir]): #Divide the number of observed cuts by the bias value pass #predicted_cuts[dir][num] = (cuts[dir][num] + 1.0) / (val + 1.0) if interval.strand == "-": # That's numberwang, let's rotate the board! predicted_cuts["+"], predicted_cuts["-"] = predicted_cuts["-"][::-1], predicted_cuts["+"][::-1] return predicted_cuts
jpiper/pyDNase
pyDNase/__init__.py
Python
mit
25,452
<?php namespace test\TaskBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} */ class Configuration implements ConfigurationInterface { /** * {@inheritDoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('test_task'); // Here you should define the parameters that are allowed to // configure your bundle. See the documentation linked above for // more information on that topic. return $treeBuilder; } }
masudiiuc/SymHelloWorld
src/test/TaskBundle/DependencyInjection/Configuration.php
PHP
mit
873
# Copyright (c) 2012 Bingoentreprenøren AS # Copyright (c) 2012 Patrick Hanevold # # 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. module Crayfish VERSION = "0.2.8" end
patrickhno/crayfish
lib/crayfish/version.rb
Ruby
mit
1,182
import Immutable from 'immutable'; import uuid from './uuid'; export default function (suffix) { return Immutable.fromJS([ { _id: uuid(), label: 'Startpage', children: [] }, { _id: uuid(), label: `Page 1 (${suffix})`, children: [ { _id: uuid(), label: `Page 1a (${suffix})`, children: [] }, { _id: uuid(), label: `Page 1b (${suffix})`, children: [] } ] }, { _id: uuid(), label: `Page 2 (${suffix})`, children: [] } ]); }
choffmeister/react-nestedlist
public/data.js
JavaScript
mit
602
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("08. DigitAsWord")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("08. DigitAsWord")] [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("2403bd0f-bf18-4753-8f3a-9d56587d0659")] // 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")]
HMNikolova/Telerik_Academy
CSharpPartOne/5. ConditionalStatements/08. DigitAsWord/Properties/AssemblyInfo.cs
C#
mit
1,406
# By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. # What is the 10 001st prime number? import math from Utilities import Primes from Problem import Problem class N10001stPrime(Problem): def __init__(self): self.answer = 104743 def do(self): return Primes.primes_up_to_n(self.find_upper_bound(10001))[10001 - 1] # Lower bound on the number of primes below x # there is at least : x/log(x) * (1 + 1 / log(x)) primes below x # (https://en.wikipedia.org/wiki/Prime_number_theorem#Bounds_on_the_prime-counting_function) def prime_count(self, x): return (x / math.log(x)) * (1 + (1 / math.log(x))) # finds an upper bound on the number of numbers we need to find n primes def find_upper_bound(self, n): inc = 1000 num = inc while self.prime_count(num) <= n: num += inc return num
hperreault/ProjectEuler
007_N10001stPrime.py
Python
mit
932
#ignore this file
Fire-Hound/Linear-Regression-APK
ignore.py
Python
mit
18
var async = require('async'); var mongoose = require('mongoose'); // Denormalize values from foreign refs into local model var denormalizeFrom = function(schema, from) { return function(next) { var self = this; var funcs = []; for (var key in from) { var items = from[key]; var model = mongoose.model(schema.path(key).options.ref); funcs.push(function(callback) { model.findOne({ _id: self[key] }, function(err, instance) { if (err) return callback(err); items.forEach(function(item) { self[item.key] = instance[item.field]; }); callback(); }); }); } async.parallel(funcs, function(err) { if (err) return next(err); next(); }); }; }; // Denormalize values from local model into foreign refs var denormalizeTo = function(to) { return function(next) { var self = this; var funcs = []; for (var name in to) { for (var ref in to[name]) { var items = to[name][ref]; var model = mongoose.model(name); funcs.push(function(callback) { var query = {}; var update = {}; query[ref] = self._id; items.forEach(function(item) { update[item.key] = self[item.field]; }); model.update(query, update, { multi: true }, callback); }); } } async.parallel(funcs, function(err) { if (err) return next(err); next(); }); }; }; module.exports = function(schema, fields) { // Fields that will be saved to foreign models // when this schema's model is saved. var from = {}; // Fields that will be saved in this schema's model // when the foreign model is saved. var to = {}; // Collect fields by "direction" for (var field in fields) { var options = fields[field]; if (options.from) { // Ensure the `from` field is a ref if (schema.path(options.from).options.ref === undefined) { throw new Error('Must denomalize from a `ref` field'); } // Defaults options.key || (options.key = options.from + '_' + field); options.type || (options.type = String); // Add key to schema in which to denormalize the foreign data var item = {}; item[options.key] = { type: options.type }; schema.add(item); from[options.from] || (from[options.from] = []); from[options.from].push({ field: field, key: options.key, type: options.type }); } else if (options.to) { options.key || (options.key = options.ref + '_' + field); to[options.to] || (to[options.to] = {}); to[options.to][options.ref] || (to[options.to][options.ref] = []); to[options.to][options.ref].push({ field: field, key: options.key }); } else { throw new Error('Must specify a direction'); } } // Pre-save hooks to perform the denormalization schema.pre('save', denormalizeFrom(schema, from)); schema.pre('save', denormalizeTo(to)); };
scttnlsn/mongoose-denormalize
lib/index.js
JavaScript
mit
3,736
<?php use Illuminate\Database\Seeder; class CategoriesTableSeeder extends Seeder { /** * Auto generated seed file * * @return void */ public function run() { \DB::table('categories')->delete(); \DB::table('categories')->insert(array ( 0 => array ( 'id' => 15, 'parent_id' => NULL, 'lft' => 1, 'rgt' => 6, 'depth' => 0, 'name' => 'PlayStation 4', 'slug' => 'playstation-4', 'created_at' => '2015-06-13 16:39:27', 'updated_at' => '2015-06-14 15:00:36', ), 1 => array ( 'id' => 16, 'parent_id' => NULL, 'lft' => 7, 'rgt' => 10, 'depth' => 0, 'name' => 'Xbox One', 'slug' => 'xbox-one', 'created_at' => '2015-06-13 16:40:50', 'updated_at' => '2015-06-14 15:00:36', ), 2 => array ( 'id' => 17, 'parent_id' => NULL, 'lft' => 11, 'rgt' => 14, 'depth' => 0, 'name' => 'Wii U', 'slug' => 'wii-u', 'created_at' => '2015-06-13 16:43:00', 'updated_at' => '2015-06-14 15:00:36', ), 3 => array ( 'id' => 18, 'parent_id' => NULL, 'lft' => 15, 'rgt' => 16, 'depth' => 0, 'name' => 'Wii', 'slug' => 'wii', 'created_at' => '2015-06-13 16:44:16', 'updated_at' => '2015-06-14 15:00:36', ), 4 => array ( 'id' => 19, 'parent_id' => NULL, 'lft' => 19, 'rgt' => 20, 'depth' => 0, 'name' => 'PC', 'slug' => 'pc', 'created_at' => '2015-06-13 16:45:26', 'updated_at' => '2015-06-14 15:00:36', ), 5 => array ( 'id' => 20, 'parent_id' => NULL, 'lft' => 17, 'rgt' => 18, 'depth' => 0, 'name' => 'PlayStation 3', 'slug' => 'playstation-3', 'created_at' => '2015-06-13 16:46:28', 'updated_at' => '2015-06-14 15:00:36', ), 6 => array ( 'id' => 23, 'parent_id' => 15, 'lft' => 2, 'rgt' => 3, 'depth' => 1, 'name' => 'Games', 'slug' => 'ps4-games', 'created_at' => '2015-06-13 17:01:16', 'updated_at' => '2015-06-13 17:01:52', ), 7 => array ( 'id' => 25, 'parent_id' => 16, 'lft' => 8, 'rgt' => 9, 'depth' => 1, 'name' => 'Games', 'slug' => 'xbox-one-games', 'created_at' => '2015-06-13 17:02:20', 'updated_at' => '2015-06-14 15:00:36', ), 8 => array ( 'id' => 26, 'parent_id' => 17, 'lft' => 12, 'rgt' => 13, 'depth' => 1, 'name' => 'Games', 'slug' => 'wii-u-games', 'created_at' => '2015-06-13 17:02:33', 'updated_at' => '2015-06-14 15:00:36', ), 9 => array ( 'id' => 27, 'parent_id' => 15, 'lft' => 4, 'rgt' => 5, 'depth' => 1, 'name' => 'Consoles', 'slug' => 'ps4-consoles', 'created_at' => '2015-06-13 21:52:12', 'updated_at' => '2015-06-14 15:00:36', ), )); } }
IvanBernatovic/gameshop
database/seeds/CategoriesTableSeeder.php
PHP
mit
2,824
const express = require('express'); const config = require('./config/config'); const glob = require('glob'); const mongoose = require('mongoose'); mongoose.connect(config.db); const db = mongoose.connection; db.on('error', function () { throw new Error('unable to connect to database at ' + config.db); }); const models = glob.sync(config.root + '/app/models/*.js'); models.forEach(function (model) { require(model); }); const app = express(); require('./config/express')(app, config); require('./config/helpers')(app, config); module.exports = app; module.exports.closeDatabase = function () { mongoose.connection.close(); };
weld-io/bug-hunter-game
app/app.js
JavaScript
mit
634
import unittest from functools import partialmethod from muk.sexp import * class sexp_tests(unittest.TestCase): def test_null_list(self): self.isomorphism(l=[], c=[]) def test_singleton_proper_list_to_cons(self): self.isomorphism(l=[1], c=cons(1, [])) def test_plain_proper_list_to_cons(self): self.isomorphism(l=[1,2,3], c=cons(1, cons(2, cons(3, [])))) def test_plain_improper_list_to_cons(self): self.isomorphism(l=(1,2,3), c=cons(1, cons(2, 3))) def test_nested_improper_list_to_cons(self): self.isomorphism(l=(1,[2,3], 4), c=cons(1, cons(cons(2, cons(3, [])), 4))) def test_more_nested_improper_list_to_cons(self): self.isomorphism(l=([3],(4,5), 6), c=cons(cons(3, []), cons(cons(4, 5), 6))) def test_shadow_proper_list_using_improper_list_notation(self): # pay attention, this is not an isomorphism, the next test shows the # natural way of writing, without shadowing. The broken direction is # represented by function `cons_to_list` which doesn't shadow objs it # produces. self.assertEqual(list_to_cons(([3],(4,5), [6])), cons(cons(3, []), cons(cons(4, 5), cons(6, [])))) def test_more_nested_improper_lists_into_proper_list_to_cons(self): self.isomorphism(l=[[3],(4,5), 6], c=cons(cons(3, []), cons(cons(4, 5), cons(6, [])))) def test_invalid_improper_list(self): with self.assertRaises(ImproperListError): list_to_cons(l=(3,)) def test_invalid_improper_cons(self): with self.assertRaises(ImproperListError): cons_to_list(c=cons(3, ())) def isomorphism(self, l, c): self.assertEqual(c, list_to_cons(l)) self.assertEqual(l, cons_to_list(c)) def test_tuple_wrapping_and_ctor_call(self): class A(tuple): __int__ = partialmethod(sum) a = (1,2,3,4) # vanilla tuple obj self.assertEqual(tuple, type(a)) self.assertEqual(A, type(A(a))) self.assertEqual(10, int(A(a)))
massimo-nocentini/on-python
microkanren/sexp_test.py
Python
mit
2,061
require File.dirname(__FILE__) + '/../test_helper' class OptionsValidatorTest < ActiveSupport::TestCase test "tiny mce should load the valid options on init" do assert_not_nil TinyMCE::OptionValidator.options end test "tiny mce should allow a certain number of options" do assert_equal 154, TinyMCE::OptionValidator.options.size end test "the valid method accepts valid options as strings or symbols" do assert TinyMCE::OptionValidator.valid?('mode') assert TinyMCE::OptionValidator.valid?('plugins') assert TinyMCE::OptionValidator.valid?('theme') assert TinyMCE::OptionValidator.valid?(:mode) assert TinyMCE::OptionValidator.valid?(:plugins) assert TinyMCE::OptionValidator.valid?(:theme) end test "the valid method detects invalid options as strings or symbols" do assert !TinyMCE::OptionValidator.valid?('a_fake_option') assert !TinyMCE::OptionValidator.valid?(:wrong_again) end test "plugins can be set in the options validator and be valid" do TinyMCE::OptionValidator.plugins = Array.new assert !TinyMCE::OptionValidator.valid?('paste_auto_cleanup_on_paste') TinyMCE::OptionValidator.plugins = %w{paste} assert TinyMCE::OptionValidator.valid?('paste_auto_cleanup_on_paste') end test "plugins can be added at a later stage in the script" do TinyMCE::OptionValidator.plugins = %w{paste} assert TinyMCE::OptionValidator.valid?('paste_auto_cleanup_on_paste') TinyMCE::OptionValidator.plugins += %w{fullscreen} assert ['paste', 'fullscreen'], TinyMCE::OptionValidator.plugins assert TinyMCE::OptionValidator.valid?('fullscreen_overflow') end test "advanced theme container options get through based on regex" do assert TinyMCE::OptionValidator.valid?('theme_advanced_container_content1') assert TinyMCE::OptionValidator.valid?('theme_advanced_container_content1_align') assert TinyMCE::OptionValidator.valid?('theme_advanced_container_content1_class') assert !TinyMCE::OptionValidator.valid?('theme_advanced_container_[content]') assert !TinyMCE::OptionValidator.valid?('theme_advanced_container_[content]_align') assert !TinyMCE::OptionValidator.valid?('theme_advanced_container_[content]_class') end end
gordonbisnor/Wilderness
install-with-rake/vendor/plugins/tiny_mce/test/unit/options_validator_test.rb
Ruby
mit
2,245
<?php namespace ERP\CRMBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use ERP\CRMBundle\Entity\CrmActividad; use ERP\CRMBundle\Entity\CrmCuenta; use ERP\CRMBundle\Entity\CrmAsignacionActividad; use ERP\CRMBundle\Form\CrmActividadType; /** * CrmActividad controller. * * @Route("/admin/calls") */ class CrmLlamadasController extends Controller { /** * Lists all CrmActividad entities. * * @Route("/", name="admin_calls_index") * @Method("GET") */ public function indexAction() { try{ $em = $this->getDoctrine()->getManager(); // $crmCuentas = $em->getRepository('ERPCRMBundle:CrmCuenta')->findAll(); $response = new JsonResponse(); //Persona-usuarios $personas = $em->getRepository('ERPCRMBundle:CtlUsuario')->findBy(array('estado' => 1)); //Estado $estados = $em->getRepository('ERPCRMBundle:CrmEstadoActividad')->findAll(); //Tipo recordatorio $recordatorios = $em->getRepository('ERPCRMBundle:CtlTipoRecordatorio')->findAll(); //Tipo recordatorio $tiempos = $em->getRepository('ERPCRMBundle:CtlTiempoNotificacion')->findBy(array('estado' => 1), array('tiempoReal' => 'ASC')); //Prioridad $prioridad = $em->getRepository('ERPCRMBundle:CtlPrioridad')->findBy(array('estado' => 1)); //Actividades $actividades = $em->getRepository('ERPCRMBundle:CrmTipoActividad')->findBy(array('estado' => 1)); // //$personas = $em->getRepository('ERPCRMBundle:CtlTipoEntidad')->findBy(array('estado'=>1)); // $personas = $em->getRepository('ERPCRMBundle:CtlTipoEntidad')->findAll(); // //Tipo industria // $industrias = $em->getRepository('ERPCRMBundle:CtlIndustria')->findAll(array('estado'=>1)); // //Tipos telefono // $tiposTelefono = $em->getRepository('ERPCRMBundle:CtlTipoTelefono')->findAll(); return $this->render('crmactividad/index_calls.html.twig', array( // 'crmCuentas' => $crmCuentas, 'personas'=>$personas, 'estados'=>$estados, 'recordatorios'=>$recordatorios, 'tiempos'=>$tiempos, 'prioridad'=>$prioridad, 'actividades'=>$actividades, 'menuCallsA'=>true, // 'personas'=>$personas, // 'industrias'=>$industrias, // 'tiposTelefono'=>$tiposTelefono, // 'menuProveedorA' => true, )); } catch (\Exception $e) { if(method_exists($e,'getErrorCode')){ switch (intval($e->getErrorCode())) { case 2003: $serverOffline = $this->getParameter('app.serverOffline'); $data['error'] = $serverOffline.'. CODE: '.$e->getErrorCode(); break; default : $data['error'] = $serverOffline.'. CODE: '.$e->getErrorCode(); $row['data'][0]['name'] = $e->getMessage(); break; } } else{ $data['error']=$e->getMessage(); } $response->setData($data); return $response; } } /////Actividades calls /** * List level of activities * * @Route("/activities-calls/data/list", name="admin_activities_calls_data", options={"expose"=true})) */ public function dataactivitiesAction(Request $request) { try { $timeZone = $this->get('time_zone')->getTimeZone(); date_default_timezone_set($timeZone->getNombre()); $start = $request->query->get('start'); $draw = $request->query->get('draw'); $longitud = $request->query->get('length'); $busqueda = $request->query->get('search'); $em = $this->getDoctrine()->getEntityManager(); $sql = "SELECT obj.id as id FROM ERPCRMBundle:CrmActividad obj " ."JOIN obj.tipoActividad tact WHERE tact.id=2"; $rowsTotal = $em->createQuery($sql) ->getResult(); $row['draw']=$draw++; $row['recordsTotal'] = count($rowsTotal); $row['recordsFiltered']= count($rowsTotal); $row['data']= array(); $arrayFiltro = explode(' ',$busqueda['value']); $orderParam = $request->query->get('order'); $orderBy = $orderParam[0]['column']; $orderDir = $orderParam[0]['dir']; $orderByText=""; switch(intval($orderBy)){ case 1: $orderByText = "dateStart"; break; case 2: $orderByText = "name"; break; // case 2: // $orderByText = "priority"; // break; case 3: $orderByText = "responsable"; break; // case 5: // $orderByText = "dateCancel"; // break; case 4: $orderByText = "estado"; break; } // var_dump($orderByText); $busqueda['value'] = str_replace(' ', '%', $busqueda['value']); if($busqueda['value']!=''){ $sql = "SELECT CONCAT('<div id=\"',act.id,'\" style=\"text-align:left\"><input style=\"z-index:5;\" class=\"chkItem\" type=\"checkbox\"></div>') as chk, CONCAT('<div style=\"text-align:left\">',act.nombre,'</div>') as name, CONCAT('<div style=\"text-align:left\">',p.nombre,'</div>') as priority, est.nombre as estado, (SELECT CONCAT('<div style=\"text-align:left\">',per.nombre,'<br>',per.apellido,'</div>') FROM crm_asignacion_actividad asig INNER JOIN ctl_usuario user on(asig.usuario_asignado=user.id) INNER JOIN ctl_persona per on(user.persona=per.id) WHERE asig.actividad=act.id LIMIT 0,1 ) as responsable,CONCAT('<div style=\"text-align:left\">',DATE_FORMAT(act.fecha_inicio, '%Y-%m-%d'),'<br>',DATE_FORMAT(act.fecha_inicio, '%H:%i'),'</div>') as 'dateStart', CONCAT('<div style=\"text-align:left\">',DATE_FORMAT(act.fecha_inicio, '%Y-%m-%d'),'<br>',DATE_FORMAT(act.fecha_fin, '%H:%i'),'</div>') as 'dateEnd',CONCAT('<div style=\"text-align:left\">',DATE_FORMAT(act.fecha_inicio, '%Y-%m-%d'),'<br>',DATE_FORMAT(act.fecha_cancelacion, '%H:%i'),'</div>') as 'dateCancel' FROM crm_actividad act INNER JOIN ctl_prioridad p on(act.prioridad = p.id) INNER JOIN crm_tipo_actividad tact on(act.tipo_actividad = tact.id) INNER JOIN crm_estado_actividad est on(act.estado_actividad = est.id) WHERE tact.id=2 GROUP BY 1 HAVING estado LIKE upper('%".$busqueda['value']."%') OR dateStart LIKE upper('%".$busqueda['value']."%') OR dateEnd LIKE upper('%".$busqueda['value']."%') OR priority LIKE upper('%".$busqueda['value']."%') OR name LIKE upper('%".$busqueda['value']."%') OR responsable LIKE upper('%".$busqueda['value']."%') ORDER BY ". $orderByText." ".$orderDir; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $row['data'] = $stmt->fetchAll(); $row['recordsFiltered']= count($row['data']); $sql = "SELECT CONCAT('<div id=\"',act.id,'\" style=\"text-align:left\"><input style=\"z-index:5;\" class=\"chkItem\" type=\"checkbox\"></div>') as chk, CONCAT('<div style=\"text-align:left\">',act.nombre,'</div>') as name, CONCAT('<div style=\"text-align:left\">',p.nombre,'</div>') as priority, est.nombre as estado, (SELECT CONCAT('<div style=\"text-align:left\">',per.nombre,'<br>',per.apellido,'</div>') FROM crm_asignacion_actividad asig INNER JOIN ctl_usuario user on(asig.usuario_asignado=user.id) INNER JOIN ctl_persona per on(user.persona=per.id) WHERE asig.actividad=act.id LIMIT 0,1 ) as responsable, CONCAT('<div style=\"text-align:left\">',DATE_FORMAT(act.fecha_inicio, '%Y-%m-%d'),'<br>',DATE_FORMAT(act.fecha_inicio, '%H:%i'),'</div>') as 'dateStart', CONCAT('<div style=\"text-align:left\">',DATE_FORMAT(act.fecha_inicio, '%Y-%m-%d'),'<br>',DATE_FORMAT(act.fecha_fin, '%H:%i'),'</div>') as 'dateEnd',CONCAT('<div style=\"text-align:left\">',DATE_FORMAT(act.fecha_inicio, '%Y-%m-%d'),'<br>',DATE_FORMAT(act.fecha_cancelacion, '%H:%i'),'</div>') as 'dateCancel' FROM crm_actividad act INNER JOIN ctl_prioridad p on(act.prioridad = p.id) INNER JOIN crm_tipo_actividad tact on(act.tipo_actividad = tact.id) INNER JOIN crm_estado_actividad est on(act.estado_actividad = est.id) WHERE tact.id=2 GROUP BY 1 HAVING estado LIKE upper('%".$busqueda['value']."%') OR dateStart LIKE upper('%".$busqueda['value']."%') OR dateEnd LIKE upper('%".$busqueda['value']."%') OR priority LIKE upper('%".$busqueda['value']."%') OR name LIKE upper('%".$busqueda['value']."%') OR responsable LIKE upper('%".$busqueda['value']."%') ORDER BY ". $orderByText." ".$orderDir." LIMIT " . $start . "," . $longitud; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $row['data'] = $stmt->fetchAll(); } else{ $sql = "SELECT CONCAT('<div id=\"',act.id,'\" style=\"text-align:left\"><input style=\"z-index:5;\" class=\"chkItem\" type=\"checkbox\"></div>') as chk, CONCAT('<div style=\"text-align:left\">',act.nombre,'</div>') as name, CONCAT('<div style=\"text-align:left\">',p.nombre,'</div>') as priority, est.nombre as estado, (SELECT CONCAT('<div style=\"text-align:left\">',per.nombre,'<br>',per.apellido,'</div>') FROM crm_asignacion_actividad asig INNER JOIN ctl_usuario user on(asig.usuario_asignado=user.id) INNER JOIN ctl_persona per on(user.persona=per.id) WHERE asig.actividad=act.id LIMIT 0,1 ) as responsable, CONCAT('<div style=\"text-align:left\">',DATE_FORMAT(act.fecha_inicio, '%Y-%m-%d'),'<br>',DATE_FORMAT(act.fecha_inicio, '%H:%i'),'</div>') as 'dateStart', CONCAT('<div style=\"text-align:left\">',DATE_FORMAT(act.fecha_inicio, '%Y-%m-%d'),'<br>',DATE_FORMAT(act.fecha_fin, '%H:%i'),'</div>') as 'dateEnd',CONCAT('<div style=\"text-align:left\">',DATE_FORMAT(act.fecha_inicio, '%Y-%m-%d'),'<br>',DATE_FORMAT(act.fecha_cancelacion, '%H:%i'),'</div>') as 'dateCancel' FROM crm_actividad act INNER JOIN ctl_prioridad p on(act.prioridad = p.id) INNER JOIN crm_tipo_actividad tact on(act.tipo_actividad = tact.id) INNER JOIN crm_estado_actividad est on(act.estado_actividad = est.id) WHERE tact.id=2 GROUP BY 1 ORDER BY ". $orderByText." ".$orderDir." LIMIT " . $start . "," . $longitud; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $row['data'] = $stmt->fetchAll(); // $row['recordsFiltered']= count($row['data']); // var_dump($row); } return new Response(json_encode($row)); } catch (\Exception $e) { // var_dump($e); if(method_exists($e,'getErrorCode')){ switch (intval($e->getErrorCode())) { case 2003: $serverOffline= $this->getParameter('app.serverOffline'); $row['data'][0]['name'] =$serverOffline.'. CODE: '.$e->getErrorCode(); break; default : $row['data'][0]['name'] = $e->getMessage(); break; } $row['data'][0]['chk'] =''; $row['recordsFiltered']= 0; } else{ $data['error']=$e->getMessage(); } return new Response(json_encode($row)); } } //////Fin de actividades /** * Save calls * * @Route("/calls/save", name="admin_calls_save_ajax", options={"expose"=true})) * @Method("POST") */ public function saveajaxAction(Request $request) { $isAjax = $this->get('Request')->isXMLhttpRequest(); if($isAjax){ try { $timeZone = $this->get('time_zone')->getTimeZone(); date_default_timezone_set($timeZone->getNombre()); $em = $this->getDoctrine()->getEntityManager(); $em->getConnection()->beginTransaction(); $response = new JsonResponse(); $imgData = $_FILES; //Captura de parametros // var_dump($_POST); date_default_timezone_set("America/Los_Angeles"); //tasks $idTasks = $_POST['id'];//id crmActividad $nombreTasks= $_POST['nombre'];//id crmActividad $estado = $_POST['estado'];//Estado tasks $descripcionTasks = $_POST['descripcion'];//descripcion $tipoTasks = $_POST['tipoActividades'];//id de las actividades para tareas/tasks if(isset($_POST['cuentaActividades'])){ $cuentaId = $_POST['cuentaActividades'];//id de las cuentas } else{ $cuentaId = 0;//id de las cuentas } $fechaInicio = $_POST['inicio'];//Inicio de actividad, fecha $fechaFin = $_POST['fin'];//Fin de actividad, fecha // var_dump($fechaInicio); // var_dump($fechaInicio); $dateInicio = new \DateTime($fechaInicio[0]); $dateFin = new \DateTime($fechaFin[0]); // var_dump($dateInicio); // var_dump($dateFin); // die(); //Se buscan foraneas de otras tablas, a partir de estos valores $responsableArray = $_POST['responsable'];//responsable $tipoRecordatorioArray = $_POST['tipoRecordatorio'];//tipoRecordatorio $tiempoRecordatorioArray = $_POST['tiempoRecordatorio'];//tiempoRecordatorio $prioridad = $_POST['prioridad'];//prioridad tasks $fechaRegistro = new \DateTime('now');//descripcion //Busqueda objetos a partir de ids $estadoObj = $em->getRepository('ERPCRMBundle:CrmEstadoActividad')->find($estado); $prioridadObj = $em->getRepository('ERPCRMBundle:CtlPrioridad')->find($prioridad); $cuentaObj = $em->getRepository('ERPCRMBundle:CrmCuenta')->find($cuentaId); // var_dump($cuentaObj); // die(); $tipoActividadObj = $em->getRepository('ERPCRMBundle:CrmTipoActividad')->find($tipoTasks);//Task o tareas // var_dump($tipoActividadObj); // die(); if($idTasks==''){ //Tabla crmActividad $crmActividadObj = new CrmActividad(); $crmActividadObj->setTipoActividad($tipoActividadObj); $crmActividadObj->setPrioridad($prioridadObj); $crmActividadObj->setEstadoActividad($estadoObj); $crmActividadObj->setSucursal(null); $crmActividadObj->setNombre($nombreTasks); $crmActividadObj->setDescripcion($descripcionTasks); $crmActividadObj->setFechaRegistro($fechaRegistro); $crmActividadObj->setFechaInicio($dateInicio); $crmActividadObj->setFechaFin($dateFin); $crmActividadObj->setFechaCancelacion(null); $crmActividadObj->setCuenta($cuentaObj); $calendarId =$serverSave = $this->getParameter('app.googlecalendar'); $superGoogle= $this->get('calendar.google')->getFirstSyncToken($calendarId); //$superGoogle= $this->get('calendar.google')->getEvents($calendarId,$superGoogle); //Persist crmActividadObj $em->persist($crmActividadObj); $em->flush(); $eventAttendee = array(); //Tabla crmAsignacionActividad foreach ($responsableArray as $key => $per) { //Tabla crmAsignacionActividad $responsableUsuarioObj = $em->getRepository('ERPCRMBundle:CtlUsuario')->find($per); $idPersona = $responsableUsuarioObj->getPersona()->getId(); $correosPersona = $em->getRepository('ERPCRMBundle:CtlCorreo')->findBy(array('persona'=>$idPersona)); if(count($correosPersona)!=0){ array_push($eventAttendee, $correosPersona[0]->getEmail()); } $crmAsignacionActividad = new CrmAsignacionActividad(); $crmAsignacionActividad->setActividad($crmActividadObj); $crmAsignacionActividad->setUsuarioAsignado($responsableUsuarioObj); $tiempoNotificacionUsuarioObj = $em->getRepository('ERPCRMBundle:CtlTiempoNotificacion')->find($tiempoRecordatorioArray[$key]); $crmAsignacionActividad->setTiempoNotificacion($tiempoNotificacionUsuarioObj); $tipoRecordatorioObj = $em->getRepository('ERPCRMBundle:CtlTipoRecordatorio')->find($tipoRecordatorioArray[$key]); $crmAsignacionActividad->setTipoRecordatorio($tipoRecordatorioObj); //Persist crmAsignacionActividad $em->persist($crmAsignacionActividad); $em->flush(); } $eventStart = $dateInicio; $eventEnd = $dateFin; // var_dump($eventStart); // var_dump($eventEnd); $eventSummary = $nombreTasks; $eventDescription = $descripcionTasks; $optionalParams = []; $superGoogle= $this->get('calendar.google')->addEvent($calendarId,$eventStart,$eventEnd,$eventSummary,$eventDescription,$eventAttendee,$optionalParams = []); $crmActividadObj->setGoogleId($superGoogle->getId()); $em->merge($crmAsignacionActividad); $em->flush(); //$superGoogle= $this->get('calendar.google')->initEventsList($this->getCalendarId()); $serverSave = $this->getParameter('app.serverMsgSave'); $data['id']=$crmActividadObj->getId(); $data['msg']=$serverSave; }//Fin de if id, inserción //else para la modificación del objeto crmCuenta(proveedores) y sus tablas dependientes else{ // var_dump($phoneTypeArray); // die(); $crmActividadObj = $em->getRepository('ERPCRMBundle:CrmActividad')->find($idTasks); // $crmActividadObjDuplicate = $em->getRepository('ERPCRMBundle:CrmActividad')->findBy(array('nombre'=>$nombreTasks)); // var_dump($crmActividadObjDuplicate); // die(); // if ($crmActividadObj[0]->getId()==$crmActividadObjDuplicate[0]->getId()) { // $crmActividadObj->setTipoActividad($tipoActividadObj); $crmActividadObj->setPrioridad($prioridadObj); $crmActividadObj->setEstadoActividad($estadoObj); $crmActividadObj->setNombre($nombreTasks); $crmActividadObj->setDescripcion($descripcionTasks); $crmActividadObj->setFechaInicio($dateInicio); $crmActividadObj->setFechaFin($dateFin); $crmActividadObj->setCuenta($cuentaObj); //Persist crmCuentaObj $em->merge($crmActividadObj); $em->flush(); //Eliminar personal asignado $crmAsignacionArrayObj = $em->getRepository('ERPCRMBundle:CrmAsignacionActividad')->findBy(array('actividad'=>$idTasks)); foreach ($crmAsignacionArrayObj as $key => $value) { $em->remove($value); $em->flush(); } $calendarId =$serverSave = $this->getParameter('app.googlecalendar'); $superGoogle= $this->get('calendar.google')->getFirstSyncToken($calendarId); $eventId = $crmActividadObj->getGoogleId(); $eventAttendee = array(); //Recuperar información del evento de google calendar, la url es necesaria para poder consultar, lleva el id del calendario, id del evento y el token de acceso // $superGoogle= $this->get('calendar.google')->getToken(); // $url = 'https://www.googleapis.com/calendar/v3/calendars/fbk7pcdkcncqo0f3ur264nimsk%40group.calendar.google.com/events/i3s7m1oim79tlacs38sodu5c6c/?access_token='.str_replace('"', '', $superGoogle); // var_dump($url); // $data = file_get_contents('https://www.googleapis.com/calendar/v3/calendars/fbk7pcdkcncqo0f3ur264nimsk%40group.calendar.google.com/events/i3s7m1oim79tlacs38sodu5c6c/?access_token='.str_replace('"', '', $superGoogle)); // var_dump( json_decode($data)); // die(); //Tabla crmAsignacionActividad foreach ($responsableArray as $key => $per) { //Tabla crmAsignacionActividad $responsableUsuarioObj = $em->getRepository('ERPCRMBundle:CtlUsuario')->find($per); $idPersona = $responsableUsuarioObj->getPersona()->getId(); $correosPersona = $em->getRepository('ERPCRMBundle:CtlCorreo')->findBy(array('persona'=>$idPersona)); if(count($correosPersona)!=0){ array_push($eventAttendee, $correosPersona[0]->getEmail()); } // var_dump($eventAttendee); $crmAsignacionActividad = new CrmAsignacionActividad(); $crmAsignacionActividad->setActividad($crmActividadObj); $crmAsignacionActividad->setUsuarioAsignado($responsableUsuarioObj); $tiempoNotificacionUsuarioObj = $em->getRepository('ERPCRMBundle:CtlTiempoNotificacion')->find($tiempoRecordatorioArray[$key]); $crmAsignacionActividad->setTiempoNotificacion($tiempoNotificacionUsuarioObj); $tipoRecordatorioObj = $em->getRepository('ERPCRMBundle:CtlTipoRecordatorio')->find($tipoRecordatorioArray[$key]); $crmAsignacionActividad->setTipoRecordatorio($tipoRecordatorioObj); //Persist crmAsignacionActividad $em->persist($crmAsignacionActividad); $em->flush(); } /////Manejo de excepciones para comprobar que el evento existe en google calendar try { //Eliminar evento en google calendar $superGoogle= $this->get('calendar.google')->deleteEvent($calendarId,$eventId); } catch (\Exception $e) { } $eventStart = $dateInicio; $eventEnd = $dateFin; // var_dump($eventStart); // var_dump($eventEnd); $eventSummary = $nombreTasks; $eventDescription = $descripcionTasks; $optionalParams = []; $superGoogle= $this->get('calendar.google')->addEvent($calendarId,$eventStart,$eventEnd,$eventSummary,$eventDescription,$eventAttendee,$optionalParams = []); $crmActividadObj->setGoogleId($superGoogle->getId()); $em->merge($crmAsignacionActividad); $em->flush(); // $serverDuplicate = $this->getParameter('app.serverDuplicateName'); // $data['error'] = $serverDuplicate."! CODE: ".$e->getErrorCode(); $serverSave = $this->getParameter('app.serverMsgSave'); $data['msg']=$serverSave; $data['id']=$idTasks; // } // else{ // $serverSave = $this->getParameter('app.serverMsgUpdate'); // $data['msg']=$serverSave; // $data['id']=$idTasks; // } } $em->getConnection()->commit(); $em->close(); $response->setData($data); } catch (\Exception $e) { $em->getConnection()->rollback(); $em->close(); // var_dump($e); if(method_exists($e,'getErrorCode')){ switch (intval($e->getErrorCode())){ case 2003: $serverOffline = $this->getParameter('app.serverOffline'); $data['error'] = $serverOffline.'. CODE: '.$e->getErrorCode(); break; case 1062: $serverDuplicate = $this->getParameter('app.serverDuplicateName'); $data['error'] = $serverDuplicate."! CODE: ".$e->getErrorCode(); break; default : $data['error'] = "Error CODE: ".$e->getMessage(); break; } } else{ $data['error']=$e->getMessage(); } $response->setData($data); } } else { $data['error']='Ajax request'; $response->setData($data); } return $response; } /** * Retrieve calls * * @Route("/calls/retrieve", name="admin_calls_retrieve_ajax", options={"expose"=true})) * @Method("POST") */ public function retrieveajaxAction(Request $request) { try { $timeZone = $this->get('time_zone')->getTimeZone(); date_default_timezone_set($timeZone->getNombre()); $idAct=$request->get("param1"); $response = new JsonResponse(); $em = $this->getDoctrine()->getManager(); $crmActividadObj = $em->getRepository('ERPCRMBundle:CrmActividad')->find($idAct); // $calendarId =$serverSave = $this->getParameter('app.googlecalendar'); // $superGoogle= $this->get('calendar.google')->getFirstSyncToken($calendarId); // var_dump($superGoogle); // $calendarId =$serverSave = $this->getParameter('app.googlecalendar'); // $superGoogle= $this->get('calendar.google')->getFirstSyncToken($calendarId); // $eventId = $crmActividadObj->getGoogleId(); // $eventAttendee = array(); // //Recuperar información del evento de google calendar, la url es necesaria para poder consultar, lleva el id del calendario, id del evento y el token de acceso // $superGoogle= $this->get('calendar.google')->getToken(); // var_dump($superGoogle); // $url = 'https://www.googleapis.com/calendar/v3/calendars/fbk7pcdkcncqo0f3ur264nimsk%40group.calendar.google.com/events/i3s7m1oim79tlacs38sodu5c6c/?access_token='.str_replace('"', '', $superGoogle); // //var_dump($url); // $data = file_get_contents('https://www.googleapis.com/calendar/v3/calendars/fbk7pcdkcncqo0f3ur264nimsk%40group.calendar.google.com/events/i3s7m1oim79tlacs38sodu5c6c/?access_token='.str_replace('"', '', $superGoogle)); // var_dump( json_decode($data)); // die(); // var_dump($ctlTelefonoObj); if(count($crmActividadObj)!=0){ //$object->setProbabilidad($); //$em->merge($object); //$em->flush(); //var_dump($crmActividadObj); // die(); $data['nombre']=$crmActividadObj->getNombre(); $data['estado']=$crmActividadObj->getEstadoActividad()->getId(); $data['descripcion']=$crmActividadObj->getDescripcion(); if ($crmActividadObj->getCuenta()!=null) { $data['cuentaNombre']=$crmActividadObj->getCuenta()->getNombre(); $data['cuentaId']=$crmActividadObj->getCuenta()->getId(); } else { $data['cuentaNombre']=0; $data['cuentaId']=0; } $fechaInicio=$crmActividadObj->getFechaInicio(); $fechaFin=$crmActividadObj->getFechaFin(); $data['fechaInicio']=$fechaInicio->format('Y/m/d H:i'); $data['fechaFin']=$fechaFin->format('Y/m/d H:i'); $data['prioridad']=$crmActividadObj->getPrioridad()->getId(); // var_dump($data); // die(); $crmAsignacionArrayObj = $em->getRepository('ERPCRMBundle:CrmAsignacionActividad')->findBy(array('actividad'=>$idAct)); // var_dump($crmAsignacionArrayObj); if(count($crmAsignacionArrayObj)!=0){ $personaArray=array(); $tipoRecordatorioArray=array(); $tiempoRecordatorioArray=array(); foreach ($crmAsignacionArrayObj as $key => $value) { array_push($personaArray, $value->getUsuarioAsignado()->getId()); array_push($tipoRecordatorioArray, $value->getTipoRecordatorio()->getId()); array_push($tiempoRecordatorioArray, $value->getTiempoNotificacion()->getId()); } // $data['addressArray']=$ctlDireccionObj[0]; $data['personaArray']=$personaArray; $data['tipoRecordatorioArray']=$tipoRecordatorioArray; $data['tiempoRecordatorioArray']=$tiempoRecordatorioArray; } else{ $data['personaArray']=[]; $data['tipoRecordatorioArray']=[]; $data['tiempoRecordatorioArray']=[]; } $data['id']=$idAct; $sql = "SELECT doc.id as id, doc.src as nombre, doc.estado FROM ERPCRMBundle:CrmDocumentoAdjuntoActividad doc" ." JOIN doc.actividad c " ." WHERE c.id=:idAct ORDER BY doc.fechaRegistro DESC"; $docs = $em->createQuery($sql) ->setParameters(array('idAct'=>$idAct)) ->getResult(); $data['docs']=$docs; } else{ $data['error']="Error"; } $response->setData($data); } catch (\Exception $e) { //var_dump($e); if(method_exists($e,'getErrorCode')){ switch (intval($e->getErrorCode())) { case 2003: $serverOffline = $this->getParameter('app.serverOffline'); $data['error'] = $serverOffline.'. CODE: '.$e->getErrorCode(); break; default : $data['error'] = "Error CODE: ".$e->getMessage(); break; } } else{ $data['error']=$e->getMessage(); } $response->setData($data); } return $response; } /** * Delete calls * * @Route("/calls/cancel", name="admin_calls_cancel_ajax", options={"expose"=true})) * @Method("POST") */ public function cancelajaxAction(Request $request) { $isAjax = $this->get('Request')->isXMLhttpRequest(); if($isAjax){ try { $timeZone = $this->get('time_zone')->getTimeZone(); date_default_timezone_set($timeZone->getNombre()); $ids=$request->get("param1"); $response = new JsonResponse(); // var_dump($ids); // die(); $em = $this->getDoctrine()->getManager(); $serverCancel = "¡"; foreach ($ids as $key => $id) { $object = $em->getRepository('ERPCRMBundle:CrmActividad')->find(intval($id)); // var_dump($id); // die(); if(count($object)!=0){ if ($object->getEstadoActividad()->getId()!=3) {//Estado cancelado, por defecto $object->setFechaCancelacion(new \DateTime('now')); $estatus = $em->getRepository('ERPCRMBundle:CrmEstadoActividad')->find(3); $object->setEstadoActividad($estatus); $em->merge($object); $em->flush(); $calendarId =$serverSave = $this->getParameter('app.googlecalendar'); $eventId = $object->getGoogleId(); $superGoogle= $this->get('calendar.google')->getFirstSyncToken($calendarId); try { $superGoogle= $this->get('calendar.google')->deleteEvent($calendarId,$eventId); } catch (\Exception $e) {/////Solo para que no estalle } $serverCancel = $this->getParameter('app.serverMsgCancel'); $data['msg']=$serverCancel; } else { $serverCancel .= $object->getNombre().", "; $data['error'] = $serverCancel; if($key==count($ids)-1) $data['error'] .= $this->getParameter('app.serverCancel'); } } else{ $data['error']="Error"; } } $response->setData($data); } catch (\Exception $e) { //var_dump($e); if(method_exists($e,'getErrorCode')){ switch (intval($e->getErrorCode())) { case 2003: $serverOffline = $this->getParameter('app.serverOffline'); $data['error'] = $serverOffline.'. CODE: '.$e->getErrorCode(); break; default : $data['error'] = $e->getMessage(); break; } } else{ $data['error']=$e->getMessage(); } $response->setData($data); } } else { $data['error']='Ajax request'; $response->setData($data); } return $response; } /** * Reprogramar eventos, guardar cambios * * @Route("/calls/rescheduled/calls/", name="admin_calls_rescheduled_ajax", options={"expose"=true})) * @Method("POST") */ public function rescheduledajaxAction(Request $request) { $isAjax = $this->get('Request')->isXMLhttpRequest(); if($isAjax){ try { $timeZone = $this->get('time_zone')->getTimeZone(); date_default_timezone_set($timeZone->getNombre()); $idActividad=$request->get("param1"); $fechaInicio=$request->get("param2"); $fechaFin=$request->get("param3"); // var_dump($idActividad); // var_dump($fechaInicio); // var_dump($fechaFin); $response = new JsonResponse(); $em = $this->getDoctrine()->getManager(); $em->getConnection()->beginTransaction(); $crmActividadObj = $em->getRepository('ERPCRMBundle:CrmActividad')->find($idActividad); $dateInicio = new \DateTime($fechaInicio); $dateFin = new \DateTime($fechaFin); $crmActividadObj->setFechaInicio($dateInicio); $crmActividadObj->setFechaFin($dateFin); $currentDate = date('Y-m-d H:i:s'); if ($fechaInicio<=$currentDate) { $serverDate = $this->getParameter('app.serverDateConflict'); $data['error']=$serverDate; //$data['title']=$crmActividadObj->getFechaInicio()->format('m/d H:i')." - ".$crmActividadObj->getFechaFin()->format('m/d H:i')." \n".$crmActividadObj->getNombre(); $data['title']=$crmActividadObj->getFechaInicio()->format('n/j G:i')."\n".$crmActividadObj->getFechaFin()->format('n/j G:i')."\n".$crmActividadObj->getNombre(); $response->setData($data); return $response; } // var_dump($currentDate); // var_dump($result); // die(); $calendarId =$serverSave = $this->getParameter('app.googlecalendar'); $superGoogle= $this->get('calendar.google')->getFirstSyncToken($calendarId); /////Manejo de excepciones para comprobar que el evento existe en google calendar try { //Eliminar evento en google calendar $eventId = $crmActividadObj->getGoogleId(); $superGoogle= $this->get('calendar.google')->deleteEvent($calendarId,$eventId); } catch (\Exception $e) { } $ids=array(); $eventAttendee = array(); $sql = "SELECT usr.id FROM ERPCRMBundle:CrmAsignacionActividad asigAct " ." JOIN asigAct.usuarioAsignado usr " ." WHERE asigAct.actividad=:id "; $row = $em->createQuery($sql) ->setParameters(array('id'=>$idActividad)) ->getResult(); foreach ($row as $key => $value) { array_push($ids, $value['id']); } //Tabla crmAsignacionActividad foreach ($ids as $key => $per) { //Tabla crmAsignacionActividad $responsableUsuarioObj = $em->getRepository('ERPCRMBundle:CtlUsuario')->find($per); $idPersona = $responsableUsuarioObj->getPersona()->getId(); $correosPersona = $em->getRepository('ERPCRMBundle:CtlCorreo')->findBy(array('persona'=>$idPersona)); if(count($correosPersona)!=0){ array_push($eventAttendee, $correosPersona[0]->getEmail()); } } $eventStart = $dateInicio; $eventEnd = $dateFin; // var_dump($eventStart); // var_dump($eventEnd); $eventSummary = $crmActividadObj->getNombre(); $eventDescription = $crmActividadObj->getDescripcion(); $optionalParams = []; $superGoogle= $this->get('calendar.google')->addEvent($calendarId,$eventStart,$eventEnd,$eventSummary,$eventDescription,$eventAttendee,$optionalParams = []); $crmActividadObj->setGoogleId($superGoogle->getId()); //Persist crmCuentaObj $em->merge($crmActividadObj); $em->flush(); $em->getConnection()->commit(); $em->close(); $serverSave = $this->getParameter('app.serverMsgSave'); $data['id']=$crmActividadObj->getId(); $data['msg']=$serverSave; //$data['title']=$crmActividadObj->getFechaInicio()->format('m/d H:i')." - ".$crmActividadObj->getFechaFin()->format('m/d H:i')." \n".$crmActividadObj->getNombre(); $data['title']=$crmActividadObj->getFechaInicio()->format('n/j G:i')."\n".$crmActividadObj->getFechaFin()->format('n/j G:i')."\n".$crmActividadObj->getNombre(); $response->setData($data); } catch (\Exception $e) { $em->getConnection()->rollback(); $em->close(); // var_dump($e); if(method_exists($e,'getErrorCode')){ switch (intval($e->getErrorCode())) { case 2003: $serverOffline = $this->getParameter('app.serverOffline'); $data['error'] = $serverOffline.'. CODE: '.$e->getErrorCode(); break; default : $data['error'] = $e->getMessage(); break; } } else{ $data['error']=$e->getMessage(); } $response->setData($data); } } else { $data['error']='Ajax request'; $response->setData($data); } return $response; } /** * Reprogramar eventos, guardar cambios * * @Route("/activities/get/info/", name="admin_get_info_activities_ajax", options={"expose"=true})) * @Method("POST") */ public function activitiesinfoAction(Request $request) { $isAjax = $this->get('Request')->isXMLhttpRequest(); if($isAjax){ try { $timeZone = $this->get('time_zone')->getTimeZone(); date_default_timezone_set($timeZone->getNombre()); $idActividad=$request->get("param1"); $response = new JsonResponse(); $em = $this->getDoctrine()->getManager(); $em->getConnection()->beginTransaction(); $crmActividadObj = $em->getRepository('ERPCRMBundle:CrmActividad')->find($idActividad); //var_dump($crmActividadObj); $currentDate = date('Y-m-d H:i:s'); $data['id']=$crmActividadObj->getId(); $data['nombre']=$crmActividadObj->getNombre(); $data['actividad']=$crmActividadObj->getTipoActividad()->getNombre(); if($crmActividadObj->getCuenta()!=null){ $data['cuenta']=$crmActividadObj->getCuenta()->getNombre(); } else{ $data['cuenta']='-'; } $data['clase']=$crmActividadObj->getTipoActividad()->getIcono(); $data['descripcion']=$crmActividadObj->getDescripcion(); $data['estado']=$crmActividadObj->getEstadoActividad()->getNombre(); $data['inicio']=$crmActividadObj->getFechaInicio()->format('Y-m-d H:i'); $data['fin']=$crmActividadObj->getFechaFin()->format('Y-m-d H:i'); $data['prioridad']=$crmActividadObj->getPrioridad()->getNombre(); $data['tipo']=$crmActividadObj->getTipoActividad()->getId(); $data['direccion']=$crmActividadObj->getDireccion(); $serverSave = $this->getParameter('app.serverMsgSave'); $data['msg']=$serverSave; //$data['title']=$crmActividadObj->getFechaInicio()->format('m/d H:i')." - ".$crmActividadObj->getFechaFin()->format('m/d H:i')." \n".$crmActividadObj->getNombre(); $data['title']=$crmActividadObj->getFechaInicio()->format('n/j G:i')."\n".$crmActividadObj->getFechaFin()->format('n/j G:i')."\n".$crmActividadObj->getNombre(); $response->setData($data); } catch (\Exception $e) { $em->getConnection()->rollback(); $em->close(); // var_dump($e); if(method_exists($e,'getErrorCode')){ switch (intval($e->getErrorCode())) { case 2003: $serverOffline = $this->getParameter('app.serverOffline'); $data['error'] = $serverOffline.'. CODE: '.$e->getErrorCode(); break; default : $data['error'] = $e->getMessage(); break; } } else{ $data['error']=$e->getMessage(); } $response->setData($data); } } else { $data['error']='Ajax request'; $response->setData($data); } return $response; } /** * Reprogramar eventos, guardar cambios * * @Route("/activities/change/status/", name="admin_change_status_activities_ajax", options={"expose"=true})) * @Method("POST") */ public function activitieschangeAction(Request $request) { $isAjax = $this->get('Request')->isXMLhttpRequest(); if($isAjax){ try { $idActividad=$request->get("param1"); $idStatus=$request->get("param2"); $response = new JsonResponse(); $em = $this->getDoctrine()->getManager(); //$em->getConnection()->beginTransaction(); $crmActividadObj = $em->getRepository('ERPCRMBundle:CrmActividad')->find($idActividad); if(count($crmActividadObj)!=0){ //$crmActividadObj->setEstadoActividad(); switch($idStatus){ case 1://finalizado $crmStatus = $em->getRepository('ERPCRMBundle:CrmEstadoActividad')->find($idStatus); $data['tipo']='Finalizado'; break; case 2://pendiente $crmStatus = $em->getRepository('ERPCRMBundle:CrmEstadoActividad')->find($idStatus); break; case 3://cancelado $crmStatus = $em->getRepository('ERPCRMBundle:CrmEstadoActividad')->find($idStatus); $data['tipo']='cancelado'; //var_dump($crmStatus); break; case 4://Perdida $crmStatus = $em->getRepository('ERPCRMBundle:CrmEstadoActividad')->find($idStatus); $data['tipo']='perdida'; //var_dump($crmStatus); break; } } $crmActividadObj->setEstadoActividad($crmStatus); $em->merge($crmActividadObj); $em->flush(); //var_dump($crmActividadObj); //die(); $serverSave = $this->getParameter('app.serverMsgStatusChanged'); $data['msg']=$serverSave; //$data['title']=$crmActividadObj->getFechaInicio()->format('m/d H:i')." - ".$crmActividadObj->getFechaFin()->format('m/d H:i')." \n".$crmActividadObj->getNombre(); //$data['title']=$crmActividadObj->getFechaInicio()->format('n/j G:i')."\n".$crmActividadObj->getFechaFin()->format('n/j G:i')."\n".$crmActividadObj->getNombre(); $response->setData($data); } catch (\Exception $e) { //echo $e->getMessage(); //echo $e->getLine(); $em->getConnection()->rollback(); $em->close(); //var_dump($e); if(method_exists($e,'getErrorCode')){ switch (intval($e->getErrorCode())) { case 2003: $serverOffline = $this->getParameter('app.serverOffline'); $data['error'] = $serverOffline.'. CODE: '.$e->getErrorCode(); break; default : $data['error'] = $e->getMessage(); break; } } else{ $data['error']=$e->getMessage(); } $response->setData($data); } } else { $data['error']='Ajax request'; $response->setData($data); } return $response; } }
Kstro/erpsystem
src/ERP/CRMBundle/Controller/CrmLlamadasController.php
PHP
mit
54,864
// Copyright 2016 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // The go-ethereum library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. package vm import ( "math/big" "testing" "github.com/lab2528/go-oneTime/common" "github.com/lab2528/go-oneTime/params" ) type dummyContractRef struct { calledForEach bool } func (dummyContractRef) ReturnGas(*big.Int) {} func (dummyContractRef) Address() common.Address { return common.Address{} } func (dummyContractRef) Value() *big.Int { return new(big.Int) } func (dummyContractRef) SetCode(common.Hash, []byte) {} func (d *dummyContractRef) ForEachStorage(callback func(key, value common.Hash) bool) { d.calledForEach = true } func (d *dummyContractRef) SubBalance(amount *big.Int) {} func (d *dummyContractRef) AddBalance(amount *big.Int) {} func (d *dummyContractRef) SetBalance(*big.Int) {} func (d *dummyContractRef) SetNonce(uint64) {} func (d *dummyContractRef) Balance() *big.Int { return new(big.Int) } type dummyStateDB struct { NoopStateDB ref *dummyContractRef } func TestStoreCapture(t *testing.T) { var ( env = NewEVM(Context{}, nil, params.TestChainConfig, Config{EnableJit: false, ForceJit: false}) logger = NewStructLogger(nil) mem = NewMemory() stack = newstack() contract = NewContract(&dummyContractRef{}, &dummyContractRef{}, new(big.Int), 0) ) stack.push(big.NewInt(1)) stack.push(big.NewInt(0)) var index common.Hash logger.CaptureState(env, 0, SSTORE, 0, 0, mem, stack, contract, 0, nil) if len(logger.changedValues[contract.Address()]) == 0 { t.Fatalf("expected exactly 1 changed value on address %x, got %d", contract.Address(), len(logger.changedValues[contract.Address()])) } exp := common.BigToHash(big.NewInt(1)) if logger.changedValues[contract.Address()][index] != exp { t.Errorf("expected %x, got %x", exp, logger.changedValues[contract.Address()][index]) } } func TestStorageCapture(t *testing.T) { t.Skip("implementing this function is difficult. it requires all sort of interfaces to be implemented which isn't trivial. The value (the actual test) isn't worth it") var ( ref = &dummyContractRef{} contract = NewContract(ref, ref, new(big.Int), 0) env = NewEVM(Context{}, dummyStateDB{ref: ref}, params.TestChainConfig, Config{EnableJit: false, ForceJit: false}) logger = NewStructLogger(nil) mem = NewMemory() stack = newstack() ) logger.CaptureState(env, 0, STOP, 0, 0, mem, stack, contract, 0, nil) if ref.calledForEach { t.Error("didn't expect for each to be called") } logger = NewStructLogger(&LogConfig{FullStorage: true}) logger.CaptureState(env, 0, STOP, 0, 0, mem, stack, contract, 0, nil) if !ref.calledForEach { t.Error("expected for each to be called") } }
lab2528/go-oneTime
core/vm/logger_test.go
GO
mit
3,459
define(function(){ var Track = function Track(options){ this.url = options && options.url || ''; this.instrument = options && options.instrument || ''; }; return Track; });
leesus/beat-laboratory
js/src/models/track.js
JavaScript
mit
191
const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const extractApp = new ExtractTextPlugin({ filename: 'assets/[name].[hash].css' }); const extractAntd = new ExtractTextPlugin({ filename: 'assets/antd.[hash].css' }); module.exports = { entry: { polyfills: './src/polyfills', vendor: './src/vendor', app: './src/main' }, devtool: 'source-map', output: { path: path.resolve(__dirname, '../dist'), publicPath: '/', filename: 'assets/[name].[hash].js', chunkFilename: 'assets/[id].[hash].chunk.js' }, module: { rules: [ { test: /\.s?(a|c)ss$/, loader: extractApp.extract({ fallbackLoader: 'style-loader', loader: 'css-loader?importLoaders=2&minimize&modules&camelCase&localIdentName=[name]__[local]--[hash:base64:5]!postcss-loader!sass-loader' }), exclude: /node_modules/ }, { test: /\.s?(a|c)ss$/, loader: extractAntd.extract({ fallbackLoader: 'style-loader', loader: 'css-loader?minimize' }), include: path.resolve(__dirname, '../node_modules/antd') } ] }, plugins: [ new webpack.NoErrorsPlugin(), new webpack.optimize.UglifyJsPlugin({ sourceMap: true, compress: { warnings: false } }), extractAntd, extractApp ] };
ecozoic/atl4fort
webpack/webpack.prod.js
JavaScript
mit
1,435
$('.carousel').carousel({ interval: false }) ///////////////////////////////////////// // begin navbar collapse on selection /// $('.navbar-collapse').click('li', function() { $('.navbar-collapse').collapse('hide'); }); // end navbar collapse on selection /// ///////////////////////////////////////
deepakswami07/deepakfx
js/custom.js
JavaScript
mit
319
require 'ffi/disarm/args/bkpt' require 'ffi/disarm/args/bl' require 'ffi/disarm/args/blx_imm' require 'ffi/disarm/args/blx_reg' require 'ffi/disarm/args/clz' require 'ffi/disarm/args/cp_data' require 'ffi/disarm/args/cp_ls' require 'ffi/disarm/args/cp_reg' require 'ffi/disarm/args/data_imm' require 'ffi/disarm/args/data_imm_sh' require 'ffi/disarm/args/data_reg_sh' require 'ffi/disarm/args/dsp_add_sub' require 'ffi/disarm/args/dsp_mul' require 'ffi/disarm/args/ls_hw_imm' require 'ffi/disarm/args/ls_hw_reg' require 'ffi/disarm/args/l_sign_imm' require 'ffi/disarm/args/l_sign_reg' require 'ffi/disarm/args/ls_imm' require 'ffi/disarm/args/ls_multi' require 'ffi/disarm/args/ls_reg' require 'ffi/disarm/args/ls_two_imm' require 'ffi/disarm/args/ls_two_reg' require 'ffi/disarm/args/mrs' require 'ffi/disarm/args/msr_imm' require 'ffi/disarm/args/msr' require 'ffi/disarm/args/mull' require 'ffi/disarm/args/mul' require 'ffi/disarm/args/swi' require 'ffi/disarm/args/swp'
sophsec/ffi-disarm
lib/ffi/disarm/args.rb
Ruby
mit
976
import json from operator import itemgetter import os import random import string import sys from datetime import datetime from devtools import debug from functools import partial from pathlib import Path from statistics import StatisticsError, mean from statistics import stdev as stdev_ from test_pydantic import TestPydantic try: from test_trafaret import TestTrafaret except Exception: print('WARNING: unable to import TestTrafaret') TestTrafaret = None try: from test_drf import TestDRF except Exception: print('WARNING: unable to import TestDRF') TestDRF = None try: from test_marshmallow import TestMarshmallow except Exception: print('WARNING: unable to import TestMarshmallow') TestMarshmallow = None try: from test_valideer import TestValideer except Exception: print('WARNING: unable to import TestValideer') TestValideer = None try: from test_cattrs import TestCAttrs except Exception: print('WARNING: unable to import TestCAttrs') TestCAttrs = None try: from test_cerberus import TestCerberus except Exception: print('WARNING: unable to import TestCerberus') TestCerberus = None try: from test_voluptuous import TestVoluptuous except Exception as e: print('WARNING: unable to import TestVoluptuous') TestVoluptuous = None try: from test_schematics import TestSchematics except Exception as e: print('WARNING: unable to import TestSchematics') TestSchematics = None PUNCTUATION = ' \t\n!"#$%&\'()*+,-./' LETTERS = string.ascii_letters UNICODE = '\xa0\xad¡¢£¤¥¦§¨©ª«¬ ®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' ALL = PUNCTUATION * 5 + LETTERS * 20 + UNICODE random = random.SystemRandom() # in order of performance for csv other_tests = [ TestCAttrs, TestValideer, TestMarshmallow, TestVoluptuous, TestTrafaret, TestSchematics, TestDRF, TestCerberus, ] active_other_tests = [t for t in other_tests if t is not None] class GenerateData: def __init__(self): pass def rand_string(min_length, max_length, corpus=ALL): return ''.join(random.choices(corpus, k=random.randrange(min_length, max_length))) MISSING = object() def null_missing_v(f, null_chance=0.2, missing_chance=None): r = random.random() if random.random() < null_chance: return None missing_chance = null_chance if missing_chance is None else missing_chance if r < (null_chance + missing_chance): return MISSING return f() def null_missing_string(*args, **kwargs): f = partial(rand_string, *args) return null_missing_v(f, **kwargs) def rand_email(): if random.random() < 0.2: c1, c2 = UNICODE, LETTERS else: c1, c2 = LETTERS, LETTERS return f'{rand_string(10, 50, corpus=c1)}@{rand_string(10, 50, corpus=c2)}.{rand_string(2, 5, corpus=c2)}' def null_missing_email(): return null_missing_v(rand_email) def rand_date(): r = random.randrange return f'{r(1900, 2020)}-{r(0, 12)}-{r(0, 32)}T{r(0, 24)}:{r(0, 60)}:{r(0, 60)}' def remove_missing(d): if isinstance(d, dict): return {k: remove_missing(v) for k, v in d.items() if v is not MISSING} elif isinstance(d, list): return [remove_missing(d_) for d_ in d] else: return d def generate_case(): return remove_missing(dict( id=random.randrange(1, 2000), client_name=null_missing_string(10, 280, null_chance=0.05, missing_chance=0.05), sort_index=random.random() * 200, # client_email=null_missing_email(), # email checks differ with different frameworks client_phone=null_missing_string(5, 15), location=dict( latitude=random.random() * 180 - 90, longitude=random.random() * 180, ), contractor=str(random.randrange(-100, 2000)), upstream_http_referrer=null_missing_string(10, 1050), grecaptcha_response=null_missing_string(10, 1050, null_chance=0.05, missing_chance=0.05), last_updated=rand_date(), skills=[dict( subject=null_missing_string(5, 20, null_chance=0.01, missing_chance=0), subject_id=i, category=rand_string(5, 20), qual_level=rand_string(5, 20), qual_level_id=random.randrange(2000), qual_level_ranking=random.random() * 20 ) for i in range(random.randrange(1, 5))] )) THIS_DIR = Path(__file__).parent.resolve() def stdev(d): try: return stdev_(d) except StatisticsError: return 0 def run_tests(classes, cases, repeats, json=False): if json: classes = [c for c in classes if hasattr(c, 'to_json')] lpad = max(len(t.package) for t in classes) + 4 print(f'testing {", ".join(t.package for t in classes)}, {repeats} times each') results = [] csv_results = [] for test_class in classes: times = [] p = test_class.package for i in range(repeats): count, pass_count = 0, 0 test = test_class(True) models = [] if json: models = [m for passed, m in (test.validate(c) for c in cases) if passed] start = datetime.now() for j in range(3): if json: for model in models: test.to_json(model) pass_count += 1 count += 1 else: for case in cases: passed, result = test.validate(case) pass_count += passed count += 1 time = (datetime.now() - start).total_seconds() success = pass_count / count * 100 print(f'{p:>{lpad}} ({i+1:>{len(str(repeats))}}/{repeats}) time={time:0.3f}s, success={success:0.2f}%') times.append(time) print(f'{p:>{lpad}} best={min(times):0.3f}s, avg={mean(times):0.3f}s, stdev={stdev(times):0.3f}s') model_count = 3 * len(cases) avg = mean(times) / model_count * 1e6 sd = stdev(times) / model_count * 1e6 results.append(f'{p:>{lpad}} best={min(times) / model_count * 1e6:0.3f}μs/iter ' f'avg={avg:0.3f}μs/iter stdev={sd:0.3f}μs/iter version={test_class.version}') csv_results.append([p, test_class.version, avg]) print() return results, csv_results def main(): json_path = THIS_DIR / 'cases.json' if not json_path.exists(): print('generating test cases...') cases = [generate_case() for _ in range(2000)] with json_path.open('w') as f: json.dump(cases, f, indent=2, sort_keys=True) else: with json_path.open() as f: cases = json.load(f) tests = [TestPydantic] if 'pydantic-only' not in sys.argv: tests += active_other_tests repeats = int(os.getenv('BENCHMARK_REPEATS', '5')) test_json = 'TEST_JSON' in os.environ results, csv_results = run_tests(tests, cases, repeats, test_json) for r in results: print(r) if 'SAVE' in os.environ: save_md(csv_results) def save_md(data): headings = 'Package', 'Version', 'Relative Performance', 'Mean validation time' rows = [headings, ['---' for _ in headings]] first_avg = None for package, version, avg in sorted(data, key=itemgetter(2)): if first_avg: relative = f'{avg / first_avg:0.1f}x slower' else: relative = '' first_avg = avg rows.append([package, f'`{version}`', relative, f'{avg:0.1f}μs']) table = '\n'.join(' | '.join(row) for row in rows) text = f"""\ [//]: <> (Generated with benchmarks/run.py, DO NOT EDIT THIS FILE DIRECTLY, instead run `SAVE=1 python ./run.py`.) {table} """ (Path(__file__).parent / '..' / 'docs' / '.benchmarks_table.md').write_text(text) def diff(): json_path = THIS_DIR / 'cases.json' with json_path.open() as f: cases = json.load(f) allow_extra = True pydantic = TestPydantic(allow_extra) others = [t(allow_extra) for t in active_other_tests] for case in cases: pydantic_passed, pydantic_result = pydantic.validate(case) for other in others: other_passed, other_result = other.validate(case) if other_passed != pydantic_passed: print(f'⨯ pydantic {pydantic_passed} != {other.package} {other_passed}') debug(case, pydantic_result, other_result) return print('✓ data passes match for all packages') if __name__ == '__main__': if 'diff' in sys.argv: diff() else: main() # if None in other_tests: # print('not all libraries could be imported!') # sys.exit(1)
samuelcolvin/pydantic
benchmarks/run.py
Python
mit
8,926
<?xml version="1.0" ?><!DOCTYPE TS><TS language="fa" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Unstakeable</source> <translation>در مورد Unstakeable</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Unstakeable&lt;/b&gt; version</source> <translation>نسخه Unstakeable</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation>⏎ ⏎ این نسخه نرم افزار آزمایشی است⏎ ⏎ نرم افزار تحت لیسانس MIT/X11 منتشر شده است. به فایل coping یا آدرس http://www.opensource.org/licenses/mit-license.php. مراجعه شود⏎ ⏎ این محصول شامل نرم افزاری است که با OpenSSL برای استفاده از OpenSSL Toolkit (http://www.openssl.org/) و نرم افزار نوشته شده توسط اریک یانگ (eay@cryptsoft.com ) و UPnP توسط توماس برنارد طراحی شده است.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The Unstakeable developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>فهرست آدرس</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>برای ویرایش آدرس یا بر چسب دو بار کلیک کنید</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>آدرس جدید ایجاد کنید</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>آدرس انتخاب شده در سیستم تخته رسم گیره دار کپی کنید</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>آدرس جدید</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Unstakeable 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>این آدرسها، آدرسهای unstakeable شما برای دریافت وجوه هستند. شما ممکن است آدرسهای متفاوت را به هر گیرنده اختصاص دهید که بتوانید مواردی که پرداخت می کنید را پیگیری نمایید</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>کپی آدرس</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>نمایش &amp;کد QR</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Unstakeable address</source> <translation>پیام را برای اثبات آدرس Unstakeable خود امضا کنید</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>امضا و پیام</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>آدرس انتخاب شده در سیستم تخته رسم گیره دا حذف</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>داده ها نوارِ جاری را به فایل انتقال دهید</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Unstakeable address</source> <translation>یک پیام را برای حصول اطمینان از ورود به سیستم با آدرس unstakeable مشخص، شناسایی کنید</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>شناسایی پیام</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>حذف</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Unstakeable 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>کپی و برچسب گذاری</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>ویرایش</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation type="unfinished"/> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>آدرس انتخاب شده در سیستم تخته رسم گیره دار کپی کنید</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma separated file (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>خطای صدور</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>تا فایل %1 نمی شود نوشت</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>بر چسب</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>آدرس</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>بدون برچسب</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>دیالوگ Passphrase </translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>وارد عبارت عبور</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>عبارت عبور نو</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>تکرار عبارت عبور نو</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&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>وارد کنید..&amp;lt;br/&amp;gt عبارت عبور نو در پنجره 10 یا بیشتر کاراکتورهای تصادفی استفاده کنید &amp;lt;b&amp;gt لطفا عبارت عبور</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>رمز بندی پنجره</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>این عملیت نیاز عبارت عبور پنجره شما دارد برای رمز گشایی آن</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>تکرار عبارت عبور نو</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>این عملیت نیاز عبارت عبور شما دارد برای رمز بندی آن</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>رمز بندی پنجره</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>تغییر عبارت عبور</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>عبارت عبور نو و قدیم در پنجره وارد کنید</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>تایید رمز گذاری</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR LITECOINS&lt;/b&gt;!</source> <translation>هشدار: اگر wallet رمزگذاری شود و شما passphrase را گم کنید شما همه اطلاعات unstakeable را از دست خواهید داد.</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>آیا اطمینان دارید که می خواهید wallet رمزگذاری شود؟</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>هشدار: Caps lock key روشن است</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>تغییر عبارت عبور</translation> </message> <message> <location line="-56"/> <source>Unstakeable will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your unstakeables from being stolen by malware infecting your computer.</source> <translation>Biticon هم اکنون بسته می‌شود تا فرایند رمزگذاری را تمام کند. به خاطر داشته باشید که رمزگذاری کیف پولتان نمی‌تواند به طور کامل بیتیکون‌های شما را در برابر دزدیده شدن توسط بدافزارهایی که رایانه شما را آلوده می‌کنند، محافظت نماید.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>عبارت عبور نو و قدیم در پنجره وارد کنید</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>تنا موفق رمز بندی پنجره ناشی از خطای داخل شد. پنجره شما مرز بندی نشده است</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>عبارت عبور عرضه تطابق نشد</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>نجره رمز گذار شد</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>اموفق رمز بندی پنجر</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>ناموفق رمز بندی پنجره</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>wallet passphrase با موفقیت تغییر یافت</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>امضا و پیام</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>همگام سازی با شبکه ...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>بررسی اجمالی</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>نمای کلی پنجره نشان بده</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;معاملات</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>نمایش تاریخ معاملات</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>ویرایش لیست آدرسها و بر چسب های ذخیره ای</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>نمایش لیست آدرس ها برای در یافت پر داخت ها</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>خروج</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>خروج از برنامه </translation> </message> <message> <location line="+4"/> <source>Show information about Unstakeable</source> <translation>نمایش اطلاعات در مورد بیتکویین</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>درباره &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>نمایش اطلاعات درباره Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>تنظیمات...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>رمزگذاری wallet</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>پشتیبان گیری از wallet</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>تغییر Passphrase</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation type="unfinished"/> </message> <message> <location line="-347"/> <source>Send coins to a Unstakeable address</source> <translation>سکه ها را به آدرس bitocin ارسال کن</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Unstakeable</source> <translation>انتخابهای پیکربندی را برای unstakeable اصلاح کن</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>نسخه پیشتیبان wallet را به محل دیگر انتقال دهید</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>عبارت عبور رمز گشایی پنجره تغییر کنید</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>اشکال زدایی از صفحه</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>کنسول اشکال زدایی و تشخیص را باز کنید</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>بازبینی پیام</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Unstakeable</source> <translation>یت کویین </translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>wallet</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>&amp;About Unstakeable</source> <translation>در مورد unstakeable</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;نمایش/ عدم نمایش</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign messages with your Unstakeable addresses to prove you own them</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Unstakeable addresses</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>فایل</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>تنظیمات</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>کمک</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>نوار ابزار زبانه ها</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>آزمایش شبکه</translation> </message> <message> <location line="+47"/> <source>Unstakeable client</source> <translation>مشتری Unstakeable</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Unstakeable network</source> <translation><numerusform>در صد ارتباطات فعال بیتکویین با شبکه %n</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Error</source> <translation 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 type="unfinished"/> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>تا تاریخ</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>ابتلا به بالا</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>هزینه تراکنش را تایید کنید</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>معامله ارسال شده</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>معامله در یافت شده</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>تاریخ %1 مبلغ%2 نوع %3 آدرس %4</translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>مدیریت URI</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Unstakeable address or malformed URI parameters.</source> <translation>URI قابل تحلیل نیست. این خطا ممکن است به دلیل ادرس LITECOIN اشتباه یا پارامترهای اشتباه URI رخ داده باشد</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>زمایش شبکهه</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>زمایش شبکه</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Unstakeable can no longer continue safely and will quit.</source> <translation>خطا روی داده است. Unstakeable نمی تواند بدون مشکل ادامه دهد و باید بسته شود</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>پیام شبکه</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>اصلاح آدرس</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>بر چسب</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>بر چسب با دفتر آدرس ورود مرتبط است</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>آدرس</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>آدرس با دفتر آدرس ورودی مرتبط است. این فقط در مورد آدرسهای ارسال شده است</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>آدرس در یافت نو</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>آدرس ارسال نو</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>اصلاح آدرس در یافت</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>اصلاح آدرس ارسال</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>%1آدرس وارد شده دیگر در دفتر آدرس است</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Unstakeable address.</source> <translation>آدرس وارد شده %1 یک ادرس صحیح unstakeable نیست</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>رمز گشایی پنجره امکان پذیر نیست</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>کلید نسل جدید ناموفق است</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Unstakeable-Qt</source> <translation>Unstakeable-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>نسخه</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>ستفاده :</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>انتخابها برای خطوط دستور command line</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>انتخابهای UI </translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>زبان را تنظیم کنید برای مثال &quot;de_DE&quot; (پیش فرض: system locale)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>شروع حد اقل</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>نمایش صفحه splash در STARTUP (پیش فرض:1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>اصلی</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>اصلی</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>دستمزد&amp;پر داخت معامله</translation> </message> <message> <location line="+31"/> <source>Automatically start Unstakeable after logging in to the system.</source> <translation>در زمان ورود به سیستم به صورت خودکار unstakeable را اجرا کن</translation> </message> <message> <location line="+3"/> <source>&amp;Start Unstakeable on system login</source> <translation>اجرای unstakeable در زمان ورود به سیستم</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>شبکه</translation> </message> <message> <location line="+6"/> <source>Automatically open the Unstakeable client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>اتوماتیک باز کردن بندر بیتکویین در روتر . این فقط در مواردی می باشد که روتر با کمک یو پ ن پ کار می کند</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>درگاه با استفاده از</translation> </message> <message> <location line="+7"/> <source>Connect to the Unstakeable network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>اتصال به شبکه LITECOIN از طریق پراکسی ساکس (برای مثال وقتی از طریق نرم افزار TOR متصل می شوید)</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>اتصال با پراکسی SOCKS</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>پراکسی و آی.پی.</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>درس پروکسی</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>درگاه</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>درگاه پراکسی (مثال 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS و نسخه</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>نسخه SOCKS از پراکسی (مثال 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>صفحه</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>tray icon را تنها بعد از کوچک کردن صفحه نمایش بده</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>حد اقل رساندن در جای نوار ابزار ها</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>حد اقل رساندن در جای خروج بر نامه وقتیکه پنجره بسته است.وقتیکه این فعال است برنامه خاموش می شود بعد از انتخاب دستور خاموش در منیو</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>کوچک کردن صفحه در زمان بستن</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>نمایش</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>میانجی کاربر و زبان</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Unstakeable.</source> <translation>زبان میانجی کاربر می تواند در اینجا تنظیم شود. این تنظیمات بعد از شروع دوباره RESTART در LITECOIN اجرایی خواهند بود.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>واحد برای نمایش میزان وجوه در:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>بخش فرعی پیش فرض را برای نمایش میانجی و زمان ارسال سکه ها مشخص و انتخاب نمایید</translation> </message> <message> <location line="+9"/> <source>Whether to show Unstakeable addresses in the transaction list or not.</source> <translation>تا آدرسهای bITCOIN در فهرست تراکنش نمایش داده شوند یا نشوند.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>نمایش آدرسها در فهرست تراکنش</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>تایید</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>رد</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>انجام</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>پیش فرض</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>هشدار</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Unstakeable.</source> <translation>این تنظیمات پس از اجرای دوباره Unstakeable اعمال می شوند</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>آدرس پراکسی داده شده صحیح نیست</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>تراز</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Unstakeable network after a connection is established, but this process has not completed yet.</source> <translation>اطلاعات نمایش داده شده روزآمد نیستند.wallet شما به صورت خودکار با شبکه unstakeable بعد از برقراری اتصال روزآمد می شود اما این فرایند هنوز کامل نشده است.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>راز:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>تایید نشده</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>wallet</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>نابالغ</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>بالانس/تتمه حساب استخراج شده، نابالغ است /تکمیل نشده است</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>اخرین معاملات&amp;lt</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>تزار جاری شما</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>تعداد معاملات که تایید شده ولی هنوز در تزار جاری شما بر شمار نرفته است</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>روزآمد نشده</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start unstakeable: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>دیالوگ QR CODE</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>درخواست پرداخت</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>مقدار:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>برچسب:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>پیام</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;ذخیره به عنوان...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>خطا در زمان رمزدار کردن URI در کد QR</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>میزان وجه وارد شده صحیح نیست، لطفا بررسی نمایید</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>URI ذکر شده بسیار طولانی است، متن برچسب/پیام را کوتاه کنید</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>ذخیره کد QR</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>تصاویر با فرمت PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>نام مشتری</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>-</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>نسخه مشتری</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>اطلاعات</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>استفاده از نسخه OPENSSL</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>زمان آغاز STARTUP</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>شبکه</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>تعداد اتصالات</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>در testnetکها</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>زنجیره بلاک</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>تعداد کنونی بلاکها</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>تعداد تخمینی بلاکها</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>زمان آخرین بلاک</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>باز کردن</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>گزینه های command-line</translation> </message> <message> <location line="+7"/> <source>Show the Unstakeable-Qt help message to get a list with possible Unstakeable command-line options.</source> <translation>پیام راهنمای Unstakeable-Qt را برای گرفتن فهرست گزینه های command-line نشان بده</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>نمایش</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>کنسول</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>ساخت تاریخ</translation> </message> <message> <location line="-104"/> <source>Unstakeable - Debug window</source> <translation>صفحه اشکال زدایی Unstakeable </translation> </message> <message> <location line="+25"/> <source>Unstakeable Core</source> <translation> هسته Unstakeable </translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>فایلِ لاگِ اشکال زدایی</translation> </message> <message> <location line="+7"/> <source>Open the Unstakeable debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>فایلِ لاگِ اشکال زدایی Unstakeable را از دایرکتوری جاری داده ها باز کنید. این عملیات ممکن است برای فایلهای لاگِ حجیم طولانی شود.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>پاکسازی کنسول</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Unstakeable RPC console.</source> <translation>به کنسول Unstakeable RPC خوش آمدید</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>دکمه های بالا و پایین برای مرور تاریخچه و Ctrl-L برای پاکسازی صفحه</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>با تایپ عبارت HELP دستورهای در دسترس را مرور خواهید کرد</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>ارسال سکه ها</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>ارسال چندین در یافت ها فورا</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>اضافه کردن دریافت کننده</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>پاک کردن تمام ستون‌های تراکنش</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>پاکسازی همه</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>تزار :</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 بتس</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>عملیت دوم تایید کنید</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;;ارسال</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>(%3) تا &lt;b&gt;%1&lt;/b&gt; درصد%2</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>ارسال سکه ها تایید کنید</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation> %1شما متماینید که می خواهید 1% ارسال کنید ؟</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>و</translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>آدرس گیرنده نادرست است، لطفا دوباره بررسی کنید.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>مبلغ پر داخت باید از 0 بیشتر باشد </translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>میزان وجه از بالانس/تتمه حساب شما بیشتر است</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>کل میزان وجه از بالانس/تتمه حساب شما بیشتر می شود وقتی %1 هزینه تراکنش نیز به ین میزان افزوده می شود</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>آدرس تکراری یافت شده است، در زمان انجام عملیات به هر آدرس تنها یکبار می توانید اطلاعات ارسال کنید</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation 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>خطا: تراکنش تایید نشد. این پیام زمانی روی می دهد که مقداری از سکه های WALLET شما استفاده شده اند برای مثال اگر شما از WALLET.DAT استفاده کرده اید، ممکن است سکه ها استفاده شده باشند اما در اینجا نمایش داده نشوند</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>تراز</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>A&amp;مبلغ :</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>به&amp;پر داخت :</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>برای آدرس بر پسب وارد کنید که در دفتر آدرس اضافه شود</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;بر چسب </translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>اآدرسن ازدفتر آدرس انتخاب کنید</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>آدرس از تخته رسم گیره دار پست کنید </translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>بر داشتن این در یافت کننده</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Unstakeable address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>آدرس بیتکویین وارد کنید (bijvoorbeeld: Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>امضا - امضا کردن /شناسایی یک پیام</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;امضای پیام</translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>شما می توانید پیامها را با آدرس خودتان امضا نمایید تا ثابت شود متعلق به شما هستند. مواظب باشید تا چیزی که بدان مطمئن نیستنید را امضا نکنید زیرا حملات فیشینگ در زمان ورود شما به سیستم فریبنده هستند. تنها مواردی را که حاوی اطلاعات دقیق و قابل قبول برای شما هستند را امضا کنید</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>آدرس برای امضا کردن پیام با (برای مثال Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>یک آدرس را از فهرست آدرسها انتخاب کنید</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>آدرس از تخته رسم گیره دار پست کنید </translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>پیامی را که می‌خواهید امضا کنید در اینجا وارد کنید</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>این امضا را در system clipboard کپی کن</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Unstakeable address</source> <translation>پیام را برای اثبات آدرس LITECOIN خود امضا کنید</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>تنظیم دوباره تمامی فیلدهای پیام</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>پاکسازی همه</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>تایید پیام</translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>آدرس/پیام خود را وارد کنید (مطمئن شوید که فاصله بین خطوط، فاصله ها، تب ها و ... را دقیقا کپی می کنید) و سپس امضا کنید تا پیام تایید شود. مراقب باشید که پیام را بیشتر از مطالب درون امضا مطالعه نمایید تا فریب شخص سوم/دزدان اینترنتی را نخورید.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>آدرس برای امضا کردن پیام با (برای مثال Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Unstakeable address</source> <translation>پیام را برای اطمنان از ورود به سیستم با آدرس LITECOIN مشخص خود،تایید کنید</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>تنظیم دوباره تمامی فیلدهای پیام تایید شده</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Unstakeable address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>آدرس بیتکویین وارد کنید (bijvoorbeeld: Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>با کلیک بر &quot;امضای پیام&quot; شما یک امضای جدید درست می کنید</translation> </message> <message> <location line="+3"/> <source>Enter Unstakeable signature</source> <translation>امضای BITOCOIN خود را وارد کنید</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>آدرس وارد شده صحیح نیست</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>اطفا آدرس را بررسی کرده و دوباره امتحان کنید</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>آدرس وارد شده با کلید وارد شده مرتبط نیست</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>قفل کردن wallet انجام نشد</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>کلید شخصی برای آدرس وارد شده در دسترس نیست</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>پیام امضا کردن انجام نشد</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>پیام امضا شد</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>امضا نمی تواند رمزگشایی شود</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>لطفا امضا را بررسی و دوباره تلاش نمایید</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>امضا با تحلیلِ پیام مطابقت ندارد</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>عملیات شناسایی پیام انجام نشد</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>پیام شناسایی شد</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Unstakeable developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>آزمایش شبکه</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>باز کردن تا%1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1 آفلاین</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1 تایید نشده </translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>ایید %1 </translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>وضعیت</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>انتشار از طریق n% گره انتشار از طریق %n گره</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>تاریخ </translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>منبع</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>تولید شده</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>فرستنده</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>گیرنده</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>آدرس شما</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>برچسب</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>بدهی </translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>بلوغ در n% از بیشتر بلاکها بلوغ در %n از بیشتر بلاکها</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>غیرقابل قبول</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>اعتبار</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>هزینه تراکنش</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>هزینه خالص</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>پیام</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>نظر</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>شناسه کاربری برای تراکنش</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>سکه های ایجاد شده باید 120 بلاک را قبل از استفاده بالغ کنند. در هنگام ایجاد بلاک، آن بلاک در شبکه منتشر می شود تا به زنجیره بلاکها بپیوندد. اگر در زنجیره قرار نگیرد، پیام وضعیت به غیرقابل قبول تغییر می بپیابد و قابل استفاده نیست. این مورد معمولا زمانی پیش می آید که گره دیگری به طور همزمان بلاکی را با فاصل چند ثانیه ای از شما ایجاد کند.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>اشکال زدایی طلاعات</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>تراکنش</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>درونداد</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>مبلغ</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>صحیح</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>نادرست</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>هنوز با مو فقیت ارسال نشده</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>مشخص نیست </translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>جزییات معاملات</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>در این قاب شیشه توصیف دقیق معامله نشان می شود</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>تاریخ</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>نوع</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>ایل جدا </translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>مبلغ</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>از شده تا 1%1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>افلایین (%1)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>تایید نشده (%1/%2)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>تایید شده (%1)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>بالانس/تتمه حساب استخراج شده زمانی که %n از بیشتر بلاکها بالغ شدند در دسترس خواهد بود بالانس/تتمه حساب استخراج شده زمانی که n% از بیشتر بلاکها بالغ شدند در دسترس خواهد بود</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>این بلوک از دیگر گره ها در یافت نشده بدین دلیل شاید قابل قابول نیست</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>تولید شده ولی قبول نشده</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>در یافت با :</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>دریافتی از</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>ارسال به :</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>پر داخت به خودتان</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>استخراج</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(کاربرد ندارد)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>وضعیت معالمه . عرصه که تعداد تایید نشان می دهد</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>تاریخ و ساعت در یافت معامله</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>نوع معاملات</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>آدرس مقصود معاملات </translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>مبلغ از تزار شما خارج یا وارد شده</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>همه</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>امروز</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>این هفته</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>این ماه</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>ماه گذشته</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>امسال</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>محدوده </translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>در یافت با</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>ارسال به</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>به خودتان </translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>استخراج</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>یگر </translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>برای جست‌‌وجو نشانی یا برچسب را وارد کنید</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>حد اقل مبلغ </translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>کپی آدرس </translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>کپی بر چسب</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>روگرفت مقدار</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>اصلاح بر چسب</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>جزئیات تراکنش را نمایش بده</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>صادرات تاریخ معامله</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma فایل جدا </translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>تایید شده</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>تاریخ </translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>نوع </translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>ر چسب</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>ایل جدا </translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>مبلغ</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>آی دی</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>خطای صادرت</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>تا فایل %1 نمی شود نوشت</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>&gt;محدوده</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>به</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>ارسال سکه ها</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+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>داده ها نوارِ جاری را به فایل انتقال دهید</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Unstakeable version</source> <translation>سخه بیتکویین</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>ستفاده :</translation> </message> <message> <location line="-29"/> <source>Send command to -server or unstakeabled</source> <translation>ارسال فرمان به سرور یا باتکویین</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>لیست فومان ها</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>کمک برای فرمان </translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>تنظیمات</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: unstakeable.conf)</source> <translation>(: unstakeable.confپیش فرض: )فایل تنظیمی خاص </translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: unstakeabled.pid)</source> <translation>(unstakeabled.pidپیش فرض : ) فایل پید خاص</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>دایرکتور اطلاعاتی خاص</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>سایز کَش بانک داده را بر حسب مگابایت تنظیم کنید (پیش فرض:25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 3456 or testnet: 13456)</source> <translation>برای اتصالات به &lt;port&gt; (پیش‌فرض: 3456 یا تست‌نت: 13456) گوش کنید</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>حداکثر &lt;n&gt; اتصال با همکاران برقرار داشته باشید (پیش‌فرض: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>اتصال به گره برای دریافت آدرسهای قرینه و قطع اتصال</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>آدرس عمومی خود را ذکر کنید</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>آستانه برای قطع ارتباط با همکاران بدرفتار (پیش‌فرض: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>مدت زمان به ثانیه برای جلوگیری از همکاران بدرفتار برای اتصال دوباره (پیش‌فرض: 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>در زمان تنظیم درگاه RPX %u در فهرست کردن %s اشکالی رخ داده است</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 4567 or testnet: 13456)</source> <translation>( 4567پیش فرض :) &amp;lt;poort&amp;gt; JSON-RPC شنوایی برای ارتباطات</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>JSON-RPC قابل فرمانها و</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>اجرای در پس زمینه به عنوان شبح و قبول فرمان ها</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>استفاده شبکه آزمایش</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>پذیرش اتصالات از بیرون (پیش فرض:1 بدون پراکسی یا اتصال)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=unstakeablerpc 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;Unstakeable Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Unstakeable is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>حجم حداکثر تراکنشهای با/کم اهمیت را به بایت تنظیم کنید (پیش فرض: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>هشدار:paytxfee بسیار بالا تعریف شده است! این هزینه تراکنش است که باید در زمان ارسال تراکنش بپردازید</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>هشدار: تراکنش نمایش داده شده ممکن است صحیح نباشد! شما/یا یکی از گره ها به روزآمد سازی نیاز دارید </translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Unstakeable will not work properly.</source> <translation>هشدار: لطفا زمان و تاریخ رایانه خود را تصحیح نمایید! اگر ساعت رایانه شما اشتباه باشد unstakeable ممکن است صحیح کار نکند</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>بستن گزینه ایجاد</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>تنها در گره (های) مشخص شده متصل شوید</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>آدرس آی.پی. خود را شناسایی کنید (پیش فرض:1 در زمان when listening وno -externalip)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>شنیدن هر گونه درگاه انجام پذیر نیست. ازlisten=0 برای اینکار استفاده کیند.</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>قرینه ها را برای جستجوی DNS بیاب (پیش فرض: 1 مگر در زمان اتصال)</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 type="unfinished"/> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &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>آدرس نرم افزار تور غلط است %s</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>حداکثر بافر دریافت شده بر اساس اتصال &lt;n&gt;* 1000 بایت (پیش فرض:5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>حداکثر بافر دریافت شده بر اساس اتصال &lt;n&gt;* 1000 بایت (پیش فرض:1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>تنها =به گره ها در شبکه متصا شوید &lt;net&gt; (IPv4, IPv6 or Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>برونداد اطلاعات اشکال زدایی اضافی. گزینه های اشکال زدایی دیگر رفع شدند</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>برونداد اطلاعات اشکال زدایی اضافی برای شبکه</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>به خروجی اشکال‌زدایی برچسب زمان بزنید</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Unstakeable Wiki for SSL setup instructions)</source> <translation>گزینه ssl (به ویکیunstakeable برای راهنمای راه اندازی ssl مراجعه شود)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>نسخه ای از پراکسی ساکس را برای استفاده انتخاب کنید (4-5 پیش فرض:5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>اطلاعات ردگیری/اشکال‌زدایی را به جای فایل لاگ اشکال‌زدایی به کنسول بفرستید</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>اطلاعات ردگیری/اشکال‌زدایی را به اشکال‌زدا بفرستید</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>حداکثر سایز بلاک بر اساس بایت تنظیم شود (پیش فرض: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>حداقل سایز بلاک بر اساس بایت تنظیم شود (پیش فرض: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>فایل debug.log را در startup مشتری کوچک کن (پیش فرض:1 اگر اشکال زدایی روی نداد)</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>(میلی ثانیه )فاصله ارتباط خاص</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>از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:1 در زمان شنیدن)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>برای دستیابی به سرویس مخفیانه نرم افزار تور از پراکسی استفاده کنید (پیش فرض:same as -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>JSON-RPC شناسه برای ارتباطات</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>هشدار: این نسخه قدیمی است، روزآمدسازی مورد نیاز است</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation 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>JSON-RPC عبارت عبور برای ارتباطات</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>از آدرس آی پی خاص JSON-RPC قبول ارتباطات</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>(127.0.0.1پیش فرض: ) &amp;lt;ip&amp;gt; دادن فرمانها برای استفاده گره ها روی</translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>زمانی که بهترین بلاک تغییر کرد، دستور را اجرا کن (%s در cmd با block hash جایگزین شده است)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>wallet را به جدیدترین فرمت روزآمد کنید</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation> (100پیش فرض:)&amp;lt;n&amp;gt; گذاشتن اندازه کلید روی </translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>اسکان مجدد زنجیر بلوکها برای گم والت معامله</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>JSON-RPCبرای ارتباطات استفاده کنید OpenSSL (https)</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation> (server.certپیش فرض: )گواهی نامه سرور</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>(server.pemپیش فرض: ) کلید خصوصی سرور</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>رمز های قابل قبول( TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>پیام کمکی</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>امکان اتصال به %s از این رایانه وجود ندارد ( bind returned error %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>اتصال از طریق پراکسی ساکس</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>به DNS اجازه بده تا برای addnode ، seednode و اتصال جستجو کند</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>بار گیری آدرس ها</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>خطا در بارگیری wallet.dat: کیف پول خراب شده است</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Unstakeable</source> <translation>خطا در بارگیری wallet.dat: کیف پول به ویرایش جدیدتری از Biticon نیاز دارد</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Unstakeable to complete</source> <translation>سلام</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>خطا در بارگیری wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>آدرس پراکسی اشتباه %s</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>شبکه مشخص شده غیرقابل شناسایی در onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>نسخه پراکسی ساکس غیرقابل شناسایی درخواست شده است: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>آدرس قابل اتصال- شناسایی نیست %s</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>آدرس خارجی قابل اتصال- شناسایی نیست %s</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>میزان وجه اشتباه برای paytxfee=&lt;میزان وجه&gt;: %s</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>میزان وجه اشتباه</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>بود جه نا کافی </translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>بار گیری شاخص بلوک</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>به اتصال یک گره اضافه کنید و اتصال را باز نگاه دارید</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Unstakeable is probably already running.</source> <translation>اتصال به %s از این رایانه امکان پذیر نیست. Unstakeable احتمالا در حال اجراست.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>پر داجت برای هر کیلو بیت برای اضافه به معامله ارسال</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>بار گیری والت</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>امکان تنزل نسخه در wallet وجود ندارد</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>آدرس پیش فرض قابل ذخیره نیست</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>اسکان مجدد</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>بار گیری انجام شده است</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>برای استفاده از %s از انتخابات</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>خطا</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>%s، شما باید یک rpcpassword را در فایل پیکربندی تنظیم کنید :⏎%s⏎ اگر فایل ایجاد نشد، یک فایل فقط متنی ایجاد کنید. </translation> </message> </context> </TS>
Action-Committee/unstakeable
src/qt/locale/bitcoin_fa.ts
TypeScript
mit
119,415
/* MIT License Copyright (c) 2022 Looker Data Sciences, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ import type { I18nState } from '../../utils' const resources = { describe_date: { ' complete': ' 完成', 'absolute prefix dateTime': '{{prefix}} {{dateTime}}', ago: '以前', 'from now': '从现在起', 'is any time': '任意时间', 'is before': '早于', 'is day': '在 {{day}} 这一天', 'is from dateTimeStart until dateTimeEnd': '从 {{dateTimeStart}} 到 {{dateTimeEnd}}', 'is in month year': '在 {{year}} 年 {{month}} 之内', 'is in the last': '在过去 {{describeInterval}} 之内', 'is in the year year': '在 {{year}} 年之内', 'is interval ago': '在 {{interval}} 之前', 'is intervalStart intervalType for intervalEnd': '{{intervalType}} 在 {{intervalStart}} 到 {{intervalEnd}} 期间', 'is not null': '不为空值', 'is on dateTime': '在 {{dateTime}} 这一时间', 'is on or after': '等于或晚于', 'is previous unitLabel': '上一 {{unitLabel}}', 'is type unitLabel': '为 {{type}} {{unitLabel}}', 'prefix interval timePassed': '{{prefix}} {{interval}} {{timePassed}}', 'prefix now': '{{prefix}} 现在', 'this startInterval to endInterval': '此 {{startInterval}} 到 {{endInterval}}', 'value complete unitLabel': '{{value}}{{complete}} {{unitLabel}}', }, get_months: { April: '四月', August: '八月', December: '十二月', February: '二月', January: '一月', July: '七月', June: '六月', March: '三月', May: '5 月', November: '十一月', October: '十月', September: '九月', }, get_unit_label: { 'complete day': '完整天', 'complete days': '完整天', 'complete fiscal quarter': '完整财政季度', 'complete fiscal quarters': '完整财政季度', 'complete fiscal year': '完整财政年度', 'complete fiscal years': '完整财政年度', 'complete hour': '完整小时', 'complete hours': '完整小时', 'complete minute': '完整分钟', 'complete minutes': '完整分钟', 'complete month': '完整月', 'complete months': '完整月', 'complete quarter': '完整季度', 'complete quarters': '完整季度', 'complete second': '完整秒', 'complete seconds': '完整秒', 'complete week': '完整周', 'complete weeks': '完整周', 'complete year': '完整年', 'complete years': '完整年', day: '天', days: '天', 'fiscal quarter': '财政季度', 'fiscal quarters': '个财政季度', 'fiscal year': '财政年度', 'fiscal years': '个财政年度', hour: '小时', hours: '小时', minute: '分钟', minutes: '分钟', month: '月', months: '个月', quarter: '季度', quarters: '个季度', second: '秒', seconds: '秒', week: '周', weeks: '周', year: '年', years: '年', }, summary: { 'Value required': '必须提供值', }, } export const zhCN: I18nState = { locale: 'zh-CN', resources: { 'zh-CN': resources }, }
looker-open-source/components
packages/filter-expressions/src/locales/resources/zh-CN.ts
TypeScript
mit
4,142
<?xml version="1.0" ?><!DOCTYPE TS><TS language="vi" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About ReturnCoin</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;ReturnCoin&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 © 2015 The ReturnCoin 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>Click đúp chuột để chỉnh sửa địa chỉ hoặc nhãn dữ liệu</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Tạo một địa chỉ mới</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Sao chép các địa chỉ đã được chọn vào bộ nhớ tạm thời của hệ thống</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your ReturnCoin 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 ReturnCoin 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 ReturnCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Xóa</translation> </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>Tập tin tách biệt bởi dấu phẩy (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Nhãn dữ liệu</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Địa chỉ</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(chưa có nhãn)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&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>ReturnCoin 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 ReturnCoin</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></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 ReturnCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Modify configuration options for ReturnCoin</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>ReturnCoin</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+180"/> <source>&amp;About ReturnCoin</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>ReturnCoin client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+75"/> <source>%n active connection(s) to ReturnCoin network</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+413"/> <source>Staking.&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></translation> </message> <message> <location line="-312"/> <source>About ReturnCoin card</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about ReturnCoin 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></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation 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 ReturnCoin 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></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. ReturnCoin 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>Số lượng</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>Địa chỉ</translation> </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>(chưa có nhãn)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&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 ReturnCoin 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>returncoin-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 ReturnCoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start ReturnCoin 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 ReturnCoin 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 ReturnCoin 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 ReturnCoin.</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 ReturnCoin 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 ReturnCoin.</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 ReturnCoin 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 returncoin-qt help message to get a list with possible ReturnCoin 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>ReturnCoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>ReturnCoin 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 ReturnCoin 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 ReturnCoin 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 ReturnCoin address (e.g. PXkRZYXwNDxsgvMmtE3M7rXJKDohbf54Pm)</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 ReturnCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(chưa có nhãn)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation 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. PXkRZYXwNDxsgvMmtE3M7rXJKDohbf54Pm)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a ReturnCoin address (e.g. PXkRZYXwNDxsgvMmtE3M7rXJKDohbf54Pm)</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. PXkRZYXwNDxsgvMmtE3M7rXJKDohbf54Pm)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this ReturnCoin 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. PXkRZYXwNDxsgvMmtE3M7rXJKDohbf54Pm)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified ReturnCoin 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 ReturnCoin address (e.g. PXkRZYXwNDxsgvMmtE3M7rXJKDohbf54Pm)</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 ReturnCoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation 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></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></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>Số lượng</translation> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation 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>Địa chỉ</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Số lượng</translation> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Received from</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation type="unfinished"/> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Today</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This week</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Last month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This year</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Range...</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>To yourself</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Other</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Min amount</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Tập tin tách biệt bởi dấu phẩy (*.csv)</translation> </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>Nhãn dữ liệu</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Địa chỉ</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Số lượng</translation> </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>ReturnCoin 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 returncoind</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: ReturnCoin.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: returncoind.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 ReturnCoin 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=ReturnCoinrpc 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;ReturnCoin 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. ReturnCoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>ReturnCoin</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 ReturnCoin</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart ReturnCoin 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. ReturnCoin 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>
ReturnCoin/ReturnCoin
src/qt/locale/bitcoin_vi.ts
TypeScript
mit
107,681
require 'gyazo/version' require 'gyazo/error' require 'gyazo/client'
masui/gyazo-ruby
lib/gyazo.rb
Ruby
mit
69
/** * description:维修保养 * author: dongooo * create: 2016-09-18 下午2:38 * php: https://github.com/dongooo **/
dongooo/yonyouAuto
yyauto-web/src/main/webapp/webui/src/app/module/maintain/maintain.js
JavaScript
mit
130
/* jshint unused:true, undef:true, node:true */ /* * The lame logger. Standardize the level of message using html tag names * as logging methods. */ var path = require("path"); var util = require("util"); // Just in case colors was not required previously, we need it here. require("colors"); var argsToArray = function(args) { return Array.prototype.slice.call(args); }; /** * If made truthy, all loggers will display caller information, * despite their individual settings. */ var _globalDisplayCallerInfo = false; /** * Turns on, or off, the display of the caller info, globally overriding * all local settings. * @param setting {Boolean} If truthy, turns on the display of the * caller info for all existing loggers. If falsey, turns it off. */ module.exports.globalDisplayCallerInfo = function(setting) { _globalDisplayCallerInfo = (setting) ? true : false; }; var fmixin = { /** * What line number called this logger method? * NOTE: This method is designed to be called from within a logger * function and will not work as expected if called outside of the * logger. */ _callerInfo: function() { if (!this._displayCallerInfo && !_globalDisplayCallerInfo) { return ""; } else { var callerFrame = (new Error()).stack.split('\n')[3]; // Got the line number trick from: // https://github.com/igo/nlogger // in the file: // https://github.com/igo/nlogger/blob/master/lib/nlogger.js var lineNumber = callerFrame.split(':')[1]; // Made up the filename trick based on the above. var fileName = path.basename(callerFrame.split(/\(|\:/g)[1]); return "("+fileName+":"+lineNumber+") "; } }, /** * Turns on, or off, the display of the caller info. * @param setting {Boolean} If truthy, turns on the display of the * caller info. If falsey, turns it off. */ displayCallerInfo: function(setting) { this._displayCallerInfo = (setting) ? true : false; }, /** * Return the current amount of indentation. * @return {String} The current indentation. * @private */ _getIndent: function() { var currentIndent = []; var i; for (i = 0; i < this._currentIndent; i++) { currentIndent[i] = this._singleIndent; } return currentIndent.join(""); }, /** * Pass arg to set to make llogger be quiet (no output) or not. */ quiet: function () { if (!arguments.length) { return this._quiet; } else { this._quiet = arguments[0]; } }, /** * Increase the indentation level by one. */ indent: function() { this._currentIndent += 1; }, /** * Decrease the indentation level by one (never goes below 0). */ dedent: function() { this._currentIndent -= 1; if (this._currentIndent < 0) { this._currentIndent = 0; } }, /** * Print message as a stylized diagnostic section header. */ h1: function() { if (!this.quiet()) { var prefix = this._callerInfo() + this._getIndent() + "#".magenta.bold; var args = argsToArray(arguments).map(function(a) { if (typeof a != "string") { a = util.inspect(a); } return a.toUpperCase().magenta.bold.inverse; }).join(" "); console.log.call(console, prefix, args); } }, /** * Print message as a stylized diagnostic sub-section header. */ h2: function() { if (!this.quiet()) { var prefix = this._callerInfo() + this._getIndent() + "##".magenta.bold; var args = argsToArray(arguments).map(function(a) { if (typeof a != "string") { a = util.inspect(a); } return a.magenta.bold.inverse; }).join(" "); console.log.call(console, prefix, args); } }, /** * Print message as a stylized diagnostic sub-sub-section header. */ h3: function() { if (!this.quiet()) { var prefix = this._callerInfo() + this._getIndent() + "###".magenta.bold; var args = argsToArray(arguments).map(function(a) { if (typeof a != "string") { a = util.inspect(a); } return a.magenta.bold; }).join(" "); console.log.call(console, prefix, args); } }, /** * Print message as a stylized diagnostic sub-sub-sub-section header. */ h4: function() { if (!this.quiet()) { var prefix = this._callerInfo() + this._getIndent() + "####".magenta.bold; var args = argsToArray(arguments).map(function(a) { if (typeof a != "string") { a = util.inspect(a); } return a.magenta.bold; }).join(" "); console.log.call(console, prefix, args); } }, /** * Print message as a stylized diagnostic sub-sub-sub-sub-section header. */ h5: function() { if (!this.quiet()) { var prefix = this._callerInfo() + this._getIndent() + "#####".magenta.bold; var args = argsToArray(arguments).map(function(a) { if (typeof a != "string") { a = util.inspect(a); } return a.magenta; }).join(" "); console.log.call(console, prefix, args); } }, /** * Print message as a stylized diagnostic sub-sub-sub-sub-sub-section * header. */ h6: function() { if (!this.quiet()) { var prefix = this._callerInfo() + this._getIndent() + "######".magenta.bold; var args = argsToArray(arguments).map(function(a) { if (typeof a != "string") { a = util.inspect(a); } return a.toLowerCase().magenta; }).join(" "); console.log.call(console, prefix, args); } }, /** * Indent message one level in from the current indentation level. */ li: function() { if (!this.quiet()) { var prefix = this._callerInfo() + this._getIndent() + "*".green; var args = argsToArray(arguments).map(function(a) { if (typeof a != "string") { a = util.inspect(a); } return a.green; }).join(" "); console.log.call(console, prefix, args); } }, /** * Prints out an 80 character horizontal rule. */ hr: function() { if (!this.quiet()) { var hr = []; for (var i = 0; i < 79; i++) { hr[i] = "-"; } console.log(this._callerInfo() + this._getIndent() + hr.join("").green); } }, /** * Print a regular output message. * Output is sent through console.log. * (Output is immune to the indentation rules but will print file info.) */ // This will get linked up in the "constructor" function. //log: baseLogger, /** * Print a warning message. * Output is sent through console.warn. * (Output is immune to the indentation rules but will print file info.) */ warn: function() { if (!this.quiet()) { var prefix = this._callerInfo().yellow + "WARNING:".yellow; var args = argsToArray(arguments).map(function(a) { if (typeof a != "string") { a = util.inspect(a); } return a.yellow; }).join(" "); console.log.call(console, prefix, args); } }, /** * Print an error message. * Output is sent through console.error. * (Output is immune to the indentation rules but will print file info.) */ error: function() { if (!this.quiet()) { var prefix = this._callerInfo().red + "ERROR:".red; var args = argsToArray(arguments).map(function(a) { if (typeof a != "string") { a = util.inspect(a); } return a.red; }).join(" "); console.log.call(console, prefix, args); } }, }; /** * Create a new logger instance. */ module.exports.create = function() { // Most of this bullshit is because Function.prototype.bind doesn't operate // like I thought it would when passing a f() as a thisArg. var self = Object.create(fmixin); /** * Should the caller info be displayed with messages or not? * @type {Boolean} * @private */ self._displayCallerInfo = false; /** * What represents a single indentation level? * @type {String} * @private */ self._singleIndent = " "; /** * What is the current indentation level? * @type {Number} * @private */ self._currentIndent = 0; /** * Are we quiet or not? */ self._quiet = false; // Function that also acts as base object / namespace. // Must be bound before calling var baseLogger = function() { if (!self.quiet()) { var prefix = self._callerInfo().green; var args = argsToArray(arguments).map(function(a) { if (typeof a != "string") { a = util.inspect(a); } return a.green; }).join(" "); // This is the only one routinely blank. if (prefix) { args = prefix + args; } console.log.call(console, args); } }; for (var prop in fmixin) { if (fmixin.hasOwnProperty(prop)) { // Ugh blargl cthulhu cthulhu beetlegeuse. baseLogger[prop] = fmixin[prop].bind(self); } } baseLogger.log = baseLogger; // Need to bind here since this function is also used as a generic mixin // to the prototype. return baseLogger; };
jeremyosborne/llogger
llogger.js
JavaScript
mit
10,299
using MvvmCross; using MvvmCross.Plugin; namespace MvvX.Plugins.OAuthClient { [MvxPlugin] public class Plugin : IMvxPlugin { public void Load() { Mvx.IoCProvider.RegisterSingleton<IOAuthClient>(new PlatformOAuthClient()); } } }
mathieumack/MvvX.Plugins.OauthClient
MvvX.Plugins.OAuthClient/platforms/android/Plugin.cs
C#
mit
280
# frozen_string_literal: true # This class extends an OpenStruct object by adding predicate methods to mimic # ActiveRecord access. We rely on the initial values being true or false to # determine whether to define a predicate method because for a newly-added # column that has not been migrated yet, there is no way to determine the # column type without parsing db/structure.sql. module Gitlab class FakeApplicationSettings < OpenStruct include ApplicationSettingImplementation # Mimic ActiveRecord predicate methods for boolean values def self.define_predicate_methods(options) options.each do |key, value| next if key.to_s.end_with?('?') next unless [true, false].include?(value) define_method "#{key}?" do actual_key = key.to_s.chomp('?') self[actual_key] end end end def initialize(options = {}) super FakeApplicationSettings.define_predicate_methods(options) end alias_method :read_attribute, :[] alias_method :has_attribute?, :[] end end Gitlab::FakeApplicationSettings.prepend_if_ee('EE::Gitlab::FakeApplicationSettings')
mmkassem/gitlabhq
lib/gitlab/fake_application_settings.rb
Ruby
mit
1,150
package com.home.pori.demo_proj_01; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.home.pori.demo_proj_01", appContext.getPackageName()); } }
subhamoykarmakar224/GREQuant
DEMO_PROJ_01/app/src/androidTest/java/com/home/pori/demo_proj_01/ExampleInstrumentedTest.java
Java
mit
756
import {expect} from "chai"; import Sinon from "sinon"; import {CLASS_STORE, descriptorOf, Metadata, METHOD_STORE, PARAM_STORE, PROPERTY_STORE, prototypeOf, Store} from "../../src"; class FakeMetadata { attr1: any; attr2: any; constructor(public target: any) {} test() { return this.target; } } class SuperFake extends FakeMetadata {} describe("Store", () => { describe("constructor", () => { describe("when metadata should be store on class", () => { let spyGet: any, store: any, store2: any, store3: any; before(() => { spyGet = Sinon.spy(Metadata, "getOwn"); store = Store.from(FakeMetadata); store2 = Store.from(FakeMetadata); store3 = Store.from(class {}); store.set("keyTest", {test: "2"}); }); after(() => { spyGet.restore(); }); it("should have been called the Metadata.get()", () => { expect(spyGet).to.have.been.calledWithExactly(CLASS_STORE, FakeMetadata); }); it("should share the same StoreMap when the signature is equals", () => { expect(store.get("keyTest")).to.eq(store2.get("keyTest")); }); it("should not share the same StoreMap when the signature is not equals", () => { expect(store.get("keyTest")).not.to.eq(store3.get("keyTest")); }); }); describe("when metadata should be store on method", () => { let spyGet: any, store: any; before(() => { spyGet = Sinon.spy(Metadata, "getOwn"); store = Store.from(FakeMetadata, "get", { value: () => {} }); }); after(() => { spyGet.restore(); }); it("should have been called the Metadata.get()", () => { expect(spyGet).to.have.been.calledWithExactly(METHOD_STORE, FakeMetadata, "get"); }); }); describe("when metadata should be store on property (1)", () => { let spyGet: any, store: any; before(() => { spyGet = Sinon.spy(Metadata, "getOwn"); store = Store.from(FakeMetadata, "get"); }); after(() => { spyGet.restore(); }); it("should have been called the Metadata.get()", () => { expect(spyGet).to.have.been.calledWithExactly(PROPERTY_STORE, FakeMetadata, "get"); }); }); describe("when metadata should be store on property (2)", () => { let spyGet: any, store: any; before(() => { spyGet = Sinon.spy(Metadata, "getOwn"); store = Store.from(FakeMetadata, "get", { set: () => {} }); }); after(() => { spyGet.restore(); }); it("should have been called the Metadata.get()", () => { expect(spyGet).to.have.been.calledWithExactly(PROPERTY_STORE, FakeMetadata, "get"); }); }); describe("when metadata should be store on property (3)", () => { let spyGet: any, store: any; before(() => { spyGet = Sinon.spy(Metadata, "getOwn"); store = Store.from(FakeMetadata, "get", { get: () => {} }); }); after(() => { spyGet.restore(); }); it("should have been called the Metadata.get()", () => { expect(spyGet).to.have.been.calledWithExactly(PROPERTY_STORE, FakeMetadata, "get"); }); }); describe("when metadata should be store on parameters", () => { let spyGet: any, store: any; before(() => { spyGet = Sinon.spy(Metadata, "getOwn"); store = Store.from(FakeMetadata, "get", 0); }); after(() => { spyGet.restore(); }); it("should have been called the Metadata.get()", () => { expect(spyGet).to.have.been.calledWithExactly(PARAM_STORE, FakeMetadata, "get"); }); }); }); describe("set()", () => { let store: any; before(() => { store = Store.from(FakeMetadata); store.set("key", {}); }); it("should add a metadata", () => { expect(store.get("key")).to.deep.equal({}); }); }); describe("has()", () => { let store: any; before(() => { store = Store.from(FakeMetadata); }); it("should return true if class is known", () => { expect(store.has("key")).to.be.true; }); it("should return false if class is unknown", () => { expect(store.has("key2")).to.be.false; }); }); describe("delete()", () => { let store: any; before(() => { store = Store.from(FakeMetadata); }); it("should remove key", () => { store.set("key", {test: true}); expect(store.get("key")).to.deep.equal({test: true}); store.delete("key"); expect(store.get("key")).to.equal(undefined); }); }); describe("merge()", () => { let store: any; before(() => { store = Store.from(FakeMetadata); store.merge("key3", {attr1: 1}); store.merge("key3", {attr2: 2}); }); it("should merge metadata", () => { expect(store.get("key3")).to.deep.equal({attr1: 1, attr2: 2}); }); }); describe("inheritance", () => { let r1: any, r2: any; before(() => { Store.from(FakeMetadata).set("sc", {test: "test"}); Store.from(SuperFake).set("sc", {test: "test2"}); r1 = Store.from(SuperFake).get("sc"); r2 = Store.from(FakeMetadata).get("sc"); }); it("should haven't the same sc", () => { expect(r1).to.not.deep.equal(r2); }); }); describe("from()", () => { it("should create a store from Symbol", () => { // GIVEN const TOKEN = Symbol.for("token"); const TOKEN2 = Symbol.for("token2"); const store1 = Store.from(TOKEN); const store2 = Store.from(TOKEN); const store3 = Store.from(TOKEN2); // WHEN store1.set("test", "value"); expect(store2.get("test")).to.eq("value"); expect(store3.get("test")).to.eq(undefined); }); }); });
Romakita/ts-express-decorators
packages/core/src/domain/Store.spec.ts
TypeScript
mit
5,880
package dorp import ( "errors" "fmt" "io" "golang.org/x/crypto/nacl/secretbox" ) // A SetMessage is the Go representation of the JSON message // sent to set states type SetMessage struct { DoorState string LightState string } // A State is a binary condition of the door or lights. type State byte //go:generate stringer -type=State // Positive and Negative are the two possible states const ( Negative State = iota Positive ) // ErrWrongNumberOfStates may be returned if a function takes a slice of states // and got the wrong number. This probably will only occur deserializing network data. var ErrWrongNumberOfStates = errors.New("incorrect state count") // GenerateNonce creats a 24 byte nonce from the source of randomness rand func GenerateNonce(rand io.Reader) ([24]byte, error) { var nonce [24]byte var n int for i := 0; i < 3; i++ { n, _ = rand.Read(nonce[:]) if n == 24 { break } } if n != 24 { return nonce, fmt.Errorf("encrypt: unable to read 24 random bytes for nonce (read %d)", n) } return nonce, nil } // KeyToByteArray converts a key to the [32]bytes required by nacl.secretbox func KeyToByteArray(key string) ([32]byte, error) { var k [32]byte if len(key) != 32 { return k, fmt.Errorf("Key must be 32 bytes (characters) long") } n := copy(k[:], []byte(key)) if n != 32 { return k, fmt.Errorf("Copying key failed") } return k, nil } // ProcessNonceMessage takes the message from the server and the shared key // and returns the next nonce the server expects func ProcessNonceMessage(message *[64]byte, key *[32]byte) (*[24]byte, error) { var nonce [24]byte copy(nonce[:], message[64-24:]) var nextNonce []byte var ok bool nextNonce, ok = secretbox.Open(nextNonce, message[:64-24], &nonce, key) if !ok { return nil, fmt.Errorf("Unable to open box") } n := copy(nonce[:], nextNonce) if n != 24 { return nil, fmt.Errorf("Recvd nonce has incorrect length") } return &nonce, nil } // Thought of a haiku // I may as well leave it here // To be found by you
millere/dorp
dorp.go
GO
mit
2,034
package com.mczal.nb.controller; import com.mczal.nb.dto.InputSetDtoRequest; import com.mczal.nb.service.hdfs.HdfsService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.concurrent.atomic.AtomicInteger; /** * Created by mczal on 08/03/17. */ @Controller @RequestMapping(InputSetController.ABSOLUTE_PATH) public class InputSetController { public static final String ABSOLUTE_PATH = "/admin/input-set"; private static final String LAYOUTS_ADMIN = "layouts/admin"; private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private HdfsService hdfsService; @Value("${hdfs.input.regex}") private String regex; @RequestMapping({"", "/"}) public String index(Model model) throws Exception { return "redirect:" + ABSOLUTE_PATH + "/both"; } @RequestMapping("/both") public String indexBoth(Model model) throws Exception { // return "redirect:/admin/home"; model.addAttribute("view", "input-set-both"); model.addAttribute("inputSet", new InputSetDtoRequest()); // logger.info("listInputDirOnPath(): " + hdfsService.listInputDirOnPath().toString()); model.addAttribute("availableDirs", hdfsService.listInputDirOnPath()); return LAYOUTS_ADMIN; } @RequestMapping("/infoonly") public String indexInfoOnly(Model model) throws Exception { // return "redirect:/admin/home"; model.addAttribute("view", "input-set-infoonly"); model.addAttribute("inputSet", new InputSetDtoRequest()); // logger.info("listInputDirOnPath(): " + hdfsService.listInputDirOnPath().toString()); model.addAttribute("availableDirs", hdfsService.listInputDirOnPath()); return LAYOUTS_ADMIN; } @RequestMapping("/inputonly") public String indexInputOnly(Model model) throws Exception { // return "redirect:/admin/home"; model.addAttribute("view", "input-set-inputonly"); model.addAttribute("inputSet", new InputSetDtoRequest()); // logger.info("listInputDirOnPath(): " + hdfsService.listInputDirOnPath().toString()); model.addAttribute("availableDirs", hdfsService.listInputDirOnPath()); return LAYOUTS_ADMIN; } @RequestMapping(method = RequestMethod.POST, value = "") public String postFile(Model model, InputSetDtoRequest inputSetDtoRequest, RedirectAttributes redirectAttributes) throws Exception { // logger.info(inputSetDtoRequest.toString()); if (inputSetDtoRequest.getFilesInput().length == 0 || inputSetDtoRequest.getFilesInfo().length == 0 || inputSetDtoRequest.getTypes().size() == 0 || inputSetDtoRequest.getClazz().size() == 0) { redirectAttributes.addFlashAttribute("danger", "File error on upload files"); return "redirect:" + ABSOLUTE_PATH; } String modelDir; if (inputSetDtoRequest.getModelDirSelect().equals("null")) { if (inputSetDtoRequest.getModelDir() == null || inputSetDtoRequest.getModelDir().trim() .equals("")) { redirectAttributes.addFlashAttribute("danger", "Error upload new file"); return "redirect:" + ABSOLUTE_PATH; } else { modelDir = inputSetDtoRequest.getModelDir(); hdfsService.cleanHdfsDir(modelDir); } } else { modelDir = inputSetDtoRequest.getModelDirSelect(); } BufferedReader brInfo = new BufferedReader( new InputStreamReader(inputSetDtoRequest.getFilesInfo()[0].getInputStream())); int countCols = hdfsService .transformAndTransferInfoToHdfsInfo(brInfo, inputSetDtoRequest.getClazz(), inputSetDtoRequest.getTypes(), modelDir); // logger.info( // "inputSetDtoRequest.getFilesInput().length = " + inputSetDtoRequest.getFilesInput().length); AtomicInteger atomicInteger = new AtomicInteger(1); Arrays.stream(inputSetDtoRequest.getFilesInput()).forEach(multipartFile -> { // logger.info("FileName: " + multipartFile.getOriginalFilename()); try { BufferedReader brInput = new BufferedReader(new InputStreamReader(multipartFile.getInputStream())); BufferedReader brInputLines = new BufferedReader(new InputStreamReader(multipartFile.getInputStream())); AtomicInteger totalLinesAtomic = new AtomicInteger(0); brInputLines.lines().forEach(s -> { totalLinesAtomic.incrementAndGet(); }); int totalLines = totalLinesAtomic.get(); hdfsService.transportToHdfs(brInput, modelDir, atomicInteger.getAndIncrement(), inputSetDtoRequest.getPercentage(), totalLines, countCols); } catch (Exception e) { e.printStackTrace(); } }); // BufferedReader brInput = new BufferedReader( // new InputStreamReader(inputSetDtoRequest.getFilesInput()[0].getInputStream())); // hdfsService.transportToHdfs(brInput, inputSetDtoRequest.getModelDir()); redirectAttributes.addFlashAttribute("success", "Success upload new file to HDFS"); return "redirect:" + ABSOLUTE_PATH; } @RequestMapping(method = RequestMethod.POST, value = "/infoonly") public String postInfoOnly(Model model, InputSetDtoRequest inputSetDtoRequest, RedirectAttributes redirectAttributes) throws Exception { if (inputSetDtoRequest.getFilesInput() != null || inputSetDtoRequest.getFilesInfo().length == 0 || inputSetDtoRequest.getTypes().size() == 0 || inputSetDtoRequest.getClazz().size() == 0) { redirectAttributes.addFlashAttribute("danger", "File error on upload files"); return "redirect:" + ABSOLUTE_PATH; } String modelDir; if (inputSetDtoRequest.getModelDirSelect().equals("null")) { if (inputSetDtoRequest.getModelDir() == null || inputSetDtoRequest.getModelDir().trim() .equals("")) { redirectAttributes.addFlashAttribute("danger", "Error upload new file"); return "redirect:" + ABSOLUTE_PATH + "/infoonly"; } else { modelDir = inputSetDtoRequest.getModelDir(); hdfsService.cleanHdfsDir(modelDir); } } else { modelDir = inputSetDtoRequest.getModelDirSelect(); } BufferedReader brInfo = new BufferedReader( new InputStreamReader(inputSetDtoRequest.getFilesInfo()[0].getInputStream())); int countCols = hdfsService .transformAndTransferInfoToHdfsInfo(brInfo, inputSetDtoRequest.getClazz(), inputSetDtoRequest.getTypes(), modelDir); redirectAttributes.addFlashAttribute("success", "Success upload info file"); return "redirect:" + ABSOLUTE_PATH + "/infoonly"; } @RequestMapping(method = RequestMethod.POST, value = "/inputonly") public String postInputOnly(Model model, InputSetDtoRequest inputSetDtoRequest, RedirectAttributes redirectAttributes) throws Exception { if (inputSetDtoRequest.getFilesInput().length == 0 || inputSetDtoRequest.getFilesInfo().length == 0 || inputSetDtoRequest.getTypes().size() > 0 || inputSetDtoRequest.getClazz().size() > 0) { redirectAttributes.addFlashAttribute("danger", "File error on upload files"); logger.error("Error"); logger.error("inputlength: " + inputSetDtoRequest.getFilesInput().length); logger.error("infolength: " + inputSetDtoRequest.getFilesInfo().length); logger.error("typesSize: " + inputSetDtoRequest.getTypes().size()); logger.error("clazzSize: " + inputSetDtoRequest.getClazz().size()); return "redirect:" + ABSOLUTE_PATH + "/inputonly"; } String modelDir; if (inputSetDtoRequest.getModelDirSelect().equals("null")) { if (inputSetDtoRequest.getModelDir() == null || inputSetDtoRequest.getModelDir().trim() .equals("")) { redirectAttributes.addFlashAttribute("danger", "Error upload new file"); return "redirect:" + ABSOLUTE_PATH; } else { modelDir = inputSetDtoRequest.getModelDir(); hdfsService.cleanHdfsDir(modelDir); } } else { modelDir = inputSetDtoRequest.getModelDirSelect(); } BufferedReader brInfo = new BufferedReader( new InputStreamReader(inputSetDtoRequest.getFilesInfo()[0].getInputStream())); int countCols = (int) brInfo.lines().findFirst().get().split(regex).length; AtomicInteger atomicInteger = new AtomicInteger(1); Arrays.stream(inputSetDtoRequest.getFilesInput()).forEach(multipartFile -> { // logger.info("FileName: " + multipartFile.getOriginalFilename()); try { BufferedReader brInput = new BufferedReader(new InputStreamReader(multipartFile.getInputStream())); BufferedReader brInputLines = new BufferedReader(new InputStreamReader(multipartFile.getInputStream())); AtomicInteger totalLinesAtomic = new AtomicInteger(0); brInputLines.lines().forEach(s -> { totalLinesAtomic.incrementAndGet(); }); int totalLines = totalLinesAtomic.get(); hdfsService.transportToHdfs(brInput, modelDir, atomicInteger.getAndIncrement(), inputSetDtoRequest.getPercentage(), totalLines, countCols); } catch (Exception e) { e.printStackTrace(); } }); redirectAttributes.addFlashAttribute("success", "Success upload input file"); return "redirect:" + ABSOLUTE_PATH + "/inputonly"; } }
mczal/spring-naivebayes
src/main/java/com/mczal/nb/controller/InputSetController.java
Java
mit
9,792
// setup global chai methods import { expect } from 'chai' import Vue from 'vue/dist/vue.common' import VueTouch from '../helpers/vue-touch' import { createFromTemplate, isEnabled, isDisabled, allDisabled } from '../helpers' describe('VueTouch.enabledProps', () => { beforeEach(() => { Vue.use(VueTouch) }) it('prop is true by default & events are enabled', () => { const vt = createFromTemplate(` <v-touch @tap="cb" @swipe="cb" /> `) const propEnabled = vt.enabled expect(propEnabled).to.be.true const rcEnabled = isEnabled(vt, 'tap') expect(rcEnabled).to.be.true }) it('all rcg disabled when enabled="false"', () => { const vt = createFromTemplate(` <v-touch v-bind:enabled="false" v-on:tap="cb" v-on:swipe="cb" /> `) expect(vt.enabled).to.be.false const areAllDisabled = allDisabled(vt) expect(areAllDisabled).to.be.true }) it('Passing obj to enabled prop correctly toggles recognizers', () => { const vt = createFromTemplate(` <v-touch v-bind:enabled="{ tap: true, swipe: false }" v-on:tap="cb" v-on:swipe="cb" /> `) vt.$nextTick() .then(() => { const tapEnabled = isEnabled(vt, 'tap') const swipeDisabled = isDisabled(vt, 'swipe') expect(tapEnabled && swipeDisabled).to.be.true }) .then(() => { vt.updateEnabled({ tap: false, swipe: true }) return vt.$nextTick() }) .then(() => { const tapDisabled = isDisabled(vt, 'tap') const swipeEnabled = isEnabled(vt, 'swipe') expect(tapDisabled && swipeEnabled).to.be.true }) }) })
whjvenyl/vue-touch-next
test/specs/enabledProps.js
JavaScript
mit
1,679
namespace SubClassing { partial class Form1 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.SuspendLayout(); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(552, 175); this.Name = "Form1"; this.Text = "Basic Sub-classing Demo"; this.ResumeLayout(false); } #endregion } }
Dhiraj3005/Mastering-C-Sharp-and-.NET-Framework
Chapter13/1-SubClassing/SubClassing/Form1.Designer.cs
C#
mit
1,383
import React, {Component} from 'react'; import {StyleSheet, Image, View, Text} from 'react-native'; export default class PersonalInfo extends Component { static navigationOptions = { headerTitle: "我", }; render() { return ( <View style={styles.container}> <Image style={styles.imageStyle} source={require('../images/avatar.jpg')}/> <Text>我的Github: https://github.com/panyz</Text> <Text>Repo: https://github.com/panyz/GankAndPanyz</Text> <Text style={{marginTop: 30, marginHorizontal: 30}}> This is a completely developed by the React Native App, inside the data from the contents of gank.io and their own GitHub some of the Content. 这是一个完全由React Native开发的App,里面的数据内容来自gank.io(干货集中营)和自己GitHub上的一些Content。有什么问题, 欢迎到Issue中提出! </Text> </View> ) } } const styles = StyleSheet.create({ container: { flex: 1, alignItems: 'center' }, textStyle: {}, imageStyle: { borderRadius: 100, height: 80, width: 80, marginVertical: 15, } });
panyz/GankAndPanyz
src/pages/PersonalInfoPage.js
JavaScript
mit
1,320
<html> <head> <title> Why can't Congress oppose the war? </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <?php include "../../legacy-includes/Script.htmlf" ?> </head> <body bgcolor="#FFFFCC" text="000000" link="990000" vlink="660000" alink="003366" leftmargin="0" topmargin="0"> <table width="744" cellspacing="0" cellpadding="0" border="0"> <tr><td width="474"><a name="Top"></a><?php include "../../legacy-includes/TopLogo.htmlf" ?></td> <td width="270"><?php include "../../legacy-includes/TopAd.htmlf" ?> </td></tr></table> <table width="744" cellspacing="0" cellpadding="0" border="0"> <tr><td width="18" bgcolor="FFCC66"></td> <td width="108" bgcolor="FFCC66" valign=top><?php include "../../legacy-includes/LeftButtons.htmlf" ?></td> <td width="18"></td> <td width="480" valign="top"> <?php include "../../legacy-includes/BodyInsert.htmlf" ?> <font face="Arial, Helvetica, sans-serif" size="2"><b>WHAT WE THINK</b></font><br> <font face="Times New Roman, Times, serif" size="4">Two-thirds of people around the U.S. do...</font><br> <font face="Times New Roman, Times, serif" size="5"><b>Why can't Congress oppose the war?</b></font><p> <font face="Arial, Helvetica, sans-serif" size="2">February 23, 2007 | Page 3</font><p> <font face="Times New Roman, Times, serif" size="3">LAST NOVEMBER, the congressional elections sent a clear message that a majority of people wanted to see an end to the U.S. war on Iraq. Four months later, and the new Democrat-controlled Congress hasn't managed to get all its members to cast a vote about the most pressing political issue of the day.<p> The House of Representatives at least managed to pass a nonbinding resolution disapproving of the Bush administration's plans to send 21,500 additional troops to Iraq.<p> But last weekend, with the Senate called into a special Saturday session, Republicans used undemocratic procedural tactics--the same ones they railed against the former Democratic minority for even mentioning, much less using--to block a vote on a similar measure.<p> In October 2002, within hours of the House approving a resolution giving Bush the authority to declare war on Iraq, the Senate took no time whipping up a resounding yes vote. Four years later, with Iraq occupation spiraling into ever-deeper crisis, the "world's greatest deliberative body" can't muster enough votes to bring a nonbinding resolution to the floor.<p> But even if the Senate could manage a vote on the nonbinding resolution passed by the House, there's another problem with it. It's nonbinding.<p> The question now is if the Democrats who talk a good game when it comes to criticizing Bush's escalation in Iraq will do something concrete to challenge the administration's war policy.<p> A good place to start would be the almost $100 billion in emergency supplemental funding for the war in Iraq that Bush needs Congress to approve in the coming months.<p> But weak-in-the-knees Democrats have already been bowing before the complaints of Republicans accusing them of "not supporting our troops." "They've denounced the surge," accused Sen. Mitch McConnell (R-Ky.) "The question is, are they going to fund the troops?"<p> As if the goal of those who want to end the occupation is to withdraw all the bombs and warplanes and supplies from Iraq--but leave U.S. soldiers. If any of the politicians really cared about "supporting our troops," they would fight to bring them home right now.<p> <p><font face="Arial, Helvetica, sans-serif" size="1">- - - - - - - - - - - - - - - -</font></p> <font face="Times New Roman, Times, serif" size="3">SOME DEMOCRATS are putting forward proposals on Iraq that go beyond nonbinding resolutions.<p> One from House Appropriations Defense Subcommittee Chair Rep. John Murtha would add provisions to the supplemental funding bill that, he claims, would make it harder for Bush to go through with his troop surge.<p> The Murtha plan is favored by many Democrats because it doesn't actually call for cutting off funds for the war. "We're going to make sure people understand we're supporting the troops and protecting the troops," Murtha said in an interview posted on the Web by the antiwar group Win Without War.<p> Liberal lobbying groups are joining right in. "What we have staked out is a campaign to stop the war without cutting off funding" for the troops, said Tom Mazzie of Americans Against Escalation of the War in Iraq. "We call it the 'readiness strategy.'"<p> But a "campaign to stop the war without cutting off funding" is in reality a campaign to stop the war without stopping the war. It makes about as much sense as an antiwar group calling itself "Win Without War"--especially four years after the war has started.<p> Resolutions like Murtha's could give Democrats cover on the Iraq issue, but they don't do anything to stop the Iraq war.<p> The toughest proposal on Iraq from a Democrat--House Resolution 508, introduced by Reps. Barbara Lee, Maxine Waters and Lynne Woolsey--would set a six-month deadline for the withdrawal of all U.S. troops within six months.<p> The bill isn't unconditional. It calls for an "international stabilization force" to stay in Iraq for up to two years after the end of the U.S. occupation--if "requested" by an Iraqi government.<p> But the worst thing about this legislation is that it doesn't stand a chance of passing--and its liberal sponsors know it. It amounts to an attempt to show that antiwar forces have a voice in the halls of Congress--while the "real" debate takes place among "pragmatic" Democrats whose concern isn't ending the occupation, but deciding how best to manage it.<p> The Democrats are interested in saving the war on Iraq from the Bush administration's disastrous mistakes, not ending it.<p> The possibility of galvanizing support for immediate withdrawal in Iraq is plain.<p> Take a recent petition issued by Noam Chomsky, Howard Zinn, Cindy Sheehan and others, which argued, "We call on the U.S. to get out of Iraq--not in six months, not in a year, but now." Or Vermont, where the state Senate and House passed a resolution calling for U.S. forces to "immediately withdraw" from Iraq,<p> Antiwar activists can set their sights on demonstrations called around the country for the weekend of March 17--the fourth anniversary of the invasion--to keep up the demand for immediate withdrawal.<p> <?php include "../../legacy-includes/BottomNavLinks.htmlf" ?> <td width="12"></td> <td width="108" valign="top"> <?php include "../../legacy-includes/RightAdFolder.htmlf" ?> </td> </tr> </table> </body> </html>
ISO-tech/sw-d8
web/2007-1/620/620_03_Congress.php
PHP
mit
6,602
//2D sprite class //Created by James Vanderhyde, 31 May 2010 import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GraphicsConfiguration; import java.awt.Image; import java.awt.Rectangle; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import javax.swing.ImageIcon; public class ImageSprite { //Screen coordinates protected double x,y; protected double width, height; protected Image image; public ImageSprite() { image=null; } public ImageSprite(String imageFileName) { this.setImage(imageFileName); x=this.width/2; y=this.height/2; } public ImageSprite(String imageFileName, GraphicsConfiguration gc) { this(imageFileName); this.createCompatibleImage(gc); } protected final void setImage(String name) { image=(new ImageIcon(this.getClass().getResource(name))).getImage(); //image=(new ImageIcon(name)).getImage(); width=image.getWidth(null); height=image.getHeight(null); } private void createCompatibleImage(GraphicsConfiguration gc) { BufferedImage copy; if (image instanceof BufferedImage) { BufferedImage bim = (BufferedImage)image; int transparency = bim.getColorModel().getTransparency(); copy = gc.createCompatibleImage(bim.getWidth(), bim.getHeight(), transparency); } else { final int t=java.awt.Transparency.TRANSLUCENT; copy = gc.createCompatibleImage(image.getWidth(null), image.getHeight(null),t); } //copy image Graphics2D g2d = copy.createGraphics(); g2d.drawImage(image,0,0,null); g2d.dispose(); image=copy; } public static BufferedImage loadCompatibleImage(String imageFileName,GraphicsConfiguration gc) { ImageSprite s=new ImageSprite(imageFileName,gc); return (BufferedImage)s.image; } public void paint(Graphics g) { Rectangle viewport=g.getClipBounds(); if ((viewport==null) || (viewport.intersects(this.getBoundingRect()))) g.drawImage(image, (int)Math.floor(x-width/2), (int)Math.floor(y-height/2), null); } public Rectangle2D.Double getBoundingRect() { return new Rectangle2D.Double(x-width/2, y-height/2,width,height); } public double getX() { return x; } public void setX(double x) { this.x=x; } public double getY() { return y; } public void setY(double y) { this.y=y; } }
jvanderhyde/worlds-tiniest-platformer
TiniestPlatformer/src/ImageSprite.java
Java
mit
2,494
#include "guiutil.h" #include "bitcoinaddressvalidator.h" #include "walletmodel.h" #include "bitcoinunits.h" #include "util.h" #include "init.h" #include "base58.h" #include <QString> #include <QDateTime> #include <QDoubleValidator> #include <QFont> #include <QLineEdit> #include <QUrl> #include <QTextDocument> // For Qt::escape #include <QAbstractItemView> #include <QApplication> #include <QClipboard> #include <QFileDialog> #include <QDesktopServices> #include <QThread> #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> #ifdef WIN32 #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif #define _WIN32_WINNT 0x0501 #ifdef _WIN32_IE #undef _WIN32_IE #endif #define _WIN32_IE 0x0501 #define WIN32_LEAN_AND_MEAN 1 #ifndef NOMINMAX #define NOMINMAX #endif #include "shlwapi.h" #include "shlobj.h" #include "shellapi.h" #endif namespace GUIUtil { QString dateTimeStr(const QDateTime &date) { return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm"); } QString dateTimeStr(qint64 nTime) { return dateTimeStr(QDateTime::fromTime_t((qint32)nTime)); } QFont bitcoinAddressFont() { QFont font("Monospace"); font.setStyleHint(QFont::TypeWriter); return font; } void setupAddressWidget(QLineEdit *widget, QWidget *parent) { widget->setMaxLength(BitcoinAddressValidator::MaxAddressLength); widget->setValidator(new BitcoinAddressValidator(parent)); widget->setFont(bitcoinAddressFont()); } void setupAmountWidget(QLineEdit *widget, QWidget *parent) { QDoubleValidator *amountValidator = new QDoubleValidator(parent); amountValidator->setDecimals(8); amountValidator->setBottom(0.0); widget->setValidator(amountValidator); widget->setAlignment(Qt::AlignRight|Qt::AlignVCenter); } bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out) { if(uri.scheme() != QString("densecoin")) return false; // check if the address is valid CBitcoinAddress addressFromUri(uri.path().toStdString()); if (!addressFromUri.IsValid()) return false; SendCoinsRecipient rv; rv.address = uri.path(); rv.amount = 0; QList<QPair<QString, QString> > items = uri.queryItems(); for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++) { bool fShouldReturnFalse = false; if (i->first.startsWith("req-")) { i->first.remove(0, 4); fShouldReturnFalse = true; } if (i->first == "label") { rv.label = i->second; fShouldReturnFalse = false; } else if (i->first == "amount") { if(!i->second.isEmpty()) { if(!BitcoinUnits::parse(BitcoinUnits::BTC, i->second, &rv.amount)) { return false; } } fShouldReturnFalse = false; } if (fShouldReturnFalse) return false; } if(out) { *out = rv; } return true; } bool parseBitcoinURI(QString uri, SendCoinsRecipient *out) { // Convert densecoin:// to densecoin: // // Cannot handle this later, because densecoin:// will cause Qt to see the part after // as host, // which will lowercase it (and thus invalidate the address). if(uri.startsWith("densecoin://")) { uri.replace(0, 11, "densecoin:"); } QUrl uriInstance(uri); return parseBitcoinURI(uriInstance, out); } QString HtmlEscape(const QString& str, bool fMultiLine) { QString escaped = Qt::escape(str); if(fMultiLine) { escaped = escaped.replace("\n", "<br>\n"); } return escaped; } QString HtmlEscape(const std::string& str, bool fMultiLine) { return HtmlEscape(QString::fromStdString(str), fMultiLine); } void copyEntryData(QAbstractItemView *view, int column, int role) { if(!view || !view->selectionModel()) return; QModelIndexList selection = view->selectionModel()->selectedRows(column); if(!selection.isEmpty()) { // Copy first item QApplication::clipboard()->setText(selection.at(0).data(role).toString()); } } QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut) { QString selectedFilter; QString myDir; if(dir.isEmpty()) // Default to user documents location { myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); } else { myDir = dir; } QString result = QFileDialog::getSaveFileName(parent, caption, myDir, filter, &selectedFilter); /* Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...) */ QRegExp filter_re(".* \\(\\*\\.(.*)[ \\)]"); QString selectedSuffix; if(filter_re.exactMatch(selectedFilter)) { selectedSuffix = filter_re.cap(1); } /* Add suffix if needed */ QFileInfo info(result); if(!result.isEmpty()) { if(info.suffix().isEmpty() && !selectedSuffix.isEmpty()) { /* No suffix specified, add selected suffix */ if(!result.endsWith(".")) result.append("."); result.append(selectedSuffix); } } /* Return selected suffix if asked to */ if(selectedSuffixOut) { *selectedSuffixOut = selectedSuffix; } return result; } Qt::ConnectionType blockingGUIThreadConnection() { if(QThread::currentThread() != QCoreApplication::instance()->thread()) { return Qt::BlockingQueuedConnection; } else { return Qt::DirectConnection; } } bool checkPoint(const QPoint &p, const QWidget *w) { QWidget *atW = qApp->widgetAt(w->mapToGlobal(p)); if (!atW) return false; return atW->topLevelWidget() == w; } bool isObscured(QWidget *w) { return !(checkPoint(QPoint(0, 0), w) && checkPoint(QPoint(w->width() - 1, 0), w) && checkPoint(QPoint(0, w->height() - 1), w) && checkPoint(QPoint(w->width() - 1, w->height() - 1), w) && checkPoint(QPoint(w->width() / 2, w->height() / 2), w)); } void openDebugLogfile() { boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; /* Open debug.log with the associated application */ if (boost::filesystem::exists(pathDebug)) QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(pathDebug.string()))); } ToolTipToRichTextFilter::ToolTipToRichTextFilter(int size_threshold, QObject *parent) : QObject(parent), size_threshold(size_threshold) { } bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt) { if(evt->type() == QEvent::ToolTipChange) { QWidget *widget = static_cast<QWidget*>(obj); QString tooltip = widget->toolTip(); if(tooltip.size() > size_threshold && !tooltip.startsWith("<qt/>") && !Qt::mightBeRichText(tooltip)) { // Prefix <qt/> to make sure Qt detects this as rich text // Escape the current message as HTML and replace \n by <br> tooltip = "<qt/>" + HtmlEscape(tooltip, true); widget->setToolTip(tooltip); return true; } } return QObject::eventFilter(obj, evt); } #ifdef WIN32 boost::filesystem::path static StartupShortcutPath() { return GetSpecialFolderPath(CSIDL_STARTUP) / "Densecoin.lnk"; } bool GetStartOnSystemStartup() { // check for Densecoin.lnk return boost::filesystem::exists(StartupShortcutPath()); } bool SetStartOnSystemStartup(bool fAutoStart) { // If the shortcut exists already, remove it for updating boost::filesystem::remove(StartupShortcutPath()); if (fAutoStart) { CoInitialize(NULL); // Get a pointer to the IShellLink interface. IShellLink* psl = NULL; HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, reinterpret_cast<void**>(&psl)); if (SUCCEEDED(hres)) { // Get the current executable path TCHAR pszExePath[MAX_PATH]; GetModuleFileName(NULL, pszExePath, sizeof(pszExePath)); TCHAR pszArgs[5] = TEXT("-min"); // Set the path to the shortcut target psl->SetPath(pszExePath); PathRemoveFileSpec(pszExePath); psl->SetWorkingDirectory(pszExePath); psl->SetShowCmd(SW_SHOWMINNOACTIVE); psl->SetArguments(pszArgs); // Query IShellLink for the IPersistFile interface for // saving the shortcut in persistent storage. IPersistFile* ppf = NULL; hres = psl->QueryInterface(IID_IPersistFile, reinterpret_cast<void**>(&ppf)); if (SUCCEEDED(hres)) { WCHAR pwsz[MAX_PATH]; // Ensure that the string is ANSI. MultiByteToWideChar(CP_ACP, 0, StartupShortcutPath().string().c_str(), -1, pwsz, MAX_PATH); // Save the link by calling IPersistFile::Save. hres = ppf->Save(pwsz, TRUE); ppf->Release(); psl->Release(); CoUninitialize(); return true; } psl->Release(); } CoUninitialize(); return false; } return true; } #elif defined(LINUX) // Follow the Desktop Application Autostart Spec: // http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html boost::filesystem::path static GetAutostartDir() { namespace fs = boost::filesystem; char* pszConfigHome = getenv("XDG_CONFIG_HOME"); if (pszConfigHome) return fs::path(pszConfigHome) / "autostart"; char* pszHome = getenv("HOME"); if (pszHome) return fs::path(pszHome) / ".config" / "autostart"; return fs::path(); } boost::filesystem::path static GetAutostartFilePath() { return GetAutostartDir() / "densecoin.desktop"; } bool GetStartOnSystemStartup() { boost::filesystem::ifstream optionFile(GetAutostartFilePath()); if (!optionFile.good()) return false; // Scan through file for "Hidden=true": std::string line; while (!optionFile.eof()) { getline(optionFile, line); if (line.find("Hidden") != std::string::npos && line.find("true") != std::string::npos) return false; } optionFile.close(); return true; } bool SetStartOnSystemStartup(bool fAutoStart) { if (!fAutoStart) boost::filesystem::remove(GetAutostartFilePath()); else { char pszExePath[MAX_PATH+1]; memset(pszExePath, 0, sizeof(pszExePath)); if (readlink("/proc/self/exe", pszExePath, sizeof(pszExePath)-1) == -1) return false; boost::filesystem::create_directories(GetAutostartDir()); boost::filesystem::ofstream optionFile(GetAutostartFilePath(), std::ios_base::out|std::ios_base::trunc); if (!optionFile.good()) return false; // Write a densecoin.desktop file to the autostart directory: optionFile << "[Desktop Entry]\n"; optionFile << "Type=Application\n"; optionFile << "Name=Densecoin\n"; optionFile << "Exec=" << pszExePath << " -min\n"; optionFile << "Terminal=false\n"; optionFile << "Hidden=false\n"; optionFile.close(); } return true; } #else // TODO: OSX startup stuff; see: // https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Articles/CustomLogin.html bool GetStartOnSystemStartup() { return false; } bool SetStartOnSystemStartup(bool fAutoStart) { return false; } #endif HelpMessageBox::HelpMessageBox(QWidget *parent) : QMessageBox(parent) { header = tr("Densecoin-Qt") + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()) + "\n\n" + tr("Usage:") + "\n" + " densecoin-qt [" + tr("command-line options") + "] " + "\n"; coreOptions = QString::fromStdString(HelpMessage()); uiOptions = tr("UI options") + ":\n" + " -lang=<lang> " + tr("Set language, for example \"de_DE\" (default: system locale)") + "\n" + " -min " + tr("Start minimized") + "\n" + " -splash " + tr("Show splash screen on startup (default: 1)") + "\n"; setWindowTitle(tr("Densecoin-Qt")); setTextFormat(Qt::PlainText); // setMinimumWidth is ignored for QMessageBox so put in nonbreaking spaces to make it wider. setText(header + QString(QChar(0x2003)).repeated(50)); setDetailedText(coreOptions + "\n" + uiOptions); } void HelpMessageBox::printToConsole() { // On other operating systems, the expected action is to print the message to the console. QString strUsage = header + "\n" + coreOptions + "\n" + uiOptions; fprintf(stderr, "%s", strUsage.toStdString().c_str()); } void HelpMessageBox::showOrPrint() { #if defined(WIN32) // On windows, show a message box, as there is no stderr/stdout in windowed applications exec(); #else // On other operating systems, print help text to console printToConsole(); #endif } } // namespace GUIUtil
dynius/densecoin
src/qt/guiutil.cpp
C++
mit
13,505
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-comp-2654', templateUrl: './comp-2654.component.html', styleUrls: ['./comp-2654.component.css'] }) export class Comp2654Component implements OnInit { constructor() { } ngOnInit() { } }
angular/angular-cli-stress-test
src/app/components/comp-2654/comp-2654.component.ts
TypeScript
mit
484
import {Injectable} from '@angular/core'; import {IJenkinsData} from 'jenkins-api-ts-typings'; import {IJenkinsNode} from 'jenkins-api-ts-typings'; import {IJenkinsJob} from 'jenkins-api-ts-typings'; import {IJenkinsBuild} from 'jenkins-api-ts-typings'; import {IJenkinsUser} from 'jenkins-api-ts-typings'; import {IJenkinsView} from 'jenkins-api-ts-typings'; import {IJenkinsChangeSet} from 'jenkins-api-ts-typings'; import {IJenkinsAction} from 'jenkins-api-ts-typings'; @Injectable() export class IJenkinsDataMockService implements IJenkinsData { public nodes: Array<IJenkinsNode> = new Array<IJenkinsNode>(); public jobs: Array<IJenkinsJob> = new Array<IJenkinsJob>(); public builds: Map<IJenkinsJob, Array<IJenkinsBuild>> = new Map<IJenkinsJob, Array<IJenkinsBuild>>(); public users: Array<IJenkinsUser> = new Array<IJenkinsUser>(); public views: Array<IJenkinsView> = new Array<IJenkinsView>(); public changeSets: Map<IJenkinsBuild, Array<IJenkinsChangeSet>> = new Map<IJenkinsBuild, Array<IJenkinsChangeSet>>(); public actions: Map<IJenkinsBuild, Array<IJenkinsAction>> = new Map<IJenkinsBuild, Array<IJenkinsAction>>(); }
Andrei-Straut/statkins
src/main/webapp/src/app/test-mock/services/jenkins-data.mock.service.ts
TypeScript
mit
1,159
export class ValidationMessagesConfiguration { class: string; defaultErrorMessages: DefaultErrorMessages; } export class DefaultErrorMessages { required: string; pattern: string; email: string; minLength: string; maxLength: string; minNumber: string; maxNumber: string; noEmpty: string; unknownError: string; rangeLength: string; range: string; digit: string; equal: string; url: string; date: string; areEqual: string; passwords: string; [key: string]: string; } export const defaultConfig: ValidationMessagesConfiguration = { class: 'text-danger', defaultErrorMessages: { required: 'This field is required!', pattern: 'The input value does not match the pattern required!', email: 'Invalid email!', minLength: 'Minimum length is {0}!', maxLength: 'Maximum length is {0}!', minNumber: 'Minimal value is {0}!', maxNumber: 'Maximal value is {0}!', noEmpty: 'Only blank spaces are not allowed!', rangeLength: 'The input must be between {0} and {1} symbols long!', range: 'The input must be between {0} and {1}!', digit: 'The input must be a number!', equal: 'The input must be equal to {0}!', url: 'The input must be a valid URL!', date: 'The input must be a valid date!', areEqual: 'The values in the group must match!', passwords: 'Both fields "Password" and "Confirm Password" must match!', unknownError: 'Unknown Error!', }, };
d-kostov-dev/ng2-mdf-validation-messages
src/config.ts
TypeScript
mit
1,563
# frozen_string_literal: true require 'spec_helper' describe Projects::DiscussionsController do let(:user) { create(:user) } let(:merge_request) { create(:merge_request) } let(:project) { merge_request.source_project } let(:note) { create(:discussion_note_on_merge_request, noteable: merge_request, project: project) } let(:discussion) { note.discussion } let(:request_params) do { namespace_id: project.namespace, project_id: project, merge_request_id: merge_request, id: note.discussion_id } end describe 'GET show' do before do sign_in user end context 'when user is not authorized to read the MR' do it 'returns 404' do get :show, params: request_params, session: { format: :json } expect(response).to have_gitlab_http_status(404) end end context 'when user is authorized to read the MR' do before do project.add_reporter(user) end it 'returns status 200' do get :show, params: request_params, session: { format: :json } expect(response).to have_gitlab_http_status(200) end it 'returns status 404 if MR does not exists' do merge_request.destroy! get :show, params: request_params, session: { format: :json } expect(response).to have_gitlab_http_status(404) end end context 'when user is authorized but note is LegacyDiffNote' do before do project.add_developer(user) note.update!(type: 'LegacyDiffNote') end it 'returns status 200' do get :show, params: request_params, session: { format: :json } expect(response).to have_gitlab_http_status(200) end end end describe 'POST resolve' do before do sign_in user end context "when the user is not authorized to resolve the discussion" do it "returns status 404" do post :resolve, params: request_params expect(response).to have_gitlab_http_status(404) end end context "when the user is authorized to resolve the discussion" do before do project.add_developer(user) end context "when the discussion is not resolvable" do before do note.update(system: true) end it "returns status 404" do post :resolve, params: request_params expect(response).to have_gitlab_http_status(404) end end context "when the discussion is resolvable" do it "resolves the discussion" do post :resolve, params: request_params expect(note.reload.discussion.resolved?).to be true expect(note.reload.discussion.resolved_by).to eq(user) end it "sends notifications if all discussions are resolved" do expect_any_instance_of(MergeRequests::ResolvedDiscussionNotificationService).to receive(:execute).with(merge_request) post :resolve, params: request_params end it "returns the name of the resolving user" do post :resolve, params: request_params expect(json_response['resolved_by']['name']).to eq(user.name) end it "returns status 200" do post :resolve, params: request_params expect(response).to have_gitlab_http_status(200) end it "renders discussion with serializer" do expect_any_instance_of(DiscussionSerializer).to receive(:represent) .with(instance_of(Discussion), { context: instance_of(described_class), render_truncated_diff_lines: true }) post :resolve, params: request_params end context 'diff discussion' do let(:note) { create(:diff_note_on_merge_request, noteable: merge_request, project: project) } let(:discussion) { note.discussion } it "returns truncated diff lines" do post :resolve, params: request_params expect(json_response['truncated_diff_lines']).to be_present end end end end end describe 'DELETE unresolve' do before do sign_in user note.discussion.resolve!(user) end context "when the user is not authorized to resolve the discussion" do it "returns status 404" do delete :unresolve, params: request_params expect(response).to have_gitlab_http_status(404) end end context "when the user is authorized to resolve the discussion" do before do project.add_developer(user) end context "when the discussion is not resolvable" do before do note.update(system: true) end it "returns status 404" do delete :unresolve, params: request_params expect(response).to have_gitlab_http_status(404) end end context "when the discussion is resolvable" do it "unresolves the discussion" do delete :unresolve, params: request_params expect(note.reload.discussion.resolved?).to be false end it "returns status 200" do delete :unresolve, params: request_params expect(response).to have_gitlab_http_status(200) end context "when vue_mr_discussions cookie is present" do before do cookies[:vue_mr_discussions] = 'true' end it "renders discussion with serializer" do expect_any_instance_of(DiscussionSerializer).to receive(:represent) .with(instance_of(Discussion), { context: instance_of(described_class), render_truncated_diff_lines: true }) delete :unresolve, params: request_params end end end end end end
stoplightio/gitlabhq
spec/controllers/projects/discussions_controller_spec.rb
Ruby
mit
5,740
/** * https://gist.github.com/gaearon/830490fc17d3fccc88c9 * Inspiration and apdatation from code in the link above */ import React, { Component, PropTypes } from 'react' import ReactDOM from 'react-dom' export default class AudioPlayer extends Component { static propTypes = { source: PropTypes.string.isRequired, isPlaying: PropTypes.bool.isRequired, defaultTime: PropTypes.number, // onProgress: PropTypes.func.isRequired, // onTimeUpdate: PropTypes.func.isRequired, onEnd: PropTypes.func.isRequired }; render() { return ( <audio preload='none'> <source src={this.props.source} type='audio/mpeg' /> </audio> ) } /** * start of react life cycle functions */ componentDidMount() { var node = ReactDOM.findDOMNode(this) // node.addEventListener('progress', this.handleProgress) // node.addEventListener('timeupdate', this.handleTimeUpdate) node.addEventListener('ended', this.handleMediaEnd) this.updateIsPlaying() } componentDidUpdate(prevProps) { if (prevProps.source !== this.props.source) { this.updateSource() } if (prevProps.isPlaying !== this.props.isPlaying) { this.updateIsPlaying() } if (prevProps.defaultTime !== this.props.defaultTime) { this.updateCurrentTime() } } componentWillUnmount() { var node = ReactDOM.findDOMNode(this) // node.removeEventListener('progress', this.handleProgress) // node.removeEventListener('timeupdate', this.handleTimeUpdate) node.removeEventListener('ended', this.handleMediaEnd) } /** * Start of custom logic functions */ // handleTimeUpdate = () => { // var node = ReactDOM.findDOMNode(this) // var currentTime = node.currentTime // var trackDuration = node.duration // this.props.onTimeUpdate({ // currentTime: currentTime, // trackDuration: trackDuration // }) // } handleMediaEnd = () => { ReactDOM.findDOMNode(this).currentTime = 0 this.props.onEnd() }; // handleProgress = () => { // var node = ReactDOM.findDOMNode(this) // var trackDuration = node.duration // var buffered = node.buffered // this.props.onProgress({ // trackDuration: trackDuration, // buffered: buffered // }) // } updateCurrentTime = () => { var node = ReactDOM.findDOMNode(this) if (node.readyState) { node.currentTime = this.props.defaultTime } }; updateIsPlaying = () => { var node = ReactDOM.findDOMNode(this) var isPlaying = this.props.isPlaying if (isPlaying) { node.play() } else { node.pause() } }; updateSource = () => { var node = ReactDOM.findDOMNode(this) var isPlaying = this.props.isPlaying node.pause() // this.props.onTimeUpdate({ // currentTime: 0, // trackDuration: node.duration // }) node.load() if (isPlaying) { node.play() } }; }
wwwfreedom/FreeCodeCamp
src/components/PomoTime/AudioPlayer/AudioPlayer.js
JavaScript
mit
2,976
// // System.Web.UI.WebContrls.FormViewModeEventHandler.cs; // // Authors: // Sanjay Gupta (gsanjay@novell.com) // // (C) 2004 Novell, Inc (http://www.novell.com) // // // 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. // #if NET_2_0 namespace System.Web.UI.WebControls { public delegate void FormViewModeEventHandler (object sender, FormViewModeEventArgs e); } #endif
jjenki11/blaze-chem-rendering
qca_designer/lib/ml-pnet-0.8.1/mcs-sources/class/System.Web/System.Web.UI.WebControls/FormViewModeEventHandler.cs
C#
mit
1,400
# # 3rd party libraries require 'celluloid' require 'celluloid/autostart' require 'exception_notification' require 'koala' require 'open-uri' require 'sucker_punch' # local libraries require_relative 'facebook/helpers' module CacheParty class Engine < ::Rails::Engine initializer :assets do |config| Rails.application.config.assets.precompile += %w( cache_party/application.js cache_party/application.css ) end isolate_namespace CacheParty config.generators do |g| g.test_framework :rspec, view_specs: false, helper_specs: false, routing_specs: false, controller_specs: false, request_specs: true, fixtures: true g.fixture_replacement :factory_girl, dir: 'spec/factories/cache_party' g.helper = false g.stylesheets = false end end end
rjayroach/cache-party
lib/cache_party/engine.rb
Ruby
mit
845
package org.openfact.ubl.send; import java.util.HashMap; import java.util.Map; import java.util.Properties; import org.apache.cxf.configuration.jsse.TLSClientParameters; import org.apache.cxf.configuration.security.FiltersType; import org.apache.cxf.endpoint.Client; import org.apache.cxf.frontend.ClientProxy; import org.apache.cxf.interceptor.LoggingInInterceptor; import org.apache.cxf.interceptor.LoggingOutInterceptor; import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; import org.apache.cxf.transport.http.HTTPConduit; import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor; public class ServiceWrapper<T> { private String wsUrl; private Map<String, String> config; private ServicePasswordThread passwordThread; public ServiceWrapper(Map<String, String> config, String wsUrl) { this.wsUrl = wsUrl; this.config = config; passwordThread = new ServicePasswordThread(config); } public T initWebService(Class<?> serviceClass) { Properties properties = System.getProperties(); properties.put("org.apache.cxf.stax.allowInsecureParser", "1"); System.setProperties(properties); JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); Map<String, Object> props = new HashMap<>(); props.put("mtom-enabled", Boolean.FALSE); factory.setProperties(props); factory.setAddress(wsUrl); factory.getInInterceptors().add(new LoggingInInterceptor()); factory.getOutInterceptors().add(new LoggingOutInterceptor()); factory.setServiceClass(serviceClass); T client = (T) factory.create(); try { configureSSLOnTheClient(client, config.get("username")); return client; } catch (ServiceConfigurationException ex) { throw new RuntimeException(ex); } } private void configureSSLOnTheClient(Object object, String username) throws ServiceConfigurationException { Client client = ClientProxy.getClient(object); HTTPConduit httpConduit = (HTTPConduit) client.getConduit(); TLSClientParameters tlsParams = new TLSClientParameters(); tlsParams.setDisableCNCheck(true); HTTPClientPolicy policy = new HTTPClientPolicy(); policy.setConnectionTimeout(30000L); policy.setReceiveTimeout(15000L); policy.setAllowChunking(false); httpConduit.setClient(policy); FiltersType filter = new FiltersType(); filter.getInclude().add(".*_EXPORT_.*"); filter.getInclude().add(".*_EXPORT1024_.*"); filter.getInclude().add(".*_WITH_DES_.*"); filter.getInclude().add(".*_WITH_NULL_.*"); filter.getExclude().add(".*_DH_anon_.*"); tlsParams.setCipherSuitesFilter(filter); httpConduit.setTlsClientParameters(tlsParams); HashMap outProps = new HashMap(); outProps.put("action", "UsernameToken"); outProps.put("user", username); outProps.put("passwordType", "PasswordText"); outProps.put("passwordCallbackClass", ServicePasswordCallback.class.getName()); WSS4JOutInterceptor wsOut = new WSS4JOutInterceptor(outProps); client.getEndpoint().getOutInterceptors().add(wsOut); } }
openfact/openfact-temp
services/src/main/java/org/openfact/ubl/send/ServiceWrapper.java
Java
mit
3,016
export * from './modules'; import {dependencies} from './dependencies'; import {default as bootstrap} from './bootstrap'; import {default as run} from './run'; export const application: angular.IModule = angular.module( 'Beacon', dependencies ); // Bootstrap the application. bootstrap(application).then((): void => { // Run the application. run(application); });
BeaconPlatform/frontend
application/entry.ts
TypeScript
mit
376
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace probno { class Program { static void Main(string[] args) { } } }
vasilchavdarov/SoftUniHomework
Projects/Exam Programing Fundamentals/probno/Program.cs
C#
mit
244
// Copyright (c) 2015-2018 Robert Rypuła - https://audio-network.rypula.pl 'use strict'; var AudioMonoIO = AudioNetwork.Rewrite.WebAudio.AudioMonoIO, WaveAnalyser = AudioNetwork.Rewrite.Dsp.WaveAnalyser; function init() { } function checkWaveAnalyserPerformance() { var log; log = ''; log += runPerformanceTest(1 * 1024) + '\n<br/>'; log += runPerformanceTest(2 * 1024) + '\n<br/>'; log += runPerformanceTest(4 * 1024) + '\n<br/>'; log += runPerformanceTest(8 * 1024) + '\n<br/>'; log += runPerformanceTest(16 * 1024) + '\n<br/>'; log += runPerformanceTest(32 * 1024) + '\n<br/>'; log += runPerformanceTest(64 * 1024) + '\n<br/>'; html('#log-performance', log); } function runPerformanceTest(windowSize) { var SAMPLE_RATE = 48000, // fixed for all devices SUBCARRIERS = 100, // for average dummySamplePerPeriod, windowFunction, waveAnalyser, i, j, decibel, timeDomainData = [], start, end, oneSubcarrierTime, windowSizeDurationMs, subcarriersPerSecond; for (i = 0; i < windowSize; i++) { timeDomainData.push(-1 + 2 * Math.random()); } start = new Date().getTime(); dummySamplePerPeriod = 1; // could be any other value windowFunction = true; waveAnalyser = new WaveAnalyser(dummySamplePerPeriod, windowSize, windowFunction); for (i = 0; i < SUBCARRIERS; i++) { waveAnalyser.setSamplePerPeriod(1 + i); for (j = 0; j < windowSize; j++) { waveAnalyser.handle(timeDomainData[j]); } decibel = waveAnalyser.getDecibel(); } end = new Date().getTime(); oneSubcarrierTime = (end - start) / SUBCARRIERS; windowSizeDurationMs = (windowSize / SAMPLE_RATE) * 1000; subcarriersPerSecond = windowSizeDurationMs / oneSubcarrierTime; return '' + '<b>Window size:</b> ' + windowSize + ' samples\n<br/>' + '<b>Window time:</b> ' + windowSizeDurationMs.toFixed(1) + ' ms\n<br/>' + '<b>One frequency computation time:</b> ' + oneSubcarrierTime + ' ms (' + (100 * (oneSubcarrierTime / windowSizeDurationMs)).toFixed(1) + ' % of window time)\n<br/>' + '<b>[estimation] Real-time frequencies:</b> ' + subcarriersPerSecond.toFixed(0) + '\n<br/>' + '<b>[estimation] DFT computing time:</b> ' + (0.5 * oneSubcarrierTime * windowSize / 1000).toFixed(3) + ' s\n<br/>'; }
robertrypula/AudioNetwork
example/00-03-02-wave-analyser-performance/wave-analyser-performance.js
JavaScript
mit
2,472
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FileMatcher = exports.excludedNames = undefined; var _bluebirdLst; function _load_bluebirdLst() { return _bluebirdLst = require("bluebird-lst"); } var _bluebirdLst2; function _load_bluebirdLst2() { return _bluebirdLst2 = _interopRequireDefault(require("bluebird-lst")); } exports.getMainFileMatchers = getMainFileMatchers; exports.getFileMatchers = getFileMatchers; exports.copyFiles = copyFiles; var _builderUtil; function _load_builderUtil() { return _builderUtil = require("builder-util"); } var _fs; function _load_fs() { return _fs = require("builder-util/out/fs"); } var _fsExtraP; function _load_fsExtraP() { return _fsExtraP = require("fs-extra-p"); } var _minimatch; function _load_minimatch() { return _minimatch = require("minimatch"); } var _path = _interopRequireWildcard(require("path")); var _core; function _load_core() { return _core = require("./core"); } var _filter; function _load_filter() { return _filter = require("./util/filter"); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // https://github.com/electron-userland/electron-builder/issues/733 const minimatchOptions = { dot: true }; // noinspection SpellCheckingInspection const excludedNames = exports.excludedNames = ".git,.hg,.svn,CVS,RCS,SCCS," + "__pycache__,.DS_Store,thumbs.db,.gitignore,.gitkeep,.gitattributes,.npmignore," + ".idea,.vs,.flowconfig,.jshintrc,.eslintrc,.circleci," + ".yarn-integrity,.yarn-metadata.json,yarn-error.log,yarn.lock,package-lock.json,npm-debug.log," + "appveyor.yml,.travis.yml,circle.yml,.nyc_output"; /** @internal */ class FileMatcher { constructor(from, to, macroExpander, patterns) { this.macroExpander = macroExpander; this.excludePatterns = null; this.from = macroExpander(from); this.to = macroExpander(to); this.patterns = (0, (_builderUtil || _load_builderUtil()).asArray)(patterns).map(it => this.normalizePattern(it)); this.isSpecifiedAsEmptyArray = Array.isArray(patterns) && patterns.length === 0; } normalizePattern(pattern) { if (pattern.startsWith("./")) { pattern = pattern.substring("./".length); } return _path.posix.normalize(this.macroExpander(pattern.replace(/\\/g, "/"))); } addPattern(pattern) { this.patterns.push(this.normalizePattern(pattern)); } prependPattern(pattern) { this.patterns.unshift(this.normalizePattern(pattern)); } isEmpty() { return this.patterns.length === 0; } containsOnlyIgnore() { return !this.isEmpty() && this.patterns.find(it => !it.startsWith("!")) == null; } computeParsedPatterns(result, fromDir) { const relativeFrom = fromDir == null ? null : _path.relative(fromDir, this.from); if (this.patterns.length === 0 && relativeFrom != null) { // file mappings, from here is a file result.push(new (_minimatch || _load_minimatch()).Minimatch(relativeFrom, minimatchOptions)); return; } for (let pattern of this.patterns) { if (relativeFrom != null) { pattern = _path.join(relativeFrom, pattern); } const parsedPattern = new (_minimatch || _load_minimatch()).Minimatch(pattern, minimatchOptions); result.push(parsedPattern); // do not add if contains dot (possibly file if has extension) if (!pattern.includes(".") && !(0, (_filter || _load_filter()).hasMagic)(parsedPattern)) { // https://github.com/electron-userland/electron-builder/issues/545 // add **/* result.push(new (_minimatch || _load_minimatch()).Minimatch(`${pattern}/**/*`, minimatchOptions)); } } } createFilter() { const parsedPatterns = []; this.computeParsedPatterns(parsedPatterns); return (0, (_filter || _load_filter()).createFilter)(this.from, parsedPatterns, this.excludePatterns); } toString() { return `from: ${this.from}, to: ${this.to}, patterns: ${this.patterns.join(", ")}`; } } exports.FileMatcher = FileMatcher; /** @internal */ function getMainFileMatchers(appDir, destination, macroExpander, platformSpecificBuildOptions, packager, outDir, isElectronCompile) { const buildResourceDir = _path.resolve(packager.info.projectDir, packager.buildResourcesDir); let matchers = packager.info.isPrepackedAppAsar ? null : getFileMatchers(packager.info.config, "files", appDir, destination, macroExpander, platformSpecificBuildOptions); if (matchers == null) { matchers = [new FileMatcher(appDir, destination, macroExpander)]; } const matcher = matchers[0]; // add default patterns, but only if from equals to app dir if (matcher.from !== appDir) { return matchers; } // https://github.com/electron-userland/electron-builder/issues/1741#issuecomment-311111418 so, do not use inclusive patterns const patterns = matcher.patterns; const customFirstPatterns = []; // electron-webpack - we need to copy only package.json and node_modules from root dir (and these files are added by default), so, explicit empty array is specified if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) { customFirstPatterns.push("**/*"); } else { // prependPattern - user pattern should be after to be able to override // do not use **/node_modules/**/* because if pattern starts with **, all not explicitly excluded directories will be traversed (performance + empty dirs will be included into the asar) customFirstPatterns.push("node_modules/**/*"); if (!patterns.includes("package.json")) { patterns.push("package.json"); } } // https://github.com/electron-userland/electron-builder/issues/1482 const relativeBuildResourceDir = _path.relative(matcher.from, buildResourceDir); if (relativeBuildResourceDir.length !== 0 && !relativeBuildResourceDir.startsWith(".")) { customFirstPatterns.push(`!${relativeBuildResourceDir}{,/**/*}`); } const relativeOutDir = matcher.normalizePattern(_path.relative(packager.info.projectDir, outDir)); if (!relativeOutDir.startsWith(".")) { customFirstPatterns.push(`!${relativeOutDir}{,/**/*}`); } // add our default exclusions after last user possibly defined "all"/permissive pattern let insertIndex = 0; for (let i = patterns.length - 1; i >= 0; i--) { if (patterns[i].startsWith("**/")) { insertIndex = i + 1; break; } } patterns.splice(insertIndex, 0, ...customFirstPatterns); // not moved to copyNodeModules because depends on platform packager (for now, not easy) if (packager.platform !== (_core || _load_core()).Platform.WINDOWS) { // https://github.com/electron-userland/electron-builder/issues/1738 patterns.push("!**/node_modules/**/*.{dll,exe}"); } patterns.push(`!**/*.{iml,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,suo,xproj,cc,pdb}`); patterns.push("!**/._*"); patterns.push("!**/electron-builder.{yaml,yml,json,json5,toml}"); //noinspection SpellCheckingInspection patterns.push(`!**/{${excludedNames}}`); if (isElectronCompile) { patterns.push("!.cache{,/**/*}"); } // https://github.com/electron-userland/electron-builder/issues/1969 // exclude ony for app root, use .yarnclean to clean node_modules patterns.push("!.editorconfig"); const debugLogger = packager.info.debugLogger; if (debugLogger.enabled) { //tslint:disable-next-line:no-invalid-template-strings debugLogger.add(`${macroExpander("${arch}")}.firstOrDefaultFilePatterns`, patterns); } return matchers; } /** @internal */ function getFileMatchers(config, name, defaultSrc, defaultDestination, macroExpander, customBuildOptions) { const globalPatterns = config[name]; const platformSpecificPatterns = customBuildOptions[name]; const defaultMatcher = new FileMatcher(defaultSrc, defaultDestination, macroExpander); const fileMatchers = []; function addPatterns(patterns) { if (patterns == null) { return; } else if (!Array.isArray(patterns)) { if (typeof patterns === "string") { defaultMatcher.addPattern(patterns); return; } patterns = [patterns]; } for (const pattern of patterns) { if (typeof pattern === "string") { // use normalize to transform ./foo to foo defaultMatcher.addPattern(pattern); } else if (name === "asarUnpack") { throw new Error(`Advanced file copying not supported for "${name}"`); } else { const from = pattern.from == null ? defaultSrc : _path.resolve(defaultSrc, pattern.from); const to = pattern.to == null ? defaultDestination : _path.resolve(defaultDestination, pattern.to); fileMatchers.push(new FileMatcher(from, to, macroExpander, pattern.filter)); } } } addPatterns(globalPatterns); addPatterns(platformSpecificPatterns); if (!defaultMatcher.isEmpty()) { // default matcher should be first in the array fileMatchers.unshift(defaultMatcher); } return fileMatchers.length === 0 ? null : fileMatchers; } /** @internal */ function copyFiles(matchers) { if (matchers == null || matchers.length === 0) { return (_bluebirdLst2 || _load_bluebirdLst2()).default.resolve(); } return (_bluebirdLst2 || _load_bluebirdLst2()).default.map(matchers, (() => { var _ref = (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* (matcher) { const fromStat = yield (0, (_fs || _load_fs()).statOrNull)(matcher.from); if (fromStat == null) { (0, (_builderUtil || _load_builderUtil()).warn)(`File source ${matcher.from} doesn't exist`); return; } if (fromStat.isFile()) { const toStat = yield (0, (_fs || _load_fs()).statOrNull)(matcher.to); // https://github.com/electron-userland/electron-builder/issues/1245 if (toStat != null && toStat.isDirectory()) { return yield (0, (_fs || _load_fs()).copyOrLinkFile)(matcher.from, _path.join(matcher.to, _path.basename(matcher.from)), fromStat); } yield (0, (_fsExtraP || _load_fsExtraP()).mkdirs)(_path.dirname(matcher.to)); return yield (0, (_fs || _load_fs()).copyOrLinkFile)(matcher.from, matcher.to, fromStat); } if (matcher.isEmpty() || matcher.containsOnlyIgnore()) { matcher.prependPattern("**/*"); } if ((_builderUtil || _load_builderUtil()).debug.enabled) { (0, (_builderUtil || _load_builderUtil()).debug)(`Copying files using pattern: ${matcher}`); } return yield (0, (_fs || _load_fs()).copyDir)(matcher.from, matcher.to, { filter: matcher.createFilter() }); }); return function (_x) { return _ref.apply(this, arguments); }; })()); } //# sourceMappingURL=fileMatcher.js.map
302bis/figma-app-ubuntu
app/node_modules/electron-builder/out/fileMatcher.js
JavaScript
mit
11,762
;(function($){ "use strict"; // youtube var fnResizeMedia = function() { $("div.movie").each(function(i, el){ $("iframe", el).each(function(j, iframe){ var w = $(el).width(); var h = w * 0.5625; $(iframe).width(w); $(iframe).height(h); }) }) }; // -- fnResizeMedia(); $(window).resize(fnResizeMedia); })(jQuery);
scienceaction/scienceaction.github.io
assets/js/scienceaction.js
JavaScript
mit
350
// Relabelling.cpp // created by Kuangdai on 6-Jun-2016 // particle relabelling #include "Relabelling.h" #include "Quad.h" #include "SpectralConstants.h" #include "Geometric3D.h" #include "XMath.h" #include "Geodesy.h" #include "PreloopFFTW.h" #include "PRT_1D.h" #include "PRT_3D.h" Relabelling::Relabelling(const Quad *quad): mMyQuad(quad) { mStiff_dZ = RDMatXN::Zero(mMyQuad->getNr(), nPE); mStiff_dZdR = RDMatXN::Zero(mMyQuad->getNr(), nPE); mStiff_dZdT = RDMatXN::Zero(mMyQuad->getNr(), nPE); mStiff_dZdZ = RDMatXN::Zero(mMyQuad->getNr(), nPE); for (int ipol = 0; ipol <= nPol; ipol++) { for (int jpol = 0; jpol <= nPol; jpol++) { int ipnt = ipol * nPntEdge + jpol; mMass_dZ[ipnt] = RDColX::Zero(mMyQuad->getPointNr(ipol, jpol)); mMass_dZdR[ipnt] = RDColX::Zero(mMyQuad->getPointNr(ipol, jpol)); mMass_dZdT[ipnt] = RDColX::Zero(mMyQuad->getPointNr(ipol, jpol)); mMass_dZdZ[ipnt] = RDColX::Zero(mMyQuad->getPointNr(ipol, jpol)); } } } void Relabelling::addUndulation(const std::vector<Geometric3D *> &g3D, double srcLat, double srcLon, double srcDep, double phi2D) { if (g3D.size() == 0) { return; } double rElemCenter = mMyQuad->computeCenterRadius(); int Nr = mMyQuad->getNr(); for (int ipol = 0; ipol <= nPol; ipol++) { for (int jpol = 0; jpol <= nPol; jpol++) { int ipnt = ipol * nPntEdge + jpol; const RDCol2 &xieta = SpectralConstants::getXiEta(ipol, jpol, mMyQuad->isAxial()); const RDMatX3 &rtpS = mMyQuad->computeGeocentricGlobal(srcLat, srcLon, srcDep, xieta, Nr, phi2D); for (int alpha = 0; alpha < Nr; alpha++) { double r = rtpS(alpha, 0); double t = rtpS(alpha, 1); double p = rtpS(alpha, 2); for (const auto &model: g3D) { mStiff_dZ(alpha, ipnt) += model->getDeltaR(r, t, p, rElemCenter); } } } } if (!isZero()) { checkHmin(); formGradientUndulation(); formMassUndulation(); } } RDMatXN Relabelling::getStiffJacobian() const { int n = mMyQuad->getNr(); RDMatXN J(n, nPE); for (int ipol = 0; ipol <= nPol; ipol++) { for (int jpol = 0; jpol <= nPol; jpol++) { const RDCol2 &xieta = SpectralConstants::getXiEta(ipol, jpol, mMyQuad->isAxial()); double Z = mMyQuad->mapping(xieta).norm(); int ipnt = ipol * nPntEdge + jpol; if (Z < tinyDouble) { const RDColX &J22 = RDColX::Ones(n) + mStiff_dZdZ.col(ipnt); J.col(ipnt) = J22.schur(J22).schur(J22); } else { const RDColX &J00 = RDColX::Ones(n) + mStiff_dZ.col(ipnt) / Z; const RDColX &J22 = RDColX::Ones(n) + mStiff_dZdZ.col(ipnt); J.col(ipnt) = J00.schur(J00).schur(J22); } } } if (J.array().minCoeff() <= 0.) { throw std::runtime_error("Relabelling::getStiffJacobian || Negative Jacobian."); } return J; } RDMatXN4 Relabelling::getStiffX() const { int n = mMyQuad->getNr(); RDMatXN4 X(n, nPE * 4); for (int ipol = 0; ipol <= nPol; ipol++) { for (int jpol = 0; jpol <= nPol; jpol++) { const RDCol2 &xieta = SpectralConstants::getXiEta(ipol, jpol, mMyQuad->isAxial()); double Z = mMyQuad->mapping(xieta).norm(); int ipnt = ipol * nPntEdge + jpol; RDColX J0(n), J1(n), J2(n), J3(n); if (Z < tinyDouble) { J0 = RDColX::Ones(n) + mStiff_dZdZ.col(ipnt); } else { J0 = RDColX::Ones(n) + mStiff_dZ.col(ipnt) / Z; } J1 = mStiff_dZdR.col(ipnt); J2 = mStiff_dZdT.col(ipnt); J3 = RDColX::Ones(n) + mStiff_dZdZ.col(ipnt); X.col(nPE * 0 + ipnt) = J0.array().pow(-1.).matrix(); X.col(nPE * 1 + ipnt) = -J1.schur((J0.schur(J3)).array().pow(-1.).matrix()); X.col(nPE * 2 + ipnt) = -J2.schur((J0.schur(J3)).array().pow(-1.).matrix()); X.col(nPE * 3 + ipnt) = J3.array().pow(-1.).matrix(); } } return X; } arPP_RDColX Relabelling::getMassJacobian() const { arPP_RDColX J; for (int ipol = 0; ipol <= nPol; ipol++) { for (int jpol = 0; jpol <= nPol; jpol++) { int n = mMyQuad->getPointNr(ipol, jpol); const RDCol2 &xieta = SpectralConstants::getXiEta(ipol, jpol, mMyQuad->isAxial()); double Z = mMyQuad->mapping(xieta).norm(); int ipnt = ipol * nPntEdge + jpol; if (Z < tinyDouble) { const RDColX &J22 = RDColX::Ones(n) + mMass_dZdZ[ipnt]; J[ipnt] = J22.schur(J22).schur(J22); } else { const RDColX &J00 = RDColX::Ones(n) + mMass_dZ[ipnt] / Z; const RDColX &J22 = RDColX::Ones(n) + mMass_dZdZ[ipnt]; J[ipnt] = J00.schur(J00).schur(J22); } if (J[ipnt].array().minCoeff() <= 0.) { throw std::runtime_error("Relabelling::getMassJacobian || Negative Jacobian."); } } } return J; } RDMatX3 Relabelling::getSFNormalRTZ(int ipol, int jpol) const { int n = mMyQuad->getPointNr(ipol, jpol); const RDCol2 &xieta = SpectralConstants::getXiEta(ipol, jpol, mMyQuad->isAxial()); double Z = mMyQuad->mapping(xieta).norm(); int ipnt = ipol * nPntEdge + jpol; RDColX J0(n), J1(n), J2(n); if (Z < tinyDouble) { J0 = RDColX::Ones(n) + mMass_dZdZ[ipnt]; } else { J0 = RDColX::Ones(n) + mMass_dZ[ipnt] / Z; } J1 = mMass_dZdR[ipnt]; J2 = mMass_dZdT[ipnt]; RDMatX3 normal(n, 3); normal.col(0) = -J1.schur(J0); normal.col(1) = -J2.schur(J0); normal.col(2) = J0.schur(J0); return normal; } bool Relabelling::isZero() const { return mStiff_dZ.array().abs().maxCoeff() < tinyDouble; } bool Relabelling::isPar1D() const { return XMath::equalRows(mStiff_dZ); } PRT *Relabelling::createPRT(bool elem1D) const { if (isZero()) { return 0; } const RDMatXN4 &X = getStiffX(); if (elem1D) { std::array<RMatPP, 4> xstruct; for (int idim = 0; idim < 4; idim++) { RDRowN xi_flat = X.block(0, nPE * idim, 1, nPE); RDMatPP xi_strct; XMath::structuredUseFirstRow(xi_flat, xi_strct); xstruct[idim] = xi_strct.cast<Real>(); } return new PRT_1D(xstruct); } else { return new PRT_3D(X.cast<Real>()); } } //////////////////////////////////////////////////////////////////////////////////////////// void Relabelling::checkHmin() { int Nr = mMyQuad->getNr(); int maxOrder = (Nr + 1) / 2 - 1; RDMatXN original = mStiff_dZ; for (int order = 0; order <= maxOrder; order++) { // gaussian smooth for (int ipnt = 0; ipnt < nPntElem; ipnt++) { RDColX data = original.col(ipnt); XMath::gaussianSmoothing(data, order, 100, true); mStiff_dZ.col(ipnt) = data; } // compute hmin const RDColX &hmin = mMyQuad->getHminSlices(); double hmin_all = XMath::trigonResampling(5 * Nr, hmin).minCoeff(); if (hmin_all >= hmin.minCoeff() * .8) { // if (order >= 2) { // std::cout << order << " " << Nr << std::endl; // for (int i = 0; i < Nr; i++) // std::cout << original.col(0)(i) << " " << mStiff_dZ.col(0)(i) << std::endl; // std::cout << std::endl << std::endl; // } return; } } throw std::runtime_error("Relabelling::checkHmin || Program should not have reached here."); } void Relabelling::formGradientUndulation() { int Nr = mMyQuad->getNr(); int Nu = Nr / 2; // mask Nyquist first if (Nr % 2 == 0) { for (int ipnt = 0; ipnt < nPntElem; ipnt++) { const RDColX &data_even = mStiff_dZ.col(ipnt); const RDColX &data_odd = XMath::trigonResampling(Nr - 1, data_even); mStiff_dZ.col(ipnt) = XMath::trigonResampling(Nr, data_odd); } } // FFT R2C vec_CDMatPP deltaR_C(Nu + 1, CDMatPP::Zero()); for (int ipol = 0; ipol <= nPol; ipol++) { for (int jpol = 0; jpol <= nPol; jpol++) { int ipnt = ipol * nPntEdge + jpol; PreloopFFTW::getR2C_RMat(Nr) = mStiff_dZ.col(ipnt); PreloopFFTW::computeR2C(Nr); const CDColX &R2C_C = PreloopFFTW::getR2C_CMat(Nr); for (int alpha = 0; alpha <= Nu; alpha++) { deltaR_C[alpha](ipol, jpol) = R2C_C(alpha); } } } // gradient const ar3_CDMatPP zero_ar3_CDMatPP = {CDMatPP::Zero(), CDMatPP::Zero(), CDMatPP::Zero()}; vec_ar3_CDMatPP nablaDeltaR_C(Nu + 1, zero_ar3_CDMatPP); mMyQuad->computeGradientScalar(deltaR_C, nablaDeltaR_C); // FFT C2R for (int ipol = 0; ipol <= nPol; ipol++) { for (int jpol = 0; jpol <= nPol; jpol++) { int ipnt = ipol * nPntEdge + jpol; CDColX &C2R_C = PreloopFFTW::getC2R_CMat(Nr); // phi = T for (int alpha = 0; alpha <= Nu; alpha++) { C2R_C(alpha) = nablaDeltaR_C[alpha][1](ipol, jpol); } PreloopFFTW::computeC2R(Nr); mStiff_dZdT.col(ipnt) = PreloopFFTW::getC2R_RMat(Nr); // s for (int alpha = 0; alpha <= Nu; alpha++) { C2R_C(alpha) = nablaDeltaR_C[alpha][0](ipol, jpol); } PreloopFFTW::computeC2R(Nr); RDColX drds = PreloopFFTW::getC2R_RMat(Nr); // z for (int alpha = 0; alpha <= Nu; alpha++) { C2R_C(alpha) = nablaDeltaR_C[alpha][2](ipol, jpol); } PreloopFFTW::computeC2R(Nr); RDColX drdz = PreloopFFTW::getC2R_RMat(Nr); // rotate s-phi-z to RTZ const RDCol2 &xieta = SpectralConstants::getXiEta(ipol, jpol, mMyQuad->isAxial()); double theta = Geodesy::theta(mMyQuad->mapping(xieta)); mStiff_dZdZ.col(ipnt) = drdz * cos(theta) + drds * sin(theta); mStiff_dZdR.col(ipnt) = -drdz * sin(theta) + drds * cos(theta); } } } void Relabelling::formMassUndulation() { for (int ipol = 0; ipol <= nPol; ipol++) { for (int jpol = 0; jpol <= nPol; jpol++) { int ipnt = ipol * nPntEdge + jpol; int nr_mass = mMyQuad->getPointNr(ipol, jpol); mMass_dZ[ipnt] = XMath::linearResampling(nr_mass, mStiff_dZ.col(ipnt)); mMass_dZdR[ipnt] = XMath::linearResampling(nr_mass, mStiff_dZdR.col(ipnt)); mMass_dZdT[ipnt] = XMath::linearResampling(nr_mass, mStiff_dZdT.col(ipnt)); mMass_dZdZ[ipnt] = XMath::linearResampling(nr_mass, mStiff_dZdZ.col(ipnt)); } } }
kuangdai/AxiSEM3D
SOLVER/src/preloop/physics/relabelling/Relabelling.cpp
C++
mit
11,028
#ifndef GENETIC_RANDOMPOPULATIONGENERATOR_HPP_ #define GENETIC_RANDOMPOPULATIONGENERATOR_HPP_ #include "data/Graph.hpp" #include "genetic/Population.hpp" namespace tsp { class RandomPopulationGenerator { private: const Graph &graph_; unsigned int startNode_; public: RandomPopulationGenerator(const Graph &graph); ~RandomPopulationGenerator(); void setStartNode(const unsigned int startNode); void generateIndividual(Individual &individual); void generatePopulation(Population &population, const unsigned int size); }; } #endif
AvS2016/ParallelTSP
src/genetic/RandomPopulationGenerator.hpp
C++
mit
610
package at.fishkog.als.ui.actions; import java.util.Stack; import at.fishkog.als.AdvancedLogicSimulator; public class Actions { //TODO Temp needs to be initialized in each project public static final Actions instance = new Actions(); private Stack<Action> actions; public Actions() { actions = new Stack<Action>(); } protected void add(Action action) { if(actions.isEmpty()) { AdvancedLogicSimulator.mainUi.menuItemUndo.setDisable(false); } this.actions.push(action); } public void undo() { if(actions.isEmpty()) return; Action action = actions.pop(); action.type.undo(action); if(actions.isEmpty()) { AdvancedLogicSimulator.mainUi.menuItemUndo.setDisable(true); } } }
domkog/AdvancedLogicSimulator
AdvancedLogicSimulator/src/at/fishkog/als/ui/actions/Actions.java
Java
mit
750
// This software is part of the Autofac IoC container // Copyright (c) 2013 Autofac Contributors // https://autofac.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. using System; using NHibernate.Bytecode.Lightweight; using NHibernate.Properties; namespace Autofac.Extras.NHibernate.Bytecode { /// <summary> /// Reflection optimizer implementation. /// </summary> public class AutofacReflectionOptimizer : ReflectionOptimizer { private readonly IComponentContext _container; /// <summary> /// Initializes a new instance of the <see cref="AutofacReflectionOptimizer"/> class. /// </summary> /// <param name="container">The container.</param> /// <param name="mappedType">The type being mapped.</param> /// <param name="getters">The getters.</param> /// <param name="setters">The setters.</param> public AutofacReflectionOptimizer(IComponentContext container, Type mappedType, IGetter[] getters, ISetter[] setters) : base(mappedType, getters, setters) { _container = container; } /// <summary> /// Creates the instance. /// </summary> /// <returns>The instance.</returns> public override object CreateInstance() { if (_container.IsRegistered(mappedType)) return _container.Resolve(mappedType); return _container.IsRegisteredWithName(mappedType.FullName, mappedType) ? _container.ResolveNamed(mappedType.FullName, mappedType) : base.CreateInstance(); } /// <summary> /// Determines if an exception should be thrown for when no default constructor is found. /// </summary> /// <param name="type">The type.</param> protected override void ThrowExceptionForNoDefaultCtor(Type type) { } } }
autofac/Autofac.Extras.NHibernate
src/Autofac.Extras.NHibernate/Bytecode/AutofacReflectionOptimizer.cs
C#
mit
2,949
export default () => ({ hostname: process.env.ES_HOST || 'localhost', port: 1116, useSslConnection: global.runningTestsInSecureMode, validateServer: !global.runningTestsInSecureMode, credentials: { username: 'admin', password: 'changeit' }, poolOptions: { autostart: false, max: 10, min: 0 }, connectionNameGenerator: () => `CUSTOM_TCP_CONNECTION_NAME_${new Date().getTime()}` });
RemoteMetering/geteventstore-promise
tests/support/getTcpConfigCustomConnectionName.js
JavaScript
mit
399
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import datetime import numpy as np from copy import deepcopy import sys import logging class System: def __init__(self, _start_time, start_power=0, test_plan=None): self.start_power = start_power self.power_left = self.start_power self.last_event = _start_time self.last_decision = _start_time self.decision_interval = (24*3600) / test_plan.state_number self.reward = 0 self.time_to_read_input = 0 self.learning_a = deepcopy(test_plan.learning_module) self.current_clock = self.learning_a.choose_action(0) self.first_start = True self.event_count = 0 self.awake_count = 0 self.ml_parameters = {'d_penalty': test_plan.delay_award, 'd_award': test_plan.delay_award, 's_penalty': test_plan.awake_penalty, 's_award': test_plan.awake_award, 'delay_threshold': test_plan.delay_threshold, 'delay_scale': 2} self.power_consumption = {'sleep': 4.42, 'active': 63.68} self.button_push_counter = 0 self.voltage = 6.54 self.b_event_action = False print("d_penalty = ", self.ml_parameters['d_penalty'], "s_penalty", self.ml_parameters['s_penalty'], 's_award', self.ml_parameters['s_award'], "delay_threshold", self.ml_parameters['delay_threshold']) def simulation_step(self, _current_time): if self.time_to_read_input <= 0: if self.b_event_action: self.reward += self.ml_parameters['s_award'] self.b_event_action = False else: self.reward -= self.ml_parameters['s_penalty'] self.awake_count += 1 self.power_left += self.power_consumption['active'] * self.voltage / 1000. self.time_to_read_input = self.current_clock else: self.power_left += self.power_consumption['sleep'] * self.voltage / 1000. self.time_to_read_input -= 1 if _current_time - self.last_decision >= datetime.timedelta(seconds=self.decision_interval)\ or _current_time < self.last_decision: self.last_decision = _current_time state = (_current_time.hour * 3600 + _current_time.minute * 60 + _current_time.second) / self.decision_interval if not self.first_start: # update (Q table)/knowledge self.learning_a.update_knowledge(self.calculate_reward(), int(state)) self.first_start = False # Learning - choose action self.current_clock = self.learning_a.choose_action(int(state)) def reset_epoch(self): self.power_left = self.start_power self.button_push_counter = 0 self.event_count = 0 self.awake_count = 0 try: self.learning_a.e_greedy *= .9 except AttributeError: pass def event_action(self, _): self.event_count += 1 self.b_event_action = True if self.time_to_read_input > np.random.normal(loc=self.ml_parameters['delay_threshold'], scale=self.ml_parameters['delay_scale']): self.reward -= self.ml_parameters['d_penalty'] self.button_push_counter += 1 else: self.reward += self.ml_parameters['d_award'] self.reward -= self.time_to_read_input return self.time_to_read_input def calculate_reward(self): reward = self.reward self.reward = 0 self.awake_count = 0 self.event_count = 0 return reward class SystemTransmission: def __init__(self, _start_time, start_power=0, test_plan=None): self.start_power = start_power self.power_left = self.start_power self.last_event = _start_time self.last_decision = _start_time self.decision_interval = 1200 self.reward = 0 self.power_reward = 0 self.time_to_read_input = 0 self.learning_a = deepcopy(test_plan.learning_module) self.update_knowledge = False self.event_count = 0 self.awake_count = 0 self.power_consumption = {'idle': 63.68, 'sleep': 4.42, 'off': None, 'gprs': [32.75, 36.39, 37.26, 38.82, 41.09, 42.99, 44.9, 46.81, 48.71, 50.62], 'sms': 16.37} self.timings = {'sms': 18.16, 'gprs': [23.41, 25.13, 26.06, 27.19, 28.52, 29.74, 30.97, 32.3, 33.42, 34.65], 'deregister_sms': 2., 'deregister_gprs': 2.02} self.rewards = {'delay_award': 150, 'delay_penalty': 150, 'buff_overflow': 10000, 'lost_message': 1000} self.rewards_const = {'message_threshold': 500, 'power_scale': .2} self.current_state = 'off' self.max_buff_size = 9 self.buff = [] self.state_number = int(((24 * 60 * 60) / self.decision_interval) * (self.max_buff_size + 1)) self.delays = [[] for _ in range(self.state_number)] self.button_push_counter = 0 self.action_time = None self.last_action = None self.aggregation_count = 0 self.mode = test_plan.mode def simulation_step(self, _current_time): # self.power_left += self.power_consumption['idle'] buff_timeout = 3600 if self.mode == 'timeout': buff_timeout = 1200 for mgs in self.buff: delay = self.datatime2seconds(_current_time) - self.datatime2seconds(mgs) if delay < 0: delay = 86400 - self.datatime2seconds(mgs) + self.datatime2seconds(_current_time) # logging.error("rtime = " + str(_current_time) + "mgs = " + str(mgs)) if delay > buff_timeout: # print(self.buff) # logging.error("TIMEOUT! rtime = " + str(_current_time) + "mgs = " + str(mgs)) self.send_gprs(_current_time, add2buff=False) self.learning_a.update_knowledge(-200, self.time2state(_current_time)) self.update_knowledge = False def reset_epoch(self): self.delays = [[] for _ in range(self.state_number)] self.power_left = self.start_power self.button_push_counter = 0 try: self.learning_a.e_greedy *= .9 except AttributeError: pass def event_action(self, _current_time): # logging.info("LEARNING MODE = " + str(self.mode)) state = self.time2state(_current_time) if self.update_knowledge: self.learning_a.update_knowledge(self.calculate_reward(_current_time), int(state)) self.update_knowledge = True if self.mode == 'ml': if len(self.buff) == 0: action = self.learning_a.choose_action(state, restricted_state=[2]) elif len(self.buff) > 0: action = self.learning_a.choose_action(state, restricted_state=[0]) elif self.mode == 'sms': action = 0 elif self.mode == 'timeout': action = 1 else: logging.error("MODE NOT SET!") sys.exit() # logging.info("ACTION == " + str(action)) self.execute_action(action, _current_time) def execute_action(self, action, time): """ # 0 - wyślij SMS # 1 - dodaj wiadomość do bufora # 2 - wyślij przez GPRS wiadomości z bufora :param action: :param time: """ if action == 0: self.send_sms(time) elif action == 1: if len(self.buff) > self.max_buff_size - 2: self.send_gprs(time) else: self.buffer_data(time) elif action == 2: self.send_gprs(time) def buffer_data(self, r_time): self.last_action = 'buff' if len(self.buff) == 0: self.action_time = r_time self.buff.append(r_time) else: self.buff.append(r_time) def send_sms(self, r_time): self.last_action = 'sms' self.action_time = r_time time = self.timings['sms'] - self.timings['deregister_sms'] energy = self.power_consumption['sms'] # power consumed for sending sms self.power_left += energy if time < 0: sys.exit() self.delays[self.time2state(r_time)].append(time) def send_gprs(self, r_time, add2buff=True): self.aggregation_count = len(self.buff) self.last_action = 'gprs' if add2buff: self.buff.append(r_time) messages_number = len(self.buff) time = self.timings['gprs'][messages_number] - self.timings['deregister_gprs'] energy = self.power_consumption['gprs'][messages_number] self.power_left += energy for mgs in self.buff: delay = self.datatime2seconds(r_time) - self.datatime2seconds(mgs) + time if delay > 14400: logging.error("rtime = " + str(r_time) + "mgs = " + str(mgs)) if delay < 0: delay = 86400 - self.datatime2seconds(mgs) + self.datatime2seconds(r_time) + time self.delays[self.time2state(r_time)].append(delay) self.buff.clear() def calculate_reward(self, r_time): if self.dates2seconds(r_time, self.action_time) > 350: if self.last_action != 'buff': reward = 100 else: reward = -100 else: if self.last_action == 'buff': reward = 100 else: reward = -100 if self.last_action == 'gprs': if self.aggregation_count < 4: reward -= 400 else: reward += 200 # self.action_time = r_time return reward def delay2reward(self, seconds): if seconds > self.rewards_const['message_threshold']: self.button_push_counter += 1 return self.rewards['delay_penalty'] else: return self.rewards['delay_award'] def time2state(self, _current_time): time_state = int((_current_time.hour * 3600 + _current_time.minute * 60 + _current_time.second) / self.decision_interval) val = time_state + 72 * self.buff2state(len(self.buff)) return val def datatime2seconds(self, _current_time): return _current_time.hour * 3600 + _current_time.minute * 60 + _current_time.second def dates2seconds(self, first_time, second_time): res_time = self.datatime2seconds(first_time) - self.datatime2seconds(second_time) if res_time < 0: res_time = 86400 - self.datatime2seconds(second_time) + self.datatime2seconds(first_time) return res_time def buff2state(self, n): if n == 0: return 0 elif n == 1: return 1 elif n < 8: return int(np.log2(n)+1) else: return int(np.log2(n-1) + 1)
pwcz/ml_embedded
simulation_tool/symulator.py
Python
mit
11,083
<h4 id="buttons" class="section-header">Buttons</h4> <div class="bs-component"> <a class="button-link" href="">Button Link</a> <a class="button" href="">Anchor Button</a> <button>Button Element</button> <input type="submit" value="submit input"> <input type="button" value="button input"> </div>
darkmuzo/staging
components/forms/button.php
PHP
mit
309
package org.accela.minesweeper.controller.fordialog; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import org.accela.minesweeper.controller.Controller; import org.accela.minesweeper.model.GameModel; import org.accela.minesweeper.profile.Profile; import org.accela.minesweeper.util.Common; import org.accela.minesweeper.view.CustomMineFieldDialog; import org.accela.minesweeper.view.GameFrame; public class CustomMineFieldController implements Controller { public static final int PRIORITY = 10; private CustomMineFieldDialog dialog = null; private ComponentListener showListener = new ShowListener(); private ActionListener okListener = new OkListener(); private GameModel model = null; @Override public void install(GameModel model, GameFrame view) { this.dialog = view.getCustomMineFieldDialog(); this.dialog.addComponentListener(showListener); this.dialog.getPanel().getOkButton().addActionListener(okListener); this.model = model; } @Override public void uninstall(GameModel model, GameFrame view) { this.dialog.removeComponentListener(showListener); this.dialog.getPanel().getOkButton().removeActionListener(okListener); } @Override public String getName() { return this.getClass().getName(); } @Override public double getPriorityOnInstallation() { return PRIORITY; } private class ShowListener extends ComponentAdapter { @Override public void componentShown(ComponentEvent e) { Profile profile = Profile.getInstance(); CustomMineFieldDialog.Panel panel = dialog.getPanel(); panel.getWidthField().setText("" + profile.getFieldSize().width); panel.getHeightField().setText("" + profile.getFieldSize().height); panel.getMineField().setText("" + profile.getMineCount()); } } private class OkListener implements ActionListener { @Override public void actionPerformed(ActionEvent e) { Profile profile = Profile.getInstance(); CustomMineFieldDialog.Panel panel = dialog.getPanel(); Dimension fieldSize = new Dimension(-1, -1); int mineCount = -1; try { fieldSize.width = Integer.parseInt(panel.getWidthField() .getText()); fieldSize.height = Integer.parseInt(panel.getHeightField() .getText()); mineCount = Integer.parseInt(panel.getMineField().getText()); } catch (NumberFormatException ex) { // do nothing } // set field size fieldSize.width = Math.max( fieldSize.width, Common.MIN_MINE_FIELD_SIZE.width); fieldSize.height = Math.max( fieldSize.height, Common.MIN_MINE_FIELD_SIZE.height); fieldSize.width = Math.min( fieldSize.width, Common.MAX_MINE_FIELD_SIZE.width); fieldSize.height = Math.min( fieldSize.height, Common.MAX_MINE_FIELD_SIZE.height); profile.setFieldSize(fieldSize); // set mine count mineCount=Math.max(mineCount, Common.getMinMineCount()); mineCount=Math.min(mineCount, Common.getMaxMineCount(fieldSize)); profile.setMineCount(mineCount); model.setFieldSizeOnStart(profile.getFieldSize()); model.setMineCountOnStart(profile.getMineCount()); model.reset(); } } }
accelazh/MineSweeper
MineSweeper/src/org/accela/minesweeper/controller/fordialog/CustomMineFieldController.java
Java
mit
3,412
declare global { namespace NodeJS { interface ProcessEnv { TOKEN: string; SENTRY_DSN: string; LOG_LEVEL?: string; DATABASE_URL?: string; SAUCENAO_API_KEY?: string; } } } // If this file has no import/export statements (i.e. is a script) // convert it into a module by adding an empty export statement. export {};
omegavesko/Shinoa
src/internal/env.d.ts
TypeScript
mit
356
<?php use Illuminate\Database\Seeder; class WorkTypeSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { DB::table('work_types')->delete(); for ($i = 1; $i <= 30; $i++) { \App\Models\WorkType::create([ 'name' => '作業'.$i, ]); } } }
fourmix-pub/fourmix-system
database/seeds/WorkTypeSeeder.php
PHP
mit
383
namespace P03_CombinationsWithoutDuplicates { using System; public class ReccursiveCombinationsWithoutDuplicates { public static void Main() { int numberOfElements = 4; int subsetSize = 2; int[] combination = new int[subsetSize]; GetNextNumber(numberOfElements, 0, 0, combination); } private static void GetNextNumber(int numberOfElements, int lowRange, int index, int[] combination) { if (index >= combination.Length) { Console.WriteLine(string.Join(" ", combination)); return; } for (int i = lowRange; i < numberOfElements; i++) { combination[index] = i + 1; GetNextNumber(numberOfElements, lowRange + (i + 1), index + 1, combination); } } } }
dechoD/Telerik-Homeworks
Module II Homeworks/DSA/Recursion/P03_CombinationsWithoutDuplicates/ReccursiveCombinationsWithoutDuplicates.cs
C#
mit
901
# Accelerator for pip, the Python package manager. # # Author: Peter Odding <peter.odding@paylogic.com> # Last Change: November 16, 2014 # URL: https://github.com/paylogic/pip-accel """ :py:mod:`pip_accel.caches.local` - Local cache backend ====================================================== This module implements the local cache backend which stores distribution archives on the local file system. This is a very simple cache backend, all it does is create directories and write local files. The only trick here is that new binary distribution archives are written to temporary files which are then moved into place atomically using :py:func:`os.rename()` to avoid partial reads caused by running multiple invocations of pip-accel at the same time (which happened in `issue 25`_). .. _issue 25: https://github.com/paylogic/pip-accel/issues/25 """ # Standard library modules. import logging import os import shutil # Modules included in our package. from pip_accel.caches import AbstractCacheBackend from pip_accel.utils import makedirs # Initialize a logger for this module. logger = logging.getLogger(__name__) class LocalCacheBackend(AbstractCacheBackend): """The local cache backend stores Python distribution archives on the local file system.""" PRIORITY = 10 def get(self, filename): """ Check if a distribution archive exists in the local cache. :param filename: The filename of the distribution archive (a string). :returns: The pathname of a distribution archive on the local file system or ``None``. """ pathname = os.path.join(self.config.binary_cache, filename) if os.path.isfile(pathname): logger.debug("Distribution archive exists in local cache (%s).", pathname) return pathname else: logger.debug("Distribution archive doesn't exist in local cache (%s).", pathname) return None def put(self, filename, handle): """ Store a distribution archive in the local cache. :param filename: The filename of the distribution archive (a string). :param handle: A file-like object that provides access to the distribution archive. """ file_in_cache = os.path.join(self.config.binary_cache, filename) logger.debug("Storing distribution archive in local cache: %s", file_in_cache) makedirs(os.path.dirname(file_in_cache)) # Stream the contents of the distribution archive to a temporary file # to avoid race conditions (e.g. partial reads) between multiple # processes that are using the local cache at the same time. temporary_file = '%s.tmp-%i' % (file_in_cache, os.getpid()) logger.debug("Using temporary file to avoid partial reads: %s", temporary_file) with open(temporary_file, 'wb') as temporary_file_handle: shutil.copyfileobj(handle, temporary_file_handle) # Atomically move the distribution archive into its final place # (again, to avoid race conditions between multiple processes). logger.debug("Moving temporary file into place ..") os.rename(temporary_file, file_in_cache) logger.debug("Finished caching distribution archive in local cache.")
theyoprst/pip-accel
pip_accel/caches/local.py
Python
mit
3,310
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("ProductAssistant.DAL")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ProductAssistant.DAL")] [assembly: AssemblyCopyright("Copyright © 2014")] [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("5fa324de-2766-4735-a9f6-6141ab4edb24")] // 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")]
gerich-home/ROI-Web-School
Docs/Practice/ProductAssistant/ProductAssistant.DAL/Properties/AssemblyInfo.cs
C#
mit
1,452
#include <cstdio> #include <iostream> #include <fstream> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <set> #include <map> #include <cstring> #include <cstdlib> #include <cmath> #include <string> #include <memory.h> #include <sstream> #include <ctime> #include <Windows.h> using namespace std; #pragma comment(linker, "/stack:64000000") typedef long long ll; typedef long double ld; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<pair<int, int > > vii; typedef vector<ll> vll; typedef vector<string> vs; typedef vector<ld> vld; typedef vector<vi> vvi; typedef vector<vii> vvii; typedef vector<vll> vvll; typedef vector<vs> vvs; typedef map<int, int> mpii; typedef map<int, string> mpis; typedef map<string, int> mpsi; typedef map<string, string> mpss; #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() #define sz(a) (int)((a).size()) #define len(a) (int)((a).length()) #define forr(i,n) for (int i = 0; i < (n); ++i) #define fori(n) forr(i,n) #define forj(n) forr(j,n) #define fork(n) forr(k,n) #define forin fori(n) #define forjn forj(n) #define forjm forj(m) #define forkm fork(m) #define foria(a) fori(sz(a)) #define foriv foria(v) #define foris fori(len(s)) #define forja(a) forj(sz(a)) #define forjv forj(v) #define forjs forj(len(s)) #define read cin>> #define write cout<< #define writeln write endl #define readt int aaa; read aaa; #define gett (bbb+1) #define fort forr(bbb,aaa) #define issa(a,s) istringstream a(s); #define iss(s) issa(ss,s); ld dis(ld x, ld y) {return sqrt(x*x+y*y);} const ld PI = acos(ld(0.0))*2; const ld pi = PI; ll gcd(ll a, ll b){return b ? gcd(b,a%b) : a;} template<class T> struct makev { vector<T> v; makev& operator << (const T& x) { v.push_back(x); return *this; } operator vector<T>& () { return v; } }; //void assert(bool b) //{ // if (!b) // throw 0; //} pair<string, string> hackHashInit() { return pair<string, string>("a", "b"); } ll getHash(const string &s, ll a, ll p) { ll res = 0; foris res = (res * a + s[i]) % p; return res; } bool hackHash(pair<string, string> v, pair<string, string> &ans, ll a, ll p) { const int len = 22; map<ll, string> mp; fori((1<<len)) { string s; s.reserve(len * v.first.length()); forj(len) if (i & (1 << j)) s += v.first; else s += v.second; ll h = getHash(s, a, p); if (mp.find(h) != mp.end()) { ans.first = mp[h]; ans.second = s; return true; } mp.insert(make_pair(h, s)); } return false; } int main() { pair<string, string> collision; if (!hackHash(hackHashInit(), collision, 53, 1000100437)) { cout << "FAIL!"; return 0; } std::cout << "First OK!"; cout << collision.first << endl << collision.second << endl; return 0; }
LoDThe/algorithms
other/Hash hack.cpp
C++
mit
3,247
/** * */ package me.chris.NetherControl; import java.util.logging.Logger; import net.milkbowl.vault.permission.Permission; /** * @author Christopher Pybus * @date Mar 25, 2012 * @file SimpleChatVariables.java * @package me.chris.SimpleChat * * @purpose */ public class Vars { //public static FileConfiguration config; public static Permission perms; public static Logger log; public static NetherControlMain plugin; //public static File configFile; public static final String version = "NetherControl 1.0"; public Vars(NetherControlMain plugin) { Vars.plugin = plugin; log = Logger.getLogger("Minecraft"); //configFile = new File(plugin.getDataFolder(), "config.yml"); //config = new YamlConfiguration(); } public static void importVariables() { } public static void exportVariables() { } }
hotshot2162/NetherControl
src/me/chris/NetherControl/Vars.java
Java
mit
887
/******************************************************************************* * The MIT License (MIT) * * Copyright (c) 2015 Igor Deplano * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. *******************************************************************************/ package it.polito.ai.polibox.service.notification.message; import it.polito.ai.polibox.persistency.model.Resource; import it.polito.ai.polibox.persistency.model.User; public class CondivisioneRichiesta extends AbstractMessage{ private User to; public CondivisioneRichiesta(User from, User to, Resource r) { this.u=from; this.o=null; this.code=108; this.to=to; } @Override protected String messageGenerator() { String s=""; s+="Richiesta della condivisione della risorsa "+((Resource)o).getName() +" spedita da "+u.getEmail() +" a " +to.getEmail(); return s; } }
IDepla/polibox
src/main/java/it/polito/ai/polibox/service/notification/message/CondivisioneRichiesta.java
Java
mit
1,892
/* * Copyright (c) 2020-2021, Norsk Helsenett SF and contributors * See the file CONTRIBUTORS for details. * * This file is licensed under the MIT license * available at https://raw.githubusercontent.com/helsenorge/Helsenorge.Messaging/master/LICENSE */ using Amqp; using Amqp.Framing; using Helsenorge.Messaging.ServiceBus; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xunit; using Xunit.Abstractions; namespace Helsenorge.Messaging.IntegrationTests.ServiceBus { internal class ServiceBusFixture : IDisposable { internal ServiceBusConnection Connection { get; } private readonly ILogger _logger; public ServiceBusFixture(ITestOutputHelper output) { if (output == null) { throw new ArgumentNullException(nameof(output)); } var loggerFactory = new LoggerFactory(); loggerFactory.AddProvider(new XUnitLoggerProvider(output)); _logger = loggerFactory.CreateLogger(typeof(ServiceBusFixture)); Connection = new ServiceBusConnection(GetConnectionString(), _logger); } public static string GetConnectionString() { var connectionString = Environment.GetEnvironmentVariable("HM_IT_CONN_STRING"); if (string.IsNullOrEmpty(connectionString)) { throw new ArgumentException("HM_IT_CONN_STRING env variable must be set before running integration tests."); } return connectionString; } public void Dispose() { Connection.CloseAsync().Wait(); } public async Task PurgeQueueAsync(string queueName) { await ReadAllMessagesAsync(queueName, true); } public ServiceBusReceiver CreateReceiver(string queueName) { return new ServiceBusReceiver(Connection, queueName, 1, _logger); } public ServiceBusSender CreateSender(string queueName) { return new ServiceBusSender(Connection, queueName, _logger); } public async Task<List<Message>> ReadAllMessagesAsync(string queueName, bool accept = false) { var list = new List<Message>(); var connection = new ServiceBusConnection(GetConnectionString(), _logger); var rawConnection = await connection.GetInternalConnectionAsync(); var session = rawConnection.CreateSession(); var receiverLink = session.CreateReceiver($"test-receiver-link-{Guid.NewGuid()}", connection.GetEntityName(queueName, LinkRole.Receiver)); Message message; while ((message = await receiverLink.ReceiveAsync(ServiceBusTestingConstants.DefaultReadTimeout)) != null) { if (accept) { receiverLink.Accept(message); } list.Add(message); } await session.CloseAsync(); await connection.CloseAsync(); return list; } public async Task<string> SendTestMessageAsync(string queueName, string messageText = null) { if (messageText == null) { messageText = $"Test message {Guid.NewGuid()}"; } var connection = new ServiceBusConnection(GetConnectionString(), _logger); var rawConnection = await connection.GetInternalConnectionAsync(); var session = rawConnection.CreateSession(); var senderLink = session.CreateSender($"test-sender-link-{Guid.NewGuid()}", connection.GetEntityName(queueName, LinkRole.Sender)); await senderLink.SendAsync(new Message { BodySection = new Data { Binary = Encoding.UTF8.GetBytes(messageText) } }).ConfigureAwait(false); await senderLink.CloseAsync(); await session.CloseAsync(); await connection.CloseAsync(); return messageText; } public async Task CheckMessageSentAsync(string queueName, string text) { var connection = new ServiceBusConnection(GetConnectionString(), _logger); var rawConnection = await connection.GetInternalConnectionAsync(); var session = rawConnection.CreateSession(); var receiverLink = session.CreateReceiver($"test-receiver-link-{Guid.NewGuid()}", connection.GetEntityName(queueName, LinkRole.Receiver)); var message = await receiverLink.ReceiveAsync(ServiceBusTestingConstants.DefaultReadTimeout); Assert.NotNull(message); receiverLink.Accept(message); Assert.Equal(text, message.GetBodyAsString()); await receiverLink.CloseAsync(); await session.CloseAsync(); await connection.CloseAsync(); } public async Task CheckDeadLetterQueueAsync(string queueName, params string[] messages) { var deadLetterMessages = await ReadAllMessagesAsync(ServiceBusTestingConstants.GetDeadLetterQueueName(queueName)); Assert.Equal(deadLetterMessages.Count, messages.Length); Assert.Equal(deadLetterMessages.Select(m => m.GetBodyAsString()), messages); } } }
ehelse/Helsenorge.Messaging
test/Helsenorge.Messaging.IntegrationTests/ServiceBus/ServiceBusFixture.cs
C#
mit
5,450
import React, { Component } from 'react'; // eslint-disable-next-line import TabNavigationView from 'ringcentral-widgets/components/TabNavigationView'; import DialPadIcon from 'ringcentral-widgets/assets/images/DialPadNav.svg'; import CallsIcon from 'ringcentral-widgets/assets/images/Calls.svg'; import MessageIcon from 'ringcentral-widgets/assets/images/Messages.svg'; import SettingsIcon from 'ringcentral-widgets/assets/images/Settings.svg'; import ContactIcon from 'ringcentral-widgets/assets/images/Contact.svg'; import MoreMenuIcon from 'ringcentral-widgets/assets/images/MoreMenu.svg'; import DialPadHoverIcon from 'ringcentral-widgets/assets/images/DialPadHover.svg'; import CallsHoverIcon from 'ringcentral-widgets/assets/images/CallsHover.svg'; import MessageHoverIcon from 'ringcentral-widgets/assets/images/MessagesHover.svg'; import SettingsHoverIcon from 'ringcentral-widgets/assets/images/SettingsHover.svg'; import ContactHoverIcon from 'ringcentral-widgets/assets/images/ContactHover.svg'; import MoreMenuHoverIcon from 'ringcentral-widgets/assets/images/MoreMenuHover.svg'; import ContactNavIcon from 'ringcentral-widgets/assets/images/ContactsNavigation.svg'; import SettingsNavIcon from 'ringcentral-widgets/assets/images/SettingsNavigation.svg'; const tabs = [ { icon: DialPadIcon, activeIcon: DialPadHoverIcon, label: 'Dial Pad', path: '/dialer', }, { icon: CallsIcon, activeIcon: CallsHoverIcon, label: 'Calls', path: '/calls', isActive: (currentPath) => currentPath === '/calls' || currentPath === '/calls/active', }, { icon: MessageIcon, activeIcon: MessageHoverIcon, label: 'Messages', path: '/messages', noticeCounts: 1, isActive: (currentPath) => currentPath === '/messages' || currentPath.indexOf('/conversations/') !== -1, }, { icon: ({ currentPath }) => { if (currentPath === '/contacts') { return <ContactNavIcon />; } else if (currentPath === '/settings') { return <SettingsNavIcon />; } return <MoreMenuIcon />; }, activeIcon: MoreMenuHoverIcon, label: 'More Menu', virtualPath: '!moreMenu', isActive: (currentPath, currentVirtualPath) => currentVirtualPath === '!moreMenu', childTabs: [ { icon: ContactIcon, activeIcon: ContactHoverIcon, label: 'Contacts', path: '/contacts', }, { icon: SettingsIcon, activeIcon: SettingsHoverIcon, label: 'Settings', path: '/settings', isActive: (currentPath) => currentPath.substr(0, 9) === '/settings', }, ], }, ]; /** * A example of `TabNavigationView` */ class TabNavigationViewDemo extends Component { constructor(props) { super(props); this.state = { currentPath: '/dialer', currentVirtualPath: '', }; this.goTo = (path, virtualPath) => { this.setState({ currentPath: path || '', currentVirtualPath: virtualPath || '', }); }; } render() { return ( <div style={{ position: 'relative', height: '500px', width: '300px', border: '1px solid #f3f3f3', }} > <TabNavigationView currentPath={this.state.currentPath} currentVirtualPath={this.state.currentVirtualPath} tabs={tabs} goTo={this.goTo} /> </div> ); } } export default TabNavigationViewDemo;
ringcentral/ringcentral-js-widget
packages/ringcentral-widgets-docs/src/app/pages/Components/TabNavigationView/Demo.js
JavaScript
mit
3,500
export default { path: 'robots', getComponent(location, cb) { if (__CLIENT__) { require.ensure([], require => { cb(null, require('../../components/Projects/Robots').default); }); } else { cb(null, require('../../components/Projects/Robots').default); } }, };
chanceeakin/portfolio-material
src/routes/projects/robots.js
JavaScript
mit
303
import { Course } from '../common/api-models'; import { determineEquivType, PdfIndexer } from './index'; import { CourseEquivalency, CREDITS_UNKNOWN, } from './models'; const subjectRegex = /^[A-Z]{3}$/; // Tests if the entirety of a string represents a valid course identifier. // Example: http://regexr.com/3estr const courseStringTester = /^(?:([A-Z]{2,4} ?)?([0-9LX]{2,4})(?: & |\/ ?)?)+$/; // Capture course identifier parts // Example: http://regexr.com/3esti const courseStringSeparator = /([A-Z]{3,4} ?)?([0-9LX]{3,4})/g; // http://regexr.com/3foll const courseNumberTester = /^\d{3}(?: ?[-+] ?\d{3})?$/; const defaultCnuCourseIndex = 4; export default class CnuIndexer extends PdfIndexer { public institution = { acronym: 'CNU', fullName: 'Christopher Newport University', location: 'Virginia', parseSuccessThreshold: 1.00 }; protected prepareRequest(): any { return 'http://cnu.edu/admission/transfer/_pdf/cnu-vccs-cnu_equivalent_course_table_02152017_kw.pdf'; } protected parseEquivalencies(rows: string[][]): [CourseEquivalency[], number] { const equivalencies: CourseEquivalency[] = []; for (const row of rows) { if (subjectRegex.test(row[0])) { // NVCC is pretty convenient const nvccCourses = parseNvccCourses(row); // CNU isn't let cnuCourses: Course[] | null = null; for (let i = defaultCnuCourseIndex; i < row.length; i++) { // Look for a cell represents the CNU course const base = row[i].trim(); if (courseStringTester.test(base)) { cnuCourses = parseCnuCourses(base); break; } // Sometimes the full identifier can't fit on a single row, // search the next row as well. if (i + 1 < row.length) { const appended = base + ' ' + row[i + 1].trim(); if (courseStringTester.test(appended)) { cnuCourses = parseCnuCourses(appended); break; } } } equivalencies.push(new CourseEquivalency( nvccCourses, cnuCourses!, determineEquivType(cnuCourses!))); } } return [equivalencies, 0]; } } function parseNvccCourses(row: string[]) { let offset = 1; let numberRaw: string; if (courseNumberTester.test(row[offset].trim() + row[offset + 1].trim())) { // The course number is broken up into two elements numberRaw = row[offset].trim() + row[++offset].trim(); } else if (courseNumberTester.test(row[offset].trim())) { // The course number is confined to one element numberRaw = row[offset].trim(); } else { throw new Error('Could not identify NVCC number for row ' + row); } const courseNumbers = numberRaw.split(/[-+]/); const courses: Course[] = []; let creditsUsed = false; for (const courseNumber of courseNumbers) { let credits = CREDITS_UNKNOWN; if (!creditsUsed) { credits = parseInt(row[2], 10); creditsUsed = true; } courses.push({ subject: row[0], number: courseNumber, credits: parseInt(row[1 + offset], 10) }); } return courses; } function parseCnuCourses(rawString: string): Course[] { let matchedCourses = rawString.match(courseStringSeparator); const courses: Course[] = []; // Split each match by a space and flat map. For example: // ['CHEM 104', '104L'] => ['CHEM', '104', '104L'] matchedCourses = [].concat.apply([], matchedCourses!.map((course) => separateCourseParts(course))); let subject = matchedCourses![0]; for (let i = 1; i < matchedCourses!.length; i++) { if (/[A-Z]/.test(matchedCourses![i][0])) { // First letter is alphabetical, assume subject subject = matchedCourses![i]; } else { // First letter is non-alphabetical, assume course number courses.push({ subject, number: matchedCourses![i], credits: CREDITS_UNKNOWN }); } } return courses; } function separateCourseParts(raw) { if (raw.indexOf(' ') !== -1) return raw.split(' '); const firstNumber = raw.search(/\d/); if (firstNumber === 0) return [raw]; return [raw.slice(0, firstNumber), raw.slice(firstNumber)]; }
thatJavaNerd/novaXfer
server/src/indexers/cnu.ts
TypeScript
mit
4,704
// Initialize Firebase var firebase = require('firebase'); var config = { apiKey: "AIzaSyA9XhQ19knvbKb7DqXp4vwGVSGkQPuqyzw", authDomain: "ubiquitouspi-ddcb0.firebaseapp.com", databaseURL: "https://ubiquitouspi-ddcb0.firebaseio.com", projectId: "ubiquitouspi-ddcb0", storageBucket: "ubiquitouspi-ddcb0.appspot.com", messagingSenderId: "909294414727" }; firebase.initializeApp(config); exports.test = (request, response) => { response.send('Database file works'); }
ssvictorlin/PI
backend/functions/routes/database.js
JavaScript
mit
479
import update from 'immutability-helper' import { REQUEST_PAGES, RECEIVE_PAGES, NEW_PAGE, UPDATE_PAGE, DELETE_PAGE } from 'actions/pageActions' export default function pages (state = {}, action) { switch (action.type) { case REQUEST_PAGES: { return { ...state, isFetching: true, didInvalidate: false } } case RECEIVE_PAGES: { return { ...state, pages: action.pages, isFetching: false, didInvalidate: false, lastUpdated: action.receivedAt } } case NEW_PAGE: { const pageIndex = state.pages.findIndex(page => page._id === action.addPage._id) if (pageIndex !== -1) return state const homepageIndex = state.pages.findIndex(page => page.homepage) if (action.addPage.homepage && homepageIndex !== -1) { return { ...state, pages: [ ...state.pages.slice(0, homepageIndex), update(state.pages[homepageIndex], { $merge: { homepage: false } }), ...state.pages.slice(homepageIndex + 1), { ...action.addPage, full: true } ] } } return { ...state, pages: [ ...state.pages, { ...action.addPage, full: true } ] } } case DELETE_PAGE: { const pageIndex = state.pages.findIndex(page => page._id === action.id) if (pageIndex === -1) return state return { ...state, pages: [ ...state.pages.slice(0, pageIndex), ...state.pages.slice(pageIndex + 1) ] } } case UPDATE_PAGE: { const { _id } = action.updatePage const pageIndex = state.pages.findIndex(page => page._id === _id) if (pageIndex === -1) return state return { ...state, pages: [ ...state.pages.slice(0, pageIndex), update(state.pages[pageIndex], { $merge: { ...action.updatePage, full: true } }), ...state.pages.slice(pageIndex + 1) ] } } default: return state } }
JasonEtco/flintcms
app/reducers/pages.js
JavaScript
mit
2,095
// Template Source: Enum.java.tt // ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ package com.microsoft.graph.models; /** * The Enum Alert Severity. */ public enum AlertSeverity { /** * unknown */ UNKNOWN, /** * informational */ INFORMATIONAL, /** * low */ LOW, /** * medium */ MEDIUM, /** * high */ HIGH, /** * unknown Future Value */ UNKNOWN_FUTURE_VALUE, /** * For AlertSeverity values that were not expected from the service */ UNEXPECTED_VALUE }
microsoftgraph/msgraph-sdk-java
src/main/java/com/microsoft/graph/models/AlertSeverity.java
Java
mit
835
package com.microsoft.azure.documentdb; import java.util.ArrayList; import java.util.Collection; import org.apache.commons.lang3.text.WordUtils; import org.json.JSONArray; import org.json.JSONObject; public class IncludedPath extends JsonSerializable { private Collection<Index> indexes; /** * Constructor. */ public IncludedPath() { super(); } /** * Constructor. * * @param jsonString the json string that represents the included path. */ public IncludedPath(String jsonString) { super(jsonString); } /** * Constructor. * * @param jsonObject the json object that represents the included path. */ public IncludedPath(JSONObject jsonObject) { super(jsonObject); } /** * Gets path. * * @return the path. */ public String getPath() { return super.getString(Constants.Properties.PATH); } /** * Sets path. * * @param path the path. */ public void setPath(String path) { super.set(Constants.Properties.PATH, path); } /** * Gets the paths that are chosen to be indexed by the user. * * @return the included paths. */ public Collection<Index> getIndexes() { if (this.indexes == null) { this.indexes = this.getIndexCollection(); if (this.indexes == null) { this.indexes = new ArrayList<Index>(); } } return this.indexes; } private Collection<Index> getIndexCollection() { if (this.propertyBag != null && this.propertyBag.has(Constants.Properties.INDEXES)) { JSONArray jsonArray = this.propertyBag.getJSONArray(Constants.Properties.INDEXES); Collection<Index> result = new ArrayList<Index>(); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); IndexKind indexKind = IndexKind.valueOf(WordUtils.capitalize( jsonObject.getString(Constants.Properties.INDEX_KIND))); switch (indexKind) { case Hash: result.add(new HashIndex(jsonObject.toString())); break; case Range: result.add(new RangeIndex(jsonObject.toString())); break; case Spatial: result.add(new SpatialIndex(jsonObject.toString())); break; } } return result; } return null; } public void setIndexes(Collection<Index> indexes) { this.indexes = indexes; } @Override void onSave() { if (this.indexes != null) { for (Index index : this.indexes) { index.onSave(); } super.set(Constants.Properties.INDEXES, this.indexes); } } }
rnagpal/azure-documentdb-java
src/com/microsoft/azure/documentdb/IncludedPath.java
Java
mit
3,007
// $Id: HTIOP_Acceptor_Impl.cpp 1861 2011-08-31 16:18:08Z mesnierp $ #ifndef HTIOP_ACCEPTOR_IMPL_CPP #define HTIOP_ACCEPTOR_IMPL_CPP #include "orbsvcs/HTIOP/HTIOP_Acceptor_Impl.h" #include "orbsvcs/HTIOP/HTIOP_Completion_Handler.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/ORB_Core.h" #include "tao/ORB_Table.h" #include "tao/Server_Strategy_Factory.h" #include "tao/Connector_Registry.h" #include "tao/Transport_Cache_Manager.h" #include "tao/Thread_Lane_Resources.h" #include "ace/Object_Manager.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL //////////////////////////////////////////////////////////////////////////////// template <class SVC_HANDLER> TAO::HTIOP::Creation_Strategy<SVC_HANDLER>::Creation_Strategy (TAO_ORB_Core *orb_core) : orb_core_ (orb_core) { } template <class SVC_HANDLER> int TAO::HTIOP::Creation_Strategy<SVC_HANDLER>::make_svc_handler (SVC_HANDLER *&sh) { if (sh == 0) { ACE_NEW_RETURN (sh, SVC_HANDLER (this->orb_core_), -1); } return 0; } /////////////////////////////////////////////////////////////////////////////// template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> TAO::HTIOP::Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::Accept_Strategy (TAO_ORB_Core *orb_core) : orb_core_ (orb_core) { } template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int TAO::HTIOP::Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open ( const ACE_PEER_ACCEPTOR_ADDR &local_addr, bool restart) { return ACCEPT_STRATEGY_BASE::open (local_addr, restart); } template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int TAO::HTIOP::Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::accept_svc_handler (SVC_HANDLER *svc_handler) { int const result = ACCEPT_STRATEGY_BASE::accept_svc_handler (svc_handler); if (result == -1) { svc_handler->remove_reference (); // #REFCOUNT# is zero at this point. } return result; } /////////////////////////////////////////////////////////////////////////////// template <class SVC_HANDLER> TAO::HTIOP::Concurrency_Strategy<SVC_HANDLER>::Concurrency_Strategy (TAO_ORB_Core *orb_core) : orb_core_ (orb_core) { } template <class SVC_HANDLER> int TAO::HTIOP::Concurrency_Strategy<SVC_HANDLER>::activate_svc_handler (SVC_HANDLER *sh, void *arg) { if (this->CONCURRENCY_STRATEGY_BASE::activate_svc_handler (sh, arg) == -1) { // Activation fails, decrease reference. sh->remove_reference (); // #REFCOUNT# is zero at this point. return -1; } return 0; } TAO_END_VERSIONED_NAMESPACE_DECL #endif /* HTIOP_ACCEPTOR_IMPL_CPP */
binary42/OCI
orbsvcs/HTIOP/HTIOP_Acceptor_Impl.cpp
C++
mit
2,845
import { Component, Input } from '@angular/core'; import { MatSnackBar } from '@angular/material'; import { Title } from '@angular/platform-browser'; import { FormGroup, FormBuilder } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { BaseViewComponent } from '../../../../site/base/base-view'; import { MotionCommentSectionRepositoryService } from '../../services/motion-comment-section-repository.service'; import { ViewMotionCommentSection } from '../../models/view-motion-comment-section'; import { OperatorService } from '../../../../core/services/operator.service'; import { MotionComment } from '../../../../shared/models/motions/motion-comment'; import { ViewMotion } from '../../models/view-motion'; /** * Component for the motion comments view */ @Component({ selector: 'os-motion-comments', templateUrl: './motion-comments.component.html', styleUrls: ['./motion-comments.component.scss'] }) export class MotionCommentsComponent extends BaseViewComponent { /** * An array of all sections the operator can see. */ public sections: ViewMotionCommentSection[] = []; /** * An object of forms for one comment mapped to the section id. */ public commentForms: { [id: number]: FormGroup } = {}; /** * This object holds all comments for each section for the given motion. */ public comments: { [id: number]: MotionComment } = {}; /** * The motion, which these comments belong to. */ private _motion: ViewMotion; /** * Set to true if an error was detected to prevent automatic navigation */ public error = false; @Input() public set motion(motion: ViewMotion) { this._motion = motion; this.updateComments(); } public get motion(): ViewMotion { return this._motion; } /** * Watches for changes in sections and the operator. If one of them changes, the sections are reloaded * and the comments updated. * * @param commentRepo The repository that handles server communication * @param formBuilder Form builder to handle text editing * @param operator service to get the sections * @param titleService set the browser title * @param translate the translation service * @param matSnackBar showing errors and information */ public constructor( private commentRepo: MotionCommentSectionRepositoryService, private formBuilder: FormBuilder, private operator: OperatorService, titleService: Title, translate: TranslateService, matSnackBar: MatSnackBar ) { super(titleService, translate, matSnackBar); this.commentRepo.getViewModelListObservable().subscribe(sections => this.setSections(sections)); this.operator.getObservable().subscribe(() => this.setSections(this.commentRepo.getViewModelList())); } /** * sets the `sections` member with sections, if the operator has reading permissions. * * @param allSections A list of all sections available */ private setSections(allSections: ViewMotionCommentSection[]): void { this.sections = allSections.filter(section => this.operator.isInGroupIds(...section.read_groups_id)); this.updateComments(); } /** * Returns true if the operator has write permissions for the given section, so he can edit the comment. * * @param section The section to judge about */ public canEditSection(section: ViewMotionCommentSection): boolean { return this.operator.isInGroupIds(...section.write_groups_id); } /** * Update the comments. Comments are saved in the `comments` object associated with their section id. */ private updateComments(): void { this.comments = {}; if (!this.motion || !this.sections) { return; } this.sections.forEach(section => { this.comments[section.id] = this.motion.getCommentForSection(section); }); } /** * Puts the comment into edit mode. * * @param section The section for the comment. */ public editComment(section: ViewMotionCommentSection): void { const comment = this.comments[section.id]; const form = this.formBuilder.group({ comment: [comment ? comment.comment : ''] }); this.commentForms[section.id] = form; } /** * Saves the comment. Makes a request to the server. * * @param section The section for the comment to save */ public async saveComment(section: ViewMotionCommentSection): Promise<void> { const commentText = this.commentForms[section.id].get('comment').value; const sectionId = section.id; const motionId = this.motion.id; await this.commentRepo.saveComment(motionId, sectionId, commentText).then( () => { this.cancelEditing(section); }, error => { this.error = true; this.raiseError(`${error} :"${section.name}"`); } ); } /** * Cancles the editing for a comment. * * @param section The section for the comment */ public cancelEditing(section: ViewMotionCommentSection): void { delete this.commentForms[section.id]; } /** * Returns true, if the comment is edited. * * @param section The section for the comment. * @returns a boolean of the comments is edited */ public isCommentEdited(section: ViewMotionCommentSection): boolean { return Object.keys(this.commentForms).includes('' + section.id); } }
boehlke/OpenSlides
client/src/app/site/motions/components/motion-comments/motion-comments.component.ts
TypeScript
mit
5,713
module ActiveNode # = Active Record Belongs To Has One Association module Associations class HasOneAssociation < SingularAssociation #:nodoc: end end end
klobuczek/active_node
lib/active_node/associations/has_one_association.rb
Ruby
mit
168
//go:build go1.16 // +build go1.16 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. package armmsi import ( "encoding/json" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" ) // CloudError - An error response from the ManagedServiceIdentity service. type CloudError struct { // A list of additional details about the error. Error *CloudErrorBody `json:"error,omitempty"` } // CloudErrorBody - An error response from the ManagedServiceIdentity service. type CloudErrorBody struct { // An identifier for the error. Code *string `json:"code,omitempty"` // A list of additional details about the error. Details []*CloudErrorBody `json:"details,omitempty"` // A message describing the error, intended to be suitable for display in a user interface. Message *string `json:"message,omitempty"` // The target of the particular error. For example, the name of the property in error. Target *string `json:"target,omitempty"` } // MarshalJSON implements the json.Marshaller interface for type CloudErrorBody. func (c CloudErrorBody) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "code", c.Code) populate(objectMap, "details", c.Details) populate(objectMap, "message", c.Message) populate(objectMap, "target", c.Target) return json.Marshal(objectMap) } // Identity - Describes an identity resource. type Identity struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The properties associated with the identity. Properties *UserAssignedIdentityProperties `json:"properties,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type Identity. func (i Identity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", i.ID) populate(objectMap, "location", i.Location) populate(objectMap, "name", i.Name) populate(objectMap, "properties", i.Properties) populate(objectMap, "tags", i.Tags) populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } // IdentityUpdate - Describes an identity resource. type IdentityUpdate struct { // The geo-location where the resource lives Location *string `json:"location,omitempty"` // Resource tags Tags map[string]*string `json:"tags,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The properties associated with the identity. Properties *UserAssignedIdentityProperties `json:"properties,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type IdentityUpdate. func (i IdentityUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", i.ID) populate(objectMap, "location", i.Location) populate(objectMap, "name", i.Name) populate(objectMap, "properties", i.Properties) populate(objectMap, "tags", i.Tags) populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } // Operation supported by the Microsoft.ManagedIdentity REST API. type Operation struct { // The object that describes the operation. Display *OperationDisplay `json:"display,omitempty"` // The name of the REST Operation. This is of the format {provider}/{resource}/{operation}. Name *string `json:"name,omitempty"` } // OperationDisplay - The object that describes the operation. type OperationDisplay struct { // A description of the operation. Description *string `json:"description,omitempty"` // The type of operation. For example: read, write, delete. Operation *string `json:"operation,omitempty"` // Friendly name of the resource provider. Provider *string `json:"provider,omitempty"` // The resource type on which the operation is performed. Resource *string `json:"resource,omitempty"` } // OperationListResult - A list of operations supported by Microsoft.ManagedIdentity Resource Provider. type OperationListResult struct { // The url to get the next page of results, if any. NextLink *string `json:"nextLink,omitempty"` // A list of operations supported by Microsoft.ManagedIdentity Resource Provider. Value []*Operation `json:"value,omitempty"` } // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } // OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. type OperationsClientListOptions struct { // placeholder for future optional parameters } // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } // SystemAssignedIdentitiesClientGetByScopeOptions contains the optional parameters for the SystemAssignedIdentitiesClient.GetByScope // method. type SystemAssignedIdentitiesClientGetByScopeOptions struct { // placeholder for future optional parameters } // SystemAssignedIdentity - Describes a system assigned identity resource. type SystemAssignedIdentity struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` // Resource tags Tags map[string]*string `json:"tags,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The properties associated with the identity. Properties *SystemAssignedIdentityProperties `json:"properties,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type SystemAssignedIdentity. func (s SystemAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "tags", s.Tags) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } // SystemAssignedIdentityProperties - The properties associated with the system assigned identity. type SystemAssignedIdentityProperties struct { // READ-ONLY; The id of the app associated with the identity. This is a random generated UUID by MSI. ClientID *string `json:"clientId,omitempty" azure:"ro"` // READ-ONLY; The ManagedServiceIdentity DataPlane URL that can be queried to obtain the identity credentials. ClientSecretURL *string `json:"clientSecretUrl,omitempty" azure:"ro"` // READ-ONLY; The id of the service principal object associated with the created identity. PrincipalID *string `json:"principalId,omitempty" azure:"ro"` // READ-ONLY; The id of the tenant which the identity belongs to. TenantID *string `json:"tenantId,omitempty" azure:"ro"` } // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "tags", t.Tags) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } // UserAssignedIdentitiesClientCreateOrUpdateOptions contains the optional parameters for the UserAssignedIdentitiesClient.CreateOrUpdate // method. type UserAssignedIdentitiesClientCreateOrUpdateOptions struct { // placeholder for future optional parameters } // UserAssignedIdentitiesClientDeleteOptions contains the optional parameters for the UserAssignedIdentitiesClient.Delete // method. type UserAssignedIdentitiesClientDeleteOptions struct { // placeholder for future optional parameters } // UserAssignedIdentitiesClientGetOptions contains the optional parameters for the UserAssignedIdentitiesClient.Get method. type UserAssignedIdentitiesClientGetOptions struct { // placeholder for future optional parameters } // UserAssignedIdentitiesClientListByResourceGroupOptions contains the optional parameters for the UserAssignedIdentitiesClient.ListByResourceGroup // method. type UserAssignedIdentitiesClientListByResourceGroupOptions struct { // placeholder for future optional parameters } // UserAssignedIdentitiesClientListBySubscriptionOptions contains the optional parameters for the UserAssignedIdentitiesClient.ListBySubscription // method. type UserAssignedIdentitiesClientListBySubscriptionOptions struct { // placeholder for future optional parameters } // UserAssignedIdentitiesClientUpdateOptions contains the optional parameters for the UserAssignedIdentitiesClient.Update // method. type UserAssignedIdentitiesClientUpdateOptions struct { // placeholder for future optional parameters } // UserAssignedIdentitiesListResult - Values returned by the List operation. type UserAssignedIdentitiesListResult struct { // The url to get the next page of results, if any. NextLink *string `json:"nextLink,omitempty"` // The collection of userAssignedIdentities returned by the listing operation. Value []*Identity `json:"value,omitempty"` } // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentitiesListResult. func (u UserAssignedIdentitiesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "nextLink", u.NextLink) populate(objectMap, "value", u.Value) return json.Marshal(objectMap) } // UserAssignedIdentityProperties - The properties associated with the user assigned identity. type UserAssignedIdentityProperties struct { // READ-ONLY; The id of the app associated with the identity. This is a random generated UUID by MSI. ClientID *string `json:"clientId,omitempty" azure:"ro"` // READ-ONLY; The id of the service principal object associated with the created identity. PrincipalID *string `json:"principalId,omitempty" azure:"ro"` // READ-ONLY; The id of the tenant which the identity belongs to. TenantID *string `json:"tenantId,omitempty" azure:"ro"` } func populate(m map[string]interface{}, k string, v interface{}) { if v == nil { return } else if azcore.IsNullValue(v) { m[k] = nil } else if !reflect.ValueOf(v).IsNil() { m[k] = v } }
Azure/azure-sdk-for-go
sdk/resourcemanager/msi/armmsi/zz_generated_models.go
GO
mit
13,955
require 'capistrano/bundler' load File.expand_path('../tasks/docker-cloud.rake', __FILE__)
YourCursus/capistrano-docker-cloud
lib/capistrano/docker-cloud.rb
Ruby
mit
91
(function() { var module = namespace('trigram'); var matchWords = "(?:\\S+\\s*?)"; function getWordMatchRegex(numberOfWords, fromStart) { var exp = matchWords; exp += "{" + numberOfWords + "}"; exp = (fromStart ? "^" + exp : exp + "$"); return new RegExp(exp); }; function extractWords(input, numberOfWords, fromStart) { var regex = getWordMatchRegex(numberOfWords, fromStart); var match = regex.exec(input); return (match ? match[0].trim() : null); } function removeWords(input, numberOfWords, fromStart) { var regex = getWordMatchRegex(numberOfWords, fromStart); return input.replace(regex, '').trim(); } function getNthWord(input, index, fromStart) { var regex = getWordMatchRegex(index + 1, fromStart); var match = regex.exec(input); if (match) { var parts = match[0].trim().split(/\s+/); return parts[index]; } return ""; } function randInt(maxInteger) { return Math.floor(Math.random() * maxInteger); } function createMap(input, trigramSize) { var map = {}; if (input && input.length > 0) { var key = null; var value = null; do { value = getNthWord(input, trigramSize, true); if (value) { key = extractWords(input, trigramSize, true); map[key] = map[key] || []; if (map[key].indexOf(value) < 0) { map[key].push(value); } input = removeWords(input, 1, true); } } while (key && value); } return map; } function generate(seed, map, trigramSize, maxWords) { if (maxWords < 1 || seed.length === 0 || map === {}) return ""; var story = seed; var key = ""; do { key = extractWords(story, trigramSize, false); if (map[key]) { var words = map[key]; var word = words[randInt(words.length)]; story += " " + word; } } while(maxWords-- && map[key]); return story; } module.extractWords = extractWords; module.removeWords = removeWords; module.map = createMap; module.generate = generate; })();
mr-rampage/n-trigram
src/trigram.js
JavaScript
mit
2,104
using System; using System.Globalization; using System.IO; using System.Windows.Data; using System.Windows.Media.Imaging; namespace Desktop.ViewModel { public class ArticleImageConverter : IValueConverter { public object Convert(Object value, Type targetType, Object parameter, CultureInfo culture) { if (!(value is Byte[])) return Binding.DoNothing; try { using (MemoryStream stream = new MemoryStream(value as Byte[])) // a képet a memóriába egy adatfolyamba helyezzük { BitmapImage image = new BitmapImage(); image.BeginInit(); image.CacheOption = BitmapCacheOption.OnLoad; // a betöltött tartalom a képbe kerül image.StreamSource = stream; // átalakítjuk bitképpé image.EndInit(); return image; // visszaadjuk a létrehozott bitképet } } catch { return Binding.DoNothing; } } public object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }
balintsoos/WAF-bead2
News/Desktop/ViewModel/Converters/ArticleImageConverter.cs
C#
mit
1,296
/** * Created by zhujili on 2015/11/17. * 这是一个常量类,在 facade 类中实例化并提供给全局调用 */ js.constant.Cons = function () { //把所有产量定义为私有变量 var NOTICE_NAME = "contro_change_greet"; //提供变量获取方法,通过只读方式来获取变量值可防止变量值被修改 this.GET_NOTICE_NAME = function(){ return NOTICE_NAME; } };
kally788/jsmvc
js/constant/Cons.js
JavaScript
mit
420
<?php return array( /* |-------------------------------------------------------------------------- | Application Debug Mode |-------------------------------------------------------------------------- | | When your application is in debug mode, detailed error messages with | stack traces will be shown on every error that occurs within your | application. If disabled, a simple generic error page is shown. | */ 'debug' => false, /* |-------------------------------------------------------------------------- | Application URL |-------------------------------------------------------------------------- | | This URL is used by the console to properly generate URLs when using | the Artisan command line tool. You should set this to the root of | your application so that it is used when running Artisan tasks. | */ 'url' => 'http://localhost', /* |-------------------------------------------------------------------------- | Application Timezone |-------------------------------------------------------------------------- | | Here you may specify the default timezone for your application, which | will be used by the PHP date and date-time functions. We have gone | ahead and set this to a sensible default for you out of the box. | */ 'timezone' => 'UTC', /* |-------------------------------------------------------------------------- | Application Locale Configuration |-------------------------------------------------------------------------- | | The application locale determines the default locale that will be used | by the translation service provider. You are free to set this value | to any of the locales which will be supported by the application. | */ 'locale' => 'en', /* |-------------------------------------------------------------------------- | Application Fallback Locale |-------------------------------------------------------------------------- | | The fallback locale determines the locale to use when the current one | is not available. You may change the value to correspond to any of | the language folders that are provided through your application. | */ 'fallback_locale' => 'en', /* |-------------------------------------------------------------------------- | Encryption Key |-------------------------------------------------------------------------- | | This key is used by the Illuminate encrypter service and should be set | to a random, 32 character string, otherwise these encrypted strings | will not be safe. Please do this before deploying an application! | */ 'key' => 'RWXmcKrAUFpHcUFbBunWDREVJJBA5QRj', 'cipher' => MCRYPT_RIJNDAEL_128, /* |-------------------------------------------------------------------------- | Autoloaded Service Providers |-------------------------------------------------------------------------- | | The service providers listed here will be automatically loaded on the | request to your application. Feel free to add your own services to | this array to grant expanded functionality to your applications. | */ 'providers' => array( 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Session\CommandsServiceProvider', 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 'Illuminate\Routing\ControllerServiceProvider', 'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Encryption\EncryptionServiceProvider', 'Illuminate\Filesystem\FilesystemServiceProvider', 'Illuminate\Hashing\HashServiceProvider', 'Illuminate\Html\HtmlServiceProvider', 'Illuminate\Log\LogServiceProvider', 'Illuminate\Mail\MailServiceProvider', 'Illuminate\Database\MigrationServiceProvider', 'Illuminate\Pagination\PaginationServiceProvider', 'Illuminate\Queue\QueueServiceProvider', 'Illuminate\Redis\RedisServiceProvider', 'Illuminate\Remote\RemoteServiceProvider', 'Illuminate\Auth\Reminders\ReminderServiceProvider', 'Illuminate\Database\SeedServiceProvider', 'Illuminate\Session\SessionServiceProvider', 'Illuminate\Translation\TranslationServiceProvider', 'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\View\ViewServiceProvider', 'Illuminate\Workbench\WorkbenchServiceProvider', ), /* |-------------------------------------------------------------------------- | Service Provider Manifest |-------------------------------------------------------------------------- | | The service provider manifest is used by Laravel to lazy load service | providers which are not needed for each request, as well to keep a | list of all of the services. Here, you may set its storage spot. | */ 'manifest' => storage_path().'/meta', /* |-------------------------------------------------------------------------- | Class Aliases |-------------------------------------------------------------------------- | | This array of class aliases will be registered when this application | is started. However, feel free to register as many as you wish as | the aliases are "lazy" loaded so they don't hinder performance. | */ 'aliases' => array( 'App' => 'Illuminate\Support\Facades\App', 'Artisan' => 'Illuminate\Support\Facades\Artisan', 'Auth' => 'Illuminate\Support\Facades\Auth', 'Blade' => 'Illuminate\Support\Facades\Blade', 'Cache' => 'Illuminate\Support\Facades\Cache', 'ClassLoader' => 'Illuminate\Support\ClassLoader', 'Config' => 'Illuminate\Support\Facades\Config', 'Controller' => 'Illuminate\Routing\Controller', 'Cookie' => 'Illuminate\Support\Facades\Cookie', 'Crypt' => 'Illuminate\Support\Facades\Crypt', 'DB' => 'Illuminate\Support\Facades\DB', 'Eloquent' => 'Illuminate\Database\Eloquent\Model', 'Event' => 'Illuminate\Support\Facades\Event', 'File' => 'Illuminate\Support\Facades\File', 'Form' => 'Illuminate\Support\Facades\Form', 'Hash' => 'Illuminate\Support\Facades\Hash', 'HTML' => 'Illuminate\Support\Facades\HTML', 'Input' => 'Illuminate\Support\Facades\Input', 'Lang' => 'Illuminate\Support\Facades\Lang', 'Log' => 'Illuminate\Support\Facades\Log', 'Mail' => 'Illuminate\Support\Facades\Mail', 'Paginator' => 'Illuminate\Support\Facades\Paginator', 'Password' => 'Illuminate\Support\Facades\Password', 'Queue' => 'Illuminate\Support\Facades\Queue', 'Redirect' => 'Illuminate\Support\Facades\Redirect', 'Redis' => 'Illuminate\Support\Facades\Redis', 'Request' => 'Illuminate\Support\Facades\Request', 'Response' => 'Illuminate\Support\Facades\Response', 'Route' => 'Illuminate\Support\Facades\Route', 'Schema' => 'Illuminate\Support\Facades\Schema', 'Seeder' => 'Illuminate\Database\Seeder', 'Session' => 'Illuminate\Support\Facades\Session', 'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait', 'SSH' => 'Illuminate\Support\Facades\SSH', 'Str' => 'Illuminate\Support\Str', 'URL' => 'Illuminate\Support\Facades\URL', 'Validator' => 'Illuminate\Support\Facades\Validator', 'View' => 'Illuminate\Support\Facades\View', ), );
amiridon/com.lavishimage
lavishimage/app/config/app.php
PHP
mit
7,478
package br.com.moip.resource; import br.com.moip.MoipHttp; import br.com.moip.resource.structure.Address; import br.com.moip.resource.structure.FundingInstrument; import br.com.moip.resource.structure.Phone; import br.com.moip.resource.structure.TaxDocument; import com.google.gson.Gson; public class Customer extends MoipResource { private String id; private String ownId; private String fullname; private String email; private Phone phone = new Phone(); private String birthDate; private TaxDocument taxDocument; private FundingInstrument fundingInstrument; private Address shippingAddress; public Customer create() { Gson gson = new Gson(); MoipHttp moipHttp = moip.getMoipHttp(); String json = moipHttp.sendRequest("/v2/customers", "POST", gson.toJson(this)); Customer customer = gson.fromJson(json, Customer.class); customer.setMoip(moip); return customer; } public Customer get(String id) { Gson gson = new Gson(); MoipHttp moipHttp = moip.getMoipHttp(); String json = moipHttp.sendRequest("/v2/customers/" + id, "GET"); Customer customer = gson.fromJson(json, Customer.class); customer.setMoip(moip); return customer; } public String getId() { return id; } public String getOwnId() { return ownId; } public Customer setOwnId(String ownId) { this.ownId = ownId; return this; } public String getFullname() { return fullname; } public Customer setFullname(String fullname) { this.fullname = fullname; return this; } public String getEmail() { return email; } public Customer setEmail(String email) { this.email = email; return this; } public Phone getPhone() { return phone; } public Customer setPhone(String areaCode, String number) { return setPhone(areaCode, number, "55"); } public Customer setPhone(String areaCode, String number, String countryCode) { phone = new Phone(); phone.setAreaCode(areaCode); phone.setNumber(number); phone.setCountryCode(countryCode); return this; } public String getBirthDate() { return birthDate; } public Customer setBirthDate(String birthDate) { this.birthDate = birthDate; return this; } public TaxDocument getTaxDocument() { return taxDocument; } public Customer setTaxDocument(String number) { return setTaxDocument(number, "CPF"); } public Customer setTaxDocument(String number, String type) { taxDocument = new TaxDocument(); taxDocument.setType(type); taxDocument.setNumber(number); return this; } public Customer setShippingAddress(final Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } }
mariodias/moip-sdk-java
src/main/java/br/com/moip/resource/Customer.java
Java
mit
2,631
#include "Boolean.h" BooleanPair::BooleanPair(void) { clear(); } BooleanPair::BooleanPair(const bool is);
eirTony/eirTasker
src/apps/console/TaskConsole/hold/BooleanPair.cpp
C++
mit
110
using System.Collections.Immutable; using Microsoft.Recognizers.Text.DateTime.English.Utilities; using Microsoft.Recognizers.Definitions.English; using Microsoft.Recognizers.Definitions; using Microsoft.Recognizers.Text.Number.English; using Microsoft.Recognizers.Text.Number; namespace Microsoft.Recognizers.Text.DateTime.English { public class EnglishCommonDateTimeParserConfiguration : BaseDateParserConfiguration { public EnglishCommonDateTimeParserConfiguration(DateTimeOptions options) : base(options) { UtilityConfiguration = new EnlighDatetimeUtilityConfiguration(); UnitMap = DateTimeDefinitions.UnitMap.ToImmutableDictionary(); UnitValueMap = DateTimeDefinitions.UnitValueMap.ToImmutableDictionary(); SeasonMap = DateTimeDefinitions.SeasonMap.ToImmutableDictionary(); CardinalMap = DateTimeDefinitions.CardinalMap.ToImmutableDictionary(); DayOfWeek = DateTimeDefinitions.DayOfWeek.ToImmutableDictionary(); MonthOfYear = DateTimeDefinitions.MonthOfYear.ToImmutableDictionary(); Numbers = DateTimeDefinitions.Numbers.ToImmutableDictionary(); DoubleNumbers = DateTimeDefinitions.DoubleNumbers.ToImmutableDictionary(); CardinalExtractor = Number.English.CardinalExtractor.GetInstance(); IntegerExtractor = Number.English.IntegerExtractor.GetInstance(); OrdinalExtractor = Number.English.OrdinalExtractor.GetInstance(); NumberParser = new BaseNumberParser(new EnglishNumberParserConfiguration()); DateExtractor = new BaseDateExtractor(new EnglishDateExtractorConfiguration()); TimeExtractor = new BaseTimeExtractor(new EnglishTimeExtractorConfiguration()); DateTimeExtractor = new BaseDateTimeExtractor(new EnglishDateTimeExtractorConfiguration()); DurationExtractor = new BaseDurationExtractor(new EnglishDurationExtractorConfiguration()); DatePeriodExtractor = new BaseDatePeriodExtractor(new EnglishDatePeriodExtractorConfiguration()); TimePeriodExtractor = new BaseTimePeriodExtractor(new EnglishTimePeriodExtractorConfiguration()); DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new EnglishDateTimePeriodExtractorConfiguration()); DurationParser = new BaseDurationParser(new EnglishDurationParserConfiguration(this)); DateParser = new BaseDateParser(new EnglishDateParserConfiguration(this)); TimeParser = new TimeParser(new EnglishTimeParserConfiguration(this)); DateTimeParser = new BaseDateTimeParser(new EnglishDateTimeParserConfiguration(this)); DatePeriodParser = new BaseDatePeriodParser(new EnglishDatePeriodParserConfiguration(this)); TimePeriodParser = new BaseTimePeriodParser(new EnglishTimePeriodParserConfiguration(this)); DateTimePeriodParser = new BaseDateTimePeriodParser(new EnglishDateTimePeriodParserConfiguration(this)); } public override IImmutableDictionary<string, int> DayOfMonth => BaseDateTime.DayOfMonthDictionary.ToImmutableDictionary().AddRange(DateTimeDefinitions.DayOfMonth); } }
rubio41/Recognizers-Text
.NET/Microsoft.Recognizers.Text.DateTime/English/Parsers/EnglishCommonDateTimeParserConfiguration.cs
C#
mit
3,217
package be.wegenenverkeer.atomium.japi.client; import be.wegenenverkeer.atomium.japi.format.Entry; import be.wegenenverkeer.atomium.japi.format.Feed; import be.wegenenverkeer.atomium.japi.format.Link; import java.util.Collections; import java.util.List; import java.util.Optional; /** * Created by Karel Maesen, Geovise BVBA on 24/03/15. */ class FeedWrapper<T> { final private List<Link> links; final private List<Entry<T>> entries; final Optional<String> etag; public FeedWrapper(Feed<T> feed, Optional<String> etag) { this(feed.getLinks(), feed.getEntries(), etag); Collections.reverse(entries); } public FeedWrapper(List<Link> links, List<Entry<T>> entries, Optional<String> etag) { this.links = links; this.entries = entries; this.etag = etag; } public Optional<String> getEtag() { return etag; } public boolean isEmpty(){ return getEntries().isEmpty(); } public List<Link> getLinks() { return this.links; } public Optional<String> getPreviousHref() { return getLinkHref("previous"); } public Optional<String> getNextHref() { return getLinkHref("next"); } /** * Returns the (mandatory) 'self' link of the feed page * @return the rel='self' self link * @throws IllegalStateException if the 'self' link is not present */ public String getSelfHref() { return getMandatoryLink("self"); } /** * Returns the (mandatory) 'last' link of the feed page * @return the rel='last' link * @throws IllegalStateException if the 'last' link is not present */ public String getLastHref() { return getMandatoryLink("last"); } private String getMandatoryLink(String rel) { return getLinkHref(rel).orElseThrow( //it is a requirement for Atomium that there is always a self link () -> new IllegalStateException("No self link found on feed") ); } public Optional<String> getLinkHref(String attr){ for (Link l : getLinks()) { if (l.getRel().equals(attr)) { return Optional.of(l.getHref()); } } return Optional.empty(); } public String getLastEntryId() { if (this.entries.size() >= 1) return this.entries.get(this.entries.size() - 1).getId(); return ""; } /** * Returns the entries in the feedpage in order oldest to newest. * @return list of entries in the feedpage in order oldest to newest. */ public List<Entry<T>> getEntries() { return this.entries; } }
joachimvda/atomium
modules/client-java/src/main/java/be/wegenenverkeer/atomium/japi/client/FeedWrapper.java
Java
mit
2,689
require 'spec_helper' describe Salesforce::Persistence do let(:klass) { Account } # describe '#save' do # context 'given a new object' do # it 'returns object' do # pending # klass.new(:name => 'Test').save.should be_a(klass) # end # it 'writes valid id' do # pending # klass.new(:name => 'Test').save.id.should be # end # end # end end
i0rek/salesforce
spec/unit/salesforce/persistence_spec.rb
Ruby
mit
416
//{ #include<iostream> #include<iomanip> #include<cstdio> #include<cstring> #include<string> #include<set> #include<map> #include<vector> #include<algorithm> #include<sstream> #include<cmath> #include<queue> #include<stack> using namespace std; typedef long long ll; typedef double lf; typedef pair<ll,ll> ii; #define REP(i,n) for(ll i=0;i<n;i++) #define REP1(i,n) for(ll i=1;i<=n;i++) #define FILL(i,n) memset(i,n,sizeof i) #define X first #define Y second #define SZ(_a) (int)_a.size() #define ALL(_a) _a.begin(),_a.end() #define pb push_back #ifdef brian #define debug(...) do{\ fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\ _do(__VA_ARGS__);\ }while(0) template<typename T>void _do(T &&_x){cerr<<_x<<endl;} template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);} template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";} template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb) { _s<<"{"; for(It _it=_ita;_it!=_itb;_it++) { _s<<(_it==_ita?"":",")<<*_it; } _s<<"}"; return _s; } template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));} template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));} template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));} template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;} #define IOS() #else #define debug(...) #define pary(...) #define endl '\n' #define IOS() ios_base::sync_with_stdio(0);cin.tie(0); #endif // brian //} const ll MAXn=1e5+5,MAXlg=__lg(MAXn)+2; const ll MOD=1000000007; const ll INF=ll(1e15); int main() { IOS(); IOS(); ll n; cin>>n; if(n > 0)cout<<"yes"<<endl; else cout<<"no"<<endl; }
brianbbsu/program
code archive/GJ/z014.cpp
C++
mit
1,912
var unique = require('./unique'); module.exports = function(/* arguments */) { if(!arguments.length) return this; return unique.call(Array.prototype.concat.apply(this.slice(), arguments)); };
nbroslawsky/setops
lib/union.js
JavaScript
mit
193
module.exports = function () { return handleRangeRequests } function handleRangeRequests (req, rsp) { rsp.headers.set('Accept-Ranges', 'bytes') if (!rsp.createReadStream) return let rangeHeader = /^bytes=(\d+)-(\d+)?$/g.exec(req.headers.get('Range')) if (rangeHeader && rangeHeader[1]) { let oldStream = rsp.createReadStream let length = Number(rsp.headers.get('Content-Length')) let start = Number(rangeHeader[1]) let end = Number(rangeHeader[2]) if (!end || end > length - 1) end = length - 1 if (start > end) return // Invalid range so ignore it rsp.status = 206 rsp.statusText = 'Partial Content' rsp.headers.set('Content-Range', 'bytes ' + start + '-' + end + '/' + length) rsp.headers.set('Content-Length', end - start + 1) rsp.createReadStream = function () { return oldStream({start: start, end: end}) } } }
xuset/planktos
lib/middleware/range.js
JavaScript
mit
884
# frozen_string_literal: true require 'spec_helper' describe 'Profile > Personal Access Tokens', :js do let(:user) { create(:user) } def active_personal_access_tokens find(".table.active-tokens") end def no_personal_access_tokens_message find(".settings-message") end def created_personal_access_token find("#created-personal-access-token").value end def disallow_personal_access_token_saves! allow_any_instance_of(PersonalAccessToken).to receive(:save).and_return(false) errors = ActiveModel::Errors.new(PersonalAccessToken.new).tap { |e| e.add(:name, "cannot be nil") } allow_any_instance_of(PersonalAccessToken).to receive(:errors).and_return(errors) end before do sign_in(user) end describe "token creation" do it "allows creation of a personal access token" do name = 'My PAT' visit profile_personal_access_tokens_path fill_in "Name", with: name # Set date to 1st of next month find_field("Expires at").click find(".pika-next").click click_on "1" # Scopes check "api" check "read_user" click_on "Create personal access token" expect(active_personal_access_tokens).to have_text(name) expect(active_personal_access_tokens).to have_text('In') expect(active_personal_access_tokens).to have_text('api') expect(active_personal_access_tokens).to have_text('read_user') expect(created_personal_access_token).not_to be_empty end context "when creation fails" do it "displays an error message" do disallow_personal_access_token_saves! visit profile_personal_access_tokens_path fill_in "Name", with: 'My PAT' expect { click_on "Create personal access token" }.not_to change { PersonalAccessToken.count } expect(page).to have_content("Name cannot be nil") expect(page).not_to have_selector("#created-personal-access-token") end end end describe 'active tokens' do let!(:impersonation_token) { create(:personal_access_token, :impersonation, user: user) } let!(:personal_access_token) { create(:personal_access_token, user: user) } it 'only shows personal access tokens' do visit profile_personal_access_tokens_path expect(active_personal_access_tokens).to have_text(personal_access_token.name) expect(active_personal_access_tokens).not_to have_text(impersonation_token.name) end end describe "inactive tokens" do let!(:personal_access_token) { create(:personal_access_token, user: user) } it "allows revocation of an active token" do visit profile_personal_access_tokens_path accept_confirm { click_on "Revoke" } expect(page).to have_selector(".settings-message") expect(no_personal_access_tokens_message).to have_text("This user has no active Personal Access Tokens.") end it "removes expired tokens from 'active' section" do personal_access_token.update(expires_at: 5.days.ago) visit profile_personal_access_tokens_path expect(page).to have_selector(".settings-message") expect(no_personal_access_tokens_message).to have_text("This user has no active Personal Access Tokens.") end context "when revocation fails" do it "displays an error message" do visit profile_personal_access_tokens_path allow_any_instance_of(PersonalAccessToken).to receive(:update!).and_return(false) errors = ActiveModel::Errors.new(PersonalAccessToken.new).tap { |e| e.add(:name, "cannot be nil") } allow_any_instance_of(PersonalAccessToken).to receive(:errors).and_return(errors) accept_confirm { click_on "Revoke" } expect(active_personal_access_tokens).to have_text(personal_access_token.name) expect(page).to have_content("Could not revoke") end end end end
stoplightio/gitlabhq
spec/features/profiles/personal_access_tokens_spec.rb
Ruby
mit
3,870
var React = require('react'); var RoutedViewListMixin = require('reapp-routes/react-router/RoutedViewListMixin'); var Components = require('reapp-ui/all'); var store = require('./store'); var theme = require('./theme'); var action = require('./action'); var ContextTypes = require('./ContextTypes'); module.exports = function(opts, Component) { if (!Component) { Component = opts; opts = null; } opts = opts || { routed: true }; return React.createClass(Object.assign({}, { childContextTypes: ContextTypes }, { mixins: [].concat(opts.routed ? RoutedViewListMixin : []), getChildContext: function() { return { theme: theme(), store: store.cursor(), action: action }; }, componentWillMount() { this.forceUpdater = () => this.forceUpdate(); store.cursor() && store.cursor().listen(this.forceUpdater); }, componentWillUnmount() { store.cursor() && store.cursor().unlisten(this.forceUpdater); }, render: function() { const children = this.props.children; const Theme = this.props.theme; const viewList = <Components.ViewList {...this.props.viewListProps}> {children} </Components.ViewList> const props = opts.routed ? { child: this.hasChildRoute() && this.createChildRouteHandler || noop, viewListProps: this.routedViewListProps() } : {}; return <Component {...props} />; } } )) } function noop() { return null; }
reapp/reapp-kit
src/lib/Reapp.js
JavaScript
mit
1,579
using System; using System.Collections.Generic; using System.Linq; using System.Web.Http; namespace AddressFinderAPI { public static class WebApiConfig { public static void Register(HttpConfiguration config) { // Web API configuration and services // Web API routes config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "searchActionApi", routeTemplate: "api/{controller}/search/{*terms}" ); config.Routes.MapHttpRoute( name: "searchTopActionApi", routeTemplate: "api/{controller}/searchtop/{top}/{*terms}" ); } } }
kiwipiet/AddressFinder
AddressFinderAPI/App_Start/WebApiConfig.cs
C#
mit
719
package service; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.Calendar; import java.util.HashMap; import java.util.Map; import java.util.TimerTask; import java.util.UUID; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.FileUtils; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.ResponseHandler; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.apache.log4j.Logger; import sun.misc.BASE64Encoder; import util.SCUtils; import util.XMLUtils; import com.alibaba.fastjson.JSON; import entity.Config; import entity.Modify; /** * 服务端插件自动更新类 * * @author zbl * */ public class AutoUpdater extends TimerTask { private final Logger logger = Logger.getLogger(AutoUpdater.class); private static Object LOCK = new Object(); private final BASE64Encoder base64Encoder = new BASE64Encoder(); private static final String SERVICE_NAME = "NetcallServer";// netcallServer服务名 private static final String FILE_SERVER = "fileservertomcat";//文件服务器服务名 private final String cloudUrl;//云端URL private final File userDir = new File(System.getProperty("user.dir"));// serverDog目录 private final String netcallServerPath = userDir.getParentFile() .getAbsolutePath();// netcallServer目录 private final File backupDir = new File(netcallServerPath + File.separator + "oldfiles");// 备份目录 private final File config = new File(netcallServerPath + File.separator + "config.xml");// 配置文件,用于读取版本号 private Config conf;// 更新配置 private static int downloadFileFaildCount = 0;// 文件下载失败次数,用于回滚 private boolean isRollBack = false;// 回滚标志 private Map<String, String> rollBacks = new HashMap<String, String>(); private Modify clientUpdateModify; public AutoUpdater(String url) { this.cloudUrl = url; } @Override public void run() { synchronized (LOCK) { logger.info("start check update,current time is " + Calendar.getInstance().getTime()); checkUpdate(); while(null != conf) { try { if (null != conf.getDelay()) {//延迟更新,避免云端有过大的并发数 logger.info("delay: " + conf.getDelay() + " min"); TimeUnit.SECONDS.sleep(60 * Integer.valueOf(conf.getDelay())); } logger.info("begin to stop netcallService"); SCUtils.serviceStop(SERVICE_NAME); logger.info("begin to update files from cloud"); for (Modify modify : conf.getModifies()) { if (!isRollBack) { updateFiles(modify); } else { break; } } if (!isRollBack) {//升级成功之后 修改版本号并且删除备份文件 logger.info("update version to " + conf.getVersion()); XMLUtils.setElementValue(config, "/NetcallServer/version", conf.getVersion()); backupDir.delete(); } logger.info("begin to restart netcallService"); SCUtils.serviceStart(SERVICE_NAME); if (isRollBack) { logger.info("return ..........................."); return; } if (SCUtils.isStarted(SERVICE_NAME) && null != clientUpdateModify) { logger.info("watring for netcallserver start up......"); TimeUnit.SECONDS.sleep(60 * 3); setClientUpdateInfo(clientUpdateModify.getName(), conf.getClientUpdateInfo()); } } catch (IOException e) { logger.error(e.getMessage()); } catch (InterruptedException e) { logger.error(e.getMessage()); } finally { reset(); } checkUpdate(); } } } /** * 更新完毕之后将数据清零复位 */ private void reset() { logger.info("----------update end ,reset flag---------"); conf = null; downloadFileFaildCount = 0; isRollBack = false; rollBacks.clear(); clientUpdateModify = null; } /** * 去云端检查更新 */ private void checkUpdate() { String oldVersion = XMLUtils.getElementValue(config, "/NetcallServer/version"); logger.info("current version --->" + oldVersion); String result = null; // start to send request CloseableHttpClient httpClient = HttpClients.createDefault(); try { HttpGet httpGet = new HttpGet(cloudUrl + "checkUpdate?version=" + oldVersion); ResponseHandler<String> responseHandler = new ResponseHandler<String>() { @Override public String handleResponse(HttpResponse response) throws ClientProtocolException, IOException { int status = response.getStatusLine().getStatusCode(); if (status >= 200 && status < 300) { HttpEntity entity = response.getEntity(); return entity != null ? EntityUtils.toString(entity) : null; } else { throw new ClientProtocolException( "Unexpected response status:" + status); } } }; result = httpClient.execute(httpGet, responseHandler); } catch (ClientProtocolException e) { logger.error(e.getMessage()); } catch (IOException e) { logger.error(e.getMessage()); } finally { try { httpClient.close(); } catch (IOException e) { logger.error(e.getMessage()); } } if (null != result && !"".equals(result) && result.contains("version")) { conf = JSON.parseObject(result, Config.class); } else { // 没有文件需要更新 } } /** * 更新文件 * * @param modify */ private void updateFiles(Modify modify) { if (modify.getOperationType().equalsIgnoreCase("add")) { try { addFiles(modify); } catch (IOException e) { downloadFileFaildCount++; logger.error(e.getMessage()); if (downloadFileFaildCount <= 10) { updateFiles(modify); } else { isRollBack = true; rollBack(); } } } else if (modify.getOperationType().equalsIgnoreCase("replace")) { try { replaceFile(modify); } catch (Exception e) { downloadFileFaildCount++; logger.error(e.getMessage()); if (downloadFileFaildCount <= 10) { updateFiles(modify); } else { isRollBack = true; rollBack(); } } } else if (modify.getOperationType().equalsIgnoreCase("delete")) { deleteFiles(modify); } } /** * 添加指定文件 * * @param modify * 修改说明 * @throws IOException */ private void addFiles(Modify modify) throws IOException { File addFile = new File(netcallServerPath + modify.getPath() + File.separator + modify.getName()); downLoadFilesFromCloud(modify, addFile); logger.info("add file:" + addFile.getAbsolutePath()); if (addFile.getAbsolutePath().contains("enterprise\\spark")) { clientUpdateModify = modify; } } /** * 替换指定文件 * * @param modify * 修改说明 * @throws IOException * @throws InterruptedException */ private void replaceFile(Modify modify) throws IOException, InterruptedException { File replaceFile = new File(netcallServerPath + modify.getPath() + File.separator + modify.getName()); // 先备份并移除老文件 if (replaceFile.exists()) { backup(replaceFile, modify.getPath()); replaceFile.delete(); } if (replaceFile.getAbsolutePath().contains("apache-tomcat-7.0.37\\webapps")) { SCUtils.serviceStop(FILE_SERVER); } downLoadFilesFromCloud(modify, replaceFile); if (replaceFile.getAbsolutePath().contains("apache-tomcat-7.0.37\\webapps")) { SCUtils.serviceStart(FILE_SERVER); } logger.info("replace file:" + replaceFile.getAbsolutePath()); } /** * 删除指定文件 * * @param modify * 修改说明 */ private void deleteFiles(Modify modify) { File delFile = new File(netcallServerPath + modify.getPath() + File.separator + modify.getName()); if (!delFile.exists()) { logger.info("the file not exists,nothing to do."); } else { backup(delFile, modify.getPath()); delFile.delete(); } logger.info("delete file:" + delFile.getAbsolutePath()); } /** * 从云端下载最新的文件 * * @param modify * 修改详情 * @param targetFile * 下载目标路径 */ private void downLoadFilesFromCloud(Modify modify, File targetFile) throws IOException { if (!targetFile.exists()) { targetFile.createNewFile(); } FileOutputStream fos = new FileOutputStream(targetFile); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpGet httpGet = new HttpGet(cloudUrl + "downloadFile?version=" + conf.getVersion() + "&filename=" + base64Encoder.encode(modify.getAlias().getBytes("UTF-8"))); httpGet.setHeader("Content-Type", "text/html; charset=UTF-8"); logger.info("download file:" + modify.getAlias() + " url: " + httpGet.getURI()); CloseableHttpResponse httpResponse = httpClient.execute(httpGet); try { if (httpResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new ClientProtocolException("download failed:" + httpResponse.getStatusLine()); } httpResponse.getEntity().writeTo(fos); //check file String MD5 = DigestUtils.md5Hex(new FileInputStream(targetFile)); if (!modify.getMd5().equalsIgnoreCase(MD5)) { throw new IOException("Validation file integrity failure. filename is " + modify.getName()); } downloadFileFaildCount = 0;// 每次下载成功之后将失败次数归零 } finally { fos.close(); httpResponse.close(); httpClient.close(); } } /** * 备份文件,用于回滚 * * @param file * 要备份的文件 * @param path * 相对路径 */ private void backup(File file, String path) { if (!backupDir.exists()) { backupDir.mkdir(); } rollBacks.put(file.getAbsolutePath(), backupDir.getAbsolutePath() + path + File.separator + file.getName()); try { FileUtils.copyFileToDirectory(file, new File(backupDir.getAbsolutePath() + path)); } catch (IOException e) { logger.error("back up files faild, IOException:" + e.getMessage()); } } /** * 回滚文件修改 */ private void rollBack() { logger.info("-----------start to roll back ----------------"); for (Modify modify : conf.getModifies()) { if (!rollBacks.containsKey(netcallServerPath + modify.getPath() + File.separator + modify.getName())) {//未做过修改文件不需要回滚 continue; } if (modify.getOperationType().equalsIgnoreCase("add")) {//回滚操作为删除 File delFile = new File(netcallServerPath + modify.getPath() + File.separator + modify.getName()); if (delFile.exists()) { delFile.delete(); } } else if (modify.getOperationType().equalsIgnoreCase("replace")) { File replaceFile = new File(netcallServerPath + modify.getPath() + File.separator + modify.getName()); String copy = rollBacks.get(replaceFile.getAbsolutePath()); if (replaceFile.exists()) { replaceFile.delete(); } try { FileUtils.copyFileToDirectory(new File(copy), new File(netcallServerPath + modify.getPath())); } catch (IOException e) { logger.error(replaceFile.getAbsolutePath() + " roll back faild:" + e.getMessage()); } } else if (modify.getOperationType().equalsIgnoreCase("delete")) { File addFile = new File(netcallServerPath + modify.getPath() + File.separator + modify.getName()); String copy = rollBacks.get(addFile.getAbsolutePath()); if (addFile.exists()) { addFile.delete(); } try { FileUtils.copyFileToDirectory(new File(copy), new File(netcallServerPath + modify.getPath())); } catch (IOException e) { logger.error(addFile.getAbsolutePath() + "roll back faild:" + e.getMessage()); } } } } /** * 调用服务设置netcall客户端(PC)更新信息 * @param filename 最新的Client.exe * @param clientUpdateInfo 最新的更新信息说明 */ private void setClientUpdateInfo(String filename, String clientUpdateInfo) { logger.info("start to update netcallserver spark settings...."); CloseableHttpClient httpClient = HttpClients.createDefault(); try { HttpGet httpGet = new HttpGet( "http://localhost:9090/plugins/uiauthentication/updateclient?name=" + filename + "&info=" + clientUpdateInfo); ResponseHandler<String> responseHandler = new ResponseHandler<String>() { @Override public String handleResponse(HttpResponse response) throws ClientProtocolException, IOException { int status = response.getStatusLine().getStatusCode(); if (status >= 200 && status < 300) { HttpEntity entity = response.getEntity(); return entity != null ? EntityUtils.toString(entity) : null; } else { throw new ClientProtocolException( "Unexpected response status:" + status); } } }; String result = httpClient.execute(httpGet, responseHandler); if (result.equals("0")) { logger.info("set client update infomation successfully"); } else { logger.info("faild to set client update infomation faild"); } } catch (ClientProtocolException e) { logger.error(e.getMessage()); } catch (IOException e) { logger.error(e.getMessage()); } finally { try { httpClient.close(); } catch (IOException e) { logger.error(e.getMessage()); } } } public static void main(String[] args) { final AutoUpdater updater = new AutoUpdater("http://appserver.netcall.cc/NetCallUpdateService/"); updater.conf = new Config(); updater.conf.setVersion("1.0.1"); final Modify modify = new Modify(); modify.setMd5("E91BCF71EF07D9B8EF28863CFCF50368"); modify.setAlias("netcall_2_7_8.exe"); ExecutorService exec = Executors.newCachedThreadPool(); for (int i = 0 ; i < 20; i++) { exec.execute(new Runnable() { @Override public void run() { try { updater.downLoadFilesFromCloud(modify, new File("D:/" + UUID.randomUUID().toString() + ".exe")); } catch (IOException e) { e.printStackTrace(); } } }); } } }
hhymarco/ServiceDog
src/service/AutoUpdater.java
Java
mit
14,383
version https://git-lfs.github.com/spec/v1 oid sha256:6983db5b6619c0c95a82458eff2bc9bef5e22b8f9b5451e00bf1b07ecd685978 size 34671
yogeshsaroya/new-cdnjs
ajax/libs/ace/1.1.01/mode-velocity.js
JavaScript
mit
130
package main import ( "bytes" "encoding/json" "errors" "flag" "fmt" "io/ioutil" "log" "net/http" "os" "time" ) const usageStr = `The Lucifer binary makes requests to the Lucifer server. Usage: lucifer command [arguments] The commands are: invalidate Invalidate the cache for a given file run Run tests for a given file Use "lucifer help [command]" for more information about a command. ` const version = "0.1" const userAgent = "lucifer-client/" + version func usage() { fmt.Fprintf(os.Stderr, usageStr) flag.PrintDefaults() os.Exit(2) } const baseUri = "http://127.0.0.1:11666" const timeout = time.Duration(5) * time.Second type Filename string type LuciferInvalidateRequest struct { Files []Filename `json:"files"` } type LuciferRunRequest struct { Bail bool `json:"bail"` Files []Filename `json:"files"` Grep string `json:"grep"` } func makeRequest(method string, uri string, body *bytes.Buffer) (*http.Response, error) { req, err := http.NewRequest(method, uri, body) if err != nil { return nil, err } req.Header.Add("User-Agent", userAgent) req.Header.Add("Content-Type", "application/json") req.Header.Add("Accept", "application/json, q=0.8; application/problem+json, q=0.6; */*, q=0.3") client := http.Client{ Timeout: timeout, } return client.Do(req) } func makeRunRequest(fnames []Filename, bail bool, grep string) (string, error) { body := LuciferRunRequest{ Bail: bail, Files: fnames, } if grep != "" { body.Grep = grep } var buf bytes.Buffer enc := json.NewEncoder(&buf) enc.Encode(body) resp, err := makeRequest("POST", fmt.Sprintf("%s/v1/test_runs", baseUri), &buf) if err != nil { return "", err } defer resp.Body.Close() rbody, err := ioutil.ReadAll(resp.Body) if err != nil { return "", err } if resp.StatusCode >= 300 { // XXX return "", errors.New(string(rbody)) } return string(rbody), nil } func makeInvalidateRequest(fnames []Filename) (string, error) { body := LuciferInvalidateRequest{ Files: fnames, } var buf bytes.Buffer enc := json.NewEncoder(&buf) enc.Encode(body) resp, err := makeRequest("POST", fmt.Sprintf("%s/v1/cache/invalidate", baseUri), &buf) if err != nil { return "", err } defer resp.Body.Close() rbody, err := ioutil.ReadAll(resp.Body) if err != nil { return "", err } if resp.StatusCode >= 300 { // XXX return "", errors.New(string(rbody)) } return string(rbody), nil } func handleError(err error, verbose bool) { if verbose { log.Fatal(err) } else { os.Exit(0) } } func init() { flag.Usage = usage } func doInvalidate(flags *flag.FlagSet, sync bool, verbose bool) { err := flags.Parse(os.Args[2:]) if err != nil { handleError(err, verbose) } args := flags.Args() var fnames []Filename for i := 0; i < len(args); i++ { fnames = append(fnames, Filename(args[i])) } body, err := makeInvalidateRequest(fnames) if err != nil { handleError(err, verbose) } if verbose { fmt.Println(body) } } func doRun(flags *flag.FlagSet, bail bool, verbose bool, grep string) { args := flags.Args() var fnames []Filename for i := 0; i < len(args); i++ { fnames = append(fnames, Filename(args[i])) } body, err := makeRunRequest(fnames, bail, grep) if err != nil { handleError(err, verbose) } if verbose { fmt.Println(body) } } func main() { invalidateflags := flag.NewFlagSet("invalidate", flag.ExitOnError) sync := invalidateflags.Bool("sync", true, "Make request synchronously") verbose := invalidateflags.Bool("verbose", false, "Verbose output") runflags := flag.NewFlagSet("run", flag.ExitOnError) bail := runflags.Bool("bail", false, "Bail after a single test failure") runverbose := runflags.Bool("verbose", false, "Verbose response output") grepHelp := "Grep for the given pattern" grep := runflags.String("grep", "", grepHelp) runflags.StringVar(grep, "g", "", grepHelp+" (shorthand)") if len(os.Args) < 2 { usage() } switch os.Args[1] { case "invalidate": err := invalidateflags.Parse(os.Args[2:]) if err != nil { handleError(err, true) } doInvalidate(invalidateflags, *sync, *verbose) case "run": err := runflags.Parse(os.Args[2:]) if err != nil { handleError(err, true) } doRun(runflags, *bail, *runverbose, *grep) default: usage() } }
Shyp/lucifer
lucifer/main.go
GO
mit
4,305
define([], function () { "use strict"; /** * @param {$http} $http * @param $q * @param $resource * @constructor */ function Post($http, $q, $resource) { this.$http = $http; this.$q = $q; return $resource('/posts/:postId', { postId: '@_id' }); } Post.prototype.list = function () { return this.$http.get('/posts'); }; Post.prototype.save = function (post) { if (post._id) { return this.$http.post('/post/' + post._id, post); } return this.$http.post('/post', post); }; Post.prototype['delete'] = function (post) { return this.$http.delete('/post/' + post._id); }; Post.$inject = ['$http', '$q', '$resource']; return Post; });
lib3d/lib3d-blog
public/javascripts/app/Main/component/resource/Post.js
JavaScript
mit
781