repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
Draeius/rhun-server
src/NavigationBundle/Location/GemShopLocation.php
588
<?php namespace NavigationBundle\Location; use AppBundle\Util\Price; /** * Description of GemShopLocation * * @author Draeius */ class GemShopLocation extends GenericLocation { public function getVariables() { $params = parent::getVariables(); $settings = $this->getManager()->getRepository('AppBundle:ServerSettings')->find(1); return array_merge($params, [ 'priceColoredName' => new Price(0, 0, $settings->getPriceColoredName()), 'priceColoredTitle' => new Price(0, 0, $settings->getPriceColoredTitle()) ]); } }
mit
jonathands/dhtiny
demos/webtop/taskbar.js
1752
// JScript ファイル $dh.newClass("Taskbar", GridManager, { // Only one taskbar deltaHeight: 5, init: function(_height) { _height= _height || 28; GridManager.prototype.init.apply(this, [90,3, 1, 5, 100, _height-3,0]); window.Taskbar = this; // Only one? this._height = _height; var bs = $dh.bodySize(); $dh.bounds(this, [0, bs.height - _height, bs.width, _height]); $dh.addEv(window,"resize", function(){ var bs = $dh.bodySize(); $dh.bounds(window.Taskbar, [0, bs.height - window.Taskbar._height, bs.width-2, window.Taskbar._height]); }); this.drawStartButton(); }, drawStartButton: function() { this.startButton = $dh.$new("img",{src: "images/startbut.gif", opac: 70, bounds:[0,0,98,27]}); $dh.addCh(this, this.startButton); window.Taskbar.startButton.direction = 1; window.Taskbar.startButton.timeCount = 0; window.Taskbar.startButton.timer = setInterval(function() { var opac = $dh.opac(window.Taskbar.startButton) + window.Taskbar.startButton.direction*20; if (opac >= 100 || opac <= 0) { window.Taskbar.startButton.direction *= -1;} $dh.opac(window.Taskbar.startButton, opac); if (window.Taskbar.startButton.timeCount++ > 60) clearInterval(window.Taskbar.startButton.timer); }, 50); this.startButton.onmouseover = function() { $dh.opac(this, 100); }; this.startButton.onmouseout = function() {$dh.opac(this, 70)}; } });
mit
wilkgr76/curious-robot
start.py
1345
import random, pygame, os, sys from pygame.locals import * background_colour = (208,240,255) (width, height) = (256, 256) tw = 16 # Texture Width screen = pygame.display.set_mode((width, height)) pygame.display.set_caption('Curious Robot') screen.fill(background_colour) # Load Textures ground = pygame.image.load('stuff/textures/ground.png') grass = pygame.image.load('stuff/textures/grass.png') y_grass = pygame.image.load('stuff/textures/y_grass.png') #screen.blit(ground,(50,100)) #screen.blit(grass,(50,100)) pygame.display.flip() #while i < 256: # height = random.randint(0,240) # addgrass = random.randint(0,100) # screen.blit(ground,(i,height)) # if addgrass > 50: # screen.blit(grass,(i,height)) # i = i+16 #i=0 n = 1 while n < 6: # No. of blocks to be rendered atm n = n+1 # Increase n by 1, don't want an endless loop i = 0 w = random.randint(3,5) # w is width of platform y = random.randint(0,15) # y is height of platform x = random.randint(0,15) c = random.randint(0,1) while i < w: screen.blit(ground,(tw*x+tw*i,tw*y)) if c == 1: screen.blit(grass,(tw*x+tw*i,tw*y)) else: screen.blit(y_grass,(tw*x+tw*i,tw*y)) i = i+1 pygame.display.flip() running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False
mit
egg-/package-tracker
lib/tracker/ems.js
5743
'use strict' var request = require('request') var async = require('async') var cheerio = require('cheerio') var moment = require('moment') var tracker = require('../') var STATUS_MAP = { '접수': 'RECEIVE', '발송': 'DEPARTURE', '발송준비': 'DEPARTURE_READY', '도착': 'ARRIVAL', '발송교환국에도착': 'ARRIVAL_OUTWARD_OFFICE', '교환국도착': 'ARRIVAL_INWARD_OFFICE', '상대국인계': 'TRANSPER_DESTIATION_AIRPORT', '상대국도착': 'ARRIVAL_DESTIATION_AIRPORT', '운송사인계': 'TRANSPER_EXPRESS', '항공사인수': 'AIRPORT_RECEIVED', '항공기출발': 'AIRPORT_DEPARTURE', '통관검사대기': 'CUSTOMS_PENDING', '통관및분류': 'CUSTOMS', '배달준비': 'DELIVERY_START', '배달완료': 'DELIVERY_COMPLETE', '미배달': 'DELIVERY_UNSUCCESSFULE' } var parseStatus = function (txt) { return tracker.STATUS[STATUS_MAP[txt.replace(/\s/gim, '').replace(/\(.*\)/gim, '')]] || tracker.STATUS.UNKNOWN } var parse = { trace: function (body) { var $ = cheerio.load(body) var print = $('#print') var tables = print.find('table') if (tables.length === 0) { return null } var summary = tables.eq(0).find('tr').eq(1).find('td,th') var result = { histories: [] } result.number = summary.eq(0).text() result.sender = summary.eq(1).html().split('<br>')[0] result.receiver = summary.eq(2).html().split('<br>')[0] result.status_txt = summary.eq(3).text().trim() result.status = parseStatus(result.status_txt) result.company = summary.eq(4).text() result.company_code = ['ems', '국제특급'].indexOf(result.company.toLowerCase()) !== -1 ? tracker.COMPANY.EMS : tracker.COMPANY.KPACKET tables.eq(1).find('tr').each(function (idx) { if (idx === 0) { return true } var cols = $(this).find('td') var history = { status_txt: cols.eq(1).text().trim() } history.ts = moment(cols.eq(0).text().trim() + '+09:00', 'YYYY.MM.DD HH:mmZ').unix() history.status = parseStatus(history.status_txt) result.histories.push(history) }) return result }, normalize: function (trace, body) { var $ = cheerio.load(body) $('.table_col').find('tr').each(function (idx) { if (idx === 0) { return true } var cols = $(this).find('td') if (cols.length === 1) { return false } // update area trace.histories[idx - 1].area = cols.eq(2).text().trim() trace.histories[idx - 1].detail = [] cols.eq(3).find('p').each(function () { trace.histories[idx - 1].detail.push($(this).text().trim().replace(/\t/gim, '').replace(/\n/gi, '\n').replace(/\s{2,}/gi, ' ')) }) trace.histories[idx - 1].detail = trace.histories[idx - 1].detail.join('\n') }) return trace } } var validateHeader = function (number) { var country = number.substring(number.length - 2, number.length).toUpperCase() var prefix1 = number.substring(0, 1).toUpperCase() var prefix2 = prefix2 if (['C', 'R', 'V', 'E', 'G', 'U', 'B', 'L'].indexOf(prefix1) !== -1 || ['LK', 'ZZ'].indexOf(prefix2) !== -1) { if (prefix2 === 'LK') { if (country === 'KR' || country === 'AU') { return true } else { return false } } else if (prefix2 === 'ZZ') { if (country === 'KR') { return true } else { return false } } else { return true } } return false } var validateCountry = function (number) { var charNum = 0 var country = number.substring(number.length - 2, number.length).toUpperCase() for (var i = 0; i < country.length; i++) { if (country.charCodeAt(i) >= 65 && country.charCodeAt(i) <= 90) { ++charNum } } if (charNum === 2) { return true } return false } var validate = function (number) { // #ref https://service.epost.go.kr//postal/jscripts/epost_trace.js number = number.trim() // check header && check country if (number.length !== 13) { return tracker.ERROR.INVALID_NUMBER_LENGTH } else if (validateHeader(number) === false) { return tracker.ERROR.INVALID_NUMBER_HEADER } else if (validateCountry(number) === false) { return tracker.ERROR.INVALID_NUMBER_COUNTRY } return null } var trackingInfo = function (number) { return { trace: { method: 'GET', url: 'https://service.epost.go.kr/trace.RetrieveEmsRigiTraceList.comm?POST_CODE=' + number + '&displayHeader=N' }, normalize: { method: 'POST', url: 'https://trace.epost.go.kr/xtts/servlet/kpl.tts.common.svl.SttSVL', data: { target_command: 'kpl.tts.tt.epost.cmd.RetrieveEmsTraceEngCmd', POST_CODE: number } } } } module.exports = { trackingInfo: trackingInfo, trace: function (number, cb) { var invalidCode = validate(number) if (invalidCode !== null) { return cb(tracker.error(invalidCode)) } var tracking = trackingInfo(number) async.parallel({ trace: function (cb) { request({ url: tracking.trace.url }, function (err, res, body) { cb(err, err ? null : body) }) }, normalize: function (cb) { request.post({ url: tracking.normalize.url, form: tracking.normalize.data }, function (err, res, body) { cb(err, err ? null : body) }) } }, function (err, result) { if (err) { return cb(err) } var trace = parse.trace(result.trace) if (!trace) { return cb(tracker.error(tracker.ERROR.INVALID_NUMBER)) } trace = parse.normalize(trace, result.normalize) cb(null, trace) }) } }
mit
plahteenlahti/Pakupaku
Pakupaku/src/main/java/pakupaku/piirrettavat/Syotava.java
635
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package pakupaku.piirrettavat; import java.awt.Graphics; import java.awt.Rectangle; import pakupaku.logiikka.Peli; import pakupaku.logiikka.Piirrettava; import java.util.*; /** * Yksittäinen syötävä olento. Perii luokan piirrettava. * * @author perttulahteenlahti */ public class Syotava extends Piirrettava { private Rectangle laatikko; public Syotava(int sijaintiX, int sijaintiY) { super(sijaintiX, sijaintiY); } }
mit
samatdav/jenkins
core/src/main/java/hudson/model/UpdateCenter.java
79635
/* * The MIT License * * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Yahoo! Inc., Seiji Sogabe * * 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 hudson.model; import hudson.BulkChange; import hudson.Extension; import hudson.ExtensionPoint; import hudson.Functions; import hudson.PluginManager; import hudson.PluginWrapper; import hudson.ProxyConfiguration; import jenkins.util.SystemProperties; import hudson.Util; import hudson.XmlFile; import static hudson.init.InitMilestone.PLUGINS_STARTED; import static java.util.logging.Level.INFO; import static java.util.logging.Level.WARNING; import hudson.init.Initializer; import hudson.lifecycle.Lifecycle; import hudson.lifecycle.RestartNotSupportedException; import hudson.model.UpdateSite.Data; import hudson.model.UpdateSite.Plugin; import hudson.model.listeners.SaveableListener; import hudson.remoting.AtmostOneThreadExecutor; import hudson.security.ACL; import hudson.util.DaemonThreadFactory; import hudson.util.FormValidation; import hudson.util.HttpResponses; import hudson.util.NamingThreadFactory; import hudson.util.IOException2; import hudson.util.IOUtils; import hudson.util.PersistedList; import hudson.util.XStream2; import jenkins.MissingDependencyException; import jenkins.RestartRequiredException; import jenkins.install.InstallUtil; import jenkins.model.Jenkins; import jenkins.util.io.OnMaster; import net.sf.json.JSONObject; import org.acegisecurity.Authentication; import org.acegisecurity.context.SecurityContext; import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.input.CountingInputStream; import org.apache.commons.io.output.NullOutputStream; import org.jenkinsci.Symbol; import org.jvnet.localizer.Localizable; import org.kohsuke.accmod.restrictions.DoNotUse; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; import javax.annotation.Nonnull; import javax.net.ssl.SSLHandshakeException; import javax.servlet.ServletException; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.lang.reflect.Constructor; import java.net.HttpRetryException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.net.UnknownHostException; import java.security.DigestOutputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; import java.util.UUID; import java.util.Vector; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; import java.util.jar.Attributes; import java.util.jar.JarFile; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.CheckForNull; import org.acegisecurity.context.SecurityContextHolder; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.export.Exported; import org.kohsuke.stapler.export.ExportedBean; import org.kohsuke.stapler.interceptor.RequirePOST; /** * Controls update center capability. * * <p> * The main job of this class is to keep track of the latest update center metadata file, and perform installations. * Much of the UI about choosing plugins to install is done in {@link PluginManager}. * <p> * The update center can be configured to contact alternate servers for updates * and plugins, and to use alternate strategies for downloading, installing * and updating components. See the Javadocs for {@link UpdateCenterConfiguration} * for more information. * <p> * <b>Extending Update Centers</b>. The update center in {@code Jenkins} can be replaced by defining a * System Property (<code>hudson.model.UpdateCenter.className</code>). See {@link #createUpdateCenter(hudson.model.UpdateCenter.UpdateCenterConfiguration)}. * This className should be available on early startup, so it cannot come only from a library * (e.g. Jenkins module or Extra library dependency in the WAR file project). * Plugins cannot be used for such purpose. * In order to be correctly instantiated, the class definition must have two constructors: * {@link #UpdateCenter()} and {@link #UpdateCenter(hudson.model.UpdateCenter.UpdateCenterConfiguration)}. * If the class does not comply with the requirements, a fallback to the default UpdateCenter will be performed. * * @author Kohsuke Kawaguchi * @since 1.220 */ @ExportedBean public class UpdateCenter extends AbstractModelObject implements Saveable, OnMaster { private static final String UPDATE_CENTER_URL = SystemProperties.getString(UpdateCenter.class.getName()+".updateCenterUrl","http://updates.jenkins-ci.org/"); /** * Read timeout when downloading plugins, defaults to 1 minute */ private static final int PLUGIN_DOWNLOAD_READ_TIMEOUT = SystemProperties.getInteger(UpdateCenter.class.getName()+".pluginDownloadReadTimeoutSeconds", 60) * 1000; /** * {@linkplain UpdateSite#getId() ID} of the default update site. * @since 1.483 - public property * @since TODO - configurable via system property */ public static final String ID_DEFAULT = SystemProperties.getString(UpdateCenter.class.getName()+".defaultUpdateSiteId", "default"); @Restricted(NoExternalUse.class) public static final String ID_UPLOAD = "_upload"; /** * {@link ExecutorService} that performs installation. * @since 1.501 */ private final ExecutorService installerService = new AtmostOneThreadExecutor( new NamingThreadFactory(new DaemonThreadFactory(), "Update center installer thread")); /** * An {@link ExecutorService} for updating UpdateSites. */ protected final ExecutorService updateService = Executors.newCachedThreadPool( new NamingThreadFactory(new DaemonThreadFactory(), "Update site data downloader")); /** * List of created {@link UpdateCenterJob}s. Access needs to be synchronized. */ private final Vector<UpdateCenterJob> jobs = new Vector<UpdateCenterJob>(); /** * {@link UpdateSite}s from which we've already installed a plugin at least once. * This is used to skip network tests. */ private final Set<UpdateSite> sourcesUsed = new HashSet<UpdateSite>(); /** * List of {@link UpdateSite}s to be used. */ private final PersistedList<UpdateSite> sites = new PersistedList<UpdateSite>(this); /** * Update center configuration data */ private UpdateCenterConfiguration config; private boolean requiresRestart; /** * Simple connection status enum. */ @Restricted(NoExternalUse.class) static enum ConnectionStatus { /** * Connection status has not started yet. */ PRECHECK, /** * Connection status check has been skipped. * As example, it may happen if there is no connection check URL defined for the site. * @since TODO */ SKIPPED, /** * Connection status is being checked at this time. */ CHECKING, /** * Connection status was not checked. */ UNCHECKED, /** * Connection is ok. */ OK, /** * Connection status check failed. */ FAILED; static final String INTERNET = "internet"; static final String UPDATE_SITE = "updatesite"; } public UpdateCenter() { configure(new UpdateCenterConfiguration()); } UpdateCenter(@Nonnull UpdateCenterConfiguration configuration) { configure(configuration); } /** * Creates an update center. * @param config Requested configuration. May be {@code null} if defaults should be used * @return Created Update center. {@link UpdateCenter} by default, but may be overridden * @since TODO */ @Nonnull public static UpdateCenter createUpdateCenter(@CheckForNull UpdateCenterConfiguration config) { String requiredClassName = SystemProperties.getString(UpdateCenter.class.getName()+".className", null); if (requiredClassName == null) { // Use the defaul Update Center LOGGER.log(Level.FINE, "Using the default Update Center implementation"); return createDefaultUpdateCenter(config); } LOGGER.log(Level.FINE, "Using the custom update center: {0}", requiredClassName); try { final Class<?> clazz = Class.forName(requiredClassName).asSubclass(UpdateCenter.class); if (!UpdateCenter.class.isAssignableFrom(clazz)) { LOGGER.log(Level.SEVERE, "The specified custom Update Center {0} is not an instance of {1}. Falling back to default.", new Object[] {requiredClassName, UpdateCenter.class.getName()}); return createDefaultUpdateCenter(config); } final Class<? extends UpdateCenter> ucClazz = clazz.asSubclass(UpdateCenter.class); final Constructor<? extends UpdateCenter> defaultConstructor = ucClazz.getConstructor(); final Constructor<? extends UpdateCenter> configConstructor = ucClazz.getConstructor(UpdateCenterConfiguration.class); LOGGER.log(Level.FINE, "Using the constructor {0} Update Center configuration for {1}", new Object[] {config != null ? "with" : "without", requiredClassName}); return config != null ? configConstructor.newInstance(config) : defaultConstructor.newInstance(); } catch(ClassCastException e) { // Should never happen LOGGER.log(WARNING, "UpdateCenter class {0} does not extend hudson.model.UpdateCenter. Using default.", requiredClassName); } catch(NoSuchMethodException e) { LOGGER.log(WARNING, String.format("UpdateCenter class {0} does not define one of the required constructors. Using default", requiredClassName), e); } catch(Exception e) { LOGGER.log(WARNING, String.format("Unable to instantiate custom plugin manager [%s]. Using default.", requiredClassName), e); } return createDefaultUpdateCenter(config); } @Nonnull private static UpdateCenter createDefaultUpdateCenter(@CheckForNull UpdateCenterConfiguration config) { return config != null ? new UpdateCenter(config) : new UpdateCenter(); } public Api getApi() { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); return new Api(this); } /** * Configures update center to get plugins/updates from alternate servers, * and optionally using alternate strategies for downloading, installing * and upgrading. * * @param config Configuration data * @see UpdateCenterConfiguration */ public void configure(UpdateCenterConfiguration config) { if (config!=null) { this.config = config; } } /** * Returns the list of {@link UpdateCenterJob} representing scheduled installation attempts. * * @return * can be empty but never null. Oldest entries first. */ @Exported public List<UpdateCenterJob> getJobs() { synchronized (jobs) { return new ArrayList<UpdateCenterJob>(jobs); } } /** * Gets a job by its ID. * * Primarily to make {@link UpdateCenterJob} bound to URL. */ public UpdateCenterJob getJob(int id) { synchronized (jobs) { for (UpdateCenterJob job : jobs) { if (job.id==id) return job; } } return null; } /** * Returns latest install/upgrade job for the given plugin. * @return InstallationJob or null if not found */ public InstallationJob getJob(Plugin plugin) { List<UpdateCenterJob> jobList = getJobs(); Collections.reverse(jobList); for (UpdateCenterJob job : jobList) if (job instanceof InstallationJob) { InstallationJob ij = (InstallationJob)job; if (ij.plugin.name.equals(plugin.name) && ij.plugin.sourceId.equals(plugin.sourceId)) return ij; } return null; } /** * Get the current connection status. * <p> * Supports a "siteId" request parameter, defaulting to {@link #ID_DEFAULT} for the default * update site. * * @return The current connection status. */ @Restricted(DoNotUse.class) public HttpResponse doConnectionStatus(StaplerRequest request) { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); try { String siteId = request.getParameter("siteId"); if (siteId == null) { siteId = ID_DEFAULT; } else if (siteId.equals("default")) { // If the request explicitly requires the default ID, ship it siteId = ID_DEFAULT; } ConnectionCheckJob checkJob = getConnectionCheckJob(siteId); if (checkJob == null) { UpdateSite site = getSite(siteId); if (site != null) { checkJob = addConnectionCheckJob(site); } } if (checkJob != null) { boolean isOffline = false; for (ConnectionStatus status : checkJob.connectionStates.values()) { if(ConnectionStatus.FAILED.equals(status)) { isOffline = true; break; } } if (isOffline) { // retry connection states if determined to be offline checkJob.run(); isOffline = false; for (ConnectionStatus status : checkJob.connectionStates.values()) { if(ConnectionStatus.FAILED.equals(status)) { isOffline = true; break; } } if(!isOffline) { // also need to download the metadata updateAllSites(); } } return HttpResponses.okJSON(checkJob.connectionStates); } else { return HttpResponses.errorJSON(String.format("Cannot check connection status of the update site with ID='%s'" + ". This update center cannot be resolved", siteId)); } } catch (Exception e) { return HttpResponses.errorJSON(String.format("ERROR: %s", e.getMessage())); } } /** * Called to determine if there was an incomplete installation, what the statuses of the plugins are */ @Restricted(DoNotUse.class) // WebOnly public HttpResponse doIncompleteInstallStatus() { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); try { Map<String,String> jobs = InstallUtil.getPersistedInstallStatus(); if(jobs == null) { jobs = Collections.emptyMap(); } return HttpResponses.okJSON(jobs); } catch (Exception e) { return HttpResponses.errorJSON(String.format("ERROR: %s", e.getMessage())); } } /** * Called to persist the currently installing plugin states. This allows * us to support install resume if Jenkins is restarted while plugins are * being installed. */ @Restricted(NoExternalUse.class) public synchronized void persistInstallStatus() { List<UpdateCenterJob> jobs = getJobs(); boolean activeInstalls = false; for (UpdateCenterJob job : jobs) { if (job instanceof InstallationJob) { InstallationJob installationJob = (InstallationJob) job; if(!installationJob.status.isSuccess()) { activeInstalls = true; } } } if(activeInstalls) { InstallUtil.persistInstallStatus(jobs); // save this info } else { InstallUtil.clearInstallStatus(); // clear this info } } /** * Get the current installation status of a plugin set. * <p> * Supports a "correlationId" request parameter if you only want to get the * install status of a set of plugins requested for install through * {@link PluginManager#doInstallPlugins(org.kohsuke.stapler.StaplerRequest)}. * * @return The current installation status of a plugin set. */ @Restricted(DoNotUse.class) public HttpResponse doInstallStatus(StaplerRequest request) { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); try { String correlationId = request.getParameter("correlationId"); Map<String,Object> response = new HashMap<>(); response.put("state", Jenkins.getInstance().getInstallState().name()); List<Map<String, String>> installStates = new ArrayList<>(); response.put("jobs", installStates); List<UpdateCenterJob> jobCopy = getJobs(); for (UpdateCenterJob job : jobCopy) { if (job instanceof InstallationJob) { UUID jobCorrelationId = job.getCorrelationId(); if (correlationId == null || (jobCorrelationId != null && correlationId.equals(jobCorrelationId.toString()))) { InstallationJob installationJob = (InstallationJob) job; Map<String, String> pluginInfo = new LinkedHashMap<>(); pluginInfo.put("name", installationJob.plugin.name); pluginInfo.put("version", installationJob.plugin.version); pluginInfo.put("title", installationJob.plugin.title); pluginInfo.put("installStatus", installationJob.status.getType()); pluginInfo.put("requiresRestart", Boolean.toString(installationJob.status.requiresRestart())); if (jobCorrelationId != null) { pluginInfo.put("correlationId", jobCorrelationId.toString()); } installStates.add(pluginInfo); } } } return HttpResponses.okJSON(JSONObject.fromObject(response)); } catch (Exception e) { return HttpResponses.errorJSON(String.format("ERROR: %s", e.getMessage())); } } /** * Returns latest Jenkins upgrade job. * @return HudsonUpgradeJob or null if not found */ public HudsonUpgradeJob getHudsonJob() { List<UpdateCenterJob> jobList = getJobs(); Collections.reverse(jobList); for (UpdateCenterJob job : jobList) if (job instanceof HudsonUpgradeJob) return (HudsonUpgradeJob)job; return null; } /** * Returns the list of {@link UpdateSite}s to be used. * This is a live list, whose change will be persisted automatically. * * @return * can be empty but never null. */ public PersistedList<UpdateSite> getSites() { return sites; } /** * The same as {@link #getSites()} but for REST API. */ @Exported(name="sites") public List<UpdateSite> getSiteList() { return sites.toList(); } /** * Alias for {@link #getById}. * @param id ID of the update site to be retrieved * @return Discovered {@link UpdateSite}. {@code null} if it cannot be found */ @CheckForNull public UpdateSite getSite(String id) { return getById(id); } /** * Gets the string representing how long ago the data was obtained. * Will be the newest of all {@link UpdateSite}s. */ public String getLastUpdatedString() { long newestTs = 0; for (UpdateSite s : sites) { if (s.getDataTimestamp()>newestTs) { newestTs = s.getDataTimestamp(); } } if (newestTs == 0) { return Messages.UpdateCenter_n_a(); } return Util.getPastTimeString(System.currentTimeMillis()-newestTs); } /** * Gets {@link UpdateSite} by its ID. * Used to bind them to URL. * @param id ID of the update site to be retrieved * @return Discovered {@link UpdateSite}. {@code null} if it cannot be found */ @CheckForNull public UpdateSite getById(String id) { for (UpdateSite s : sites) { if (s.getId().equals(id)) { return s; } } return null; } /** * Gets the {@link UpdateSite} from which we receive updates for <tt>jenkins.war</tt>. * * @return * {@code null} if no such update center is provided. */ @CheckForNull public UpdateSite getCoreSource() { for (UpdateSite s : sites) { Data data = s.getData(); if (data!=null && data.core!=null) return s; } return null; } /** * Gets the default base URL. * * @deprecated * TODO: revisit tool update mechanism, as that should be de-centralized, too. In the mean time, * please try not to use this method, and instead ping us to get this part completed. */ @Deprecated public String getDefaultBaseUrl() { return config.getUpdateCenterUrl(); } /** * Gets the plugin with the given name from the first {@link UpdateSite} to contain it. * @return Discovered {@link Plugin}. {@code null} if it cannot be found */ public @CheckForNull Plugin getPlugin(String artifactId) { for (UpdateSite s : sites) { Plugin p = s.getPlugin(artifactId); if (p!=null) return p; } return null; } /** * Schedules a Jenkins upgrade. */ @RequirePOST public void doUpgrade(StaplerResponse rsp) throws IOException, ServletException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); HudsonUpgradeJob job = new HudsonUpgradeJob(getCoreSource(), Jenkins.getAuthentication()); if(!Lifecycle.get().canRewriteHudsonWar()) { sendError("Jenkins upgrade not supported in this running mode"); return; } LOGGER.info("Scheduling the core upgrade"); addJob(job); rsp.sendRedirect2("."); } /** * Invalidates the update center JSON data for all the sites and force re-retrieval. * * @since 1.432 */ public HttpResponse doInvalidateData() { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); for (UpdateSite site : sites) { site.doInvalidateData(); } return HttpResponses.ok(); } /** * Schedules a Jenkins restart. */ public void doSafeRestart(StaplerRequest request, StaplerResponse response) throws IOException, ServletException { synchronized (jobs) { if (!isRestartScheduled()) { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); addJob(new RestartJenkinsJob(getCoreSource())); LOGGER.info("Scheduling Jenkins reboot"); } } response.sendRedirect2("."); } /** * Cancel all scheduled jenkins restarts */ public void doCancelRestart(StaplerResponse response) throws IOException, ServletException { synchronized (jobs) { for (UpdateCenterJob job : jobs) { if (job instanceof RestartJenkinsJob) { if (((RestartJenkinsJob) job).cancel()) { LOGGER.info("Scheduled Jenkins reboot unscheduled"); } } } } response.sendRedirect2("."); } /** * If any of the executed {@link UpdateCenterJob}s requires a restart * to take effect, this method returns true. * * <p> * This doesn't necessarily mean the user has scheduled or initiated * the restart operation. * * @see #isRestartScheduled() */ @Exported public boolean isRestartRequiredForCompletion() { return requiresRestart; } /** * Checks if the restart operation is scheduled * (which means in near future Jenkins will restart by itself) * * @see #isRestartRequiredForCompletion() */ public boolean isRestartScheduled() { for (UpdateCenterJob job : getJobs()) { if (job instanceof RestartJenkinsJob) { RestartJenkinsJob.RestartJenkinsJobStatus status = ((RestartJenkinsJob) job).status; if (status instanceof RestartJenkinsJob.Pending || status instanceof RestartJenkinsJob.Running) { return true; } } } return false; } /** * Returns true if backup of jenkins.war exists on the hard drive */ public boolean isDowngradable() { return new File(Lifecycle.get().getHudsonWar() + ".bak").exists(); } /** * Performs hudson downgrade. */ @RequirePOST public void doDowngrade(StaplerResponse rsp) throws IOException, ServletException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); if(!isDowngradable()) { sendError("Jenkins downgrade is not possible, probably backup does not exist"); return; } HudsonDowngradeJob job = new HudsonDowngradeJob(getCoreSource(), Jenkins.getAuthentication()); LOGGER.info("Scheduling the core downgrade"); addJob(job); rsp.sendRedirect2("."); } /** * Performs hudson downgrade. */ public void doRestart(StaplerResponse rsp) throws IOException, ServletException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); HudsonDowngradeJob job = new HudsonDowngradeJob(getCoreSource(), Jenkins.getAuthentication()); LOGGER.info("Scheduling the core downgrade"); addJob(job); rsp.sendRedirect2("."); } /** * Returns String with version of backup .war file, * if the file does not exists returns null */ public String getBackupVersion() { try { JarFile backupWar = new JarFile(new File(Lifecycle.get().getHudsonWar() + ".bak")); try { Attributes attrs = backupWar.getManifest().getMainAttributes(); String v = attrs.getValue("Jenkins-Version"); if (v==null) v = attrs.getValue("Hudson-Version"); return v; } finally { backupWar.close(); } } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to read backup version ", e); return null;} } /*package*/ synchronized Future<UpdateCenterJob> addJob(UpdateCenterJob job) { addConnectionCheckJob(job.site); return job.submit(); } private @Nonnull ConnectionCheckJob addConnectionCheckJob(@Nonnull UpdateSite site) { // Create a connection check job if the site was not already in the sourcesUsed set i.e. the first // job (in the jobs list) relating to a site must be the connection check job. if (sourcesUsed.add(site)) { ConnectionCheckJob connectionCheckJob = newConnectionCheckJob(site); connectionCheckJob.submit(); return connectionCheckJob; } else { // Find the existing connection check job for that site and return it. ConnectionCheckJob connectionCheckJob = getConnectionCheckJob(site); if (connectionCheckJob != null) { return connectionCheckJob; } else { throw new IllegalStateException("Illegal addition of an UpdateCenter job without calling UpdateCenter.addJob. " + "No ConnectionCheckJob found for the site."); } } } /** * Create a {@link ConnectionCheckJob} for the specified update site. * <p> * Does not start/submit the job. * @param site The site for which the Job is to be created. * @return A {@link ConnectionCheckJob} for the specified update site. */ @Restricted(NoExternalUse.class) ConnectionCheckJob newConnectionCheckJob(UpdateSite site) { return new ConnectionCheckJob(site); } private @CheckForNull ConnectionCheckJob getConnectionCheckJob(@Nonnull String siteId) { UpdateSite site = getSite(siteId); if (site == null) { return null; } return getConnectionCheckJob(site); } private @CheckForNull ConnectionCheckJob getConnectionCheckJob(@Nonnull UpdateSite site) { synchronized (jobs) { for (UpdateCenterJob job : jobs) { if (job instanceof ConnectionCheckJob && job.site.getId().equals(site.getId())) { return (ConnectionCheckJob) job; } } } return null; } public String getDisplayName() { return "Update center"; } public String getSearchUrl() { return "updateCenter"; } /** * Saves the configuration info to the disk. */ public synchronized void save() { if(BulkChange.contains(this)) return; try { getConfigFile().write(sites); SaveableListener.fireOnChange(this, getConfigFile()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to save "+getConfigFile(),e); } } /** * Loads the data from the disk into this object. */ public synchronized void load() throws IOException { UpdateSite defaultSite = new UpdateSite(ID_DEFAULT, config.getUpdateCenterUrl() + "update-center.json"); XmlFile file = getConfigFile(); if(file.exists()) { try { sites.replaceBy(((PersistedList)file.unmarshal(sites)).toList()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to load "+file, e); } for (UpdateSite site : sites) { // replace the legacy site with the new site if (site.isLegacyDefault()) { sites.remove(site); sites.add(defaultSite); break; } } } else { if (sites.isEmpty()) { // If there aren't already any UpdateSources, add the default one. // to maintain compatibility with existing UpdateCenterConfiguration, create the default one as specified by UpdateCenterConfiguration sites.add(defaultSite); } } } private XmlFile getConfigFile() { return new XmlFile(XSTREAM,new File(Jenkins.getInstance().root, UpdateCenter.class.getName()+".xml")); } @Exported public List<Plugin> getAvailables() { Map<String,Plugin> pluginMap = new LinkedHashMap<String, Plugin>(); for (UpdateSite site : sites) { for (Plugin plugin: site.getAvailables()) { final Plugin existing = pluginMap.get(plugin.name); if (existing == null) { pluginMap.put(plugin.name, plugin); } else if (!existing.version.equals(plugin.version)) { // allow secondary update centers to publish different versions // TODO refactor to consolidate multiple versions of the same plugin within the one row final String altKey = plugin.name + ":" + plugin.version; if (!pluginMap.containsKey(altKey)) { pluginMap.put(altKey, plugin); } } } } return new ArrayList<Plugin>(pluginMap.values()); } /** * Returns a list of plugins that should be shown in the "available" tab, grouped by category. * A plugin with multiple categories will appear multiple times in the list. */ public PluginEntry[] getCategorizedAvailables() { TreeSet<PluginEntry> entries = new TreeSet<PluginEntry>(); for (Plugin p : getAvailables()) { if (p.categories==null || p.categories.length==0) entries.add(new PluginEntry(p, getCategoryDisplayName(null))); else for (String c : p.categories) entries.add(new PluginEntry(p, getCategoryDisplayName(c))); } return entries.toArray(new PluginEntry[entries.size()]); } private static String getCategoryDisplayName(String category) { if (category==null) return Messages.UpdateCenter_PluginCategory_misc(); try { return (String)Messages.class.getMethod( "UpdateCenter_PluginCategory_" + category.replace('-', '_')).invoke(null); } catch (Exception ex) { return Messages.UpdateCenter_PluginCategory_unrecognized(category); } } public List<Plugin> getUpdates() { Map<String,Plugin> pluginMap = new LinkedHashMap<String, Plugin>(); for (UpdateSite site : sites) { for (Plugin plugin: site.getUpdates()) { final Plugin existing = pluginMap.get(plugin.name); if (existing == null) { pluginMap.put(plugin.name, plugin); } else if (!existing.version.equals(plugin.version)) { // allow secondary update centers to publish different versions // TODO refactor to consolidate multiple versions of the same plugin within the one row final String altKey = plugin.name + ":" + plugin.version; if (!pluginMap.containsKey(altKey)) { pluginMap.put(altKey, plugin); } } } } return new ArrayList<Plugin>(pluginMap.values()); } /** * Ensure that all UpdateSites are up to date, without requiring a user to * browse to the instance. * * @return a list of {@link FormValidation} for each updated Update Site * @throws ExecutionException * @throws InterruptedException * @since 1.501 * */ public List<FormValidation> updateAllSites() throws InterruptedException, ExecutionException { List <Future<FormValidation>> futures = new ArrayList<Future<FormValidation>>(); for (UpdateSite site : getSites()) { Future<FormValidation> future = site.updateDirectly(DownloadService.signatureCheck); if (future != null) { futures.add(future); } } List<FormValidation> results = new ArrayList<FormValidation>(); for (Future<FormValidation> f : futures) { results.add(f.get()); } return results; } /** * {@link AdministrativeMonitor} that checks if there's Jenkins update. */ @Extension @Symbol("coreUpdate") public static final class CoreUpdateMonitor extends AdministrativeMonitor { public boolean isActivated() { Data data = getData(); return data!=null && data.hasCoreUpdates(); } public Data getData() { UpdateSite cs = Jenkins.getInstance().getUpdateCenter().getCoreSource(); if (cs!=null) return cs.getData(); return null; } } /** * Strategy object for controlling the update center's behaviors. * * <p> * Until 1.333, this extension point used to control the configuration of * where to get updates (hence the name of this class), but with the introduction * of multiple update center sites capability, that functionality is achieved by * simply installing another {@link UpdateSite}. * * <p> * See {@link UpdateSite} for how to manipulate them programmatically. * * @since 1.266 */ @SuppressWarnings({"UnusedDeclaration"}) public static class UpdateCenterConfiguration implements ExtensionPoint { /** * Creates default update center configuration - uses settings for global update center. */ public UpdateCenterConfiguration() { } /** * Check network connectivity by trying to establish a connection to * the host in connectionCheckUrl. * * @param job The connection checker that is invoking this strategy. * @param connectionCheckUrl A string containing the URL of a domain * that is assumed to be always available. * @throws IOException if a connection can't be established */ public void checkConnection(ConnectionCheckJob job, String connectionCheckUrl) throws IOException { testConnection(new URL(connectionCheckUrl)); } /** * Check connection to update center server. * * @param job The connection checker that is invoking this strategy. * @param updateCenterUrl A sting containing the URL of the update center host. * @throws IOException if a connection to the update center server can't be established. */ public void checkUpdateCenter(ConnectionCheckJob job, String updateCenterUrl) throws IOException { testConnection(new URL(updateCenterUrl + "?uctest")); } /** * Validate the URL of the resource before downloading it. * * @param job The download job that is invoking this strategy. This job is * responsible for managing the status of the download and installation. * @param src The location of the resource on the network * @throws IOException if the validation fails */ public void preValidate(DownloadJob job, URL src) throws IOException { } /** * Validate the resource after it has been downloaded, before it is * installed. The default implementation does nothing. * * @param job The download job that is invoking this strategy. This job is * responsible for managing the status of the download and installation. * @param src The location of the downloaded resource. * @throws IOException if the validation fails. */ public void postValidate(DownloadJob job, File src) throws IOException { } /** * Download a plugin or core upgrade in preparation for installing it * into its final location. Implementations will normally download the * resource into a temporary location and hand off a reference to this * location to the install or upgrade strategy to move into the final location. * * @param job The download job that is invoking this strategy. This job is * responsible for managing the status of the download and installation. * @param src The URL to the resource to be downloaded. * @return A File object that describes the downloaded resource. * @throws IOException if there were problems downloading the resource. * @see DownloadJob */ public File download(DownloadJob job, URL src) throws IOException { MessageDigest sha1 = null; try { sha1 = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException ignored) { // Irrelevant as the Java spec says SHA-1 must exist. Still, if this fails // the DownloadJob will just have computedSha1 = null and that is expected // to be handled by caller } CountingInputStream in = null; OutputStream out = null; URLConnection con = null; try { con = connect(job,src); //JENKINS-34174 - set timeout for downloads, may hang indefinitely // particularly noticeable during 2.0 install when downloading // many plugins con.setReadTimeout(PLUGIN_DOWNLOAD_READ_TIMEOUT); int total = con.getContentLength(); in = new CountingInputStream(con.getInputStream()); byte[] buf = new byte[8192]; int len; File dst = job.getDestination(); File tmp = new File(dst.getPath()+".tmp"); out = new FileOutputStream(tmp); if (sha1 != null) { out = new DigestOutputStream(out, sha1); } LOGGER.info("Downloading "+job.getName()); Thread t = Thread.currentThread(); String oldName = t.getName(); t.setName(oldName + ": " + src); try { while((len=in.read(buf))>=0) { out.write(buf,0,len); job.status = job.new Installing(total==-1 ? -1 : in.getCount()*100/total); } } catch (IOException e) { throw new IOException("Failed to load "+src+" to "+tmp,e); } finally { IOUtils.closeQuietly(out); t.setName(oldName); } if (total!=-1 && total!=tmp.length()) { // don't know exactly how this happens, but report like // http://www.ashlux.com/wordpress/2009/08/14/hudson-and-the-sonar-plugin-fail-maveninstallation-nosuchmethoderror/ // indicates that this kind of inconsistency can happen. So let's be defensive throw new IOException("Inconsistent file length: expected "+total+" but only got "+tmp.length()); } if (sha1 != null) { byte[] digest = sha1.digest(); job.computedSHA1 = Base64.encodeBase64String(digest); } return tmp; } catch (IOException e) { // assist troubleshooting in case of e.g. "too many redirects" by printing actual URL String extraMessage = ""; if (con != null && con.getURL() != null && !src.toString().equals(con.getURL().toString())) { // Two URLs are considered equal if different hosts resolve to same IP. Prefer to log in case of string inequality, // because who knows how the server responds to different host name in the request header? // Also, since it involved name resolution, it'd be an expensive operation. extraMessage = " (redirected to: " + con.getURL() + ")"; } throw new IOException2("Failed to download from "+src+extraMessage,e); } finally { IOUtils.closeQuietly(in); IOUtils.closeQuietly(out); } } /** * Connects to the given URL for downloading the binary. Useful for tweaking * how the connection gets established. */ protected URLConnection connect(DownloadJob job, URL src) throws IOException { return ProxyConfiguration.open(src); } /** * Called after a plugin has been downloaded to move it into its final * location. The default implementation is a file rename. * * @param job The install job that is invoking this strategy. * @param src The temporary location of the plugin. * @param dst The final destination to install the plugin to. * @throws IOException if there are problems installing the resource. */ public void install(DownloadJob job, File src, File dst) throws IOException { job.replace(dst, src); } /** * Called after an upgrade has been downloaded to move it into its final * location. The default implementation is a file rename. * * @param job The upgrade job that is invoking this strategy. * @param src The temporary location of the upgrade. * @param dst The final destination to install the upgrade to. * @throws IOException if there are problems installing the resource. */ public void upgrade(DownloadJob job, File src, File dst) throws IOException { job.replace(dst, src); } /** * Returns an "always up" server for Internet connectivity testing. * * @deprecated as of 1.333 * With the introduction of multiple update center capability, this information * is now a part of the <tt>update-center.json</tt> file. See * <tt>http://jenkins-ci.org/update-center.json</tt> as an example. */ @Deprecated public String getConnectionCheckUrl() { return "http://www.google.com"; } /** * Returns the URL of the server that hosts the update-center.json * file. * * @deprecated as of 1.333 * With the introduction of multiple update center capability, this information * is now moved to {@link UpdateSite}. * @return * Absolute URL that ends with '/'. */ @Deprecated public String getUpdateCenterUrl() { return UPDATE_CENTER_URL; } /** * Returns the URL of the server that hosts plugins and core updates. * * @deprecated as of 1.333 * <tt>update-center.json</tt> is now signed, so we don't have to further make sure that * we aren't downloading from anywhere unsecure. */ @Deprecated public String getPluginRepositoryBaseUrl() { return "http://jenkins-ci.org/"; } private void testConnection(URL url) throws IOException { try { URLConnection connection = (URLConnection) ProxyConfiguration.open(url); if(connection instanceof HttpURLConnection) { int responseCode = ((HttpURLConnection)connection).getResponseCode(); if(HttpURLConnection.HTTP_OK != responseCode) { throw new HttpRetryException("Invalid response code (" + responseCode + ") from URL: " + url, responseCode); } } else { Util.copyStreamAndClose(connection.getInputStream(),new NullOutputStream()); } } catch (SSLHandshakeException e) { if (e.getMessage().contains("PKIX path building failed")) // fix up this crappy error message from JDK throw new IOException("Failed to validate the SSL certificate of "+url,e); } } } /** * Things that {@link UpdateCenter#installerService} executes. * * This object will have the <tt>row.jelly</tt> which renders the job on UI. */ @ExportedBean public abstract class UpdateCenterJob implements Runnable { /** * Unique ID that identifies this job. * * @see UpdateCenter#getJob(int) */ @Exported public final int id = iota.incrementAndGet(); /** * Which {@link UpdateSite} does this belong to? */ public final UpdateSite site; /** * Simple correlation ID that can be used to associated a batch of jobs e.g. the * installation of a set of plugins. */ private UUID correlationId = null; /** * If this job fails, set to the error. */ protected Throwable error; protected UpdateCenterJob(UpdateSite site) { this.site = site; } public Api getApi() { return new Api(this); } public UUID getCorrelationId() { return correlationId; } public void setCorrelationId(UUID correlationId) { if (this.correlationId != null) { throw new IllegalStateException("Illegal call to set the 'correlationId'. Already set."); } this.correlationId = correlationId; } /** * @deprecated as of 1.326 * Use {@link #submit()} instead. */ @Deprecated public void schedule() { submit(); } @Exported public String getType() { return getClass().getSimpleName(); } /** * Schedules this job for an execution * @return * {@link Future} to keeps track of the status of the execution. */ public Future<UpdateCenterJob> submit() { LOGGER.fine("Scheduling "+this+" to installerService"); // TODO: seems like this access to jobs should be synchronized, no? // It might get synch'd accidentally via the addJob method, but that wouldn't be good. jobs.add(this); return installerService.submit(this,this); } @Exported public String getErrorMessage() { return error != null ? error.getMessage() : null; } public Throwable getError() { return error; } } /** * Restarts jenkins. */ public class RestartJenkinsJob extends UpdateCenterJob { /** * Immutable state of this job. */ @Exported(inline=true) public volatile RestartJenkinsJobStatus status = new Pending(); /** * Cancel job */ public synchronized boolean cancel() { if (status instanceof Pending) { status = new Canceled(); return true; } return false; } public RestartJenkinsJob(UpdateSite site) { super(site); } public synchronized void run() { if (!(status instanceof Pending)) { return; } status = new Running(); try { Jenkins.getInstance().safeRestart(); } catch (RestartNotSupportedException exception) { // ignore if restart is not allowed status = new Failure(); error = exception; } } @ExportedBean public abstract class RestartJenkinsJobStatus { @Exported public final int id = iota.incrementAndGet(); } public class Pending extends RestartJenkinsJobStatus { @Exported public String getType() { return getClass().getSimpleName(); } } public class Running extends RestartJenkinsJobStatus { } public class Failure extends RestartJenkinsJobStatus { } public class Canceled extends RestartJenkinsJobStatus { } } /** * Tests the internet connectivity. */ public final class ConnectionCheckJob extends UpdateCenterJob { private final Vector<String> statuses= new Vector<String>(); final Map<String, ConnectionStatus> connectionStates = new ConcurrentHashMap<>(); public ConnectionCheckJob(UpdateSite site) { super(site); connectionStates.put(ConnectionStatus.INTERNET, ConnectionStatus.PRECHECK); connectionStates.put(ConnectionStatus.UPDATE_SITE, ConnectionStatus.PRECHECK); } public void run() { connectionStates.put(ConnectionStatus.INTERNET, ConnectionStatus.UNCHECKED); connectionStates.put(ConnectionStatus.UPDATE_SITE, ConnectionStatus.UNCHECKED); if (ID_UPLOAD.equals(site.getId())) { return; } LOGGER.fine("Doing a connectivity check"); Future<?> internetCheck = null; try { final String connectionCheckUrl = site.getConnectionCheckUrl(); if (connectionCheckUrl!=null) { connectionStates.put(ConnectionStatus.INTERNET, ConnectionStatus.CHECKING); statuses.add(Messages.UpdateCenter_Status_CheckingInternet()); // Run the internet check in parallel internetCheck = updateService.submit(new Runnable() { @Override public void run() { try { config.checkConnection(ConnectionCheckJob.this, connectionCheckUrl); } catch (Exception e) { if(e.getMessage().contains("Connection timed out")) { // Google can't be down, so this is probably a proxy issue connectionStates.put(ConnectionStatus.INTERNET, ConnectionStatus.FAILED); statuses.add(Messages.UpdateCenter_Status_ConnectionFailed(connectionCheckUrl)); return; } } connectionStates.put(ConnectionStatus.INTERNET, ConnectionStatus.OK); } }); } else { LOGGER.log(WARNING, "Update site '{0}' does not declare the connection check URL. " + "Skipping the network availability check.", site.getId()); connectionStates.put(ConnectionStatus.INTERNET, ConnectionStatus.SKIPPED); } connectionStates.put(ConnectionStatus.UPDATE_SITE, ConnectionStatus.CHECKING); statuses.add(Messages.UpdateCenter_Status_CheckingJavaNet()); config.checkUpdateCenter(this, site.getUrl()); connectionStates.put(ConnectionStatus.UPDATE_SITE, ConnectionStatus.OK); statuses.add(Messages.UpdateCenter_Status_Success()); } catch (UnknownHostException e) { connectionStates.put(ConnectionStatus.UPDATE_SITE, ConnectionStatus.FAILED); statuses.add(Messages.UpdateCenter_Status_UnknownHostException(e.getMessage())); addStatus(e); error = e; } catch (Exception e) { connectionStates.put(ConnectionStatus.UPDATE_SITE, ConnectionStatus.FAILED); statuses.add(Functions.printThrowable(e)); error = e; } if(internetCheck != null) { try { // Wait for internet check to complete internetCheck.get(); } catch (Exception e) { LOGGER.log(Level.WARNING, "Error completing internet connectivity check: " + e.getMessage(), e); } } } private void addStatus(UnknownHostException e) { statuses.add("<pre>"+ Functions.xmlEscape(Functions.printThrowable(e))+"</pre>"); } public String[] getStatuses() { synchronized (statuses) { return statuses.toArray(new String[statuses.size()]); } } } /** * Enables a required plugin, provides feedback in the update center */ public class EnableJob extends InstallationJob { public EnableJob(UpdateSite site, Authentication auth, @Nonnull Plugin plugin, boolean dynamicLoad) { super(plugin, site, auth, dynamicLoad); } public Plugin getPlugin() { return plugin; } @Override public void run() { try { plugin.getInstalled().enable(); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to enable " + plugin.getDisplayName(), e); error = e; } if (dynamicLoad) { try { // remove the existing, disabled inactive plugin to force a new one to load pm.dynamicLoad(getDestination(), true); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to dynamically load " + plugin.getDisplayName(), e); error = e; requiresRestart = true; } } else { requiresRestart = true; } } } /** * A no-op, e.g. this plugin is already installed */ public class NoOpJob extends EnableJob { public NoOpJob(UpdateSite site, Authentication auth, @Nonnull Plugin plugin) { super(site, auth, plugin, false); } } /** * Base class for a job that downloads a file from the Jenkins project. */ public abstract class DownloadJob extends UpdateCenterJob { /** * Immutable object representing the current state of this job. */ @Exported(inline=true) public volatile InstallationStatus status = new Pending(); /** * Where to download the file from. */ protected abstract URL getURL() throws MalformedURLException; /** * Where to download the file to. */ protected abstract File getDestination(); @Exported public abstract String getName(); /** * Called when the whole thing went successfully. */ protected abstract void onSuccess(); /** * During download, an attempt is made to compute the SHA-1 checksum of the file. * * @since TODO */ @CheckForNull protected String getComputedSHA1() { return computedSHA1; } private String computedSHA1; private Authentication authentication; /** * Get the user that initiated this job */ public Authentication getUser() { return this.authentication; } protected DownloadJob(UpdateSite site, Authentication authentication) { super(site); this.authentication = authentication; } public void run() { try { LOGGER.info("Starting the installation of "+getName()+" on behalf of "+getUser().getName()); _run(); LOGGER.info("Installation successful: "+getName()); status = new Success(); onSuccess(); } catch (InstallationStatus e) { status = e; if (status.isSuccess()) onSuccess(); requiresRestart |= status.requiresRestart(); } catch (MissingDependencyException e) { LOGGER.log(Level.SEVERE, "Failed to install {0}: {1}", new Object[] { getName(), e.getMessage() }); status = new Failure(e); error = e; } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Failed to install "+getName(),e); status = new Failure(e); error = e; } } protected void _run() throws IOException, InstallationStatus { URL src = getURL(); config.preValidate(this, src); File dst = getDestination(); File tmp = config.download(this, src); config.postValidate(this, tmp); config.install(this, tmp, dst); } /** * Called when the download is completed to overwrite * the old file with the new file. */ protected void replace(File dst, File src) throws IOException { File bak = Util.changeExtension(dst,".bak"); bak.delete(); dst.renameTo(bak); dst.delete(); // any failure up to here is no big deal if(!src.renameTo(dst)) { throw new IOException("Failed to rename "+src+" to "+dst); } } /** * Indicates the status or the result of a plugin installation. * <p> * Instances of this class is immutable. */ @ExportedBean public abstract class InstallationStatus extends Throwable { public final int id = iota.incrementAndGet(); @Exported public boolean isSuccess() { return false; } @Exported public final String getType() { return getClass().getSimpleName(); } /** * Indicates that a restart is needed to complete the tasks. */ public boolean requiresRestart() { return false; } } /** * Indicates that the installation of a plugin failed. */ public class Failure extends InstallationStatus { public final Throwable problem; public Failure(Throwable problem) { this.problem = problem; } public String getProblemStackTrace() { return Functions.printThrowable(problem); } } /** * Indicates that the installation was successful but a restart is needed. */ public class SuccessButRequiresRestart extends Success { private final Localizable message; public SuccessButRequiresRestart(Localizable message) { this.message = message; } public String getMessage() { return message.toString(); } @Override public boolean requiresRestart() { return true; } } /** * Indicates that the plugin was successfully installed. */ public class Success extends InstallationStatus { @Override public boolean isSuccess() { return true; } } /** * Indicates that the plugin was successfully installed. */ public class Skipped extends InstallationStatus { @Override public boolean isSuccess() { return true; } } /** * Indicates that the plugin is waiting for its turn for installation. */ public class Pending extends InstallationStatus { } /** * Installation of a plugin is in progress. */ public class Installing extends InstallationStatus { /** * % completed download, or -1 if the percentage is not known. */ public final int percentage; public Installing(int percentage) { this.percentage = percentage; } } } /** * If expectedSHA1 is non-null, ensure that actualSha1 is the same value, otherwise throw. * * Utility method for InstallationJob and HudsonUpgradeJob. * * @throws IOException when checksums don't match, or actual checksum was null. */ private void verifyChecksums(String expectedSHA1, String actualSha1, File downloadedFile) throws IOException { if (expectedSHA1 != null) { if (actualSha1 == null) { // refuse to install if SHA-1 could not be computed throw new IOException("Failed to compute SHA-1 of downloaded file, refusing installation"); } if (!expectedSHA1.equals(actualSha1)) { throw new IOException("Downloaded file " + downloadedFile.getAbsolutePath() + " does not match expected SHA-1, expected '" + expectedSHA1 + "', actual '" + actualSha1 + "'"); // keep 'downloadedFile' around for investigating what's going on } } } /** * Represents the state of the installation activity of one plugin. */ public class InstallationJob extends DownloadJob { /** * What plugin are we trying to install? */ @Exported public final Plugin plugin; protected final PluginManager pm = Jenkins.getInstance().getPluginManager(); /** * True to load the plugin into this Jenkins, false to wait until restart. */ protected final boolean dynamicLoad; /** * @deprecated as of 1.442 */ @Deprecated public InstallationJob(Plugin plugin, UpdateSite site, Authentication auth) { this(plugin,site,auth,false); } public InstallationJob(Plugin plugin, UpdateSite site, Authentication auth, boolean dynamicLoad) { super(site, auth); this.plugin = plugin; this.dynamicLoad = dynamicLoad; } protected URL getURL() throws MalformedURLException { return new URL(plugin.url); } protected File getDestination() { File baseDir = pm.rootDir; return new File(baseDir, plugin.name + ".jpi"); } private File getLegacyDestination() { File baseDir = pm.rootDir; return new File(baseDir, plugin.name + ".hpi"); } public String getName() { return plugin.getDisplayName(); } @Override public void _run() throws IOException, InstallationStatus { if (wasInstalled()) { // Do this first so we can avoid duplicate downloads, too // check to see if the plugin is already installed at the same version and skip it LOGGER.info("Skipping duplicate install of: " + plugin.getDisplayName() + "@" + plugin.version); //throw new Skipped(); // TODO set skipped once we have a status indicator for it return; } try { super._run(); // if this is a bundled plugin, make sure it won't get overwritten PluginWrapper pw = plugin.getInstalled(); if (pw!=null && pw.isBundled()) { SecurityContext oldContext = ACL.impersonate(ACL.SYSTEM); try { pw.doPin(); } finally { SecurityContextHolder.setContext(oldContext); } } if (dynamicLoad) { try { pm.dynamicLoad(getDestination()); } catch (RestartRequiredException e) { throw new SuccessButRequiresRestart(e.message); } catch (Exception e) { throw new IOException("Failed to dynamically deploy this plugin",e); } } else { throw new SuccessButRequiresRestart(Messages._UpdateCenter_DownloadButNotActivated()); } } finally { synchronized(this) { // There may be other threads waiting on completion LOGGER.fine("Install complete for: " + plugin.getDisplayName() + "@" + plugin.version); // some status other than Installing or Downloading needs to be set here // {@link #isAlreadyInstalling()}, it will be overwritten by {@link DownloadJob#run()} status = new Skipped(); notifyAll(); } } } /** * Indicates there is another installation job for this plugin * @since TODO */ protected boolean wasInstalled() { synchronized(UpdateCenter.this) { for (UpdateCenterJob job : getJobs()) { if (job == this) { // oldest entries first, if we reach this instance, // we need it to continue installing return false; } if (job instanceof InstallationJob) { InstallationJob ij = (InstallationJob)job; if (ij.plugin.equals(plugin) && ij.plugin.version.equals(plugin.version)) { // wait until other install is completed synchronized(ij) { if(ij.status instanceof Installing || ij.status instanceof Pending) { try { LOGGER.fine("Waiting for other plugin install of: " + plugin.getDisplayName() + "@" + plugin.version); ij.wait(); } catch (InterruptedException e) { throw new RuntimeException(e); } } } return true; } } } return false; } } protected void onSuccess() { pm.pluginUploaded = true; } @Override public String toString() { return super.toString()+"[plugin="+plugin.title+"]"; } /** * Called when the download is completed to overwrite * the old file with the new file. */ @Override protected void replace(File dst, File src) throws IOException { verifyChecksums(plugin.getSha1(), getComputedSHA1(), src); File bak = Util.changeExtension(dst, ".bak"); bak.delete(); final File legacy = getLegacyDestination(); if (legacy.exists()) { if (!legacy.renameTo(bak)) { legacy.delete(); } } if (dst.exists()) { if (!dst.renameTo(bak)) { dst.delete(); } } if(!src.renameTo(dst)) { throw new IOException("Failed to rename "+src+" to "+dst); } } } /** * Represents the state of the downgrading activity of plugin. */ public final class PluginDowngradeJob extends DownloadJob { /** * What plugin are we trying to install? */ public final Plugin plugin; private final PluginManager pm = Jenkins.getInstance().getPluginManager(); public PluginDowngradeJob(Plugin plugin, UpdateSite site, Authentication auth) { super(site, auth); this.plugin = plugin; } protected URL getURL() throws MalformedURLException { return new URL(plugin.url); } protected File getDestination() { File baseDir = pm.rootDir; final File legacy = new File(baseDir, plugin.name + ".hpi"); if(legacy.exists()){ return legacy; } return new File(baseDir, plugin.name + ".jpi"); } protected File getBackup() { File baseDir = pm.rootDir; return new File(baseDir, plugin.name + ".bak"); } public String getName() { return plugin.getDisplayName(); } @Override public void run() { try { LOGGER.info("Starting the downgrade of "+getName()+" on behalf of "+getUser().getName()); _run(); LOGGER.info("Downgrade successful: "+getName()); status = new Success(); onSuccess(); } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Failed to downgrade "+getName(),e); status = new Failure(e); error = e; } } @Override protected void _run() throws IOException { File dst = getDestination(); File backup = getBackup(); config.install(this, backup, dst); } /** * Called to overwrite * current version with backup file */ @Override protected void replace(File dst, File backup) throws IOException { dst.delete(); // any failure up to here is no big deal if(!backup.renameTo(dst)) { throw new IOException("Failed to rename "+backup+" to "+dst); } } protected void onSuccess() { pm.pluginUploaded = true; } @Override public String toString() { return super.toString()+"[plugin="+plugin.title+"]"; } } /** * Represents the state of the upgrade activity of Jenkins core. */ public final class HudsonUpgradeJob extends DownloadJob { public HudsonUpgradeJob(UpdateSite site, Authentication auth) { super(site, auth); } protected URL getURL() throws MalformedURLException { return new URL(site.getData().core.url); } protected File getDestination() { return Lifecycle.get().getHudsonWar(); } public String getName() { return "jenkins.war"; } protected void onSuccess() { status = new Success(); } @Override protected void replace(File dst, File src) throws IOException { String expectedSHA1 = site.getData().core.getSha1(); verifyChecksums(expectedSHA1, getComputedSHA1(), src); Lifecycle.get().rewriteHudsonWar(src); } } public final class HudsonDowngradeJob extends DownloadJob { public HudsonDowngradeJob(UpdateSite site, Authentication auth) { super(site, auth); } protected URL getURL() throws MalformedURLException { return new URL(site.getData().core.url); } protected File getDestination() { return Lifecycle.get().getHudsonWar(); } public String getName() { return "jenkins.war"; } protected void onSuccess() { status = new Success(); } @Override public void run() { try { LOGGER.info("Starting the downgrade of "+getName()+" on behalf of "+getUser().getName()); _run(); LOGGER.info("Downgrading successful: "+getName()); status = new Success(); onSuccess(); } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Failed to downgrade "+getName(),e); status = new Failure(e); error = e; } } @Override protected void _run() throws IOException { File backup = new File(Lifecycle.get().getHudsonWar() + ".bak"); File dst = getDestination(); config.install(this, backup, dst); } @Override protected void replace(File dst, File src) throws IOException { Lifecycle.get().rewriteHudsonWar(src); } } public static final class PluginEntry implements Comparable<PluginEntry> { public Plugin plugin; public String category; private PluginEntry(Plugin p, String c) { plugin = p; category = c; } public int compareTo(PluginEntry o) { int r = category.compareTo(o.category); if (r==0) r = plugin.name.compareToIgnoreCase(o.plugin.name); return r; } } /** * Adds the update center data retriever to HTML. */ @Extension public static class PageDecoratorImpl extends PageDecorator { } /** * Initializes the update center. * * This has to wait until after all plugins load, to let custom UpdateCenterConfiguration take effect first. */ @Initializer(after=PLUGINS_STARTED, fatal=false) public static void init(Jenkins h) throws IOException { h.getUpdateCenter().load(); } @Restricted(NoExternalUse.class) public static void updateDefaultSite() { final UpdateSite site = Jenkins.getInstance().getUpdateCenter().getSite(UpdateCenter.ID_DEFAULT); if (site == null) { LOGGER.log(Level.SEVERE, "Upgrading Jenkins. Cannot retrieve the default Update Site ''{0}''. " + "Plugin installation may fail.", UpdateCenter.ID_DEFAULT); return; } try { // Need to do the following because the plugin manager will attempt to access // $JENKINS_HOME/updates/$ID_DEFAULT.json. Needs to be up to date. site.updateDirectlyNow(true); } catch (Exception e) { LOGGER.log(WARNING, "Upgrading Jenkins. Failed to update the default Update Site '" + UpdateCenter.ID_DEFAULT + "'. Plugin upgrades may fail.", e); } } /** * Sequence number generator. */ private static final AtomicInteger iota = new AtomicInteger(); private static final Logger LOGGER = Logger.getLogger(UpdateCenter.class.getName()); /** * @deprecated as of 1.333 * Use {@link UpdateSite#neverUpdate} */ @Deprecated public static boolean neverUpdate = SystemProperties.getBoolean(UpdateCenter.class.getName()+".never"); public static final XStream2 XSTREAM = new XStream2(); static { XSTREAM.alias("site",UpdateSite.class); XSTREAM.alias("sites",PersistedList.class); } }
mit
lxy528/Benchmark
src/main/java/xss/BenchmarkTest/BenchmarkTest02130.java
2128
/** * OWASP Benchmark Project v1.3alpha * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Foundation, version 2. * * The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package xss.BenchmarkTest; import java.io.IOException; import javax.servlet.ServletException; //import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; //@WebServlet(value="/xss-04/BenchmarkTest02130") public class BenchmarkTest02130 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); String param = request.getParameter("BenchmarkTest02130"); if (param == null) param = ""; String bar = doSomething(param); response.setHeader("X-XSS-Protection", "0"); Object[] obj = { "a", bar}; response.getWriter().printf(java.util.Locale.US,"Formatted like: %1$s and %2$s.",obj); } // end doPost private static String doSomething(String param) throws ServletException, IOException { StringBuilder sbxyz60224 = new StringBuilder(param); String bar = sbxyz60224.append("_SafeStuff").toString(); return bar; } }
mit
dorkbot/Dorkbots-Broadcasters
C#/Dorkbots/Broadcasters/BroadcastedEvents.cs
1693
/* * Author: Dayvid jones * http://www.dayvid.com * Copyright (c) Superhero Robot 2016 * http://www.superherorobot.com * Version: 1.0.0 * * Licence Agreement * * You may distribute and modify this class freely, provided that you leave this header intact, * and add appropriate headers to indicate your changes. Credit is appreciated in applications * that use this code, but is not required. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ namespace Dorkbots.Broadcasters { public class BroadcastedEvents { // Generic events public const string BROADCAST_SENT = "broadcast sent"; public const string STATE_UPDATED = "state updated"; } }
mit
chr-krenn/chr-krenn-fhj-ws2017-sd17-pse
src/main/java/org/se/lab/service/PostService.java
388
package org.se.lab.service; import org.se.lab.db.data.Community; import org.se.lab.db.data.Post; import org.se.lab.db.data.User; import java.util.Date; public interface PostService { Post createRootPost(User user, String text, Date created); Post createChildPost(Post parentpost, Community community, User user, String text, Date created); Post updatePost(Post post); }
mit
Mariya2/Trip_Assistant
client/app/routes/homePage/login/LoginUserController.js
1214
travelAssistant.controller("LoginUserController", ['$scope', 'userService', '$http', '$location', 'authentication', '$timeout', '$rootScope', function LoginUserController($scope, userService, $http, $location, authentication, $timeout, $rootScope){ $scope.user={}; $scope.login = function(){ var user = $scope.user.name; var pass = $scope.user.password; var data = { name: user, password: pass }; authentication.sendAjax(data) .then(function(loggedInUser){ $scope.alertMsg ='Success Sign In'; $scope.alertStyle = 'alert-success'; polling_interval=2000; var poll = function() { $scope.alertStyle = ''; $location.path('/InsidePage/mapApp'); $rootScope.flag = true; console.log($rootScope.flag) }; $timeout(poll, polling_interval); }, function(){ $scope.alertMsg ='Ivalid name or password'; $scope.alertStyle = 'alert-failed'; polling_interval=2000; var poll = function() { $scope.alertStyle = ''; }; $timeout(poll, polling_interval); $rootScope.flag = false; console.log($rootScope.flag) } ); } $scope.dataUser = $scope.user; $scope.user={}; $scope.authentication = authentication; } ])
mit
protherj/Umbraco-CMS
src/umbraco.businesslogic/BasePages/UmbracoEnsuredPage.cs
4854
using System; using Umbraco.Core.Logging; using System.Linq; using Umbraco.Core; using Umbraco.Core.IO; using Umbraco.Core.Logging; using umbraco.BusinessLogic; using umbraco.businesslogic.Exceptions; namespace umbraco.BasePages { /// <summary> /// UmbracoEnsuredPage is the standard protected page in the umbraco backend, and forces authentication. /// </summary> [Obsolete("This class has been superceded by Umbraco.Web.UI.Pages.UmbracoEnsuredPage")] public class UmbracoEnsuredPage : BasePage { /// <summary> /// Gets/sets the app for which this page belongs to so that we can validate the current user's security against it /// </summary> /// <remarks> /// If no app is specified then all logged in users will have access to the page /// </remarks> public string CurrentApp { get; set; } /// <summary> /// Initializes a new instance of the <see cref="UmbracoEnsuredPage"/> class. /// </summary> public UmbracoEnsuredPage() { } [Obsolete("This constructor is not used and will be removed from the codebase in the future")] public UmbracoEnsuredPage(string hest) { } /// <summary> /// If true then umbraco will force any window/frame to reload umbraco in the main window /// </summary> public bool RedirectToUmbraco { get; set; } /// <summary> /// Validates the user for access to a certain application /// </summary> /// <param name="app">The application alias.</param> /// <returns></returns> public bool ValidateUserApp(string app) { return getUser().Applications.Any(uApp => uApp.alias.InvariantEquals(app)); } /// <summary> /// Validates the user node tree permissions. /// </summary> /// <param name="Path">The path.</param> /// <param name="Action">The action.</param> /// <returns></returns> public bool ValidateUserNodeTreePermissions(string Path, string Action) { string permissions = getUser().GetPermissions(Path); if (permissions.IndexOf(Action) > -1 && (Path.Contains("-20") || ("," + Path + ",").Contains("," + getUser().StartNodeId.ToString() + ","))) return true; var user = getUser(); LogHelper.Info<UmbracoEnsuredPage>("User {0} has insufficient permissions in UmbracoEnsuredPage: '{1}', '{2}', '{3}'", () => user.Name, () => Path, () => permissions, () => Action); return false; } /// <summary> /// Gets the current user. /// </summary> /// <value>The current user.</value> public static User CurrentUser { get { return BusinessLogic.User.GetCurrent(); } } /// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Init"></see> event to initialize the page. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param> protected override void OnInit(EventArgs e) { base.OnInit(e); try { ensureContext(); if (!string.IsNullOrEmpty(CurrentApp)) { if (!ValidateUserApp(CurrentApp)) throw new UserAuthorizationException(String.Format("The current user doesn't have access to the section/app '{0}'", CurrentApp)); } } catch (UserAuthorizationException ex) { LogHelper.Warn<UmbracoEnsuredPage>(string.Format("{0} tried to access '{1}'", CurrentUser.Id, CurrentApp)); throw; } catch { // Clear content as .NET transfers rendered content. Response.Clear(); // Some umbraco pages should not be loaded on timeout, but instead reload the main application in the top window. Like the treeview for instance if (RedirectToUmbraco) Response.Redirect(SystemDirectories.Umbraco + "/logout.aspx?", true); else Response.Redirect(SystemDirectories.Umbraco + "/logout.aspx?redir=" + Server.UrlEncode(Request.RawUrl), true); } System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(ui.Culture(this.getUser())); System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture; } } }
mit
gmarciani/opmap
test/optmodel/TestRestricted.java
1873
package optmodel; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; import application.SampleApplication; import architecture.SampleArchitecture; import control.exceptions.ModelException; import control.exceptions.SolverException; import control.solver.OPPSolver; import control.solver.mp.MPSolver; import model.application.Application; import model.architecture.Architecture; import model.placement.Report; import model.placement.optmodel.OPPModel; import model.placement.optmodel.cplex.OPPRestricted; public class TestRestricted { @Rule public TestName name = new TestName(); @Before public void testInfo() { System.out.println("\n/********************************************************************************"); System.out.println(" * TEST: " + this.getClass().getSimpleName() + " " + name.getMethodName()); System.out.println(" ********************************************************************************/\n"); } @Test public void create() throws ModelException { Architecture arc = SampleArchitecture.uniform(); Application app = SampleApplication.uniform(arc.vertexSet()); OPPModel model = new OPPRestricted(app, arc); System.out.println(model); model.getCPlex().end(); } @Test public void solve() throws ModelException, SolverException { Architecture arc = SampleArchitecture.uniform(); Application app = SampleApplication.uniform(arc.vertexSet()); System.out.println(app.toPrettyString()); System.out.println(arc.toPrettyString()); OPPModel model = new OPPRestricted(app, arc); OPPSolver solver = new MPSolver(); Report report = solver.solveAndReport(model); if (report != null) System.out.println(report.toPrettyString()); else System.out.println(model.getName() + " UNSOLVABLE"); model.getCPlex().end(); } }
mit
StoianCatalin/fiiPractic2016
app/Http/Controllers/ApplyController.php
1869
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; use Validator; use Auth; use App\Question; use App\Response; use App\Training; use App\Applicant; class ApplyController extends Controller { public function registerUserResponses(Request $request){ $responses = array(); $error = 0; foreach ($request->data as $data) { $question_id = explode("-", $data[0]); $question_id = $question_id[1]; $required = Question::where('id', $question_id)->first()->required; if($required == 1){ if($data[1] == ""){ $error = 1; break; } } unset($data); } if($error == 0){ $first_question_id = 0; foreach ($request->data as $data) { $question_id = explode("-", $data[0]); $question_id = $question_id[1]; if($first_question_id == 0){ $first_question_id = $question_id; } $response = new Response(); $response->question_id = $question_id; $response->response = $data[1]; $response->applicant_id = Auth::user()->id; $response->save(); unset($data); } $training_id = Question::where('id', $first_question_id)->first()->training_id; $applicant = new Applicant(); $applicant->user_id = Auth::user()->id; $applicant->training_id = $training_id; $applicant->trainer_id = 0; $applicant->save(); echo "Datele dvs. au fost preluate!"; }else{ echo "Intrebarile marcate cu * sunt obligatorii!"; } } }
mit
Yukinoshita47/Yuki-Chan-The-Auto-Pentest
Module/Spaghetti/modules/fingerprints/framework/framework.py
617
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Spaghetti: Web Application Security Scanner # # @url: https://github.com/m4ll0k/Spaghetti # @author: Momo Outaadi (M4ll0k) # @license: See the file 'doc/LICENSE' import aspx_mvc import cakephp import cherry import django import nette import rack import rails import symfony def Framework(headers): return ( aspx_mvc.Aspxmvc().Run(headers), cakephp.Cakephp().Run(headers), cherry.Cherry().Run(headers), django.Django().Run(headers), nette.Nette().Run(headers), rack.Rack().Run(headers), rails.Rails().Run(headers), symfony.Symfony().Run(headers) )
mit
iontorrent/Torrent-Variant-Caller-stable
public/java/src/org/broadinstitute/sting/analyzecovariates/AnalysisDataManager.java
5602
/* * Copyright (c) 2010 The Broad Institute * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package org.broadinstitute.sting.analyzecovariates; import org.broadinstitute.sting.gatk.walkers.recalibration.RecalDatum; import org.broadinstitute.sting.utils.collections.NestedHashMap; import java.util.ArrayList; /** * Created by IntelliJ IDEA. * User: rpoplin * Date: Dec 1, 2009 * * The difference between this AnalysisDataManager and the RecalDataManager used by the Recalibration walkers is that here the collapsed data tables are indexed * by only read group and the given covariate, while in the recalibrator the collapsed tables are indexed by read group, reported quality, and the given covariate. */ public class AnalysisDataManager { private NestedHashMap dataCollapsedReadGroup; // Table where everything except read group has been collapsed private ArrayList<NestedHashMap> dataCollapsedByCovariate; // Tables where everything except read group and given covariate has been collapsed AnalysisDataManager() { } AnalysisDataManager( final int numCovariates ) { dataCollapsedReadGroup = new NestedHashMap(); dataCollapsedByCovariate = new ArrayList<NestedHashMap>(); for( int iii = 0; iii < numCovariates - 1; iii++ ) { // readGroup isn't counted here, its table is separate dataCollapsedByCovariate.add( new NestedHashMap() ); } } /** * Add the given mapping to all of the collapsed hash tables * @param key The list of comparables that is the key for this mapping * @param fullDatum The RecalDatum which is the data for this mapping * @param IGNORE_QSCORES_LESS_THAN The threshold in report quality for adding to the aggregate collapsed table */ public final void addToAllTables( final Object[] key, final RecalDatum fullDatum, final int IGNORE_QSCORES_LESS_THAN ) { int qscore = Integer.parseInt( key[1].toString() ); RecalDatum collapsedDatum; final Object[] readGroupCollapsedKey = new Object[1]; final Object[] covariateCollapsedKey = new Object[2]; if( !(qscore < IGNORE_QSCORES_LESS_THAN) ) { // Create dataCollapsedReadGroup, the table where everything except read group has been collapsed readGroupCollapsedKey[0] = key[0]; // Make a new key with just the read group collapsedDatum = (RecalDatum)dataCollapsedReadGroup.get( readGroupCollapsedKey ); if( collapsedDatum == null ) { dataCollapsedReadGroup.put( new RecalDatum(fullDatum), readGroupCollapsedKey ); } else { collapsedDatum.combine( fullDatum ); // using combine instead of increment in order to calculate overall aggregateQReported } } // Create dataCollapsedByCovariate's, the tables where everything except read group and given covariate has been collapsed for( int iii = 0; iii < dataCollapsedByCovariate.size(); iii++ ) { if( iii == 0 || !(qscore < IGNORE_QSCORES_LESS_THAN) ) { // use all data for the plot versus reported quality, but not for the other plots versus cycle and etc. covariateCollapsedKey[0] = key[0]; // Make a new key with the read group ... Object theCovariateElement = key[iii + 1]; // and the given covariate if( theCovariateElement != null ) { covariateCollapsedKey[1] = theCovariateElement; collapsedDatum = (RecalDatum)dataCollapsedByCovariate.get(iii).get( covariateCollapsedKey ); if( collapsedDatum == null ) { dataCollapsedByCovariate.get(iii).put( new RecalDatum(fullDatum), covariateCollapsedKey ); } else { collapsedDatum.combine( fullDatum ); } } } } } /** * Get the appropriate collapsed table out of the set of all the tables held by this Object * @param covariate Which covariate indexes the desired collapsed HashMap * @return The desired collapsed HashMap */ public final NestedHashMap getCollapsedTable( final int covariate ) { if( covariate == 0) { return dataCollapsedReadGroup; // Table where everything except read group has been collapsed } else { return dataCollapsedByCovariate.get( covariate - 1 ); // Table where everything except read group, quality score, and given covariate has been collapsed } } }
mit
mctep/mc-auth-service
src/lib/password/index.js
705
const promisify = require('bluebird').promisify; const bcrypt = require('bcryptjs'); const crypto = require('crypto'); const generateHash = promisify(bcrypt.hash); const compareHash = promisify(bcrypt.compare); module.exports = { createPasswordHash, checkPasswordHash }; function makeBeacon(username, password, SECRET) { return crypto.createHmac('sha256', SECRET) .update(username).update(password) .digest('hex'); } function createPasswordHash(username, password, SECRET, SALT_LENGTH) { return generateHash(makeBeacon(username, password, SECRET), SALT_LENGTH); } function checkPasswordHash(hash, username, password, SECRET) { return compareHash(makeBeacon(username, password, SECRET), hash); }
mit
CS2103JAN2017-F14-B3/main
src/test/java/guitests/SelectCommandTest.java
2785
package guitests; import static org.junit.Assert.assertEquals; import org.junit.Test; import onlythree.imanager.logic.commands.SelectCommand; import onlythree.imanager.model.task.ReadOnlyTask; public class SelectCommandTest extends TaskListGuiTest { @Test public void selectTask_nonEmptyList() { int taskCount = td.getTypicalTasks().length; assertSelectionSuccess(10, taskCount); // invalid index assertTaskSelected(taskCount); // assert last task selected assertSelectionSuccess(1); // first task in the list assertSelectionSuccess(taskCount); // last task in the list int middleIndex = taskCount / 2; assertSelectionSuccess(middleIndex); // a task in the middle of the list assertSelectionSuccess(taskCount + 1, taskCount); // index bigger than the taskCount assertTaskSelected(taskCount); // assert last task selected /* Testing other invalid indexes such as -1 should be done when testing the SelectCommand */ } @Test public void selectTask_emptyList() { commandBox.runCommand("clear"); assertListSize(0); assertSelectionInvalid(1); //invalid index assertNoTaskSelected(); } private void assertSelectionInvalid(int index) { commandBox.runCommand("select " + index); assertResultMessage("The task index provided is invalid"); } private void assertSelectionSuccess(int index) { assertSelectionSuccess(index, index); } private void assertSelectionSuccess(int index, int lastIndex) { commandBox.runCommand("select " + index); int selectedIndex = index; if (selectedIndex > lastIndex) { selectedIndex = lastIndex; } ReadOnlyTask task = taskListPanel.getSelectedTasks().get(0); assertResultMessage(String.format(SelectCommand.MESSAGE_SELECT_TASK_SUCCESS, selectedIndex, getCompactFormattedTask(task))); assertTaskSelected(selectedIndex); } private void assertTaskSelected(int index) { assertEquals(taskListPanel.getSelectedTasks().size(), 1); ReadOnlyTask selectedTask = taskListPanel.getSelectedTasks().get(0); assertEquals(taskListPanel.getTask(index - 1), selectedTask); } private void assertNoTaskSelected() { assertEquals(taskListPanel.getSelectedTasks().size(), 0); } /** * Returns the task with only the task name and tags. */ private String getCompactFormattedTask(ReadOnlyTask task) { StringBuilder sb = new StringBuilder(); sb.append(task.getName()); sb.append(System.lineSeparator()); sb.append("Tags: "); task.getTags().forEach(sb::append); return sb.toString(); } }
mit
sconway/portfolio
js/freelancer.js
1979
// Freelancer Theme JavaScript (function($) { "use strict"; // Start of use strict // jQuery for page scrolling feature - requires jQuery Easing plugin $('.page-scroll a').bind('click', function(event) { var $anchor = $(this); $('html, body').stop().animate({ scrollTop: ($($anchor.attr('href')).offset().top - 50) }, 1250, 'easeInOutExpo'); event.preventDefault(); }); // Highlight the top nav as scrolling occurs $('body').scrollspy({ target: '.navbar-fixed-top', offset: 51 }); // Closes the Responsive Menu on Menu Item Click $('.navbar-collapse ul li a').click(function(){ $('.navbar-toggle:visible').click(); }); // Offset for Main Navigation $('#mainNav').affix({ offset: { top: 100 } }) // Floating label headings for the contact form $(function() { $("body").on("input propertychange", ".floating-label-form-group", function(e) { $(this).toggleClass("floating-label-form-group-with-value", !!$(e.target).val()); }).on("focus", ".floating-label-form-group", function() { $(this).addClass("floating-label-form-group-with-focus"); }).on("blur", ".floating-label-form-group", function() { $(this).removeClass("floating-label-form-group-with-focus"); }); }); // Moves the input label up when the field is focused on $(".form-control").on("focus", function() { $(this).parent().addClass("floating-label-form-group-with-value"); }).on("blur", function() { if (!$(this).val()) { $(this).parent().removeClass("floating-label-form-group-with-value"); } }); // Make sure everything has loaded so heights can be properly computed $(window).load(function() { // Initialize Masonry Plugin $(".portfolio-items").masonry({}); }); })(jQuery); // End of use strict
mit
Carine2126/autoABS
src/ABS/ManageBundle/Controller/ManageController.php
465
<?php /** * Created by PhpStorm. * User: CarineFixe * Date: 19/01/2015 * Time: 21:37 */ namespace ABS\ManageBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class ManageController extends Controller { public function homeAction(){ return $this->render('ABSManageBundle:Manage:home.html.twig'); } }
mit
robertBojor/rb-utils
src/RobertB/Utils/UtilsServiceProvider.php
628
<?php namespace RobertB\Utils; use Illuminate\Support\ServiceProvider; use Illuminate\Foundation\AliasLoader; class UtilsServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; /** * Register the service provider. * * @return void */ public function register() { $this->app->bind("utils", "RobertB\Utils"); AliasLoader::getInstance()->alias("Utils", "RobertB\Utils"); } /** * Get the services provided by the provider. * * @return array */ public function provides() { return []; } }
mit
doy/libvt100-python
t/mode_test.py
8405
from . import VT100Test class ModeTest(VT100Test): def test_modes(self): assert not self.vt.hide_cursor() assert not self.vt.application_keypad() assert not self.vt.application_cursor() assert not self.vt.mouse_reporting_press() assert not self.vt.mouse_reporting_press_release() assert not self.vt.mouse_reporting_button_motion() assert not self.vt.mouse_reporting_sgr_mode() assert not self.vt.bracketed_paste() self.process("\033[?1h") assert not self.vt.hide_cursor() assert not self.vt.application_keypad() assert self.vt.application_cursor() assert not self.vt.mouse_reporting_press() assert not self.vt.mouse_reporting_press_release() assert not self.vt.mouse_reporting_button_motion() assert not self.vt.mouse_reporting_sgr_mode() assert not self.vt.bracketed_paste() self.process("\033[?9h") assert not self.vt.hide_cursor() assert not self.vt.application_keypad() assert self.vt.application_cursor() assert self.vt.mouse_reporting_press() assert not self.vt.mouse_reporting_press_release() assert not self.vt.mouse_reporting_button_motion() assert not self.vt.mouse_reporting_sgr_mode() assert not self.vt.bracketed_paste() self.process("\033[?25l") assert self.vt.hide_cursor() assert not self.vt.application_keypad() assert self.vt.application_cursor() assert self.vt.mouse_reporting_press() assert not self.vt.mouse_reporting_press_release() assert not self.vt.mouse_reporting_button_motion() assert not self.vt.mouse_reporting_sgr_mode() assert not self.vt.bracketed_paste() self.process("\033[?1000h") assert self.vt.hide_cursor() assert not self.vt.application_keypad() assert self.vt.application_cursor() assert self.vt.mouse_reporting_press() assert self.vt.mouse_reporting_press_release() assert not self.vt.mouse_reporting_button_motion() assert not self.vt.mouse_reporting_sgr_mode() assert not self.vt.bracketed_paste() self.process("\033[?1002h") assert self.vt.hide_cursor() assert not self.vt.application_keypad() assert self.vt.application_cursor() assert self.vt.mouse_reporting_press() assert self.vt.mouse_reporting_press_release() assert self.vt.mouse_reporting_button_motion() assert not self.vt.mouse_reporting_sgr_mode() assert not self.vt.bracketed_paste() self.process("\033[?1006h") assert self.vt.hide_cursor() assert not self.vt.application_keypad() assert self.vt.application_cursor() assert self.vt.mouse_reporting_press() assert self.vt.mouse_reporting_press_release() assert self.vt.mouse_reporting_button_motion() assert self.vt.mouse_reporting_sgr_mode() assert not self.vt.bracketed_paste() self.process("\033[?2004h") assert self.vt.hide_cursor() assert not self.vt.application_keypad() assert self.vt.application_cursor() assert self.vt.mouse_reporting_press() assert self.vt.mouse_reporting_press_release() assert self.vt.mouse_reporting_button_motion() assert self.vt.mouse_reporting_sgr_mode() assert self.vt.bracketed_paste() self.process("\033=") assert self.vt.hide_cursor() assert self.vt.application_keypad() assert self.vt.application_cursor() assert self.vt.mouse_reporting_press() assert self.vt.mouse_reporting_press_release() assert self.vt.mouse_reporting_button_motion() assert self.vt.mouse_reporting_sgr_mode() assert self.vt.bracketed_paste() self.process("\033[?1l") assert self.vt.hide_cursor() assert self.vt.application_keypad() assert not self.vt.application_cursor() assert self.vt.mouse_reporting_press() assert self.vt.mouse_reporting_press_release() assert self.vt.mouse_reporting_button_motion() assert self.vt.mouse_reporting_sgr_mode() assert self.vt.bracketed_paste() self.process("\033[?9l") assert self.vt.hide_cursor() assert self.vt.application_keypad() assert not self.vt.application_cursor() assert not self.vt.mouse_reporting_press() assert self.vt.mouse_reporting_press_release() assert self.vt.mouse_reporting_button_motion() assert self.vt.mouse_reporting_sgr_mode() assert self.vt.bracketed_paste() self.process("\033[?25h") assert not self.vt.hide_cursor() assert self.vt.application_keypad() assert not self.vt.application_cursor() assert not self.vt.mouse_reporting_press() assert self.vt.mouse_reporting_press_release() assert self.vt.mouse_reporting_button_motion() assert self.vt.mouse_reporting_sgr_mode() assert self.vt.bracketed_paste() self.process("\033[?1000l") assert not self.vt.hide_cursor() assert self.vt.application_keypad() assert not self.vt.application_cursor() assert not self.vt.mouse_reporting_press() assert not self.vt.mouse_reporting_press_release() assert self.vt.mouse_reporting_button_motion() assert self.vt.mouse_reporting_sgr_mode() assert self.vt.bracketed_paste() self.process("\033[?1002l") assert not self.vt.hide_cursor() assert self.vt.application_keypad() assert not self.vt.application_cursor() assert not self.vt.mouse_reporting_press() assert not self.vt.mouse_reporting_press_release() assert not self.vt.mouse_reporting_button_motion() assert self.vt.mouse_reporting_sgr_mode() assert self.vt.bracketed_paste() self.process("\033[?1006l") assert not self.vt.hide_cursor() assert self.vt.application_keypad() assert not self.vt.application_cursor() assert not self.vt.mouse_reporting_press() assert not self.vt.mouse_reporting_press_release() assert not self.vt.mouse_reporting_button_motion() assert not self.vt.mouse_reporting_sgr_mode() assert self.vt.bracketed_paste() self.process("\033[?2004l") assert not self.vt.hide_cursor() assert self.vt.application_keypad() assert not self.vt.application_cursor() assert not self.vt.mouse_reporting_press() assert not self.vt.mouse_reporting_press_release() assert not self.vt.mouse_reporting_button_motion() assert not self.vt.mouse_reporting_sgr_mode() assert not self.vt.bracketed_paste() self.process("\033>") assert not self.vt.hide_cursor() assert not self.vt.application_keypad() assert not self.vt.application_cursor() assert not self.vt.mouse_reporting_press() assert not self.vt.mouse_reporting_press_release() assert not self.vt.mouse_reporting_button_motion() assert not self.vt.mouse_reporting_sgr_mode() assert not self.vt.bracketed_paste() def test_alternate_buffer(self): self.process("\033[m\033[2J\033[H1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19\r\n20\r\n21\r\n22\r\n23\r\n24") assert self.vt.window_contents() == "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n" assert not self.vt.alternate_buffer_active() self.process("\033[?1049h") assert self.vt.window_contents() == ('\n' * 24) assert self.vt.alternate_buffer_active() self.process("foobar") assert self.vt.window_contents() == 'foobar' + ('\n' * 24) self.process("\033[?1049l") assert self.vt.window_contents() == "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n" assert not self.vt.alternate_buffer_active()
mit
zaabjuda/GB_Fabrica
guest_book/admin.py
2423
# coding=utf-8 __author__ = "Dmitry Zhiltsov" __copyright__ = "Copyright 2015, Dmitry Zhiltsov" from django.contrib.auth.admin import admin from guest_book.models import GuestBook, GuestBookMessages from web.admin import admin_site class _BaseGuestBookAdmin(admin.ModelAdmin): def _check_sp(self): return self.admin_site.name == 'service_panel' def has_module_permission(self, request): if self._check_sp(): return True return super(_BaseGuestBookAdmin, self).has_module_permission(request) def has_add_permission(self, request): if self._check_sp(): return True return super(_BaseGuestBookAdmin, self).has_add_permission(request) def has_change_permission(self, request, obj=None): if self._check_sp(): return True return super(_BaseGuestBookAdmin, self).has_change_permission(request, obj=obj) def has_delete_permission(self, request, obj=None): if self._check_sp(): return True return super(_BaseGuestBookAdmin, self).has_delete_permission(request, obj=obj) class GuestBookAdmin(_BaseGuestBookAdmin): list_display = ['name', 'is_moderated'] list_filter = ('is_moderated', ) fieldsets = ((None, { 'classes': ('wide',), 'fields': ('name', 'slug', 'is_moderated')}),) def save_model(self, request, obj, form, change): if form.is_valid(): if not request.user.is_staff: obj.owner = request.user obj.save() def get_queryset(self, request): qs = super(GuestBookAdmin, self).get_queryset(request) if not request.user.is_staff: qs = qs.filter(owner=request.user) return qs class GuestBookMessagesAdmin(_BaseGuestBookAdmin): list_filter = ('is_visible', 'guest_book',) list_display = ['author', 'guest_book', 'is_visible'] readonly_fields = ['guest_book', 'author', 'time_of_moderate', 'message'] def get_queryset(self, request): qs = super(GuestBookMessagesAdmin, self).get_queryset(request) if not request.user.is_staff: qs = qs.filter(guest_book__owner=request.user) return qs admin.site.register(GuestBook, GuestBookAdmin) admin.site.register(GuestBookMessages, GuestBookMessagesAdmin) admin_site.register(GuestBook, GuestBookAdmin) admin_site.register(GuestBookMessages, GuestBookMessagesAdmin)
mit
jiawen/Halide
src/StorageFolding.cpp
14096
#include "StorageFolding.h" #include "IROperator.h" #include "IRMutator.h" #include "Simplify.h" #include "Bounds.h" #include "IRPrinter.h" #include "Substitute.h" #include "Debug.h" #include "Monotonic.h" #include "ExprUsesVar.h" namespace Halide { namespace Internal { namespace { int64_t next_power_of_two(int64_t x) { return static_cast<int64_t>(1) << static_cast<int64_t>(std::ceil(std::log2(x))); } } // namespace using std::string; using std::vector; using std::map; // Count the number of producers of a particular func. class CountProducers : public IRVisitor { const std::string &name; void visit(const ProducerConsumer *op) { if (op->name == name) { count++; } else { IRVisitor::visit(op); } } using IRVisitor::visit; public: int count = 0; CountProducers(const std::string &name) : name(name) {} }; int count_producers(Stmt in, const std::string &name) { CountProducers counter(name); in.accept(&counter); return counter.count; } // Fold the storage of a function in a particular dimension by a particular factor class FoldStorageOfFunction : public IRMutator { string func; int dim; Expr factor; using IRMutator::visit; void visit(const Call *op) { IRMutator::visit(op); op = expr.as<Call>(); internal_assert(op); if (op->name == func && op->call_type == Call::Halide) { vector<Expr> args = op->args; internal_assert(dim < (int)args.size()); args[dim] = is_one(factor) ? 0 : (args[dim] % factor); expr = Call::make(op->type, op->name, args, op->call_type, op->func, op->value_index, op->image, op->param); } } void visit(const Provide *op) { IRMutator::visit(op); op = stmt.as<Provide>(); internal_assert(op); if (op->name == func) { vector<Expr> args = op->args; args[dim] = is_one(factor) ? 0 : (args[dim] % factor); stmt = Provide::make(op->name, op->values, args); } } public: FoldStorageOfFunction(string f, int d, Expr e) : func(f), dim(d), factor(e) {} }; // Attempt to fold the storage of a particular function in a statement class AttemptStorageFoldingOfFunction : public IRMutator { Function func; bool explicit_only; using IRMutator::visit; void visit(const ProducerConsumer *op) { if (op->name == func.name()) { // Can't proceed into the pipeline for this func stmt = op; } else { IRMutator::visit(op); } } void visit(const For *op) { if (op->for_type != ForType::Serial && op->for_type != ForType::Unrolled) { // We can't proceed into a parallel for loop. // TODO: If there's no overlap between the region touched // by the threads as this loop counter varies // (i.e. there's no cross-talk between threads), then it's // safe to proceed. stmt = op; return; } Stmt body = op->body; Box provided = box_provided(body, func.name()); Box required = box_required(body, func.name()); Box box = box_union(provided, required); // Try each dimension in turn from outermost in for (size_t i = box.size(); i > 0; i--) { Expr min = simplify(box[i-1].min); Expr max = simplify(box[i-1].max); const StorageDim &storage_dim = func.schedule().storage_dims()[i-1]; Expr explicit_factor; if (expr_uses_var(min, op->name) || expr_uses_var(max, op->name)) { // We only use the explicit fold factor if the fold is // relevant for this loop. If the fold isn't relevant // for this loop, the added asserts will be too // conservative. explicit_factor = storage_dim.fold_factor; } debug(3) << "\nConsidering folding " << func.name() << " over for loop over " << op->name << '\n' << "Min: " << min << '\n' << "Max: " << max << '\n'; // First, attempt to detect if the loop is monotonically // increasing or decreasing (if we allow automatic folding). bool min_monotonic_increasing = !explicit_only && (is_monotonic(min, op->name) == Monotonic::Increasing); bool max_monotonic_decreasing = !explicit_only && (is_monotonic(max, op->name) == Monotonic::Decreasing); if (!min_monotonic_increasing && !max_monotonic_decreasing && explicit_factor.defined()) { // If we didn't find a monotonic dimension, and we have an explicit fold factor, // assert that the min/max do in fact monotonically increase/decrease. Expr condition; Expr loop_var = Variable::make(Int(32), op->name); if (storage_dim.fold_forward) { Expr min_next = substitute(op->name, loop_var + 1, min); condition = min_next >= min; // After we assert that the min increased, assume // the min is monotonically increasing. min_monotonic_increasing = true; } else { Expr max_next = substitute(op->name, loop_var + 1, max); condition = max_next <= max; // After we assert that the max decreased, assume // the max is monotonically decreasing. max_monotonic_decreasing = true; } Expr error = Call::make(Int(32), "halide_error_bad_fold", {func.name(), storage_dim.var, op->name}, Call::Extern); body = Block::make(AssertStmt::make(condition, error), body); } // The min or max has to be monotonic with the loop // variable, and should depend on the loop variable. if (min_monotonic_increasing || max_monotonic_decreasing) { Expr extent = simplify(max - min + 1); Expr factor; if (explicit_factor.defined()) { Expr error = Call::make(Int(32), "halide_error_fold_factor_too_small", {func.name(), storage_dim.var, explicit_factor, op->name, extent}, Call::Extern); body = Block::make(AssertStmt::make(extent <= explicit_factor, error), body); factor = explicit_factor; } else { // The max of the extent over all values of the loop variable must be a constant Scope<Interval> scope; scope.push(op->name, Interval(Variable::make(Int(32), op->name + ".loop_min"), Variable::make(Int(32), op->name + ".loop_max"))); Expr max_extent = simplify(bounds_of_expr_in_scope(extent, scope).max); scope.pop(op->name); max_extent = find_constant_bound(max_extent, Direction::Upper); const int max_fold = 1024; const int64_t *const_max_extent = as_const_int(max_extent); if (const_max_extent && *const_max_extent <= max_fold) { factor = static_cast<int>(next_power_of_two(*const_max_extent)); } else { debug(3) << "Not folding because extent not bounded by a constant not greater than " << max_fold << "\n" << "extent = " << extent << "\n" << "max extent = " << max_extent << "\n"; } } if (factor.defined()) { debug(3) << "Proceeding with factor " << factor << "\n"; Fold fold = {(int)i - 1, factor}; dims_folded.push_back(fold); body = FoldStorageOfFunction(func.name(), (int)i - 1, factor).mutate(body); Expr next_var = Variable::make(Int(32), op->name) + 1; Expr next_min = substitute(op->name, next_var, min); if (can_prove(max < next_min)) { // There's no overlapping usage between loop // iterations, so we can continue to search // for further folding opportinities // recursively. } else if (!body.same_as(op->body)) { stmt = For::make(op->name, op->min, op->extent, op->for_type, op->device_api, body); return; } else { stmt = op; return; } } } else { debug(3) << "Not folding because loop min or max not monotonic in the loop variable\n" << "min = " << min << "\n" << "max = " << max << "\n"; } } // If there's no communication of values from one loop // iteration to the next (which may happen due to sliding), // then we're safe to fold an inner loop. if (box_contains(provided, required)) { body = mutate(body); } if (body.same_as(op->body)) { stmt = op; } else { stmt = For::make(op->name, op->min, op->extent, op->for_type, op->device_api, body); } } public: struct Fold { int dim; Expr factor; }; vector<Fold> dims_folded; AttemptStorageFoldingOfFunction(Function f, bool explicit_only) : func(f), explicit_only(explicit_only) {} }; /** Check if a buffer's allocated is referred to directly via an * intrinsic. If so we should leave it alone. (e.g. it may be used * extern). */ class IsBufferSpecial : public IRVisitor { public: string func; bool special = false; IsBufferSpecial(string f) : func(f) {} private: using IRVisitor::visit; void visit(const Variable *var) { if (var->type.is_handle() && var->name == func + ".buffer") { special = true; } } }; // Look for opportunities for storage folding in a statement class StorageFolding : public IRMutator { const map<string, Function> &env; using IRMutator::visit; void visit(const Realize *op) { Stmt body = mutate(op->body); IsBufferSpecial special(op->name); op->accept(&special); // Get the function associated with this realization, which // contains the explicit fold directives from the schedule. auto func_it = env.find(op->name); Function func = func_it != env.end() ? func_it->second : Function(); if (special.special) { for (const StorageDim &i : func.schedule().storage_dims()) { user_assert(!i.fold_factor.defined()) << "Dimension " << i.var << " of " << op->name << " cannot be folded because it is accessed by extern or device stages.\n"; } debug(3) << "Not attempting to fold " << op->name << " because its buffer is used\n"; if (body.same_as(op->body)) { stmt = op; } else { stmt = Realize::make(op->name, op->types, op->bounds, op->condition, body); } } else { // Don't attempt automatic storage folding if there is // more than one produce node for this func. bool explicit_only = count_producers(body, op->name) != 1; AttemptStorageFoldingOfFunction folder(func, explicit_only); debug(3) << "Attempting to fold " << op->name << "\n"; body = folder.mutate(body); if (body.same_as(op->body)) { stmt = op; } else if (folder.dims_folded.empty()) { stmt = Realize::make(op->name, op->types, op->bounds, op->condition, body); } else { Region bounds = op->bounds; for (size_t i = 0; i < folder.dims_folded.size(); i++) { int d = folder.dims_folded[i].dim; Expr f = folder.dims_folded[i].factor; internal_assert(d >= 0 && d < (int)bounds.size()); bounds[d] = Range(0, f); } stmt = Realize::make(op->name, op->types, bounds, op->condition, body); } } } public: StorageFolding(const map<string, Function> &env) : env(env) {} }; // Because storage folding runs before simplification, it's useful to // at least substitute in constants before running it, and also simplify the RHS of Let Stmts. class SubstituteInConstants : public IRMutator { using IRMutator::visit; Scope<Expr> scope; void visit(const LetStmt *op) { Expr value = simplify(mutate(op->value)); Stmt body; if (is_const(value)) { scope.push(op->name, value); body = mutate(op->body); scope.pop(op->name); } else { body = mutate(op->body); } if (body.same_as(op->body) && value.same_as(op->value)) { stmt = op; } else { stmt = LetStmt::make(op->name, value, body); } } void visit(const Variable *op) { if (scope.contains(op->name)) { expr = scope.get(op->name); } else { expr = op; } } }; Stmt storage_folding(Stmt s, const std::map<std::string, Function> &env) { s = SubstituteInConstants().mutate(s); s = StorageFolding(env).mutate(s); return s; } } }
mit
cezarykluczynski/stapi
etl/src/main/java/com/cezarykluczynski/stapi/etl/template/comic_series/dto/ComicSeriesTemplateParameter.java
312
package com.cezarykluczynski.stapi.etl.template.comic_series.dto; import com.cezarykluczynski.stapi.etl.template.publishable_series.dto.PublishableSeriesTemplateParameter; public class ComicSeriesTemplateParameter extends PublishableSeriesTemplateParameter { public static final String ISSUES = "issues"; }
mit
cstj/CSharpHelpers
Helpers.ActiveDirectoryHelpers/ActiveDirectoryHelpers.cs
3410
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.DirectoryServices.AccountManagement; using System.DirectoryServices; namespace Helpers { public class ActiveDirectoryHelpers { public static bool IsUserDomainMember(string domain, string group) { if (GetUserFromDomain(domain, group) != null) return true; return false; } public static bool IsUserMemberOfGroup(string domain, string group, string userName) { UserPrincipal user = GetUserFromDomain(domain, userName); GroupPrincipal grp = GetGroupFromDomain(domain, group); if (user != null && grp != null) { // check if user is member of that group if (user.IsMemberOf(grp)) { return true; } } return false; } public static UserPrincipal GetUserFromDomain(string domain, string userName) { PrincipalContext ctx = new PrincipalContext(ContextType.Domain, domain); return UserPrincipal.FindByIdentity(ctx, userName); } public static GroupPrincipal GetGroupFromDomain(string domain, string group) { PrincipalContext ctx = new PrincipalContext(ContextType.Domain, domain); return GroupPrincipal.FindByIdentity(ctx, group); } public static List<string> GetAccountGroups(string domain, string userName) { UserPrincipal user = GetUserFromDomain(domain, userName); if (user != null) { var src = user.GetGroups(new PrincipalContext(ContextType.Domain, domain)); var result = new List<string>(); src.ToList().ForEach(sr => result.Add(sr.SamAccountName)); return result; } return new List<string>(); } public static List<DirectoryEntry> SearchForUser(string domain, string search) { var tmp = new List<DirectoryEntry>(); if (search != null) { //Remove domain if they have put it in the search string if (search.Length > domain.Length) { if (search.Substring(0, domain.Length) == domain) search = search.Substring(domain.Length + 1); } if (search.Length >= 3) { System.DirectoryServices.DirectoryEntry de = new System.DirectoryServices.DirectoryEntry("LDAP://" + domain); System.DirectoryServices.DirectorySearcher directorySearcher = new System.DirectoryServices.DirectorySearcher(de); directorySearcher.Filter = "(&(|(objectclass=user)(objectclass=computer))(|(samaccountname=" + search + ")(displayname=" + search + ")(sn=" + search + ")(mail=" + search + ")))"; System.DirectoryServices.SearchResultCollection srCollection = directorySearcher.FindAll(); System.Threading.Tasks.Parallel.For(0, srCollection.Count, (i) => { var item = srCollection[i].GetDirectoryEntry(); lock (tmp) tmp.Add(item); }); } } return tmp; } } }
mit
liuhll/MvcCore.Demo.Solution
src/MvcCore.Demo/MvcCoreDemo.Application/Interfaces/IOrderAppService.cs
223
using MvcCoreDemo.Application.Interfaces.Common; using MvcCoreDemo.Domain.Entities.Model; namespace MvcCoreDemo.Application.Interfaces { public interface IOrderAppService : IAppService<Order> { } }
mit
bandzoogle/rackspace-email-api
lib/rackspace/email/api/customers.rb
260
# frozen_string_literal: true module Rackspace module Email module Api class Customers < Rackspace::Email::Api::Endpoint self.request_base = 'customers' self.data_class = Rackspace::Email::Api::Customer end end end end
mit
Daekesh/KeshUI
Docs/html/class_u_k_u_i_component_button_widget.js
1721
var class_u_k_u_i_component_button_widget = [ [ "UKUIComponentButtonWidget", "class_u_k_u_i_component_button_widget.html#a78e5549d076f1322c4262c4eac7714bc", null ], [ "GetButtonComponent", "class_u_k_u_i_component_button_widget.html#a25c39308eb7e384ba984120068a2f826", null ], [ "GetComponentIndex", "class_u_k_u_i_component_button_widget.html#a541b22dd937917eb2c4ea11a177a9c76", null ], [ "GetElementComponent", "class_u_k_u_i_component_button_widget.html#ab3c21a3334c9f74f693fbb478fe299ec", null ], [ "OnWidgetStateChange_Implementation", "class_u_k_u_i_component_button_widget.html#adfe666b1f040c89bbc273ad6414f96c9", null ], [ "SetButtonComponent", "class_u_k_u_i_component_button_widget.html#a47ed4645d8e82b21fc55f9c207758a0c", null ], [ "SetButtonComponentSize", "class_u_k_u_i_component_button_widget.html#aa72db3be263a98de10adb9c26dedc51f", null ], [ "SetButtonComponentSizeStruct", "class_u_k_u_i_component_button_widget.html#a75dacf58f9400d4a55df5bb463949a72", null ], [ "SetElementComponent", "class_u_k_u_i_component_button_widget.html#ae982cb0427cc614811c54fbdd74d70c4", null ], [ "arButtonComponents", "class_u_k_u_i_component_button_widget.html#a3a6b7a3ce42339623827b0a906e234eb", null ], [ "arElementComponents", "class_u_k_u_i_component_button_widget.html#a9b546d51df21befad257f76c65898b5c", null ], [ "iButtonComponentIndex", "class_u_k_u_i_component_button_widget.html#a7032bb0a2f2fb4ff280744804b2d74bf", null ], [ "iElementComponentIndex", "class_u_k_u_i_component_button_widget.html#a326cb0b22fd372abdb902e2657f1b666", null ], [ "v2ClickedElementOffset", "class_u_k_u_i_component_button_widget.html#a16e9b114a9fc5014b90b87e26457138f", null ] ];
mit
jmarkstevens/AngularPatterns
Angular1.x/ReduxFetch/ui-src/store/api.Actions.js
459
import 'whatwg-fetch'; let jsonHeader = {'Accept': 'application/json', 'Content-Type': 'application/json'}; export function apiSetData(data) { return (dispatch) => { fetch('/routes/setData', {method: 'POST', headers: jsonHeader, body: JSON.stringify(data)}) .then(() => { fetch('/routes/getData') .then((response) => response.json()) .then((json) => dispatch({type: 'GetData1Done', payload: json})); }); }; }
mit
tarunchhabra26/PythonPlayground
FSM/fsm2.py
2471
#!/usr/bin/python from __future__ import division,print_function import random,os #sys.dont_write_bytecode=True # usage: # python fsm.py 21083 # for a long-ish run # python fsm.py 1 # for a short run #---------------------------------------------- def fsm0(): m = Machine() entry = m.state("entry") # first names state is "start" foo = m.state("foo") bar = m.state("bar") stop = m.state("stop.") # anything with a "." is a "stop" m.trans(T(entry, ok, foo), T(entry, fail, stop), T(foo, ok, bar), T(foo, fail, stop), T(foo, again, entry), T(bar, ok, stop), T(bar, fail, stop), T(bar, fail, foo)) return m #---------------------------------------------- def maybe(): return random.random() > 0.5 def ok (w,a): return maybe() def fail(w,a): return maybe() def again(w,a): return maybe() #--------------------------------------------- def kv(d): return '('+', '.join(['%s: %s' % (k,d[k]) for k in sorted(d.keys()) if k[0] != "_"]) + ')' def shuffle(lst): random.shuffle(lst) return lst class Pretty(object): def __repr__(i): return i.__class__.__name__ + kv(i.__dict__) class o(Pretty): def __init__(i, **adds): i.__dict__.update(adds) #---------------------------------------------- class State(Pretty): def __init__(i,name): i.name, i.out, i.visits = name,[],0 def stop(i) : return i.name[-1] == "." def looper(i) : return i.name[0] == "#" def arrive(i): print(i.name) if not i.looper(): i.visits += 1 assert i.visits <= 5, 'loop detected' def next(i,w): for tran in shuffle(i.out): if tran.gaurd(w,tran): return tran.there return i class Trans(Pretty): def __init__(i,here,gaurd,there): i.here,i.gaurd,i.there = here, gaurd, there T= Trans class Machine(Pretty): def __init__(i): i.states={} i.first = None def state(i,txt): tmp = State(txt) i.states[txt] = tmp i.first = i.first or tmp return tmp def trans(i,*trans): for tran in trans: tran.here.out += [tran] def run(i,seed = 1): print('#', seed) random.seed(seed) w, here = o(), i.first while True: here.arrive() if here.stop(): return w else: here = here.next(w) if __name__ == '__main__': #if len(sys.argv)>1: #fsm0().run(int(sys.argv[1])) #else: fsm0().run(21083)
mit
manishramanan15/SAPUI5
WebContent/d/view/MainContent.view.js
1628
sap.ui.jsview("sap.ui.fame.d.view.MainContent", { /** Specifies the Controller belonging to this View. * In the case that it is not implemented, or that "null" is returned, this View does not have a Controller. * @memberOf d.view.MainContent */ getControllerName : function() { return "sap.ui.fame.d.view.MainContent"; }, /** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed. * Since the Controller is given to this method, its event handlers can be attached right away. * @memberOf d.view.MainContent */ createContent : function(oController) { //var oRouter = oController.getRouter(); var shell = new sap.ui.ux3.Shell("shell", { appTitle:'FAME', worksetItems: [ new sap.ui.ux3.NavigationItem("index", { key: "wi_home", text: "Home" }), new sap.ui.ux3.NavigationItem("example1", { key: "wi_example_1", text: "Example Screen 1", subItems: [ new sap.ui.ux3.NavigationItem("example11", { key: "wi_example_1_1", text: "Example 1_1" }), new sap.ui.ux3.NavigationItem("example12", { key: "wi_example_1_2", text: "Example 1_2" }), new sap.ui.ux3.NavigationItem("example13", { key: "wi_example_1_3", text: "Example 1_3" }) ] }), new sap.ui.ux3.NavigationItem("example2", { key: "wi_example_2", text: "Example Screen 2" }) ], content: [], worksetItemSelected: function(oEvent) { var sSelected = oEvent.getParameter("id"), oHashChanger = sap.ui.core.routing.HashChanger.getInstance(); //oHashChanger.setHash(oRouter.getURL("_" + sSelected)); } }); return shell; } });
mit
Vizzuality/tocapu
public/scripts/controllers/default.js
3511
define([ 'underscore', 'backbone', 'backbone-super', 'handlebars', 'facade', 'config', 'views/abstract/base', 'views/account', 'views/query', 'views/chart', 'views/datatable', 'views/modal', 'collections/data', 'text!templates/default.handlebars', 'text!sql/scatter.pgsql', 'text!sql/pie.pgsql', 'text!sql/dataQuery.pgsql' ], function(_, Backbone, bSuper, Handlebars, fc, Config, BaseView, AccountView, QueryView, ChartView, DataTableView, ModalView, DataCollection, TPL, scatterSQL, pieSQL, dataSQL) { 'use strict'; var DefaultView = BaseView.extend({ el: 'body', template: TPL, scatterTemplate: Handlebars.compile(scatterSQL), pieTemplate: Handlebars.compile(pieSQL), dataQueryTemplate: Handlebars.compile(dataSQL), initialize: function() { var accountView = new AccountView({ el: '#accountView' }); this.addView({ accountView: accountView }); var queryView = new QueryView({ el: '#queryView' }); this.addView({ queryView: queryView }); this.data = new DataCollection(); var chartView = new ChartView({ collection: this.data }); this.addView({ chartView: chartView }); var tableView = new DataTableView({ collection: this.data }); this.addView({ tableView: tableView }); this.setListeners(); }, setListeners: function() { this.appEvents.on('chart:render', this.fetchData, this); }, /** * Fetches the data from the CartoDB account */ fetchData: function() { var template = ''; var columns = {}; _.each(Config.charts[fc.get('graph')].columns, function(name) { columns[name] = fc.get(name); }); var data = { table: fc.get('table'), columns: columns }; switch(fc.get('graph')) { case 'scatter': template = this.scatterTemplate(data); break; case 'pie': template = this.pieTemplate(data); break; case 'byCategory': template = this.pieTemplate(data); break; default: template = this.dataQueryTemplate(data); break; } this.data.fetch({ data: {q: template} }, {reset: true}); }, /** * Opens the embed modal * @param {Object} e the event associated to the click on the link */ openEmbed: function(e) { e.preventDefault(); var url = 'http://'+location.host+'/#embed/'+location.hash.split('#')[1]; var content = '<p>Bla bla bla</p>'; content += '<input type="text" value=\''; content += '<iframe src="'+url+'"></iframe>'; content += '\'>'; new ModalView({ title: 'Embed code', content: content }); }, /** * Opens the share modal * @param {Object} e the event associated to the click on the link */ openShare: function(e) { e.preventDefault(); var content = '<p>Look at this, that\'s amazing!</p>'; content += '<input type="text" value="'; content += location.href; content += '">'; new ModalView({ title: 'Share link', content: content }); }, afterRender: function() { this.$el.find('#embed').on('click', _.bind(this.openEmbed, this)); this.$el.find('#share').on('click', _.bind(this.openShare, this)); }, beforeDestroy: function() { this.data.off(); this.data = null; } }); return DefaultView; });
mit
lexnapoles/bayuk
src/reducers/currentUser.js
869
import { REHYDRATE } from "redux-persist/constants"; import { REGISTER_USER, LOGIN_USER, FETCH_CURRENT_USER } from "../constants/actionTypes"; import { getJwtPayload, isNotEmpty } from "../utils"; const currentUser = (state = {}, action) => { switch (action.type) { case REHYDRATE: { return { ...state, ...action.payload.currentUser }; } case REGISTER_USER.success: case LOGIN_USER.success: { const token = action.payload; const { id } = getJwtPayload(token); return { ...state, id, token }; } case FETCH_CURRENT_USER.failure: return {}; default: return state; } }; export const getCurrentUser = user => ({ ...user }); export const isUserLoggedIn = user => isNotEmpty(user) ? Boolean(user.token) : false; export default currentUser;
mit
albu89/Hive2Hive-dev
org.hive2hive.core/src/main/java/org/hive2hive/core/file/FileChunkUtil.java
4603
package org.hive2hive.core.file; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.util.List; import org.apache.commons.io.FileUtils; import org.hive2hive.core.model.Chunk; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class FileChunkUtil { private static final Logger logger = LoggerFactory.getLogger(FileChunkUtil.class); private FileChunkUtil() { // only static methods } /** * Calculates the number of chunks. This depends on the file size and the chunk size * * @param file the file to chunk * @param chunkSize the size of an individual chunk * @return the number of chunks, if the file is empty, 1 is returned. If file is not existing, 0 is * returned. In case the given chunkSize is smaller or equal to zero, 0 is returned */ public static int getNumberOfChunks(File file, int chunkSize) { if (file == null || !file.exists()) { // no chunk needed return 0; } else if (chunkSize <= 0) { // don't divide by 0 return 0; } long fileSize = FileUtil.getFileSize(file); if (fileSize == 0) { // special case return 1; } return (int) Math.ceil((double) fileSize / Math.abs(chunkSize)); } /** * Returns the chunk of a given file. * * @param file the file to chunk * @param chunkSize the maximum size of a single chunk. If the end of the file has been reached before, * the returned chunk can be smaller. * @param chunkNumber the index of the chunk, starting at 0. When giving 0, the first chunk is read. This * parameter is similar to the offset. * @param chunkId the id of the chunk which should be returned * @return the chunk or null if no data could be read with the given parameter * @throws IOException if the file cannot be read */ public static Chunk getChunk(File file, int chunkSize, int chunkNumber, String chunkId) throws IOException { if (file == null || !file.exists()) { throw new IOException("File does not exist"); } else if (chunkSize <= 0) { throw new IOException("Chunk size cannot be smaller or equal to 0"); } else if (chunkNumber < 0) { throw new IOException("Chunk number cannot be smaller than 0"); } if (FileUtil.getFileSize(file) == 0 && chunkNumber == 0) { // special case: file exists but is empty. // return an empty chunk return new Chunk(chunkId, new byte[0], 0); } int read = 0; long offset = chunkSize * chunkNumber; byte[] data = new byte[chunkSize]; // read the next chunk of the file considering the offset RandomAccessFile rndAccessFile = new RandomAccessFile(file, "r"); rndAccessFile.seek(offset); read = rndAccessFile.read(data); rndAccessFile.close(); if (read > 0) { // the byte-Array may contain many empty slots if last chunk. Truncate it data = truncateData(data, read); return new Chunk(chunkId, data, chunkNumber); } else { return null; } } /** * Truncates a byte array * * @param data * @param read * @return a shorter byte array */ private static byte[] truncateData(byte[] data, int numOfBytes) { // shortcut if (data.length == numOfBytes) { return data; } else { byte[] truncated = new byte[numOfBytes]; for (int i = 0; i < truncated.length; i++) { truncated[i] = data[i]; } return truncated; } } /** * Reassembly of multiple file parts to a single file. Note that the file parts need to be sorted * beforehand * * @param fileParts the sorted file parts. * @param destination the destination * @throws IOException in case the files could not be read or written. */ public static void reassembly(List<File> fileParts, File destination) throws IOException { if (fileParts == null || fileParts.isEmpty()) { logger.error("File parts can't be null."); return; } else if (fileParts.isEmpty()) { logger.error("File parts can't be empty."); return; } else if (destination == null) { logger.error("Destination can't be null"); return; } if (destination.exists()) { // overwrite if (destination.delete()) { logger.debug("Destination gets overwritten. destination = '{}'", destination); } else { logger.error("Couldn't overwrite destination. destination = '{}'", destination); return; } } for (File filePart : fileParts) { // copy file parts to the new location, append FileUtils.writeByteArrayToFile(destination, FileUtils.readFileToByteArray(filePart), true); if (!filePart.delete()) { logger.warn("Couldn't delete temporary file part. filePart = '{}'", filePart); } } } }
mit
robo-coin/robocoin-wallet-source
src/qt/locale/bitcoin_zh_CN.ts
112165
<?xml version="1.0" ?><!DOCTYPE TS><TS language="zh_CN" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About robocoin</source> <translation>关于莱特币</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;robocoin&lt;/b&gt; version</source> <translation>&lt;b&gt;莱特币&lt;/b&gt;版本</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> 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.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>版权</translation> </message> <message> <location line="+0"/> <source>The robocoin developers</source> <translation>robocoin-qt 客户端开发团队</translation> </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>&amp;新建地址</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your robocoin 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>这是您用来收款的莱特币地址。为了标记不同的资金来源,建议为每个付款人保留不同的收款地址。</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;复制地址</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>显示二维码</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a robocoin address</source> <translation>签名消息,证明这个地址属于您。</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>&amp;导出</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified robocoin address</source> <translation>验证消息,确保消息是由指定的莱特币地址签名过的。</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;验证消息</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;删除</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your robocoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>这是您用来付款的莱特币地址。在付款前,请总是核实付款金额和收款地址。</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>复制 &amp;标签</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;编辑</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>付款</translation> </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>逗号分隔文件 (*.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>密码对话框</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>输入钱包的新密码。&lt;br/&gt;使用的密码请至少包含&lt;b&gt;10个以上随机字符&lt;/&gt;,或者是&lt;b&gt;8个以上的单词&lt;/b&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 ROBOCOINS&lt;/b&gt;!</source> <translation>警告:如果您加密了您的钱包,但是忘记了密码,你将会&lt;b&gt;丢失所有的莱特币&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>您确定需要为钱包加密吗?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>重要提示:您以前备份的钱包文件应该替换成最新生成的加密钱包文件(重新备份)。从安全性上考虑,您以前备份的未加密的钱包文件,在您使用新的加密钱包后将无效,请重新备份。</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>警告:大写锁定键处于打开状态!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>钱包已加密</translation> </message> <message> <location line="-56"/> <source>robocoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your robocoins from being stolen by malware infecting your computer.</source> <translation>将关闭软件以完成加密过程。 请您谨记:钱包加密并不是万能的,电脑中毒,您的莱特币还是有可能丢失。</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>钱包加密失败</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>由于一个本地错误,加密钱包操作已经失败。您的钱包没有被加密。</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>密码不匹配。</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>钱包解锁失败</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>用于解密钱包的密码不正确。</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>钱包解密失败。</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>修改钱包密码成功。</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>对&amp;消息签名...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>正在与网络同步...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;概况</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 robocoin</source> <translation>显示莱特币的相关信息</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>关于 &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>显示Qt相关信息</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;选项...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;加密钱包...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;备份钱包...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;修改密码...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>正在从磁盘导入数据块...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>正在为数据块建立索引...</translation> </message> <message> <location line="-347"/> <source>Send coins to a robocoin address</source> <translation>向一个莱特币地址发送莱特币</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for robocoin</source> <translation>设置选项</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>备份钱包到其它文件夹</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>修改钱包加密口令</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>&amp;调试窗口</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>&amp;验证消息...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>robocoin</source> <translation>莱特币</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>钱包</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;发送</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;接收</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;地址</translation> </message> <message> <location line="+22"/> <source>&amp;About robocoin</source> <translation>&amp;关于莱特币</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>显示或隐藏主窗口</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>对钱包中的私钥加密</translation> </message> <message> <location line="+7"/> <source>Sign messages with your robocoin addresses to prove you own them</source> <translation>用莱特币地址关联的私钥为消息签名,以证明您拥有这个莱特币地址</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified robocoin addresses</source> <translation>校验消息,确保该消息是由指定的莱特币地址所有者签名的</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;文件</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;设置</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;帮助</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>分页工具栏</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>robocoin client</source> <translation>莱特币客户端</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to robocoin network</source> <translation><numerusform>到莱特币网络的连接共有%n条</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>No block source available...</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>%1 / %2 个交易历史的区块已下载</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>已处理 %1 个交易历史数据块。</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n 小时前</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n 天前</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n 周前</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>落后 %1 </translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>最新收到的区块产生于 %1。</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>在此之后的交易尚未可见</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>错误</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>信息</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>该交易的字节数超标。您可以选择支付%1的交易费给处理您的交易的网络节点,有助于莱特币网络的运行。您愿意支付这笔交易费用吗?</translation> </message> <message> <location line="-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 robocoin address or malformed URI parameters.</source> <translation>URI无法解析!原因可能是莱特币地址不正确,或者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>钱包已被&lt;b&gt;加密&lt;/b&gt;,当前为&lt;b&gt;解锁&lt;/b&gt;状态</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>钱包已被&lt;b&gt;加密&lt;/b&gt;,当前为&lt;b&gt;锁定&lt;/b&gt;状态</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. robocoin can no longer continue safely and will quit.</source> <translation>发生严重错误。</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>&amp;标签</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>&amp;地址</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>输入的地址 &quot;%1&quot; 已经存在于地址簿。</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid robocoin address.</source> <translation>您输入的 &quot;%1&quot; 不是合法的莱特币地址.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>无法解锁钱包</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>密钥创建失败.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>robocoin-Qt</source> <translation>robocoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>版本</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>使用:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>命令行选项</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>UI选项</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>设置语言, 例如 &quot;de_DE&quot; (缺省: 系统语言)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>启动时最小化 </translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>启动时显示版权页 (缺省: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>选项</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;主要的</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>支付交易 &amp;费用</translation> </message> <message> <location line="+31"/> <source>Automatically start robocoin after logging in to the system.</source> <translation>登录系统后自动开启莱特币客户端</translation> </message> <message> <location line="+3"/> <source>&amp;Start robocoin on system login</source> <translation>启动时&amp;运行</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>恢复客户端的缺省设置</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>恢复缺省设置</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;网络</translation> </message> <message> <location line="+6"/> <source>Automatically open the robocoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>自动在路由器中打开莱特币端口。只有当您的路由器开启 UPnP 选项时此功能才有效。</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>使用 &amp;UPnP 映射端口</translation> </message> <message> <location line="+7"/> <source>Connect to the robocoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>通过代理服务器连接莱特币网络(例如:通过Tor连接)</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;通过Socks代理连接:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>代理服务器&amp;IP:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>代理服务器IP (如 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;端口:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>代理端口(例如 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>Socks &amp;版本</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Socks代理版本 (例如 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;窗口</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>最小化窗口后仅显示托盘图标</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;最小化到托盘</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>当窗口关闭时程序最小化而不是退出。当使用该选项时,程序只能通过在菜单中选择退出来关闭</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>单击关闭按钮最小化</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;显示</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>用户界面&amp;语言:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting robocoin.</source> <translation>在这里设置用户界面的语言。设置将在客户端重启后生效。</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;莱特币金额单位:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>选择莱特币单位。</translation> </message> <message> <location line="+9"/> <source>Whether to show robocoin addresses in the transaction list or not.</source> <translation>是否需要在交易清单中显示莱特币地址。</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>在交易清单中&amp;显示莱特币地址</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;确定</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;取消</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;应用</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>缺省</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>确认恢复缺省设置</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>某些设置选项需要重启客户端才能生效</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>您希望继续吗?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting robocoin.</source> <translation>需要重启客户端软件才能生效。</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 robocoin network after a connection is established, but this process has not completed yet.</source> <translation>现在显示的消息可能是过期的. 在连接上莱特币网络节点后,您的钱包将自动与网络同步,但是这个过程还没有完成.</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>钱包</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>&lt;b&gt;最近交易记录&lt;/b&gt;</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 robocoin: click-to-pay handler</source> <translation>暂时无法启动莱特币:点击支付功能</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>二维码对话框</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>请求付款</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>金额:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>标签:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>消息:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;另存为</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>将 URI 转换成二维码失败.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>输入的金额非法,请检查。</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>URI 太长, 请试着精简标签/消息的内容.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>保存二维码</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG图像文件(*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>客户端名称</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+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>&amp;信息</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>使用OpenSSL版本</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>启动时间</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>网络</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>连接数</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>当前为莱特币测试网络</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>数据链</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>当前数据块数量</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>预计数据块数量</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>上一数据块时间</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;打开</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>命令行选项</translation> </message> <message> <location line="+7"/> <source>Show the robocoin-Qt help message to get a list with possible robocoin command-line options.</source> <translation>显示robocoin命令行选项帮助信息</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;显示</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;控制台</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>创建时间</translation> </message> <message> <location line="-104"/> <source>robocoin - Debug window</source> <translation>莱特币 - 调试窗口</translation> </message> <message> <location line="+25"/> <source>robocoin Core</source> <translation>莱特币核心</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>调试日志文件</translation> </message> <message> <location line="+7"/> <source>Open the robocoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>打开当前目录中的调试日志文件。日志文件大的话可能要等上几秒钟。</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>清空控制台</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the robocoin RPC console.</source> <translation>欢迎来到 RPC 控制台.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>使用上下方向键浏览历史, &lt;b&gt;Ctrl-L&lt;/b&gt;清除屏幕.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>使用 &lt;b&gt;help&lt;/b&gt; 命令显示帮助信息.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+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>清除 &amp;所有</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>余额:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>确认并发送货币</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>发送</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; 到 %2 (%3)</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?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> 和 </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>收款人地址不合法,请检查。</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>支付金额必须大于0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>金额超出您的账上余额。</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>计入 %1 交易费后的金额超出您的账上余额。</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>发现重复的地址, 每次只能对同一地址发送一次.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>错误:创建交易失败!</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>错误: 交易被拒绝. 如果您使用的是备份钱包,可能存在两个钱包不同步的情况,另一个钱包中的莱特币已经被使用,但本地的这个钱包尚没有记录。</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>表单</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>金额</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>付款给这个地址 (例如 Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>为这个地址输入一个标签,以便将它添加到您的地址簿</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 robocoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>请输入莱特币地址 (例如: 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>签名</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>复制当前签名至剪切板</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this robocoin address</source> <translation>签名消息,证明这个地址属于您。</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>消息签名</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>清空所有签名消息栏</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>清除 &amp;所有</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;验证消息</translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>在下面输入签名地址,消息(请确保换行符、空格符、制表符等等一个不漏)和签名以验证消息。请确保签名信息准确,提防中间人攻击。</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>用于签名消息的地址(例如: Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified robocoin address</source> <translation>验证消息,确保消息是由指定的莱特币地址签名过的。</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>验证消息签名</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>清空所有验证消息栏</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a robocoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>请输入莱特币地址 (例如: Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>单击“签名消息“产生签名。</translation> </message> <message> <location line="+3"/> <source>Enter robocoin signature</source> <translation>输入莱特币签名</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>钱包解锁动作取消。</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 robocoin developers</source> <translation>robocoin-qt 客户端开发团队</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>至 %1 个数据块时开启</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1 / 离线</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/未确认</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 确认项</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>状态</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>通过 %n 个节点广播</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>源</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>生成</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>来自</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>到</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>自己的地址</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>标签</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>收入</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>将在 %n 个数据块后成熟</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>未被接受</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>支出</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>交易费</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>净额</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>消息</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>备注</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>交易ID</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 20 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>新挖出的莱特币必须等确20个确认才能使用。您生产出的数据块,将被广播到全网并添加到数据块链。如果入链失败,状态将变为“未被接受”,意味着您的数据块竞争失败,挖出的莱特币将不能使用。当某个节点先于你几秒生产出新的数据块,这种情况会偶尔发生。</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>调试信息</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>交易</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>输入</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>金额</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>正确</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>错误</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, 未被成功广播</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Open for %n more block</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>未知</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+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><numerusform>Open for %n more block</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>至 %1 个数据块时开启</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>离线 (%1 个确认项)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>未确认 (%1 / %2 条确认信息)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>已确认 (%1 条确认信息)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>挖矿收入余额将在 %n 个数据块后可用</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>此数据块未被其他节点接收,并可能不被接受!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>已生成但未被接受</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>接收于</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>收款来自</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>发送到</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>付款给自己</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>挖矿所得</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/a)</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>复制交易编号</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>编辑标签</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>显示交易详情</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>导出交易数据</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>逗号分隔文件(*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>已确认</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>类别</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>标签</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>地址</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>金额</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>导出错误</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>无法写入文件 %1。</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>范围:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>到</translation> </message> </context> <context> <name>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>备份钱包</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>钱包文件(*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>备份失败</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>备份钱包到其它文件夹失败.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>备份成功</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>钱包数据成功存储到新位置</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>robocoin 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 robocoind</source> <translation>发送命令到服务器或者 robocoind </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: robocoin.conf)</source> <translation>指定配置文件 (默认为 robocoin.conf) </translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: robocoind.pid)</source> <translation>指定 pid 文件 (默认为 robocoind.pid) </translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>指定数据目录 </translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>设置数据库缓冲区大小 (缺省: 25MB)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 6913 or testnet: 16913)</source> <translation>监听端口连接 &lt;port&gt; (缺省: 6913 or testnet: 16913)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>最大连接数 &lt;n&gt; (缺省: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>连接一个节点并获取对端地址, 然后断开连接</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>指定您的公共地址</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Threshold for disconnecting misbehaving peers (缺省: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Number of seconds to keep misbehaving peers from reconnecting (缺省: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>设置RPC监听端口%u时发生错误, IPv4:%s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 6914 or testnet: 16914)</source> <translation>JSON-RPC连接监听端口&lt;port&gt; (缺省:6914 testnet:16914)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>接受命令行和 JSON-RPC 命令 </translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>在后台运行并接受命令 </translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>使用测试网络 </translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>接受来自外部的连接 (缺省: 如果不带 -proxy or -connect 参数设置为1)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=robocoinrpc 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;robocoin Alert&quot; admin@foo.com </source> <translation>%s, 您必须在配置文件设置rpcpassword: %s 建议您使用下面的随机密码: rpcuser=robocoinrpc rpcpassword=%s (您无需记住此密码) 用户名和密码 必! 须! 不一样。 如果配置文件不存在,请自行建立一个只有所有者拥有只读权限的文件。 推荐您开启提示通知以便收到错误通知, 像这样: alertnotify=echo %%s | mail -s &quot;robocoin Alert&quot; admin@foo.com </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>在IPv6模式下设置RPC监听端口 %u 失败,返回到IPv4模式: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>绑定指定的IP地址开始监听。IPv6地址请使用[host]:port 格式</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. robocoin is probably already running.</source> <translation>无法给数据目录 %s上锁。本软件可能已经在运行。</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>错误:该交易被拒绝!发生这种错误的原因可能是:钱包中的莱特币已经被用掉,有可能您复制了wallet.dat钱包文件,然后用复制的钱包文件支付了莱特币,但是这个钱包文件中没有记录。</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>错误:因为该交易的数量、复杂度或者动用了刚收到不久的资金,您需要支付不少于%s的交易费用。</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>当收到相关通知时执行命令(命令行中的 %s 的替换为消息)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>当最佳区块变化时执行命令 (命令行中的 %s 会被替换成区块哈希值)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>这是测试用的预发布版本 - 请谨慎使用 - 不要用来挖矿,或者在正式商用环境下使用</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>警告:-paytxfee 交易费设置得太高了!每笔交易都将支付交易费。</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>警告:显示的交易可能不正确!您需要升级客户端软件,或者网络上的其他节点需要升级。</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong robocoin will not work properly.</source> <translation>警告:请检查电脑的日期时间设置是否正确!时间错误可能会导致莱特币客户端运行异常。</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>警告:钱包文件wallet.dat读取失败!最重要的公钥、私钥数据都没有问题,但是交易记录或地址簿数据不正确,或者存在数据丢失。</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>警告:钱包文件wallet.dat损坏! 原始的钱包文件已经备份到%s目录下并重命名为{timestamp}.bak 。如果您的账户余额或者交易记录不正确,请使用您的钱包备份文件恢复。</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>尝试从损坏的钱包文件wallet.dat中恢复私钥</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>数据块创建选项:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>仅连接到指定节点</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>检测发现数据块数据库损坏。请使用 -reindex参数重启客户端。</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>发现自己的IP地址(缺省:不带 -externalip 参数监听时设置为1)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>你想现在就重建块数据库吗?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>初始化数据块数据库出错</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Error initializing wallet database environment %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>导入数据块数据库出错</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>导入数据块数据库出错</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>错误:磁盘剩余空间低!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>错误:钱包被锁定,无法创建交易!</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>错误:系统出错。</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>监听端口失败。请使用 -listen=0 参数。</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>无法读取数据块信息</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>读取数据块失败</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>无法同步数据块索引</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>无法写入数据块索引</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>无法写入数据块信息</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>无法写数据块</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>无法写入文件信息</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>无法写入coin数据库</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>无法写入交易索引</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>无法写入回滚信息</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>通过DNS查找节点(缺省:1 除非使用 -connect 选项)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>启动时检测多少个数据块(缺省:288,0=所有)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>How thorough the block verification is (0-4, default: 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>重新为当前的blk000??.dat文件建立索引</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>设置使用调用服务 RPC 的线程数量(默认:4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>正在验证数据库的完整性...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>正在检测钱包的完整性...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>从blk000??.dat文件导入数据块</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation>信息</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>非法的 -tor 地址:&apos;%s&apos; </translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation 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>维护一份完整的交易索引(缺省:0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>每个连接的最大接收缓存,&lt;n&gt;*1000 字节(缺省:5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>每个连接的最大发送缓存,&lt;n&gt;*1000 字节(缺省:1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>仅接受符合客户端检查点设置的数据块文件</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>仅连接至指定网络的节点&lt;net&gt;(IPv4, IPv6 或者 Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>输出额外的调试信息。打开所有 -debug* 开关</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>输出额外的网络调试信息</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>为调试输出信息添加时间戳</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the robocoin Wiki for SSL setup instructions)</source> <translation>SSL选项:(参见robocoin Wiki关于SSL设置栏目)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>请选择Socks代理服务器版本 (4 或 5, 缺省: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>跟踪/调试信息输出到控制台,不输出到debug.log文件</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>跟踪/调试信息输出到 调试器debugger</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>设置最大数据块大小(缺省:250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>设置最小数据块大小(缺省:0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>客户端启动时压缩debug.log文件(缺省:no-debug模式时为1)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>设置连接超时时间(缺省:5000毫秒)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>系统错误:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation 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>使用代理服务器访问隐藏服务(缺省:同 -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>JSON-RPC连接用户名 </translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>警告:该软件版本已过时,请升级!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>You need to rebuild the databases using -reindex to change -txindex</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>钱包文件wallet.dat损坏,抢救备份失败</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>JSON-RPC连接密码 </translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>允许从指定IP接受到的JSON-RPC连接 </translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>向IP地址为 &lt;ip&gt; 的节点发送指令 (缺省: 127.0.0.1) </translation> </message> <message> <location line="-20"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>当最佳数据块变化时执行命令 (命令行中的 %s 会被替换成数据块哈希值)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>将钱包升级到最新的格式</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>设置密钥池大小为 &lt;n&gt; (缺省: 100) </translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>重新扫描数据链以查找遗漏的交易 </translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>为 JSON-RPC 连接使用 OpenSSL (https)连接</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>服务器证书 (默认为 server.cert) </translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>服务器私钥 (默认为 server.pem) </translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>可接受的加密器 (默认为 TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH) </translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>该帮助信息 </translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>无法绑定本机端口 %s (返回错误消息 %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>通过 socks 代理连接</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>使用 -addnode, -seednode 和 -connect选项时允许DNS查找</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>正在加载地址...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>wallet.dat钱包文件加载错误:钱包损坏</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of robocoin</source> <translation>wallet.dat钱包文件加载错误:请升级到最新robocoin客户端</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart robocoin to complete</source> <translation>钱包文件需要重写:请退出并重新启动robocoin客户端</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>wallet.dat钱包文件加载错误</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>非法的代理地址: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>被指定的是未知网络 -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>被指定的是未知socks代理版本: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>无法解析 -bind 端口地址: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>无法解析 -externalip 地址: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>非法金额 -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>金额不对</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>金额不足</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>加载数据块索引...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>添加节点并与其保持连接</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. robocoin is probably already running.</source> <translation>无法在本机绑定 %s 端口 . 莱特币客户端软件可能已经在运行.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>每发送1KB交易所需的费用</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>正在加载钱包...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>无法降级钱包格式</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>无法写入缺省地址</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>正在重新扫描...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>加载完成</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>使用 %s 选项</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>错误</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>您必须在配置文件中加入选项 rpcpassword : %s 如果配置文件不存在,请新建,并将文件权限设置为仅允许文件所有者读取.</translation> </message> </context> </TS>
mit
resd/massive-octo-batman
src/main/java/algorithm/bastrikov/Work1OldStableVersion.java
7296
package algorithm.bastrikov; import algorithm.util.DuplicatesMethods; import static algorithm.util.DuplicatesMethods.remove; public class Work1OldStableVersion extends WorkBase implements Methods { /*double[][] M0 = { // Need to test {0, 0, 83, 9, 30, 6, 50}, {0, 0, 66, 37, 17, 12, 26}, {29, 1, 0, 19, 0, 12, 5}, {32, 83, 66, 0, 49, 0, 80}, {3, 21, 56, 7, 0, 0, 28}, {0, 85, 8, 42, 89, 0, 0}, {18, 0, 0, 0, 58, 13, 0} };*/ /*private double[][][] M0ch; // TODO Deal with this private double[][][] M1ch; private double[][][] M2ch; private double[][][] D1ch; private double[][][] D2ch; private double[][][] DDch; private boolean saveAdditionalResult;*/ public Work1OldStableVersion(double[][] M0) { originalSize = M0.length; } /*private double[][] doMfromM0(double[][] M0) {// Метод для вычисление матрицы М double[][] M = new double[M0.length][M0.length]; double alfa = 0.005; for (int i = 0; i < M.length; i++) { for (int j = 0; j < M.length; j++) { if (i != j) M[i][j] = M0[i][j] - alfa * dpaij(M0, i, j); } } return M; } private double[][] doDfromM(double[][] M0, double[][] M1) {// Метод для вычисление матрицы D double[][] D = new double[M0.length][M0.length]; for (int i = 0; i < D.length; i++) { for (int j = 0; j < D.length; j++) { if (i != j) D[i][j] = dpaij(M1, i, j) - dpaij(M0, i, j); } } return D; } private double[][] doDDfromD(double[][] M0, double[][] D1, double[][] D2) { // Метод для вычисление матрицы приведений DDch double[][] DD = new double[D1.length][D1.length]; for (int i = 0; i < DD.length; i++) { for (int j = 0; j < DD.length; j++) { if (i != j && M0[i][j] == 0) DD[i][j] = D2[i][j] - D1[i][j]; } } return DD; }*/ @Override public int[] getD(double[][] DD, int i) { int[] d; if (i == 0) { d = maxForFirstElement(DD); // Метод для получение максимального элемента для первой матрицы DDch } else { d = max(DD, beforeP[0], beforeP[1]);// Метод для получение максимального элемента для последующих матриц DDch } return d; } private int[] maxForFirstElement(double[][] DD) { double max = -Double.MAX_VALUE; int di = 0, dj = 0; for (int i = 0; i < DD.length; i++) { // Цикл для прохода по строкам for (int j = 0; j < DD.length; j++) { // и столбцам матрицы DDch if (i != j && DD[i][j] > max) { // и нахождения координат max = DD[i][j]; // максимального элемента di = i; dj = j; } } } return new int[]{di, dj}; } @SuppressWarnings("ConstantConditions") private int[] max(double[][] DD, int ni, int nj) { double maxValue1 = -Double.MAX_VALUE; double maxValue2 = -Double.MAX_VALUE; int di = 0, dj = 0; for (int i = 0; i < DD.length; i++) { if (i != nj && DD[i][nj] > maxValue1) {// Поиск максимального элемента в строке maxValue1 = DD[i][nj]; di = i; } if (i != ni && DD[ni][i] > maxValue2) {// Поиск максимального элемента в столбце maxValue2 = DD[ni][i]; dj = i; } } return (maxValue1 >= maxValue2) ? new int[]{di, nj} : new int[]{ni, dj}; // Возврат максимального элемента } @Override @SuppressWarnings("Duplicates") /** Duplicate in @path algorithm.near.NearAlgorithmBase */ // Don't know how to fix this public void getPath(int[] d, int i) { int x = d[0]; // Координаты максимального элемента int y = d[1]; p[i][0] = mi[x];// Соответствие по данным координатам пути в исходной матрице p[i][1] = mj[y]; if (x <= y) {// Сохранение координат текущего максимального элемента в редуцированной матрице beforeP[0] = x; beforeP[1] = x; } else { beforeP[1] = x - 1; beforeP[0] = x - 1; } mi[x] = mi[y];// Необходимые приведения mi = remove(mi, y); mj = remove(mj, y); } @Override public double[][] doM0(double[][] M0, int i, int j) { M0[j][i] = 0; // Обнуление j-го и i-го элемента для сохранения гамильтонова цикла M0 = changeJI(M0, i, j); // Смена i-й строки и j-го столбца местами return setElementsM0toM(M0, j);// Новая матрица без j-й строки и j-го столбца } private double[][] changeJI(double[][] M0, int di, int dj) {// Меняем строку со столбцом double temp; for (int j = 0; j < M0.length; j++) { temp = M0[dj][j]; M0[dj][j] = M0[di][j]; M0[di][j] = temp; } return M0; } private double[][] setElementsM0toM(double[][] M0, int dj) {// Вычитаем строку и столбец, возвращаем полученную редуцированную матрицу return DuplicatesMethods.setElementsM0toM(M0, dj); } @Override public void computeLastElement() { DuplicatesMethods.computeLastElement(p, mi, mj, originalSize); } @Override public int[][] getP() { return p; } /*public void setSaveAdditionalResult(boolean saveAdditionalResult) { Work1OldStableVersion.saveAdditionalResult = saveAdditionalResult; } public double[][][] getM0ch() { return M0ch; } public void setOriginalsize(int originalSize) { Work1OldStableVersion.originalSize = originalSize; } *//** * @return 3d matrix that contents all M1ch matrix. *//* public double[][][] getM1ch() { return M1ch; } public double[][][] getM2ch() { return M2ch; } public double[][][] getD1ch() { return D1ch; } public double[][][] getD2ch() { return D2ch; } public double[][][] getDDch() { return DDch; }*/ /** * Цикл * 1. Найти ДД. * 2. Найти макс эдемент ДД. * 3. Найти соотв. элемент в пути(исходной матрице). * 4. Преобразовать матрицу. */ }
mit
sineflow/ElasticsearchBundle
Document/Provider/AbstractProvider.php
1173
<?php namespace Sineflow\ElasticsearchBundle\Document\Provider; use Sineflow\ElasticsearchBundle\Document\DocumentInterface; /** * Base document provider */ abstract class AbstractProvider implements ProviderInterface { /** * Returns a PHP Generator for iterating over the full dataset of source data that is to be inserted in ES * The returned data can be either a document entity or an array ready for direct sending to ES * * @return \Generator<DocumentInterface|array> */ abstract public function getDocuments(); /** * Build and return a document entity from the data source * The returned data can be either a document entity or an array ready for direct sending to ES * * @param int|string $id * * @return DocumentInterface|array */ abstract public function getDocument($id); /** * Returns the number of Elasticsearch documents to persist in a single bulk request * If null is returned, the 'bulk_batch_size' of the Connection will be used * * @return int|null */ public function getPersistRequestBatchSize() : ?int { return null; } }
mit
maximebedard/remets
app/services/acquaintances_providers/github.rb
86
module AcquaintancesProviders class Github def fetch [] end end end
mit
kitboy/docker-shop
html/ecshop3/ecshop/h5/modules/my-balance/my-balance.controller.js
2603
(function () { 'use strict'; angular .module('app') .controller('MyBalanceController', MyBalanceController); MyBalanceController.$inject = ['$scope', '$http', '$window', '$location', '$state', '$rootScope', 'API', 'BalanceModel']; function MyBalanceController($scope, $http, $window, $location, $state, $rootScope, API, BalanceModel) { $scope.touchBalanceDetail = _touchBalanceDetail; $scope.touchWithDrawHistory = _touchWithDrawHistory; $scope.touchWithDraw = _touchWithDraw; $scope.touchDialogCancel = _touchDialogCancel; $scope.touchDialogConfirm = _touchDialogConfirm; $scope.touchWithDrawAll = _touchWithDrawAll; $scope.balanceModel = BalanceModel; $scope.input = { withdraw : "", memo : "" } function _touchBalanceDetail() { $state.go('balance-history', {}); } function _touchWithDrawHistory() { $state.go('withdraw-history', {}); } function _touchWithDraw() { $scope.showDialog = true; } function _touchWithDrawAll() { $scope.input.withdraw = parseFloat($scope.balanceModel.balanceAmount); } function _touchDialogCancel() { $scope.showDialog = false; $scope.input.memo = ""; $scope.input.withdraw = ""; } function _touchDialogConfirm() { var withDraw = parseFloat($scope.input.withdraw); if(isNaN(withDraw)){ $scope.toast('请输入数字'); return; } if (withDraw <= 0) { $scope.toast('金额不能小于零'); return; } if (withDraw > parseFloat($scope.balanceModel.balanceAmount)) { $scope.toast('金额超出提现范围'); return; } if ($scope.input.memo.length == 0) { $scope.toast('Memo不能为空'); return; } var params = {}; params.cash = withDraw; params.memo = $scope.input.memo; API.withdraw.submit(params).then(function (withdraw) { $scope.balanceModel.reload(); $scope.cancellingOrder = null; $scope.showDialog = false; $state.go('withdraw-success', {withdraw: withdraw.cash,member_memo:withdraw.member_memo}); }); } $scope.balanceModel.reload(); } })();
mit
ntaloventi/edocument
application/controllers/Mydept.php
19082
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Mydept extends CI_Controller { public function __construct() { parent::__construct(); $this->load->library('edocumentlibrary'); $this->load->model('edocumentmodel'); $apps_url = base_url().strtolower(get_class()).'/'; // define constant for easy url handle define('APPSURL', $apps_url); $this->redirect_toprofile(); } private function redirect_toprofile() { $get_user = $this->edocumentlibrary->getUser(); $get_department = $this->edocumentmodel->getTable('privilege', array('username' => $get_user['sso_username'], 'subject' => 'department'), 'isexisting'); if ($get_department == 'notexist') { header('Location: '.base_url().'myprofile'); } } public function auto_create_deptprofile() { $get_user = $this->edocumentlibrary->getUser(); $dept_dir = $this->cli_path($get_user['department']); $is_exist = exec("[ ! -d Data/".$dept_dir." ] && echo 'not_found'"); if ($is_exist == 'not_found') { exec('mkdir Data/'.$dept_dir); } } public function index() { // create dept folder if not exist $this->auto_create_deptprofile(); $get_user = $this->edocumentlibrary->getUser(); $get_privilege = $this->edocumentmodel->getTable('privilege', array('username' => $get_user['sso_username']), 'getdata'); $get_left_menu = $this->edocumentlibrary->getButtons($get_privilege, 'department', 'nofilter'); $get_filefolder = $this->edocumentmodel->getTable('filefolder', array('location' => 'Data/'.$get_user['department'].'/'), 'getdata'); $get_content = $this->edocumentlibrary->getFilefolder($get_filefolder, 'Data/'.$get_user['department'].'/', $get_left_menu['folder_button'], $get_left_menu['file_button'], '', APPSURL); $data['get_user'] = $get_user; $data['get_content'] = $get_content; $data['get_left_menu'] = $get_left_menu; $data['title'] = 'mydept'; $data['content'] = "v_mydept"; $this->load->view('layout', $data); } // all request filtered here public function check_access() { if (isset($_POST['pathuri'])) { $pathuri = base64_decode($_POST['pathuri']); $arr_pathuri = explode('/', $pathuri); $request = $_POST['request']; $get_user = $this->edocumentlibrary->getUser(); //allowable form to send $arr_request = array('newfolder', 'upload', 'search', 'share', 'rename', 'delete'); //only owner who can access if ($arr_pathuri[1] == $get_user['department']) { if (in_array($request, $arr_request)) { $get_form = $this->edocumentmodel->getTable('form', array('name' => $request), 'getdata'); $form = str_replace('action="#action_url#', 'action="'.APPSURL, $get_form[0]->formcontent); echo $form; } elseif ($request == 'view') { $doctype = $_POST['doctype']; if ($doctype == 'folder') { $url = APPSURL.'access_filefolder?q='.$_POST['pathuri']; echo $url; } elseif ($doctype == 'file') { $ext_file = substr($pathuri, -5, -1); if ($ext_file == 'docx' ||$ext_file == 'xlsx') { $extfile = $ext_file; } else { $extfile = substr($pathuri, -4, -1); } $json = json_encode( array( 'url' => base_url().substr($pathuri, 0, -1), 'department' => $get_user['department'], 'extfile' => $extfile ) ); echo APPSURL.'view_document?q='.base64_encode($json); } } elseif ($request == 'download') { $ext_file = substr($pathuri, -5, -1); if ($ext_file == 'docx' ||$ext_file == 'xlsx') { $extfile = $ext_file; } else { $extfile = substr($pathuri, -4, -1); } $json = json_encode( array( 'url' => base_url().substr($pathuri, 0, -1), 'department' => $get_user['department'], 'extfile' => $extfile ) ); echo APPSURL.'download_document?q='.base64_encode($json); } else { $get_form = $this->edocumentmodel->getTable('form', array('name' => 'reject'), 'getdata'); echo $get_form[0]->formcontent; } } else { $get_form = $this->edocumentmodel->getTable('form', array('name' => 'reject'), 'getdata'); echo $get_form[0]->formcontent; } } else { $this->load->view('notfound'); } } public function create_folder() { if (isset($_POST['foldername'])) { $location = base64_decode($_POST['location']); $foldername = $_POST['foldername']; $datetime = date("Y-m-d h:i:s"); $get_user = $this->edocumentlibrary->getUser(); if ($foldername != '') { // check is new folder name exixting $check_name = $this->edocumentmodel->getTable('filefolder', array('name' => $foldername, 'type' => 'folder', 'location' => $location), 'isexisting'); if ($check_name == 'notexist') { $path = $this->cli_path($location); $folder_dir = $this->cli_path($foldername); // cli crete directory/folder exec("mkdir ".$path."/".$folder_dir); $dataquery = array('id' => '', 'name' => $foldername, 'type' => 'folder', 'location' => $location, 'ownby' => $get_user['sso_username'], 'times' => $datetime); $this->edocumentmodel->insertTable('filefolder', $dataquery); echo "<script>alert('berhasil membuat folder'+'\\n ".$foldername."'); window.location.href = '".APPSURL."access_filefolder?q=".$_POST['location']."';</script>"; } else { echo "<script>alert('folder sudah ada'); window.location.href = '".APPSURL."access_filefolder?q=".$_POST['location']."';</script>"; } } else { echo "<script>alert('harap isi nama folder'); window.location.href = '".APPSURL."access_filefolder?q=".$_POST['location']."';</script>"; } } else { $this->load->view('notfound'); } } public function upload_file() { if (isset($_POST['location'])) { // directive with .htaccess ini_set('upload_max_filesize', '100M'); ini_set('post_max_size', '100M'); ini_set('max_input_time', 300); ini_set('max_execution_time', 300); $get_user = $this->edocumentlibrary->getUser(); $location = base64_decode($_POST['location']); $datetime = date("Y-m-d h:i:s"); $files = $_FILES; $config['upload_path'] = $location; $config['allowed_types'] = 'gif|jpg|png|pdf|xls|xlsx|doc|docx'; //$config['max_size'] = 100; //$config['max_width'] = 1024; //$config['max_height'] = 768; $config['remove_spaces'] = FALSE; $this->load->library('upload', $config); $count = count($_FILES['userfile']['name']); for ($i=0; $i < $count; $i++) { $_FILES['userfile']['name'] = $files['userfile']['name'][$i]; $_FILES['userfile']['type'] = $files['userfile']['type'][$i]; $_FILES['userfile']['tmp_name'] = $files['userfile']['tmp_name'][$i]; $_FILES['userfile']['error'] = $files['userfile']['error'][$i]; $_FILES['userfile']['size'] = $files['userfile']['size'][$i]; //name check skip if existing $datacheck = $this->edocumentmodel->getTable('filefolder', array('name' => $_FILES['userfile']['name'], 'type' => 'file', 'location' => $location), 'isexisting'); if ($datacheck == 'notexist' && $_FILES['userfile']['name'] != null) { $this->upload->do_upload(); $dataquery = array('id' => '', 'name' => $_FILES['userfile']['name'], 'type' => 'file', 'location' => $location, 'ownby' => $get_user['sso_username'], 'times' => $datetime); $this->edocumentmodel->insertTable('filefolder', $dataquery); } } header('Location: '.APPSURL.'access_filefolder?q='.$_POST['location']); } else { $this->load->view('notfound'); } } public function search_filefolder() { if (isset($_POST['searchname'])) { $search_key = $_POST['searchname']; $back_location = $_POST['location']; $get_user = $this->edocumentlibrary->getUser(); $get_privilege = $this->edocumentmodel->getTable('privilege', array('username' => $get_user['sso_username']), 'getdata'); $get_left_menu = $this->edocumentlibrary->getButtons($get_privilege, 'department', 'search'); $get_filefolder = $this->edocumentmodel->getTablelike('filefolder', array('name' => $search_key, 'location' => 'Data/'.$get_user['department'].'/'), 'getdata'); $get_content = $this->edocumentlibrary->getFilefolder($get_filefolder, 'Data/'.$get_user['department'].'/', $get_left_menu['folder_button'], $get_left_menu['file_button'], $back_location, APPSURL); $data['get_user'] = $get_user; $data['get_content'] = $get_content; $data['get_left_menu'] = $get_left_menu; $data['title'] = 'mydept'; $data['content'] = "v_mydept"; $this->load->view('layout', $data); } else { $this->load->view('notfound'); } } public function access_filefolder() { if (isset($_GET['q'])) { $path_uri = $_GET['q']; $location = base64_decode($path_uri); $get_user = $this->edocumentlibrary->getUser(); $check_query = $this->checkQueryerror("filefolder", "concat_ws('', location, name)", $location); if ($check_query == 'existing' || $check_query == 'notexist') { $get_privilege = $this->edocumentmodel->getTable('privilege', array('username' => $get_user['sso_username']), 'getdata'); $get_left_menu = $this->edocumentlibrary->getButtons($get_privilege, 'department', 'nofilter'); $get_filefolder = $this->edocumentmodel->getTable('filefolder', array('location' => $location), 'getdata'); $get_content = $this->edocumentlibrary->getFilefolder($get_filefolder, $location, $get_left_menu['folder_button'], $get_left_menu['file_button'], '', APPSURL); $data['get_user'] = $get_user; $data['get_content'] = $get_content; $data['get_left_menu'] = $get_left_menu; $data['title'] = 'mydept'; $data['content'] = "v_mydept"; $this->load->view('layout', $data); } else { $this->load->view('notfound'); } } else { $this->load->view('notfound'); } } private function checkQueryerror($table_name, $where, $value) { $validate = $this->edocumentmodel->getTablecustom($table_name, $where, $value); if ($validate == 'existing') { return 'existing'; } elseif ($validate == 'notexist') { return 'notexist'; } else { return json_encode($validate); } } public function view_document() { if (isset($_GET['q'])) { $q = $_GET['q']; $arr_q = json_decode(base64_decode($q), true); $file = str_replace(' ', '%20', $arr_q['url']); $extfile = strtolower($arr_q['extfile']); $get_user = $this->edocumentlibrary->getUser(); // explode to see which main folder is file located $arr_url = explode('/', $arr_q['url']); //if owner access not using viewer js if ($arr_q['department'] == $get_user['department']) { // filter suppoerted file if ($extfile == 'pdf') { header('Content-Type: application/pdf'); header('Content-Disposition: inline;'); readfile($file); exit; } elseif ($extfile == 'png' || $extfile == 'jpg' || $extfile == 'gif') { header('Content-Type: image/'.$extfile); header('Content-Disposition: inline;'); readfile($file); exit; } else { echo "<script>alert('maaf file media belum disupport');window.close();</script>"; } } else { echo "<script>alert('maaf anda belum mempunyai authorisasi');window.close();</script>"; } } else { $this->load->view('notfound'); } } public function download_document() { if (isset($_GET['q'])) { $q = $_GET['q']; $arr_q = json_decode(base64_decode($q), true); $file = str_replace(' ', '%20', $arr_q['url']); $extfile = strtolower($arr_q['extfile']); $get_user = $this->edocumentlibrary->getUser(); // explode to see which main folder is file located $arr_url = explode('/', $arr_q['url']); //if owner access not using viewer js if ($arr_q['department'] == $get_user['department']) { header('Content-Type: application/force-download'); header('Content-Disposition: attachment; filename=download.'.$extfile); readfile($file); } else { echo "<script>alert('maaf anda belum mempunyai authorisasi');window.close();</script>"; } } else { $this->load->view('notfound'); } } public function share_file() { //check is post as expected $arr_post = array(); foreach ($_POST as $key => $value) { if ($value != null) { $arr_post[$key] = $value; } } if (count($arr_post) == 4) { $access = $_POST['access']; $expired = $_POST['expire']." 23:59:59"; $toperson = str_replace('@moratelindo.co.id', '', str_replace(';', ' ', $_POST['toperson'])); $pathuri = substr(base64_decode($_POST['location']), 0, -1); $arr_pathuri = explode('/', $pathuri); $num_component = count($arr_pathuri); $location = ''; for ($i=0; $i < $num_component; $i++) { if ($i != ($num_component - 1)) { $location .= $arr_pathuri[$i].'/'; } else{ $name = $arr_pathuri[$i]; } } $get_filefolder = $this->edocumentmodel->getTable('filefolder', array('name' => $name, 'type' => 'file', 'location' => $location), 'getdata'); $filefolder_id = $get_filefolder[0]->id; $get_user = $this->edocumentlibrary->getUser(); $datetime = date("Y-m-d h:i:s"); $dataquery = array('id' => '', 'filefolder_id' => $filefolder_id, 'from' => $get_user['sso_username'], 'to_person' => $toperson, 'access' => $access, 'expired' => $expired, 'give_on' => $datetime); $this->edocumentmodel->insertTable('shares', $dataquery); echo "<script>alert('file berhasil dibagikan'); window.location.href = '".APPSURL."access_filefolder?q=".base64_encode($location)."';</script>"; } else { $pathuri = substr(base64_decode($_POST['location']), 0, -1); $arr_pathuri = explode('/', $pathuri); $num_component = count($arr_pathuri); $location = ''; for ($i=0; $i < $num_component; $i++) { if ($i != ($num_component - 1)) { $location .= $arr_pathuri[$i].'/'; } } echo "<script>alert('harap isi field yg kosong'); window.location.href = '".APPSURL."access_filefolder?q=".base64_encode($location)."';</script>"; } } public function rename_filefolder() { //check is post as expected $arr_post = array(); foreach ($_POST as $key => $value) { if ($value != null) { $arr_post[$key] = $value; } } if (count($arr_post) == 3) { $new_name = $_POST['filefoldername']; $doctype = $_POST['doctype']; $location = $_POST['location']; $component_loc = substr(base64_decode($location), 0, -1); $arr_comp_loc = explode('/', $component_loc); $count_comp = count($arr_comp_loc); $parent_loc = ''; for ($i=0; $i < $count_comp; $i++) { if ($i != ($count_comp - 1)) { $parent_loc .= $arr_comp_loc[$i].'/'; } else{ $child_loc = $arr_comp_loc[$i]; } } $get_user = $this->edocumentlibrary->getUser(); $datetime = date("Y-m-d h:i:s"); $check_name = $this->edocumentmodel->getTable('filefolder', array('name' => $new_name, 'type' => $doctype, 'location' => $parent_loc), 'isexisting'); if ($check_name == 'notexist') { $old_file_path = $this->cli_path($parent_loc.$child_loc); $new_file_path = $this->cli_path($parent_loc.$new_name); // rename file in server exec('mv '.$old_file_path.' '.$new_file_path); // update table $data_query = array('name' => $new_name, 'times' => $datetime); $this->edocumentmodel->updateTable('filefolder', $data_query, array('name' => $child_loc, 'type' => $doctype, 'location' => $parent_loc)); if ($doctype == 'folder') { // update rest location field $select = $this->edocumentmodel->getTablelike('filefolder', array('location' => $component_loc), 'getdata'); if ($select != 'notexist') { $newarray = array(); foreach ($select as $key => $value) { foreach ($value as $k => $v) { if ($k == 'id') { $newarray[$key]['id'] = $v; } elseif ($k == 'location') { $newarray[$key]['location'] = str_replace($child_loc, $new_name, $v); } } } // update table location related $this->edocumentmodel->updateTablepatch('filefolder', $newarray, 'id'); } } echo "<script>alert('".$doctype." berhasil diganti'); window.location.href = '".APPSURL."access_filefolder?q=".base64_encode($parent_loc)."';</script>"; } else { echo "<script>alert('".$doctype." sudah ada'); window.location.href = '".APPSURL."access_filefolder?q=".base64_encode($parent_loc)."';</script>"; } } else { $location = $_POST['location']; $component_loc = substr(base64_decode($location), 0, -1); $arr_comp_loc = explode('/', $component_loc); $count_comp = count($arr_comp_loc); $parent_loc = ''; for ($i=0; $i < $count_comp; $i++) { if ($i != ($count_comp - 1)) { $parent_loc .= $arr_comp_loc[$i].'/'; } } echo "<script>alert('harap isi filed kosong'); window.location.href = '".APPSURL."access_filefolder?q=".base64_encode($parent_loc)."';</script>"; } } public function delete_filefolder() { $arr_post = array(); foreach ($_POST as $key => $value) { if ($value != null) { $arr_post[$key] = $value; } } if (count($arr_post) == 2) { $doctype = $_POST['doctype']; $component_loc = substr(base64_decode($_POST['location']), 0, -1); $component_loc_dir = $this->cli_path($component_loc); $arr_comp_loc = explode('/', $component_loc); // key for last component $num_component = count($arr_comp_loc); $parent_loc = ''; for ($i=0; $i < $num_component; $i++) { if ($i != ($num_component - 1)) { $parent_loc .= $arr_comp_loc[$i].'/'; } else{ $child_loc = $arr_comp_loc[$i]; } } //remove files or folder exec('rm -fr '.$component_loc_dir); // delete its record $this->edocumentmodel->deleteTable('filefolder', array('name' => $child_loc, 'type' => $doctype, 'location' => $parent_loc)); if ($doctype == 'folder') { //delete child path table $this->edocumentmodel->deleteTablelike('location', $component_loc, 'filefolder'); } echo "<script>alert('".$doctype." berhasil dihapus'); window.location.href = '".APPSURL."access_filefolder?q=".base64_encode($parent_loc)."';</script>"; } else { $component_loc = substr(base64_decode($_POST['location']), 0, -1); $component_loc_dir = $this->cli_path($component_loc); $arr_comp_loc = explode('/', $component_loc); // key for last component $num_component = count($arr_comp_loc); $parent_loc = ''; for ($i=0; $i < $num_component; $i++) { if ($i != ($num_component - 1)) { $parent_loc .= $arr_comp_loc[$i].'/'; } } echo "<script>alert('".$doctype." berhasil dihapus'); window.location.href = '".APPSURL."access_filefolder?q=".base64_encode($parent_loc)."';</script>"; } } private function cli_path($str) { $pattern = array(' ', '(', ')', '&'); $replace = array('\ ', '\(', '\)', '\&'); $return = ''; for ($i=0; $i < count($pattern); $i++) { if (strpos($str, $pattern[$i]) != false) { $str = str_replace($pattern[$i], $replace[$i], $str); } } return $str; } }
mit
romainneutron/PHPExiftool
lib/PHPExiftool/Driver/Tag/MXF/WorkingTitle.php
775
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <imprec@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool\Driver\Tag\MXF; use JMS\Serializer\Annotation\ExclusionPolicy; use PHPExiftool\Driver\AbstractTag; /** * @ExclusionPolicy("all") */ class WorkingTitle extends AbstractTag { protected $Id = 'mixed'; protected $Name = 'WorkingTitle'; protected $FullName = 'MXF::Main'; protected $GroupName = 'MXF'; protected $g0 = 'MXF'; protected $g1 = 'MXF'; protected $g2 = 'Video'; protected $Type = 'mixed'; protected $Writable = false; protected $Description = 'Working Title'; }
mit
try-dash-now/gDasH
lib/common.py
13968
#!/usr/bin/python '''The MIT License (MIT) Copyright (c) 2017 Yu Xiong Wei(try.dash.now@gmail.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.''' __author__ = 'Yu, Xiongwei(Sean Yu)' __doc__ = ''' created 5/14/2017 ''' from functools import wraps import traceback import os import inspect import imp import re from datetime import datetime debug = False def dut_exception_handler(function_name): @wraps(function_name) def wrapped(*args, **kwargs): try: dut_instance=None if len(args): dut_instance= args[0] r = function_name(*args, **kwargs) except Exception as e: if dut_instance: if debug: pass else: dut_instance.close_session() raise(e) return r return wrapped def get_folder_item(path): abs_path = os.path.abspath(path) if os.path.exists(abs_path): folder_list = sorted(os.listdir(abs_path)) else: folder_list= None return folder_list import subprocess, tempfile def runner(file_name, setting_file=None): exe_cmd ='' pipe_input ,file_name =tempfile.mkstemp() #from setting file to get the log folder path and more setting for future valid_file_type =['.tc', '.ts', '.py'] cmd={ 'tc': '', 'ts': '' } #check file type, python file, csv file, test suite file .... subprocess.Popen(args = exe_cmd ,shell =True, stdin=pipe_input) #init sessions, create a session pool for used by test steps #execute import csv def load_bench(bench_file): bench_name = os.path.basename(bench_file) dict_bench = {bench_name:{}} with open(bench_file) as bench: reader = csv.reader(bench,delimiter=',') for row in reader: if len(row)<1: continue else: name = row[0] import string valid_chars = "_%s%s" % (string.ascii_letters, string.digits) #valid_chars =frozenset(valid_chars) name = re.sub('[^{}]'.format(valid_chars), '_',name) if dict_bench.has_key(name): print('warning: duplicate session name "{}" in file "{}",overwritten!!!'.format(name, os.path.abspath(bench_file))) continue else: dict_attributes = {} for attribute in row[1:]: #print("$$",attribute) if attribute in ['']: if len(dict_attributes)>0: continue else: return {} elif attribute.find('=')==-1: return {} a_name,a_value = attribute.split('=') dict_attributes[a_name.strip()]=a_value.strip().replace('\\r', '\r').replace('\\n','\n') dict_bench[os.path.basename(bench_file)][name]=dict_attributes return dict_bench #def create_session(name, attribute): # if attribute.has_key('init_file_name'): # #this is a echo session # ses = echo(name, attribute['init_file_name']) # elif attribute.has_key('type'): #if attribute['type'].lower()=='ssh': # from common import dut_exception_handler, debug, warn,log, info,error, TRACE_LEVEL # ses = dut(name, **attribute ) # return ses def parse_command_line(cmd_string): import shlex cmd_string = cmd_string.strip() lex = shlex.shlex(cmd_string) lex.quotes = '"' lex.whitespace_split = True cmd_list=list(lex) module_name, class_name,function_name, arg='','','',[] if cmd_list.__len__()>=1: mod_funct=cmd_list[0].split('.') if mod_funct.__len__() ==1: module_name ='' class_name = '' function_name = mod_funct[0] elif mod_funct.__len__()==2: class_name='' module_name,function_name = mod_funct[:2] elif mod_funct.__len__()>2: module_name,class_name,function_name=mod_funct[:3] args = cmd_list[1:] return module_name,class_name,function_name,args def call_function_in_module(module_name, class_name, function_name, args , environment =None): import inspect new_argvs=[] new_kwargs={} str_code = '' def GetFunArgs(*argvs, **kwargs): #re-assign for self.argvs and self.kwargvs for arg in argvs: new_argvs.append(arg) for k in kwargs.keys(): new_kwargs.update({k:kwargs[k]}) if environment: globals().update(environment) args_string = ','.join(['{}'.format(x) for x in args]) eval('GetFunArgs({args})'.format(args=args_string)) info('\nmodule_name: \t{mn}\nclass_name: \t{cn}\nfunction_name: \t{fn}\nargs:{args}\nkwargs: {kwargs}'.format(mn=module_name,cn = class_name,fn=function_name,args=new_argvs, kwargs=new_kwargs)) instance_name = '{}_inst'.format(module_name) try: #print(module_name, 'is existed in globals()', globals()[module_name]) file, path_name, description = imp.find_module(module_name) lmod = imp.load_module(module_name, file, path_name,description) if class_name != "": #instance_name = getattr(lmod, class_name)() str_code = '{}_instance.{}({})'.format(module_name, function_name, args_string) else: #instance_name = getattr(lmod, function_name) str_code = '{}.{}({})'.format(module_name, function_name, args_string) except Exception as e: msg = "failed to load module {}:{}".format(module_name, e) error(msg ) return function_name, new_argvs,new_kwargs, str_code WARN_LEVEL = 0 INFO_LEVEL = 1 DEBUG_LEVEL = 2 ERRO_LEVEL = 3 TRACE_LEVEL_NAME = ["WARN",'INFO','DBUG','ERRO'] TRACE_LEVEL = 3 def caller_stack_info(level=DEBUG_LEVEL, depth = 2): curframe = inspect.currentframe() calframe = inspect.getouterframes(curframe, 2) for i in range(0,depth-2): calframe = inspect.getouterframes(calframe[1][0],2) if calframe[2][0].f_locals.has_key('self'): class_name = '{}'.format(type(calframe[2][0].f_locals['self'])) #name = calframe[2][0].f_locals['self'].ses_name+'.' if 'ses_name' in inspect.getmembers(calframe[2][0].f_locals['self']) else '' else: class_name='' file_name, line_no, caller_name,code_list, = calframe[2][1:5] level = TRACE_LEVEL_NAME[level] msg= '{level}\t{fn}:{line_no}\t{caller}'.format(level =level ,fn=os.path.basename(file_name), line_no = line_no,caller = caller_name) if level==0: msg = '{level}\t{line_no}\t{caller}'.format(level = level,line_no = line_no,caller = caller_name) elif level==1: msg = '' return msg def log(string, info_type_index=3, depth = 2): prefix = caller_stack_info(info_type_index, depth) prefix = '{}\t{}'.format(datetime.now().isoformat(' '), prefix) string= "{}".format(string) new_string = '\n\t'.join( string.split('\n')) str = '{}:{}\n'.format(prefix,new_string) if TRACE_LEVEL<=info_type_index or info_type_index==INFO_LEVEL: print(str.strip()) return str def combine_args(string = [], kwargs ={}): if string is None: string = '' if type(string)in [type(''), type(1), type(1.0)]: stirng = [string] format_string='{n: <20}= {v}\n' if len(kwargs)>0: new_arg_list = list(kwargs)+['{}'.format(x) for x in string] max_len = len(max(new_arg_list, key= len))+1 format_string = '{n: <%d}= {v}\n'%(max_len) str = ','.join(['{}'.format(x) for x in string]) str+='\t\n'+''.join([format_string.format(n=x, v=kwargs[x]) for x in sorted(kwargs)]) return str def info(*string, **kwargs): str = combine_args(string,kwargs ) return log(str, INFO_LEVEL, 3) def error(*string, **kwargs): str = combine_args(string,kwargs ) return log(str, ERRO_LEVEL, 3) def debug(*string, **kwargs): str = combine_args(string,kwargs ) return log(str, DEBUG_LEVEL, 3) def warn(*string, **kwargs): str = combine_args(string,kwargs ) return log(str, WARN_LEVEL, 3) def reload_module(instance, function_name): parents = type.mro(type(instance))[:-1] parents.insert(0, instance) class_name = 0 target_module_name =None target_module = None for p in parents: if p.__dict__.has_key(function_name): target_module_name= p.__module__ break for p in parents:#[::-1]: mn = p.__module__ if target_module_name==mn: module_info =imp.find_module(mn )# imp.new_module(modulename) module_dyn = imp.load_module(mn ,*module_info) reload(module_dyn) target_module= module_dyn def get_next_in_ring_list(current_index,the_list,increase=True): index = current_index if the_list is [] or the_list is None: index = -1 min_index = 0 max_index = len(the_list) -1 if increase: index +=1 if index >max_index : index =0 else: index -=1 if index <0: index=max_index value='' if index==-1 or len(the_list)==0: pass else: value=the_list[index] return index, value import smtplib def send_mail_smtp_without_login( TO, SUBJECT, TEXT, SERVER, FROM ):#msg, FROM, TO, SUBJECT, USER, LOGIN, type='smtp', ): if isinstance(TO, (basestring)): TO = TO.replace(',',';').split(';') mailServer = smtplib.SMTP(SERVER) #~~~SMTP server for outgoing mail mailServer.ehlo() for recipient in TO: #~Loop that emails everyone on the list MAIL = '''from: {sender}\r\nsubject: {sub}\r\nto: {to}\r\n\r\n\r\n{msg}'''.format(sender=FROM, to=recipient, sub=SUBJECT, msg = TEXT) mailServer.sendmail(FROM, recipient,MAIL) print(MAIL) mailServer.close() def run_script(script_name, args=[]): import sys sys.argv= [script_name]+args oo, oe = sys.stdout, sys.stderr info('script is running',script_name = script_name, args = args) try: execfile(script_name,globals() ) except SystemExit: pass sys.stdout, sys.stderr = oo,oe info('script is completed',script_name = script_name, args = args) def create_dir(log_path): log_path = os.path.normpath(log_path) log_path = os.path.abspath(log_path) log_path = log_path.split(os.sep) tmp=None for d in log_path: if tmp is None: tmp = d else: tmp= os.sep.join([tmp, d]) if os.path.exists(tmp): pass else: os.mkdir(tmp) info('create dir: {}'.format('{}'.format(os.sep).join(log_path))) return tmp def get_log_folder_from_sys_argv(log_path= None): import sys, os, re arg_numbers = len(sys.argv) if log_path is None: log_path = '../log/tmp' if arg_numbers>=3: if sys.argv[-2].lower().strip() == '-l': log_path = sys.argv[-1] info(log_path) return log_path def create_case_folder(log_path = None): import sys, os, re arg_numbers = len(sys.argv) case_name ="TestCase" if log_path is None: log_path = '../log/tmp' base_name = os.path.basename(sys.argv[0]) if len(base_name)==0: base_name = sys.argv[0] if arg_numbers >0: case_name = base_name if arg_numbers>=3: if sys.argv[-2].lower().strip() == '-l': log_path = sys.argv[-1] case_name = base_name+'-{}'.format(sys.argv[1:-2]) else: case_name =base_name+'-{}'.format(sys.argv[1:arg_numbers]) elif arg_numbers==2: case_name= base_name+'-{}'.format(sys.argv[1]) else: case_name= base_name import datetime timestamps = datetime.datetime.now().isoformat('-').split('.')[0].replace(':','-') removelist = '\-_.' pat = r'[^\w'+removelist+']' case_name = re.sub(pat, '', case_name) MAX_FILE_NAME_LENGTH=256 folder_name = '{}-{}'.format(case_name, timestamps)[:MAX_FILE_NAME_LENGTH] full_path = '{}/{}'.format(log_path, folder_name) return create_dir(full_path) def csvfile2array(csvfile, Delimiter = ',', Newline = '', Quoting=csv.QUOTE_ALL): a=[] import os if os.name!='nt': f= open(csvfile, 'r', newline= Newline ) else: f = open(csvfile,'r') reader = csv.reader(f, delimiter=Delimiter, quoting=Quoting) for row in reader: a.append(row) return a def array2htmltable(Array): content = "<table border='1' align='left' width=autofit >" for index , sublist in enumerate( Array): content += ' <tr><td>\n%d</td><td>'%(index+1) content += ' </td><td>'.join(['{}'.format(x) if x!='' else '&nbsp;' for x in sublist ]) content += ' \n</td></tr>\n' content += ' \n </table><br>' return content
mit
Maayam/koza-extranet
src/AppBundle/Repository/MissionRepository.php
237
<?php namespace AppBundle\Repository; /** * MissionRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class MissionRepository extends \Doctrine\ORM\EntityRepository { }
mit
ttanimichi/rails
railties/lib/rails/commands/secrets/secrets_command.rb
1715
require "active_support" require_relative "../../secrets" module Rails module Command class SecretsCommand < Rails::Command::Base # :nodoc: no_commands do def help say "Usage:\n #{self.class.banner}" say "" say self.class.desc end end def setup generator.start end def edit if ENV["EDITOR"].to_s.empty? say "No $EDITOR to open decrypted secrets in. Assign one like this:" say "" say %(EDITOR="mate --wait" bin/rails secrets:edit) say "" say "For editors that fork and exit immediately, it's important to pass a wait flag," say "otherwise the secrets will be saved immediately with no chance to edit." return end require_application_and_environment! Rails::Secrets.read_for_editing do |tmp_path| system("#{ENV["EDITOR"]} #{tmp_path}") end say "New secrets encrypted and saved." rescue Interrupt say "Aborted changing encrypted secrets: nothing saved." rescue Rails::Secrets::MissingKeyError => error say error.message rescue Errno::ENOENT => error raise unless error.message =~ /secrets\.yml\.enc/ Rails::Secrets.read_template_for_editing do |tmp_path| system("#{ENV["EDITOR"]} #{tmp_path}") generator.skip_secrets_file { setup } end end private def generator require_relative "../../generators" require_relative "../../generators/rails/encrypted_secrets/encrypted_secrets_generator" Rails::Generators::EncryptedSecretsGenerator end end end end
mit
adammcarth/OpenLog
js/capture.js
3170
var Logger = function() { this.l = window.location; this.SERVER = this.l.protocol + "//" + this.l.hostname + ":{{SERVER_PORT}}/log"; this.LOGGING_LEVELS = { info: true, warn: true, error: true }; var key = "openLogQueue", store = localStorage, tags = document.getElementsByTagName('script'), self = this, i, d; this.o = { error: console.error, info: console.info, log: console.log, warn: console.warn }; this.queue = JSON.parse(store.getItem(key) || "[]"); store.removeItem(key); window.onbeforeunload = function() { store.setItem(key, JSON.stringify(self.queue)); }; setInterval(function() { if (!self.sending) { self.sendQueue.call(self); } }, 1000); for (i = 0; i < tags.length; i++) { d = tags[i].getAttribute('data-capture'); url = tags[i].getAttribute('data-log-url'); if (url) { this.SERVER = url; } if (d) { d = d.split(" "); this.LOGGING_LEVELS = { info: false, warn: false, error: false }; for (i = 0; i < d.length; i++) { this.set(d[i], true); } break; } } }; Logger.prototype = { console: function(msg) { this.o.log.apply(console, [msg]); }, error: function() { console.error.apply(console, arguments); }, info: function() { console.info.apply(console, arguments); }, warn: function() { console.warn.apply(console, arguments); }, sendQueue: function() { if (this.queue.length > 0) { var req = new XMLHttpRequest(), self = this; self.sending = true; req.open("post", this.SERVER, true); req.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); req.onload = function() { self.queue = []; self.sending = false; }; req.onerror = function() { self.sending = false; }; req.send("[" + this.queue.join(", ") + "]"); } }, _send: function(type, message, t) { var a = this.LOGGING_LEVELS[type] || false; if (a && this.LOGGING_LEVELS[type]) { this.queue.push(JSON.stringify({type: type, message: message, trace: (t || Error().trace), time: Date.now(), page: this.l.href})); } }, set: function(type, state) { if (typeof (this.LOGGING_LEVELS[type]) !== 'undefined') { this.LOGGING_LEVELS[type] = state; } } }; var Log = new Logger(), types = ["error", "info", "log", "warn"]; for (var i = 0; i < types.length; i++) { (function() { var k = i; console[types[k]] = function () { Log._send(types[k], arguments, Error().stack); Log.o[types[k]].apply(this, arguments); }; })(); // jshint ignore:line } window.onerror = function(msg, a, b, c, err) { Log._send("error", msg, err.stack); }; window.Log = Log;
mit
nicecoinx/nicecoin
src/qt/locale/bitcoin_zh_CN.ts
112199
<?xml version="1.0" ?><!DOCTYPE TS><TS language="zh_CN" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About NiceCoin</source> <translation>关于莱特币</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;NiceCoin&lt;/b&gt; version</source> <translation>&lt;b&gt;莱特币&lt;/b&gt;版本</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> 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.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>版权</translation> </message> <message> <location line="+0"/> <source>The NiceCoin (undergravity.club.vip) Developers</source> <translation>NiceCoin-qt 客户端开发团队</translation> </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>&amp;新建地址</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your NiceCoin 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>这是您用来收款的莱特币地址。为了标记不同的资金来源,建议为每个付款人保留不同的收款地址。</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;复制地址</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>显示二维码</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a NiceCoin address</source> <translation>签名消息,证明这个地址属于您。</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>&amp;导出</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified NiceCoin address</source> <translation>验证消息,确保消息是由指定的莱特币地址签名过的。</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;验证消息</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;删除</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your NiceCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>这是您用来付款的莱特币地址。在付款前,请总是核实付款金额和收款地址。</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>复制 &amp;标签</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;编辑</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>付款</translation> </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>逗号分隔文件 (*.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>密码对话框</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>输入钱包的新密码。&lt;br/&gt;使用的密码请至少包含&lt;b&gt;10个以上随机字符&lt;/&gt;,或者是&lt;b&gt;8个以上的单词&lt;/b&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 MASTERNICE&lt;/b&gt;!</source> <translation>警告:如果您加密了您的钱包,但是忘记了密码,你将会&lt;b&gt;丢失所有的莱特币&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>您确定需要为钱包加密吗?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>重要提示:您以前备份的钱包文件应该替换成最新生成的加密钱包文件(重新备份)。从安全性上考虑,您以前备份的未加密的钱包文件,在您使用新的加密钱包后将无效,请重新备份。</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>警告:大写锁定键处于打开状态!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>钱包已加密</translation> </message> <message> <location line="-56"/> <source>NiceCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your nicecoins from being stolen by malware infecting your computer.</source> <translation>将关闭软件以完成加密过程。 请您谨记:钱包加密并不是万能的,电脑中毒,您的莱特币还是有可能丢失。</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>钱包加密失败</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>由于一个本地错误,加密钱包操作已经失败。您的钱包没有被加密。</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>密码不匹配。</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>钱包解锁失败</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>用于解密钱包的密码不正确。</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>钱包解密失败。</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>修改钱包密码成功。</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>对&amp;消息签名...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>正在与网络同步...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;概况</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 NiceCoin</source> <translation>显示莱特币的相关信息</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>关于 &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>显示Qt相关信息</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;选项...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;加密钱包...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;备份钱包...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;修改密码...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>正在从磁盘导入数据块...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>正在为数据块建立索引...</translation> </message> <message> <location line="-347"/> <source>Send coins to a NiceCoin address</source> <translation>向一个莱特币地址发送莱特币</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for NiceCoin</source> <translation>设置选项</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>备份钱包到其它文件夹</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>修改钱包加密口令</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>&amp;调试窗口</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>&amp;验证消息...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>NiceCoin</source> <translation>莱特币</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>钱包</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;发送</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;接收</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;地址</translation> </message> <message> <location line="+22"/> <source>&amp;About NiceCoin</source> <translation>&amp;关于莱特币</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>显示或隐藏主窗口</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>对钱包中的私钥加密</translation> </message> <message> <location line="+7"/> <source>Sign messages with your NiceCoin addresses to prove you own them</source> <translation>用莱特币地址关联的私钥为消息签名,以证明您拥有这个莱特币地址</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified NiceCoin addresses</source> <translation>校验消息,确保该消息是由指定的莱特币地址所有者签名的</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;文件</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;设置</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;帮助</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>分页工具栏</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>NiceCoin client</source> <translation>莱特币客户端</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to NiceCoin network</source> <translation><numerusform>到莱特币网络的连接共有%n条</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>No block source available...</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>%1 / %2 个交易历史的区块已下载</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>已处理 %1 个交易历史数据块。</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n 小时前</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n 天前</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n 周前</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>落后 %1 </translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>最新收到的区块产生于 %1。</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>在此之后的交易尚未可见</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>错误</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>信息</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>该交易的字节数超标。您可以选择支付%1的交易费给处理您的交易的网络节点,有助于莱特币网络的运行。您愿意支付这笔交易费用吗?</translation> </message> <message> <location line="-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 NiceCoin address or malformed URI parameters.</source> <translation>URI无法解析!原因可能是莱特币地址不正确,或者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>钱包已被&lt;b&gt;加密&lt;/b&gt;,当前为&lt;b&gt;解锁&lt;/b&gt;状态</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>钱包已被&lt;b&gt;加密&lt;/b&gt;,当前为&lt;b&gt;锁定&lt;/b&gt;状态</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. NiceCoin can no longer continue safely and will quit.</source> <translation>发生严重错误。</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>&amp;标签</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>&amp;地址</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>输入的地址 &quot;%1&quot; 已经存在于地址簿。</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid NiceCoin address.</source> <translation>您输入的 &quot;%1&quot; 不是合法的莱特币地址.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>无法解锁钱包</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>密钥创建失败.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>NiceCoin-Qt</source> <translation>NiceCoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>版本</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>使用:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>命令行选项</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>UI选项</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>设置语言, 例如 &quot;de_DE&quot; (缺省: 系统语言)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>启动时最小化 </translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>启动时显示版权页 (缺省: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>选项</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;主要的</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>支付交易 &amp;费用</translation> </message> <message> <location line="+31"/> <source>Automatically start NiceCoin after logging in to the system.</source> <translation>登录系统后自动开启莱特币客户端</translation> </message> <message> <location line="+3"/> <source>&amp;Start NiceCoin on system login</source> <translation>启动时&amp;运行</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>恢复客户端的缺省设置</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>恢复缺省设置</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;网络</translation> </message> <message> <location line="+6"/> <source>Automatically open the NiceCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>自动在路由器中打开莱特币端口。只有当您的路由器开启 UPnP 选项时此功能才有效。</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>使用 &amp;UPnP 映射端口</translation> </message> <message> <location line="+7"/> <source>Connect to the NiceCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>通过代理服务器连接莱特币网络(例如:通过Tor连接)</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;通过Socks代理连接:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>代理服务器&amp;IP:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>代理服务器IP (如 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;端口:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>代理端口(例如 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>Socks &amp;版本</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Socks代理版本 (例如 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;窗口</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>最小化窗口后仅显示托盘图标</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;最小化到托盘</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>当窗口关闭时程序最小化而不是退出。当使用该选项时,程序只能通过在菜单中选择退出来关闭</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>单击关闭按钮最小化</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;显示</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>用户界面&amp;语言:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting NiceCoin.</source> <translation>在这里设置用户界面的语言。设置将在客户端重启后生效。</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;莱特币金额单位:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>选择莱特币单位。</translation> </message> <message> <location line="+9"/> <source>Whether to show NiceCoin addresses in the transaction list or not.</source> <translation>是否需要在交易清单中显示莱特币地址。</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>在交易清单中&amp;显示莱特币地址</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;确定</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;取消</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;应用</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>缺省</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>确认恢复缺省设置</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>某些设置选项需要重启客户端才能生效</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>您希望继续吗?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting NiceCoin.</source> <translation>需要重启客户端软件才能生效。</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 NiceCoin network after a connection is established, but this process has not completed yet.</source> <translation>现在显示的消息可能是过期的. 在连接上莱特币网络节点后,您的钱包将自动与网络同步,但是这个过程还没有完成.</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>钱包</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>&lt;b&gt;最近交易记录&lt;/b&gt;</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 nicecoin: click-to-pay handler</source> <translation>暂时无法启动莱特币:点击支付功能</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>二维码对话框</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>请求付款</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>金额:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>标签:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>消息:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;另存为</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>将 URI 转换成二维码失败.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>输入的金额非法,请检查。</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>URI 太长, 请试着精简标签/消息的内容.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>保存二维码</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG图像文件(*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>客户端名称</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+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>&amp;信息</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>使用OpenSSL版本</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>启动时间</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>网络</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>连接数</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>当前为莱特币测试网络</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>数据链</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>当前数据块数量</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>预计数据块数量</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>上一数据块时间</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;打开</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>命令行选项</translation> </message> <message> <location line="+7"/> <source>Show the NiceCoin-Qt help message to get a list with possible NiceCoin command-line options.</source> <translation>显示Mana命令行选项帮助信息</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;显示</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;控制台</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>创建时间</translation> </message> <message> <location line="-104"/> <source>NiceCoin - Debug window</source> <translation>莱特币 - 调试窗口</translation> </message> <message> <location line="+25"/> <source>NiceCoin Core</source> <translation>莱特币核心</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>调试日志文件</translation> </message> <message> <location line="+7"/> <source>Open the NiceCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>打开当前目录中的调试日志文件。日志文件大的话可能要等上几秒钟。</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>清空控制台</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the NiceCoin RPC console.</source> <translation>欢迎来到 RPC 控制台.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>使用上下方向键浏览历史, &lt;b&gt;Ctrl-L&lt;/b&gt;清除屏幕.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>使用 &lt;b&gt;help&lt;/b&gt; 命令显示帮助信息.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+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>清除 &amp;所有</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>余额:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>确认并发送货币</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>发送</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; 到 %2 (%3)</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?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> 和 </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>收款人地址不合法,请检查。</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>支付金额必须大于0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>金额超出您的账上余额。</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>计入 %1 交易费后的金额超出您的账上余额。</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>发现重复的地址, 每次只能对同一地址发送一次.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>错误:创建交易失败!</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>错误: 交易被拒绝. 如果您使用的是备份钱包,可能存在两个钱包不同步的情况,另一个钱包中的莱特币已经被使用,但本地的这个钱包尚没有记录。</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>表单</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>金额</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>付款给这个地址 (例如 Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>为这个地址输入一个标签,以便将它添加到您的地址簿</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 NiceCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>请输入莱特币地址 (例如: 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>签名</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>复制当前签名至剪切板</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this NiceCoin address</source> <translation>签名消息,证明这个地址属于您。</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>消息签名</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>清空所有签名消息栏</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>清除 &amp;所有</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;验证消息</translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>在下面输入签名地址,消息(请确保换行符、空格符、制表符等等一个不漏)和签名以验证消息。请确保签名信息准确,提防中间人攻击。</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>用于签名消息的地址(例如: Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified NiceCoin address</source> <translation>验证消息,确保消息是由指定的莱特币地址签名过的。</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>验证消息签名</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>清空所有验证消息栏</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a NiceCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>请输入莱特币地址 (例如: Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>单击“签名消息“产生签名。</translation> </message> <message> <location line="+3"/> <source>Enter NiceCoin signature</source> <translation>输入莱特币签名</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>钱包解锁动作取消。</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 NiceCoin (undergravity.club.vip) Developers</source> <translation>NiceCoin-qt 客户端开发团队</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>至 %1 个数据块时开启</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1 / 离线</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/未确认</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 确认项</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>状态</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>通过 %n 个节点广播</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>源</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>生成</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>来自</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>到</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>自己的地址</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>标签</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>收入</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>将在 %n 个数据块后成熟</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>未被接受</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>支出</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>交易费</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>净额</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>消息</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>备注</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>交易ID</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>新挖出的莱特币必须等确120个确认才能使用。您生产出的数据块,将被广播到全网并添加到数据块链。如果入链失败,状态将变为“未被接受”,意味着您的数据块竞争失败,挖出的莱特币将不能使用。当某个节点先于你几秒生产出新的数据块,这种情况会偶尔发生。</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>调试信息</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>交易</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>输入</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>金额</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>正确</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>错误</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, 未被成功广播</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Open for %n more block</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>未知</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+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><numerusform>Open for %n more block</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>至 %1 个数据块时开启</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>离线 (%1 个确认项)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>未确认 (%1 / %2 条确认信息)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>已确认 (%1 条确认信息)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>挖矿收入余额将在 %n 个数据块后可用</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>此数据块未被其他节点接收,并可能不被接受!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>已生成但未被接受</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>接收于</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>收款来自</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>发送到</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>付款给自己</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>挖矿所得</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/a)</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>复制交易编号</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>编辑标签</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>显示交易详情</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>导出交易数据</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>逗号分隔文件(*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>已确认</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>类别</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>标签</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>地址</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>金额</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>导出错误</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>无法写入文件 %1。</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>范围:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>到</translation> </message> </context> <context> <name>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>备份钱包</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>钱包文件(*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>备份失败</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>备份钱包到其它文件夹失败.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>备份成功</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>钱包数据成功存储到新位置</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>NiceCoin 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 nicecoind</source> <translation>发送命令到服务器或者 nicecoind </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: nicecoin.conf)</source> <translation>指定配置文件 (默认为 nicecoin.conf) </translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: nicecoind.pid)</source> <translation>指定 pid 文件 (默认为 nicecoind.pid) </translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>指定数据目录 </translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>设置数据库缓冲区大小 (缺省: 25MB)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 10333 or testnet: 11333)</source> <translation>监听端口连接 &lt;port&gt; (缺省: 10333 or testnet: 11333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>最大连接数 &lt;n&gt; (缺省: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>连接一个节点并获取对端地址, 然后断开连接</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>指定您的公共地址</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Threshold for disconnecting misbehaving peers (缺省: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Number of seconds to keep misbehaving peers from reconnecting (缺省: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>设置RPC监听端口%u时发生错误, IPv4:%s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 10332 or testnet: 11332)</source> <translation>JSON-RPC连接监听端口&lt;port&gt; (缺省:10332 testnet:11332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>接受命令行和 JSON-RPC 命令 </translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>在后台运行并接受命令 </translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>使用测试网络 </translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>接受来自外部的连接 (缺省: 如果不带 -proxy or -connect 参数设置为1)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: nicecoinrpc 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;NiceCoin Alert&quot; admin@foo.com </source> <translation>%s, 您必须在配置文件设置rpcpassword: %s 建议您使用下面的随机密码: nicecoinrpc rpcpassword=%s (您无需记住此密码) 用户名和密码 必! 须! 不一样。 如果配置文件不存在,请自行建立一个只有所有者拥有只读权限的文件。 推荐您开启提示通知以便收到错误通知, 像这样: alertnotify=echo %%s | mail -s &quot;NiceCoin Alert&quot; admin@foo.com </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>在IPv6模式下设置RPC监听端口 %u 失败,返回到IPv4模式: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>绑定指定的IP地址开始监听。IPv6地址请使用[host]:port 格式</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. NiceCoin is probably already running.</source> <translation>无法给数据目录 %s上锁。本软件可能已经在运行。</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>错误:该交易被拒绝!发生这种错误的原因可能是:钱包中的莱特币已经被用掉,有可能您复制了wallet.dat钱包文件,然后用复制的钱包文件支付了莱特币,但是这个钱包文件中没有记录。</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>错误:因为该交易的数量、复杂度或者动用了刚收到不久的资金,您需要支付不少于%s的交易费用。</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>当收到相关通知时执行命令(命令行中的 %s 的替换为消息)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>当最佳区块变化时执行命令 (命令行中的 %s 会被替换成区块哈希值)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>这是测试用的预发布版本 - 请谨慎使用 - 不要用来挖矿,或者在正式商用环境下使用</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>警告:-paytxfee 交易费设置得太高了!每笔交易都将支付交易费。</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>警告:显示的交易可能不正确!您需要升级客户端软件,或者网络上的其他节点需要升级。</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong NiceCoin will not work properly.</source> <translation>警告:请检查电脑的日期时间设置是否正确!时间错误可能会导致莱特币客户端运行异常。</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>警告:钱包文件wallet.dat读取失败!最重要的公钥、私钥数据都没有问题,但是交易记录或地址簿数据不正确,或者存在数据丢失。</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>警告:钱包文件wallet.dat损坏! 原始的钱包文件已经备份到%s目录下并重命名为{timestamp}.bak 。如果您的账户余额或者交易记录不正确,请使用您的钱包备份文件恢复。</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>尝试从损坏的钱包文件wallet.dat中恢复私钥</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>数据块创建选项:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>仅连接到指定节点</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>检测发现数据块数据库损坏。请使用 -reindex参数重启客户端。</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>发现自己的IP地址(缺省:不带 -externalip 参数监听时设置为1)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>你想现在就重建块数据库吗?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>初始化数据块数据库出错</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Error initializing wallet database environment %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>导入数据块数据库出错</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>导入数据块数据库出错</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>错误:磁盘剩余空间低!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>错误:钱包被锁定,无法创建交易!</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>错误:系统出错。</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>监听端口失败。请使用 -listen=0 参数。</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>无法读取数据块信息</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>读取数据块失败</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>无法同步数据块索引</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>无法写入数据块索引</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>无法写入数据块信息</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>无法写数据块</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>无法写入文件信息</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>无法写入coin数据库</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>无法写入交易索引</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>无法写入回滚信息</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>通过DNS查找节点(缺省:1 除非使用 -connect 选项)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>启动时检测多少个数据块(缺省:288,0=所有)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>How thorough the block verification is (0-4, default: 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>重新为当前的blk000??.dat文件建立索引</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>设置使用调用服务 RPC 的线程数量(默认:4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>正在验证数据库的完整性...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>正在检测钱包的完整性...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>从blk000??.dat文件导入数据块</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation>信息</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>非法的 -tor 地址:&apos;%s&apos; </translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation 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>维护一份完整的交易索引(缺省:0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>每个连接的最大接收缓存,&lt;n&gt;*1000 字节(缺省:5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>每个连接的最大发送缓存,&lt;n&gt;*1000 字节(缺省:1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>仅接受符合客户端检查点设置的数据块文件</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>仅连接至指定网络的节点&lt;net&gt;(IPv4, IPv6 或者 Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>输出额外的调试信息。打开所有 -debug* 开关</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>输出额外的网络调试信息</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>为调试输出信息添加时间戳</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the NiceCoin Wiki for SSL setup instructions)</source> <translation>SSL选项:(参见NiceCoin Wiki关于SSL设置栏目)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>请选择Socks代理服务器版本 (4 或 5, 缺省: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>跟踪/调试信息输出到控制台,不输出到debug.log文件</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>跟踪/调试信息输出到 调试器debugger</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>设置最大数据块大小(缺省:250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>设置最小数据块大小(缺省:0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>客户端启动时压缩debug.log文件(缺省:no-debug模式时为1)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>设置连接超时时间(缺省:5000毫秒)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>系统错误:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation 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>使用代理服务器访问隐藏服务(缺省:同 -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>JSON-RPC连接用户名 </translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>警告:该软件版本已过时,请升级!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>You need to rebuild the databases using -reindex to change -txindex</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>钱包文件wallet.dat损坏,抢救备份失败</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>JSON-RPC连接密码 </translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>允许从指定IP接受到的JSON-RPC连接 </translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>向IP地址为 &lt;ip&gt; 的节点发送指令 (缺省: 127.0.0.1) </translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>当最佳数据块变化时执行命令 (命令行中的 %s 会被替换成数据块哈希值)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>将钱包升级到最新的格式</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>设置密钥池大小为 &lt;n&gt; (缺省: 100) </translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>重新扫描数据链以查找遗漏的交易 </translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>为 JSON-RPC 连接使用 OpenSSL (https)连接</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>服务器证书 (默认为 server.cert) </translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>服务器私钥 (默认为 server.pem) </translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>可接受的加密器 (默认为 TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH) </translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>该帮助信息 </translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>无法绑定本机端口 %s (返回错误消息 %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>通过 socks 代理连接</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>使用 -addnode, -seednode 和 -connect选项时允许DNS查找</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>正在加载地址...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>wallet.dat钱包文件加载错误:钱包损坏</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of NiceCoin</source> <translation>wallet.dat钱包文件加载错误:请升级到最新Mana客户端</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart NiceCoin to complete</source> <translation>钱包文件需要重写:请退出并重新启动Mana客户端</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>wallet.dat钱包文件加载错误</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>非法的代理地址: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>被指定的是未知网络 -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>被指定的是未知socks代理版本: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>无法解析 -bind 端口地址: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>无法解析 -externalip 地址: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>非法金额 -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>金额不对</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>金额不足</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>加载数据块索引...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>添加节点并与其保持连接</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. NiceCoin is probably already running.</source> <translation>无法在本机绑定 %s 端口 . 莱特币客户端软件可能已经在运行.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>每发送1KB交易所需的费用</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>正在加载钱包...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>无法降级钱包格式</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>无法写入缺省地址</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>正在重新扫描...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>加载完成</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>使用 %s 选项</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>错误</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>您必须在配置文件中加入选项 rpcpassword : %s 如果配置文件不存在,请新建,并将文件权限设置为仅允许文件所有者读取.</translation> </message> </context> </TS>
mit
shvets/cafebabe
cafebabe/src/main/java/org/sf/cafebabe/task/classfile/SearchDialog.java
11534
// SearchDialog.java package org.sf.cafebabe.task.classfile; import org.sf.cafebabe.Constants; import org.sf.cafebabe.gadget.classtree.EntryNode; import org.sf.cafebabe.gadget.classtree.PlainClassTree; import org.sf.classfile.*; import org.sf.classfile.attribute.CodeAttribute; import org.sf.classfile.attribute.MethodBody; import org.sf.classfile.instruction.Instruction; import javax.swing.*; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; import javax.swing.tree.TreeModel; import javax.swing.tree.TreeNode; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; import java.util.Enumeration; import java.util.StringTokenizer; /** * Dialog for search preparation process through class file entities */ public class SearchDialog extends JDialog { private final String PLAIN_ACTION = "plain"; private final String CP_ACTION = "cp"; private final String FIELD_ACTION = "field"; private final String METHOD_ACTION = "method"; private final String ATTRIBUTE_ACTION = "attribute"; static private int searchMode = Constants.SEARCH_PLAIN; static private String searchString = null; static private JTextField inputField; private PlainClassTree classTree; private ConstPool constPool; public SearchDialog(JFrame parentFrame, PlainClassTree classTree, ConstPool constPool) { // Make sure we call the parent super(parentFrame, false); this.classTree = classTree; this.constPool = constPool; enableEvents(AWTEvent.FOCUS_EVENT_MASK); this.getContentPane().setLayout(new BorderLayout()); // Set the characteristics for this dialog instance this.setTitle("Search a string..."); this.setResizable(false); Rectangle r = parentFrame.getBounds(); this.setBounds(r.x + r.width/2 - 550/2, r.y + r.height/2 - 210/2, 550, 210); this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); ButtonGroup group = new ButtonGroup(); JRadioButton radio1 = new JRadioButton("Plain"); JRadioButton radio2 = new JRadioButton("Constant pool"); JRadioButton radio3 = new JRadioButton("Fields"); JRadioButton radio4 = new JRadioButton("Methods"); JRadioButton radio5 = new JRadioButton("Class attributes"); radio1.setActionCommand(PLAIN_ACTION); radio2.setActionCommand(CP_ACTION); radio3.setActionCommand(FIELD_ACTION); radio4.setActionCommand(METHOD_ACTION); radio5.setActionCommand(ATTRIBUTE_ACTION); radio1.setSelected((searchMode == Constants.SEARCH_PLAIN)); radio2.setSelected((searchMode == Constants.SEARCH_CONST_POOL)); radio3.setSelected((searchMode == Constants.SEARCH_FIELD)); radio4.setSelected((searchMode == Constants.SEARCH_METHOD)); radio5.setSelected((searchMode == Constants.SEARCH_CLASS_ATTRIBUTE)); group.add(radio1); group.add(radio2); group.add(radio3); group.add(radio4); group.add(radio5); inputField = new JTextField(searchString, 45); JButton searchButton = new JButton("Next"); JButton closeButton = new JButton("Close"); ModeListener modeListener = new ModeListener(); SearchListener searchListener = new SearchListener(); radio1.addActionListener(modeListener); radio2.addActionListener(modeListener); radio3.addActionListener(modeListener); radio4.addActionListener(modeListener); radio5.addActionListener(modeListener); inputField.addActionListener(searchListener); searchButton.addActionListener(searchListener); closeButton.addActionListener(new CloseListener()); JPanel panel11 = new JPanel(); panel11.setBorder(new TitledBorder(new EtchedBorder(), "Search mode")); JPanel panel1 = new JPanel(); panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS)); panel1.add(Box.createRigidArea(new Dimension(10, 0))); panel1.add(panel11); panel1.add(Box.createRigidArea(new Dimension(10, 0))); panel1.add(Box.createRigidArea(new Dimension(10, 0))); panel11.add(radio1); panel11.add(Box.createRigidArea(new Dimension(10, 0))); panel11.add(radio2); panel11.add(Box.createRigidArea(new Dimension(10, 0))); panel11.add(radio3); panel11.add(Box.createRigidArea(new Dimension(10, 0))); panel11.add(radio4); panel11.add(Box.createRigidArea(new Dimension(10, 0))); panel11.add(radio5); panel11.add(Box.createRigidArea(new Dimension(10, 0))); JPanel panel31 = new JPanel(); panel31.setBorder(new TitledBorder(new EtchedBorder(), "Input a string:")); JPanel panel3 = new JPanel(); panel3.setLayout(new BoxLayout(panel3, BoxLayout.X_AXIS)); panel3.add(Box.createRigidArea(new Dimension(10, 0))); panel3.add(panel31); panel3.add(Box.createRigidArea(new Dimension(10, 0))); panel31.add(inputField); panel3.add(Box.createRigidArea(new Dimension(10, 0))); JPanel panel5 = new JPanel(); panel5.setLayout(new BoxLayout(panel5, BoxLayout.X_AXIS)); panel5.add(Box.createRigidArea(new Dimension(30, 0))); panel5.add(searchButton); panel5.add(Box.createRigidArea(new Dimension(20, 0))); panel5.add(closeButton); JPanel topPanel = new JPanel(); topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.Y_AXIS)); this.setContentPane(topPanel); topPanel.add(Box.createRigidArea(new Dimension(0, 10))); topPanel.add(panel3); topPanel.add(Box.createRigidArea(new Dimension(0, 10))); topPanel.add(panel1); topPanel.add(Box.createRigidArea(new Dimension(0, 10))); topPanel.add(panel5); topPanel.add(Box.createRigidArea(new Dimension(0, 10))); inputField.requestFocus(); } // inner classes-adapters class CloseListener implements ActionListener { public void actionPerformed(ActionEvent e) { dispose(); } } class ModeListener implements ActionListener { public void actionPerformed(ActionEvent event) { String cmd = event.getActionCommand(); if(cmd.equals(PLAIN_ACTION)) { searchMode = Constants.SEARCH_PLAIN; } else if(cmd.equals(CP_ACTION)) { searchMode = Constants.SEARCH_CONST_POOL; } else if(cmd.equals(FIELD_ACTION)) { searchMode = Constants.SEARCH_FIELD; } else if(cmd.equals(METHOD_ACTION)) { searchMode = Constants.SEARCH_METHOD; } else if(cmd.equals(ATTRIBUTE_ACTION)) { searchMode = Constants.SEARCH_CLASS_ATTRIBUTE; } } } class SearchListener implements ActionListener { private SearchThread searchThread = null; private boolean isFirstClick = true; public void actionPerformed(ActionEvent e) { if(isFirstClick) { isFirstClick = false; searchString = inputField.getText(); if(searchString != null && searchString.length() > 0) { searchThread = new SearchThread(searchString, searchMode); searchThread.start(); } } else { if(searchThread != null) { synchronized(searchThread) { searchThread.notify(); } } else { isFirstClick = true; } } } class SearchThread extends Thread { TreeModel dataModel = classTree.getModel(); TreeNode root = (TreeNode)dataModel.getRoot(); boolean isFound = false; private String line; private int searchMode; SearchThread(String line, int searchMode) { super("SearchThread"); setPriority(Thread.MIN_PRIORITY+2); this.line = line ; this.searchMode = searchMode; } public void run() { TreeNode treeNode = null; if(searchMode == Constants.SEARCH_PLAIN) { treeNode = root; } else if(searchMode == Constants.SEARCH_CONST_POOL) { treeNode = getChild(ConstPool.TYPE); } else if(searchMode == Constants.SEARCH_FIELD) { treeNode = getChild(Constants.FIELDS_TEXT); } else if(searchMode == Constants.SEARCH_METHOD) { treeNode = getChild(Constants.METHODS_TEXT); } else if(searchMode == Constants.SEARCH_CLASS_ATTRIBUTE) { treeNode = getChild(Constants.CLASS_ATTRIBUTES_TEXT); } if(treeNode != null) { search(line, treeNode); } if(isFound) { JOptionPane.showMessageDialog(SearchDialog.this, "No more string \"" + line + "\" in this class file.", "Search dialog", JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog(SearchDialog.this, "String \"" + line + "\" does not found!", "Search dialog", JOptionPane.INFORMATION_MESSAGE); } isFirstClick = true; } private void search(String line, TreeNode node) { Enumeration e = node.children(); while(e.hasMoreElements()) { TreeNode iNode = (TreeNode)e.nextElement(); if(iNode instanceof EntryNode) { Entry entry = ((EntryNode)iNode).getEntry(); if(entry instanceof MethodEntry) { if(searchMode == Constants.SEARCH_PLAIN || searchMode == Constants.SEARCH_METHOD) { MethodEntry methodEntry = (MethodEntry)entry; AttributeEntry attribute = methodEntry.getAttribute(AttributeEntry.CODE, constPool); if(attribute != null) { CodeAttribute codeAttribute; try { codeAttribute = new CodeAttribute(attribute); } catch(IOException ex) { ex.printStackTrace(); return; } MethodBody methodBody = codeAttribute.getMethodBody(); Instruction[] instructions = methodBody.getInstructions(); for(int i=0; i < instructions.length; i++) { Instruction instruction = instructions[i]; String str = instruction.resolve(constPool); StringTokenizer st = new StringTokenizer(str); while(st.hasMoreTokens()) { String token = st.nextToken(); if(token.toLowerCase().startsWith(line.toLowerCase())) { classTree.openMethodBodyEditor(methodEntry, i); isFound = true; try { synchronized(this) { this.wait(); } } catch(InterruptedException ex) {} } } } } } } } String text = iNode.toString(); if(iNode instanceof EntryNode) { Entry entry = ((EntryNode)iNode).getEntry(); if(entry instanceof Resolvable) { Resolvable resolvable = (Resolvable)entry; //System.out.println("??? " + resolvable.resolve(constPool)); text = resolvable.resolve(constPool); } } StringTokenizer st = new StringTokenizer(text); while(st.hasMoreTokens()) { String token = st.nextToken(); if(token.toLowerCase().startsWith(line.toLowerCase())) { classTree.changePosition(iNode); isFound = true; try { synchronized(this) { this.wait(); } } catch(InterruptedException ex) {} } } search(line, iNode); } } private TreeNode getChild(String childText) { Enumeration e = root.children(); while(e.hasMoreElements()) { TreeNode iNode = (TreeNode)e.nextElement(); if(iNode.toString().equals(childText)) { return iNode; } } return null; } } } }
mit
Amossov/Margatsni
Margatsni/Properties/AssemblyInfo.cs
1433
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Resources; // 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("Margatsni")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Margatsni")] [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("e3a28a72-3b26-4eed-a342-ca8599ea296e")] // 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 Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")]
mit
skritter/skritter-html5
app/components/practice/toolbar/PracticePadToolbarComponent.js
3218
const GelatoComponent = require('gelato/component'); /** * @class PracticePadToolbarComponent * @extends {GelatoComponent} */ const PracticePadToolbarComponent = GelatoComponent.extend({ events: { 'click .nav-list-btn': 'handleNavListBtnClicked', 'click .vocab-item': 'handleVocabItemClicked', }, /** * @property template * @type {Function} */ template: require('./PracticePadToolbarComponent.jade'), /** * Template for individual vocab list items * @type {Function} */ vocabItemTemplate: require('./PracticePadToolbarVocabItem.jade'), /** * @method initialize * @constructor */ initialize: function (options) { this.dueCountOffset = 0; this.page = options.page; }, /** * @method render * @returns {PracticePadToolbarComponent} */ render: function () { this.renderTemplate(); this.renderVocabs(); return this; }, /** * Renders the list with all the vocabs in the list * @param {Number} position the currently selected vocab */ renderVocabs (position = 0) { const vocabs = this.page.charactersToLoad; const ids = this.page.idsToLoad.split('|'); const minVisible = Math.max(0, position - 2); const maxVisible = Math.min(vocabs.length, position + 2); let vocabListStr = ''; for (let i = 0; i < vocabs.length; i++) { vocabListStr += this.vocabItemTemplate({ vocab: vocabs[i], id: ids[i], position: i, selected: i === position, visible: (i < minVisible || i > maxVisible), targetLang: this.page.targetLang, }); } this.$('#vocab-list-wrapper').html(vocabListStr); this.updateVocabList(); }, /** * Handles a user clicking on a navigation arrow in the list and fires * an event to navigate to the specified vocab. * @param {jQuery.ClickEvent} event the click event */ handleNavListBtnClicked (event) { const direction = $(event.currentTarget).data('direction'); this.trigger('nav:' + direction); }, /** * Handles a user clicking on a vocab item in the list and fires an event * to navigate to the specified vocab. * @param {jQuery.ClickEvent} event the click event */ handleVocabItemClicked (event) { const pos = $(event.currentTarget).data('position'); this.trigger('nav:vocab', pos); }, /** * Updates the vocab list visually with the 5 most relevant vocabs * @param {Number} position the currently selected vocab */ updateVocabList (position = 0) { const vocabs = this.page.charactersToLoad; const minVisible = Math.max(0, position - 2); const maxVisible = Math.min(vocabs.length, position + 2); const vocabItems = this.$('.vocab-item'); for (let i = 0; i < vocabItems.length; i++) { $(vocabItems[i]) .toggleClass('hidden', (i < minVisible || i > maxVisible)) .toggleClass('selected', i === position); } this.$('.nav-list-btn').toggleClass('hidden', vocabs.length < 2); this.$('#prev-vocab-btn').toggleClass('invisible', position === 0); this.$('#next-vocab-btn').toggleClass('invisible', position === vocabs.length - 1); }, }); module.exports = PracticePadToolbarComponent;
mit
hrtrftrtwqh/0000
src/qt/locale/bitcoin_fr.ts
133491
<?xml version="1.0" ?><!DOCTYPE TS><TS language="fr" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Cleverbot</source> <translation>Au sujet de Cleverbot</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Cleverbot&lt;/b&gt; version</source> <translation>Version de &lt;b&gt;Cleverbot&lt;/b&gt;</translation> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The BlackCoin developers</source> <translation>Copyright © 2009-2014 Les développeurs Bitcoin Copyright © 2012-2014 Les développeurs NovaCoin Copyright © 2014 Les développeurs Cleverbot</translation> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or &lt;a href=&quot;http://www.opensource.org/licenses/mit-license.php&quot;&gt;http://www.opensource.org/licenses/mit-license.php&lt;/a&gt;. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (&lt;a href=&quot;https://www.openssl.org/&quot;&gt;https://www.openssl.org/&lt;/a&gt;) and cryptographic software written by Eric Young (&lt;a href=&quot;mailto:eay@cryptsoft.com&quot;&gt;eay@cryptsoft.com&lt;/a&gt;) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Répertoire d&apos;adresses</translation> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Double cliquer afin de modifier l&apos;adresse ou l&apos;étiquette</translation> </message> <message> <location line="+24"/> <source>Create a new address</source> <translation>Créer une nouvelle adresse</translation> </message> <message> <location line="+10"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copier l&apos;adresse sélectionnée vers le presse-papier système</translation> </message> <message> <location line="-7"/> <source>&amp;New Address</source> <translation>&amp;Nouvelle adresse</translation> </message> <message> <location line="-43"/> <source>These are your Cleverbot 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>Ce sont vos adresses pour recevoir vos paiements. Vous pouvez utiliser une adresse différente pour chaque réception afin d&apos;identifier facilement le payeur.</translation> </message> <message> <location line="+53"/> <source>&amp;Copy Address</source> <translation>&amp;Copier l&apos;adresse</translation> </message> <message> <location line="+7"/> <source>Show &amp;QR Code</source> <translation>Montrer le &amp;QR Code</translation> </message> <message> <location line="+7"/> <source>Sign a message to prove you own a Cleverbot address</source> <translation>Signer un message afin de valider l&apos;identité de votre adresse Cleverbot</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Signer le &amp;message</translation> </message> <message> <location line="+17"/> <source>Delete the currently selected address from the list</source> <translation>Effacer l&apos;adresse actuellement sélectionnée de la liste</translation> </message> <message> <location line="-10"/> <source>Verify a message to ensure it was signed with a specified Cleverbot address</source> <translation>Vérifier un message pour s&apos;assurer qu&apos;il vient d&apos;un adresse Cleverbot spécifique.</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Vérifier un message</translation> </message> <message> <location line="+10"/> <source>&amp;Delete</source> <translation>&amp;Supprimer</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Copier l&apos;&amp;Étiquette</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Modifier</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation>Exporter votre répertoire d&apos;adresses</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Fichier de valeurs séparées par des virgules (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Erreur lors de l&apos;export</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Impossible d&apos;écrire dans le fichier %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+145"/> <source>Label</source> <translation>Étiquette</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(aucune étiquette)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Dialogue de phrase de passe</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Saisir la phrase de passe</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nouvelle phrase de passe</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Répéter la phrase de passe</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation>Sert à désactiver les transactions sortantes si votre compte de système d&apos;exploitation est compromis. Ne procure pas de réelle sécurité.</translation> </message> <message> <location line="+3"/> <source>For staking only</source> <translation>Pour &quot;staking&quot; seulement</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+38"/> <source>Encrypt wallet</source> <translation>Chiffrer le portefeuille</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Cette opération nécessite votre phrase de passe pour déverrouiller le portefeuille.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Déverrouiller le portefeuille</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Cette opération nécessite votre phrase de passe pour déchiffrer le portefeuille.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Déchiffrer le portefeuille</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Changer la phrase de passe</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Saisir l’ancienne phrase de passe pour le portefeuille ainsi que la nouvelle.</translation> </message> <message> <location line="+45"/> <source>Confirm wallet encryption</source> <translation>Confirmer le chiffrement du portefeuille</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation>Avertissement : Si vous chiffrez votre portefeuille et perdez votre passphrase, vous ne pourrez &lt;b&gt;plus accéder à vos Botcoins&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Êtes-vous sûr de vouloir chiffrer votre portefeuille ?</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>IMPORTANT : Toute sauvegarde précédente de votre fichier de portefeuille devrait être remplacée par le nouveau fichier de portefeuille chiffré. Pour des raisons de sécurité, les sauvegardes précédentes de votre fichier de portefeuille non chiffré deviendront inutilisables dès lors que vous commencerez à utiliser le nouveau portefeuille chiffré.</translation> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Attention : la touche Verr. Maj. est activée !</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>Portefeuille chiffré</translation> </message> <message> <location line="-140"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>Cleverbot 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>L&apos;application Cleverbot va désormais se terminer afin de finaliser le processus de chiffrage. Merci de noter que le chiffrage du portefeuille ne garantit pas de se prémunir du vol via utilisation de malware, qui auraient pu infecter votre ordinateur. </translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Le chiffrement du portefeuille a échoué</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Le chiffrement du portefeuille a échoué en raison d&apos;une erreur interne. Votre portefeuille n&apos;a pas été chiffré.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>Les phrases de passe saisies ne correspondent pas.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>Le déverrouillage du portefeuille a échoué</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>La phrase de passe saisie pour déchiffrer le portefeuille est incorrecte.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Le déchiffrage du portefeuille a échoué</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>La phrase de passe du portefeuille a été modifiée avec succès.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+297"/> <source>Sign &amp;message...</source> <translation>Signer le &amp;message...</translation> </message> <message> <location line="-64"/> <source>Show general overview of wallet</source> <translation>Afficher une vue d’ensemble du portefeuille</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;Transactions</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Parcourir l&apos;historique des transactions</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation>Carnet d&apos;adresses</translation> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation>Éditer la liste d&apos;adresses et étiquettes</translation> </message> <message> <location line="-18"/> <source>Show the list of addresses for receiving payments</source> <translation>Montrer la liste d&apos;adresses de réception de paiements</translation> </message> <message> <location line="+34"/> <source>E&amp;xit</source> <translation>Q&amp;uitter</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Quitter l’application</translation> </message> <message> <location line="+4"/> <source>Show information about Cleverbot</source> <translation>Afficher des informations au sujet de Cleverbot</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>À propos de &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Afficher les informations au sujet de Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Options…</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Chiffrer le portefeuille...</translation> </message> <message> <location line="+2"/> <source>&amp;Backup Wallet...</source> <translation>Sauvegarder le &amp;portefeuille...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Changer la phrase de passe...</translation> </message> <message> <location line="+9"/> <source>&amp;Export...</source> <translation>&amp;Exporter...</translation> </message> <message> <location line="-55"/> <source>Send coins to a Cleverbot address</source> <translation>Envoyer des monnaies vers une adresse Cleverbot</translation> </message> <message> <location line="+39"/> <source>Modify configuration options for Cleverbot</source> <translation>Modification des options de configuration de Cleverbot</translation> </message> <message> <location line="+17"/> <source>Export the data in the current tab to a file</source> <translation>Export des données de l&apos;onglet courant vers un fichier</translation> </message> <message> <location line="-13"/> <source>Encrypt or decrypt wallet</source> <translation>Chiffrer ou déchiffrer le portefeuille</translation> </message> <message> <location line="+2"/> <source>Backup wallet to another location</source> <translation>Sauvegarder le portefeuille vers un autre emplacement</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Modifier la phrase de passe utilisée pour le chiffrement du portefeuille</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation>&amp;Fenêtre de débogage</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Ouvrir la console de débogage et de diagnostic</translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>&amp;Vérifier un message...</translation> </message> <message> <location line="-214"/> <location line="+551"/> <source>Cleverbot</source> <translation>Cleverbot</translation> </message> <message> <location line="-551"/> <source>Wallet</source> <translation>Portefeuille</translation> </message> <message> <location line="+193"/> <source>&amp;About Cleverbot</source> <translation>&amp;Au sujet de Cleverbot</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Montrer / Masquer</translation> </message> <message> <location line="+8"/> <source>Unlock wallet</source> <translation>Déverrouiller le portefeuille</translation> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation>&amp;Verrouiller le portefeuille</translation> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation>Verrouiller le portefeuille</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Fichier</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;Paramètres</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>&amp;Aide</translation> </message> <message> <location line="+17"/> <source>Tabs toolbar</source> <translation>Barre d&apos;onglets</translation> </message> <message> <location line="+46"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+58"/> <source>Cleverbot client</source> <translation>Client Cleverbot</translation> </message> <message numerus="yes"> <location line="+70"/> <source>%n active connection(s) to Cleverbot network</source> <translation><numerusform>%n connexion active au réseau Cleverbot</numerusform><numerusform>%n connexions actives au réseau Cleverbot</numerusform></translation> </message> <message> <location line="+488"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation>Staking.&lt;br&gt;Votre poids est de %1&lt;br&gt;Le poids du réseau est de %2&lt;br&gt;Temps estimé avant récompense %3</translation> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation>Pas de staking car votre portefeuille est verouillé</translation> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation> Pas de staking car votre portefeuille est hors ligne</translation> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation>Pas de staking car votre portefeuille est en cours de synchronisation</translation> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation>Pas de staking car vos monnaies ne sont pas encore matures</translation> </message> <message> <location line="-808"/> <source>&amp;Dashboard</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>&amp;Unlock Wallet...</source> <translation>&amp;Déverrouiller le portefeuille...</translation> </message> <message> <location line="+273"/> <source>Up to date</source> <translation>À jour</translation> </message> <message> <location line="+43"/> <source>Catching up...</source> <translation>Rattrapage en cours…</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Confirmer le paiement des frais de transaction</translation> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Transaction envoyée</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Transaction entrante</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Date : %1 Montant : %2 Type : %3 Adresse : %4 </translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation>Prise en charge de l&apos;URL</translation> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid Cleverbot address or malformed URI parameters.</source> <translation>L&apos;adresse du portefeuille Cleverbot n&apos;as pas pu être correctement identifiée, car invalide ou malformée.</translation> </message> <message> <location line="+9"/> <source>Wallet is &lt;b&gt;not encrypted&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Le portefeuille est &lt;b&gt;chiffré&lt;/b&gt; et est actuellement &lt;b&gt;déverrouillé&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Le portefeuille est &lt;b&gt;chiffré&lt;/b&gt; et actuellement &lt;b&gt;verrouillé&lt;/b&gt;</translation> </message> <message> <location line="+24"/> <source>Backup Wallet</source> <translation>Sauvegarder le portefeuille</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Données liées au portefeuille (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Echec de la sauvegarde</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Une erreur a été rencontrée lors de la sauvegarde du portefeuille vers la nouvelle destination.</translation> </message> <message numerus="yes"> <location line="+91"/> <source>%n second(s)</source> <translation><numerusform>%n seconde</numerusform><numerusform>%n secondes</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation><numerusform>%n minute</numerusform><numerusform>%n minutes</numerusform></translation> </message> <message numerus="yes"> <location line="-429"/> <location line="+433"/> <source>%n hour(s)</source> <translation><numerusform>%n heure</numerusform><numerusform>%n heures</numerusform></translation> </message> <message> <location line="-456"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+27"/> <location line="+433"/> <source>%n day(s)</source> <translation><numerusform>%n jour</numerusform><numerusform>%n jours</numerusform></translation> </message> <message numerus="yes"> <location line="-429"/> <location line="+6"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+0"/> <source>%1 and %2</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+0"/> <source>%n year(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+5"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+324"/> <source>Not staking</source> <translation>Pas de staking</translation> </message> <message> <location filename="../bitcoin.cpp" line="+104"/> <source>A fatal error occurred. Cleverbot can no longer continue safely and will quit.</source> <translation>Une erreur fatale a été rencontrée. L&apos;application Cleverbot ne peut plus être s&apos;exécuter de façon correcte et va se terminer.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+110"/> <source>Network Alert</source> <translation>Alerte réseau</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation>Fonctions de contrôle des monnaies</translation> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation>Quantité :</translation> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation>Octets :</translation> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Montant :</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation>Priorité :</translation> </message> <message> <location line="+48"/> <source>Fee:</source> <translation>Frais :</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Sortie faible:</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="+552"/> <source>no</source> <translation>non</translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation>Après les frais :</translation> </message> <message> <location line="+35"/> <source>Change:</source> <translation>Monnaie :</translation> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation>Tout (dé)sélectionner</translation> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation>Mode arborescence</translation> </message> <message> <location line="+16"/> <source>List mode</source> <translation>Mode liste</translation> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Montant</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation>Étiquette</translation> </message> <message> <location line="+5"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Date</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation>Confirmations</translation> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Confirmée</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation>Priorité</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>Copier l’adresse</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copier l’étiquette</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Copier le montant</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>Copier l&apos;ID de la transaction</translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation>Copier la quantité</translation> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation>Copier les frais</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Copier le montant après les frais</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copier les octets</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Copier la priorité</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copier la sortie faible</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copier la monnaie</translation> </message> <message> <location line="+317"/> <source>highest</source> <translation>la plus élevée</translation> </message> <message> <location line="+1"/> <source>high</source> <translation>élevée</translation> </message> <message> <location line="+1"/> <source>medium-high</source> <translation>moyennement-élevée</translation> </message> <message> <location line="+1"/> <source>medium</source> <translation>moyenne</translation> </message> <message> <location line="+4"/> <source>low-medium</source> <translation>moyennement-basse</translation> </message> <message> <location line="+1"/> <source>low</source> <translation>basse</translation> </message> <message> <location line="+1"/> <source>lowest</source> <translation>la plus basse</translation> </message> <message> <location line="+155"/> <source>DUST</source> <translation>DUST</translation> </message> <message> <location line="+0"/> <source>yes</source> <translation>oui</translation> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation>Cette étiquette passe au rouge, si la taille de la transaction est supérieure à 10000 bytes. Cela implique que des frais à hauteur d&apos;au moins %1 par kb seront nécessaires. Ceux-ci Peuvent varier de +/- 1 Byte par entrée.</translation> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation>Les transactions avec une priorité haute ont plus de chances d&apos;être traitées en un block. L&apos;étiquette passe au rouge si votre priorité est plus basse que la &quot;moyenne&quot;. Cela implique que des frais d&apos;un minimum de %1 par kb sont requis</translation> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation>Cette étiquette passe au rouge, Lorsqu&apos;un destinataire reçoit un montant inférieur à %1. Cela implique que des frais à hauteur de %2 seront nécessaire Les montants inférieurs à 0.546 fois les frais minimum de relais apparaissent en tant que DUST.</translation> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation>Cette étiquette passe au rouge, lorsque la différence est inférieure à %1. Cela implique que des frais à hauteur d&apos;au moins %2 seront nécessaires.</translation> </message> <message> <location line="+36"/> <location line="+66"/> <source>(no label)</source> <translation>(aucune étiquette)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation>monnaie de %1 (%2)</translation> </message> <message> <location line="+1"/> <source>(change)</source> <translation>(monnaie)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Modifier l&apos;adresse</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Étiquette</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>L&apos;étiquette associée à cette entrée du carnet d&apos;adresse</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Adresse</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>L&apos;adresse associée à cette entrée du carnet d&apos;adresse. Seules les adresses d&apos;envoi peuvent être modifiées.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Nouvelle adresse de réception</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nouvelle adresse d’envoi</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Modifier l’adresse de réception</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Modifier l’adresse d&apos;envoi</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>L’adresse fournie « %1 » est déjà présente dans le carnet d&apos;adresses.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Cleverbot address.</source> <translation>L&apos;adresse &quot;%1&quot; renseignée n&apos;est pas une adresse Cleverbot valide.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Impossible de déverrouiller le portefeuille.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Échec de génération de la nouvelle clef.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+426"/> <location line="+12"/> <source>Cleverbot-Qt</source> <translation>Cleverbot-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>version</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Utilisation:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>Options de ligne de commande</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>Options graphiques</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Définir la langue, par exemple « fr_FR » (par défaut: la langue du système)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Démarrer en mode réduit</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Affichage de l&apos;écran de démarrage (par défaut: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Options</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>Réglages &amp;principaux</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation>Frais de transaction optionnels par kB permettant d&apos;assurer la rapidité de traitement de votre transaction. La plupart des transactions sont de 1 kB. Frais de 0.01 recommandés.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Payer des &amp;frais de transaction</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation>Montants réservés ne participant pas au &quot;staking&quot; pouvant être utilisés pour dépensés à tout moment.</translation> </message> <message> <location line="+15"/> <source>Reserve</source> <translation>Réserve</translation> </message> <message> <location line="+31"/> <source>Automatically start Cleverbot after logging in to the system.</source> <translation>Démarrage automatique du client Cleverbot lors de la connexion au système</translation> </message> <message> <location line="+3"/> <source>&amp;Start Cleverbot on system login</source> <translation>&amp;Démarrage du client Cleverbot à la connexion au système</translation> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>&amp;Réseau</translation> </message> <message> <location line="+6"/> <source>Automatically open the Cleverbot client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Ouvrir automatiquemwnr le port client de Cleverbot sur le routeur. Ceci ne fonctionne que dans le cas où le support UPnP sur votre routeur existe et est actif.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapper le port avec l&apos;&amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Cleverbot network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Connexion au réseau Cleverbot à travers un proxy SOCKS (e.g. Connexion via le réseau Tor).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Connexion à travers du proxy SOCKS:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP du serveur Proxy mandataire :</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>Addresse IP du proxy (e.g. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Port:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Port du serveur Proxy mandataire (par ex. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Version SOCKS :</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Version SOCKS du serveur mandataire (par ex. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Fenêtre</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Afficher uniquement une icône système après minimisation.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimiser dans la barre système au lieu de la barre des tâches</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>Minimiser au lieu de quitter l&apos;application lorsque la fenêtre est fermée. Si cette option est activée, l&apos;application ne pourra être fermée qu&apos;en sélectionnant Quitter dans le menu.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimiser lors de la fermeture</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Affichage</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Langue de l&apos;interface utilisateur :</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Cleverbot.</source> <translation>La langue d&apos;interface de l&apos;utilisateur peut être définie ici. Les modification seront prises en compte après redémarrage de l&apos;application Cleverbot</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unité d&apos;affichage des montants:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Choisissez la sous-unité par défaut pour l&apos;affichage dans l&apos;interface et lors de l&apos;envoi de pièces.</translation> </message> <message> <location line="+9"/> <source>Whether to show coin control features or not.</source> <translation>Afficher ou non les fonctions de contrôle des pièces.</translation> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation>Afficher les options de monnaie &amp; contrôle (mode expert)</translation> </message> <message> <location line="+7"/> <source>Whether to select the coin outputs randomly or with minimal coin age.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Minimize weight consumption (experimental)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use black visual theme (requires restart)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Annuler</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Appliquer</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>par défaut</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation>Avertissement</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Cleverbot.</source> <translation>Les paramètres prendront effet après redémarrage du client Cleverbot</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>L&apos;adresse de serveur mandataire -proxy- fournie est invalide.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Formulaire</translation> </message> <message> <location line="+46"/> <location line="+247"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Cleverbot network after a connection is established, but this process has not completed yet.</source> <translation>Les informations affichées peuvent être obsolètes. Votre portefeuille se synchronise automatiquement avec le réseau Cleverbot mais ce processus n&apos;est pas encore terminé.</translation> </message> <message> <location line="-173"/> <source>Stake:</source> <translation>Stake:</translation> </message> <message> <location line="+32"/> <source>Unconfirmed:</source> <translation>Non confirmé:</translation> </message> <message> <location line="-113"/> <source>Wallet</source> <translation>Portefeuille</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation>Disponible pour dépense:</translation> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation>Votre solde actuel pouvant être dépensé</translation> </message> <message> <location line="+80"/> <source>Immature:</source> <translation>Immature:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Le solde généré n&apos;est pas encore mature</translation> </message> <message> <location line="+23"/> <source>Total:</source> <translation>Total:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation>Votre solde total actuel</translation> </message> <message> <location line="+50"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transactions récentes&lt;/b&gt;</translation> </message> <message> <location line="-118"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Montant total des transactions nécessitant confirmation, et ne figurant pas encore dans le solde actuel</translation> </message> <message> <location line="-32"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation>Montant total des transactions en &quot;staking&quot; et ne figurant pas encore dans le solde actuel</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>désynchronisé</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start cleverbot: 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>Boîte de dialogue QR Code</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Demander un paiement</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Montant:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Étiquette:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Message:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Enregistrer sous...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Erreur d&apos;encodage de l&apos;URI en code QR.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Le montant indiqué est invalide, veuillez vérifier.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>L&apos;URI résultant est trop long, essayez de réduire le texte d&apos;étiquette / de message.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Sauvegarder le QR Code</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>Images PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nom du client</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <source>N/A</source> <translation>N.D.</translation> </message> <message> <location line="-194"/> <source>Client version</source> <translation>Version du client</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informations</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Version d&apos;OpenSSL utilisée</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Heure de démarrage</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Réseau</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Nombre de connexions</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Sur testnet</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Chaîne de blocs</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Nombre actuel de blocs</translation> </message> <message> <location line="+197"/> <source>&amp;Network Traffic</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Clear</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Totals</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>In:</source> <translation type="unfinished"/> </message> <message> <location line="+80"/> <source>Out:</source> <translation type="unfinished"/> </message> <message> <location line="-383"/> <source>Last block time</source> <translation>Horodatage du dernier bloc</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Ouvrir</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Options de ligne de commande</translation> </message> <message> <location line="+7"/> <source>Show the Cleverbot-Qt help message to get a list with possible Cleverbot command-line options.</source> <translation>Afficher le message d&apos;aide Cleverbot-Qt afin d&apos;obtenir la liste des options de de L&apos;outil en ligne de commande Cleverbot</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Afficher</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Console</translation> </message> <message> <location line="-237"/> <source>Build date</source> <translation>Date de compilation</translation> </message> <message> <location line="-104"/> <source>Cleverbot - Debug window</source> <translation>Cleverbot - Fenêtre de déboggage</translation> </message> <message> <location line="+25"/> <source>Cleverbot Core</source> <translation>Cleverbot Core</translation> </message> <message> <location line="+256"/> <source>Debug log file</source> <translation>Journal de débogage</translation> </message> <message> <location line="+7"/> <source>Open the Cleverbot debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Ouvrir le fichier journal de debug Cleverbot au sein du répertoire courant. Cette opération peut prendre quelques secondes dans le cas de fichiers journaux volumineux.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Nettoyer la console</translation> </message> <message> <location filename="../rpcconsole.cpp" line="+325"/> <source>Welcome to the Cleverbot RPC console.</source> <translation>Bienvenue sur la console RPC de Cleverbot.</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>Utiliser les touches de curseur pour naviguer dans l&apos;historique et &lt;b&gt;Ctrl-L&lt;/b&gt; pour effacer l&apos;écran.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Taper &lt;b&gt;help&lt;/b&gt; pour afficher une vue générale des commandes disponibles.</translation> </message> <message> <location line="+127"/> <source>%1 B</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 KB</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 MB</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 GB</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>%1 m</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>%1 h</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 h %2 m</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+181"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Envoyer des monnaies</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation>Fonctions de contrôle des monnaies</translation> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation>Entrants...</translation> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation>choisi automatiquement</translation> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation>Fonds insuffisants!</translation> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation>Quantité:</translation> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation>0</translation> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation>Octets:</translation> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>Montant:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 CLT</source> <translation>123.456 CLT {0.00 ?}</translation> </message> <message> <location line="-191"/> <source>Priority:</source> <translation>Priorité:</translation> </message> <message> <location line="+19"/> <source>medium</source> <translation>medium</translation> </message> <message> <location line="+32"/> <source>Fee:</source> <translation>Frais:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Sortie faible</translation> </message> <message> <location line="+19"/> <source>no</source> <translation>non</translation> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation>Après frais:</translation> </message> <message> <location line="+35"/> <source>Change</source> <translation>Monnaie :</translation> </message> <message> <location line="+50"/> <source>custom change address</source> <translation>adresse de change personnalisée</translation> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>Envoyer à plusieurs destinataires à la fois</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Ajouter un &amp;Destinataire</translation> </message> <message> <location line="+16"/> <source>Remove all transaction fields</source> <translation>Réinitialiser tous les champs liés à la transaction</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>&amp;Tout nettoyer</translation> </message> <message> <location line="+24"/> <source>Balance:</source> <translation>Solde:</translation> </message> <message> <location line="+16"/> <source>123.456 CLT</source> <translation>123.456 CLT</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Confirmer l’action d&apos;envoi</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>E&amp;nvoyer</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a Cleverbot address (e.g. CUiT51DAMapkqhsMk8LPEVokwz72EeghfG)</source> <translation>Entrer une adresse Cleverbot (par ex: CUiT51DAMapkqhsMk8LPEVokwz72EeghfG)</translation> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation>Copier la quantité</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copier le montant</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation>Copier les frais</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Copier le montant après les frais</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copier les octets</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Copier la priorité</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copier la sortie faible</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copier la monnaie</translation> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; à %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirmer l’envoi des pièces</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Etes-vous sûr de vouloir envoyer %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>et</translation> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>L&apos;adresse du destinataire n’est pas valide, veuillez la vérifier.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Le montant à payer doit être supérieur à 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Le montant dépasse votre solde.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Le montant dépasse votre solde lorsque les frais de transaction de %1 sont inclus.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Adresse indentique trouvée, il n&apos;est possible d&apos;envoyer qu&apos;une fois à chaque adresse par opération d&apos;envoi.</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>Erreur: La transaction a été rejetée. Cela peut se produire si une quantité d&apos;argent de votre portefeuille a déjà été dépensée, comme dans le cas où une copie du fichier wallet.dat aurait été utilisée afin d&apos;effectuer des dépenses, à la place du fichier courant.</translation> </message> <message> <location line="+247"/> <source>WARNING: Invalid Cleverbot address</source> <translation>AVERTISSEMENT: Adresse Cleverbot Invalide</translation> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(pas d&apos;étiquette)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation>AVERTISSEMENT: Adresse Cleverbot Invalide</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Formulaire</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Montant:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>&amp;Payer à:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. CUiT51DAMapkqhsMk8LPEVokwz72EeghfG)</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>Saisir une étiquette pour cette adresse afin de l’ajouter à votre carnet d’adresses</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Étiquette :</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Choisir une adresse du carnet d&apos;adresse</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>Coller l&apos;adresse depuis le presse-papier</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>Supprimer ce destinataire</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Cleverbot address (e.g. CUiT51DAMapkqhsMk8LPEVokwz72EeghfG)</source> <translation>Entrer une adresse Cleverbot (par ex: CUiT51DAMapkqhsMk8LPEVokwz72EeghfG)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Signatures - Signer / Vérifier un message</translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>&amp;Signer un message</translation> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Vous pouvez signer des messages avec vos adresses pour prouver que vous les détenez. Faites attention de ne rien signer de suspect car des attaques d&apos;hameçonnage peuvent essayer d&apos;usurper votre identité par votre signature. Ne signez que des déclarations entièrement détaillées et avec lesquelles vous serez d&apos;accord.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. CUiT51DAMapkqhsMk8LPEVokwz72EeghfG)</source> <translation>Entrer une adresse Cleverbot (par ex: CUiT51DAMapkqhsMk8LPEVokwz72EeghfG)</translation> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation>Choisir une adresse du carnet d&apos;adresse</translation> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>Coller une adresse depuis le presse-papier</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>Saisir ici le message que vous désirez signer</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation>Copier la signature actuelle dans le presse-papier</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Cleverbot address</source> <translation>Signer le message afin de prouver l&apos;identité de votre adresse Cleverbot</translation> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation>Réinitialiser tous les champs de signature de message</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>&amp;Tout nettoyer</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>&amp;Vérifier un message</translation> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Saisir ci-dessous l&apos;adresse de signature, le message (assurez-vous d&apos;avoir copié exactement les retours à la ligne, les espaces, tabulations etc...) et la signature pour vérifier le message. Faire attention à ne pas déduire davantage de la signature que ce qui est contenu dans le message signé lui-même pour éviter d&apos;être trompé par une attaque d&apos;homme du milieu.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. CUiT51DAMapkqhsMk8LPEVokwz72EeghfG)</source> <translation>L&apos;adresse avec laquelle le message à été signé (ex: CUiT51DAMapkqhsMk8LPEVokwz72EeghfG)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Cleverbot address</source> <translation>Vérifiez le message afin de vous assurer qu&apos;il provient de l&apos;adresse Cleverbot spécifiée.</translation> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>Réinitialiser tous les champs de vérification de message</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Cleverbot address (e.g. CUiT51DAMapkqhsMk8LPEVokwz72EeghfG)</source> <translation>Entrer une adresse Cleverbot (par ex: CUiT51DAMapkqhsMk8LPEVokwz72EeghfG)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Cliquez sur « Signer le message » pour générer la signature</translation> </message> <message> <location line="+3"/> <source>Enter Cleverbot signature</source> <translation>Entrer une signature Cleverbot</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>L&apos;adresse saisie est invalide.</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>Veuillez vérifier l&apos;adresse et réessayer.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>L&apos;adresse saisie ne fait pas référence à une clef.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Le déverrouillage du portefeuille a été annulé.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>La clef privée pour l&apos;adresse indiquée n&apos;est pas disponible.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>La signature du message a échoué.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Le message a été signé.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>La signature n&apos;a pu être décodée.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Veuillez vérifier la signature et réessayer.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>La signature ne correspond pas à l&apos;empreinte du message.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Échec de la vérification du message.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Message vérifié.</translation> </message> </context> <context> <name>TrafficBotcoinWidget</name> <message> <location filename="../trafficgraphwidget.cpp" line="+75"/> <source>KB/s</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+25"/> <source>Open until %1</source> <translation>Ouvert jusqu&apos;à %1</translation> </message> <message> <location line="+6"/> <source>conflicted</source> <translation>en conflit</translation> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%1/hors ligne</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/non confirmée</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmations</translation> </message> <message> <location line="+17"/> <source>Status</source> <translation>État</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, diffusée à travers %n nœud</numerusform><numerusform>, diffusée à travers %n nœuds</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Date</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Source</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Généré</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>De</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>votre propre adresse</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>étiquette</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Crédit</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>arrive à maturité dans %n bloc de plus</numerusform><numerusform>arrive à maturité dans %n blocks supplémentaires</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>refusé</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Débit</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Frais de transaction</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Montant net</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Message</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Commentaire</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID de la transaction</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 510 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Les pièces de monnaie générées nécessitent une maturation de 510 blocks avant de pouvoir être utilisées. Lors de la génération d&apos;un blokc, celui-ci est diffusé sur le réseau afin d&apos;être ajouté à la chaîne de blocks. En cas d&apos;échec, son état passera en &quot;non accepté&quot; et celui-ci ne pourra pas être dépensé. Cela peut occasionnellement se produire, lorsqu&apos;un noeud différent génère un block à quelques secondes d&apos;intervalle du vôtre.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informations de débogage</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transaction</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation>Entrants</translation> </message> <message> <location line="+21"/> <source>Amount</source> <translation>Montant</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>vrai</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>faux</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, n’a pas encore été diffusée avec succès</translation> </message> <message numerus="yes"> <location line="-36"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+71"/> <source>unknown</source> <translation>inconnu</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Détails de la transaction</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Ce panneau affiche une description détaillée de la transaction</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+231"/> <source>Date</source> <translation>Date</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Montant</translation> </message> <message> <location line="+52"/> <source>Open until %1</source> <translation>Ouvert jusqu&apos;à %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmée (%1 confirmations)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation><numerusform>Ouvert pour %n bloc de plus</numerusform><numerusform>Ouvert pour %n blocs de plus</numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation>Hors ligne</translation> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation>Non confirmé</translation> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation>En cours de confirmation (%1 sur %2 confirmations recommandées)</translation> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation>En conflit</translation> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation>Immature (%1 confirmations, sera disponible après %2)</translation> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Ce bloc n’a été reçu par aucun autre nœud et ne sera probablement pas accepté!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Généré mais pas accepté</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>Reçue avec</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Reçue de</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Envoyée à</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Paiement à vous-même</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Extrait</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n.d)</translation> </message> <message> <location line="+194"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>État de la transaction. Laissez le pointeur de la souris sur ce champ pour voir le nombre de confirmations.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Date et heure de réception de la transaction.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Type de transaction.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>L’adresse de destination de la transaction.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Montant ajouté ou enlevé au solde.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+54"/> <location line="+17"/> <source>All</source> <translation>Toutes</translation> </message> <message> <location line="-16"/> <source>Today</source> <translation>Aujourd’hui</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Cette semaine</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Ce mois-ci</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Le mois dernier</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Cette année</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Intervalle…</translation> </message> <message> <location line="+12"/> <source>Received with</source> <translation>Reçue avec</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Envoyée à</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>À vous-même</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Extrait</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Autres</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Saisir une adresse ou une étiquette à rechercher</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Montant min.</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copier l’adresse</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copier l’étiquette</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copier le montant</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copier l&apos;ID de la transaction</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Modifier l’étiquette</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Afficher les détails de la transaction</translation> </message> <message> <location line="+138"/> <source>Export Transaction Data</source> <translation>Exporter les données de la transaction</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Fichier de valeurs séparées par des virgules (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmée</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Date</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Étiquette</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Montant</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Erreur lors de l&apos;export</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Impossible d&apos;écrire dans le fichier %1</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Intervalle:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>à</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+208"/> <source>Sending...</source> <translation>Envoi...</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+173"/> <source>Cleverbot version</source> <translation>Version Cleverbot</translation> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Utilisation:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or botcoind</source> <translation>Envoyer commande à -server ou botcoind</translation> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Lister les commandes</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Obtenir de l’aide pour une commande</translation> </message> <message> <location line="-147"/> <source>Options:</source> <translation>Options:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: cleverbot.conf)</source> <translation>Spécifier le fichier de configuration (par défaut: cleverbot.conf)</translation> </message> <message> <location line="+1"/> <source>Specify pid file (default: botcoind.pid)</source> <translation>Spécifier le fichier pid (par défaut: botcoind.pid)</translation> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation>Spécifier le fichier de portefeuille (dans le répertoire de données)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Spécifier le répertoire de données</translation> </message> <message> <location line="-25"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=cleverbotrpc 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;Cleverbot Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Définir la taille du tampon de base de données en mégaoctets (par défaut : 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation>Définir la taille du journal de base de données en mégaoctets (par défaut : 100)</translation> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 30371 or testnet: 30373)</source> <translation>Écouter les connexions sur le &lt;port&gt; (par défault: 30371 ou testnet: 30373)</translation> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Garder au plus &lt;n&gt; connexions avec les pairs (par défaut : 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Se connecter à un nœud pour obtenir des adresses de pairs puis se déconnecter</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>Spécifier votre propre adresse publique</translation> </message> <message> <location line="+4"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation>Connexion à l&apos;adresse fournie. Utiliser la notation [machine]:port pour les adresses IPv6</translation> </message> <message> <location line="+1"/> <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Always query for peer addresses via DNS lookup (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Seuil de déconnexion des pairs de mauvaise qualité (par défaut : 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Délai en secondes de refus de reconnexion aux pairs de mauvaise qualité (par défaut : 86400)</translation> </message> <message> <location line="-37"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Une erreur est survenue lors du positionnement du port RPC %u pour écouter sur une adresse IPv4 : %s</translation> </message> <message> <location line="+65"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 31371 or testnet: 31373)</source> <translation>Écouter les connexions JSON-RPC sur le &lt;port&gt; (default: 31371 or testnet: 31373)</translation> </message> <message> <location line="-17"/> <source>Accept command line and JSON-RPC commands</source> <translation>Accepter les commandes de JSON-RPC et de la ligne de commande</translation> </message> <message> <location line="+1"/> <source>Run in the background as a daemon and accept commands</source> <translation>Fonctionner en arrière-plan en tant que démon et accepter les commandes</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Utiliser le réseau de test</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Accepter les connexions entrantes (par défaut : 1 si aucun -proxy ou -connect )</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Une erreur est survenue lors du réglage du port RPC %u pour écouter sur IPv6, retour à IPv4 : %s</translation> </message> <message> <location line="+96"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Fixer la taille maximale d&apos;un bloc en octets (par défault: 27000)</translation> </message> <message> <location line="+12"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Attention : -paytxfee est réglée sur un montant très élevé ! Il s&apos;agit des frais de transaction que vous payerez si vous envoyez une transaction.</translation> </message> <message> <location line="-103"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Cleverbot will not work properly.</source> <translation>Avertissement: Veuillez vérifier la date et l&apos;heure de votre ordinateur. Cleverbot ne pourra pas fonctionner correctement si l&apos;horloge est réglée de façon incorrecte</translation> </message> <message> <location line="+132"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Avertissement : une erreur est survenue lors de la lecture de wallet.dat ! Toutes les clefs ont été lues correctement mais les données de transaction ou les entrées du carnet d&apos;adresses sont peut-être incorrectes ou manquantes.</translation> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Avertissement : wallet.dat corrompu, données récupérées ! Le fichier wallet.dat original a été enregistré en tant que wallet.{timestamp}.bak dans %s ; si votre solde ou transactions sont incorrects vous devriez effectuer une restauration depuis une sauvegarde.</translation> </message> <message> <location line="-31"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Tenter de récupérer les clefs privées d&apos;un wallet.dat corrompu</translation> </message> <message> <location line="+5"/> <source>Block creation options:</source> <translation>Options de création de bloc:</translation> </message> <message> <location line="-69"/> <source>Connect only to the specified node(s)</source> <translation>Ne se connecter qu&apos;au(x) nœud(s) spécifié(s)</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Découvrir sa propre adresse IP (par défaut: 1 lors de l&apos;écoute et si aucun -externalip)</translation> </message> <message> <location line="+101"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Échec de l&apos;écoute sur un port quelconque. Utilisez -listen=0 si vous voulez ceci.</translation> </message> <message> <location line="-91"/> <source>Sync checkpoints policy (default: strict)</source> <translation>Politique de synchronisation des checkpoints (default: strict)</translation> </message> <message> <location line="+89"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Adresse -tor invalide: &apos;%s&apos;</translation> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation>Montant incorrect pour -reservebalance=&lt;montant&gt;</translation> </message> <message> <location line="-88"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Tampon maximal de réception par « -connection » &lt;n&gt;*1 000 octets (par défaut : 5 000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Tampon maximal d&apos;envoi par « -connection », &lt;n&gt;*1 000 octets (par défaut : 1 000)</translation> </message> <message> <location line="-17"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Se connecter uniquement aux nœuds du réseau &lt;net&gt; (IPv4, IPv6 ou Tor)</translation> </message> <message> <location line="+31"/> <source>Prepend debug output with timestamp</source> <translation>Horodater les messages de debug</translation> </message> <message> <location line="+41"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>Options SSL : (voir le Wiki de Bitcoin pour les instructions de configuration du SSL)</translation> </message> <message> <location line="-81"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Sélectionner la version du proxy socks à utiliser (4-5, par défaut: 5)</translation> </message> <message> <location line="+42"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Envoyer les informations de débogage/trace à la console au lieu du fichier debug.log</translation> </message> <message> <location line="+5"/> <source>Send trace/debug info to debugger</source> <translation>Envoyer les informations de débogage/trace à la console au lieu du fichier debug.log</translation> </message> <message> <location line="+30"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Fixer la taille maximale d&apos;un block en bytes (default: 250000)</translation> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Définir la taille minimale de bloc en octets (par défaut : 0)</translation> </message> <message> <location line="-35"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Réduire le fichier debug.log lors du démarrage du client (par défaut : 1 lorsque -debug n&apos;est pas présente)</translation> </message> <message> <location line="-43"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Spécifier le délai d&apos;expiration de la connexion en millisecondes (par défaut: 5000)</translation> </message> <message> <location line="+116"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation>Impossible de &quot;signer&quot; le checkpoint, mauvaise clef de checkpoint? </translation> </message> <message> <location line="-86"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Utiliser l&apos;UPnP pour rediriger le port d&apos;écoute (par défaut: 0)</translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Utiliser l&apos;UPnP pour rediriger le port d&apos;écoute (par défaut: 1 lors de l&apos;écoute)</translation> </message> <message> <location line="-26"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Utiliser un proxy pour atteindre les services cachés (par défaut: équivalent à -proxy)</translation> </message> <message> <location line="+47"/> <source>Username for JSON-RPC connections</source> <translation>Nom d&apos;utilisateur pour les connexions JSON-RPC</translation> </message> <message> <location line="+51"/> <source>Verifying database integrity...</source> <translation>Vérification d&apos;intégrité de la base de données...</translation> </message> <message> <location line="+44"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation>ATTENTION : violation du checkpoint de synchronisation, mais ignorée!</translation> </message> <message> <location line="-1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Avertissement : cette version est obsolète, une mise à niveau est nécessaire !</translation> </message> <message> <location line="-54"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrompu, la récupération a échoué</translation> </message> <message> <location line="-56"/> <source>Password for JSON-RPC connections</source> <translation>Mot de passe pour les connexions JSON-RPC</translation> </message> <message> <location line="-32"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation>Synchronisation de l&apos;horloge avec d&apos;autres noeuds. Désactiver si votre serveur est déjà synchronisé avec le protocole NTP (défaut: 1)</translation> </message> <message> <location line="+13"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation>Lors de la création de transactions, ignorer les entrées dont la valeur sont inférieures (défaut: 0.01)</translation> </message> <message> <location line="+6"/> <source>Output debugging information (default: 0, supplying &lt;category&gt; is optional)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>If &lt;category&gt; is not supplied, output all debugging information.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&lt;category&gt; can be:</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Autoriser les connexions JSON-RPC depuis l&apos;adresse IP spécifiée</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Envoyer des commandes au nœud fonctionnant sur &lt;ip&gt; (par défaut : 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Wait for RPC server to start</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Exécuter la commande lorsque le meilleur bloc change (%s dans cmd est remplacé par le hachage du bloc)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Exécuter la commande lorsqu&apos;une transaction du portefeuille change (%s dans la commande est remplacée par TxID)</translation> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation>Nécessite a confirmations pour modification (par défaut: 0)</translation> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Exécute une commande lorsqu&apos;une alerte correspondante est reçue (%s dans la commande est remplacé par message)</translation> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>Mettre à niveau le portefeuille vers le format le plus récent</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Régler la taille de la réserve de clefs sur &lt;n&gt; (par défaut : 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Réanalyser la chaîne de blocs pour les transactions de portefeuille manquantes</translation> </message> <message> <location line="+3"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation>Niveau d&apos;approfondissement de la vérification des blocs (0-6, default: 1)</translation> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation>Importe les blocs d&apos;un fichier externe blk000?.dat</translation> </message> <message> <location line="+9"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Utiliser OpenSSL (https) pour les connexions JSON-RPC</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Fichier de certificat serveur (par défaut : server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Clef privée du serveur (par défaut : server.pem)</translation> </message> <message> <location line="+10"/> <source>Initialization sanity check failed. Cleverbot is shutting down.</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation>Erreur: Portefeuille déverrouillé uniquement pour &quot;staking&quot; , impossible d&apos;effectuer cette transaction</translation> </message> <message> <location line="+17"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation>AVERTISSEMENT: point de contrôle invalide! Les transactions affichées peuvent être incorrectes! Il est peut-être nécessaire d&apos;effectuer une mise à jour, ou d&apos;avertir les développeurs du projet.</translation> </message> <message> <location line="-174"/> <source>This help message</source> <translation>Ce message d&apos;aide</translation> </message> <message> <location line="+104"/> <source>Wallet %s resides outside data directory %s.</source> <translation>Le portefeuille %s est situé en dehors du répertoire de données %s</translation> </message> <message> <location line="+37"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Impossible de se lier à %s sur cet ordinateur (bind a retourné l&apos;erreur %d, %s)</translation> </message> <message> <location line="-133"/> <source>Connect through socks proxy</source> <translation>Se connecter à travers un proxy socks</translation> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Autoriser les recherches DNS pour -addnode, -seednode et -connect</translation> </message> <message> <location line="+126"/> <source>Loading addresses...</source> <translation>Chargement des adresses…</translation> </message> <message> <location line="-12"/> <source>Error loading blkindex.dat</source> <translation>Erreur de chargement du fichier blkindex.dat</translation> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Erreur lors du chargement de wallet.dat: portefeuille corrompu</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of Cleverbot</source> <translation>Erreur de chargement du fichier wallet.dat: le portefeuille nécessite une version plus récente de l&apos;application Cleverbot</translation> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart Cleverbot to complete</source> <translation>Le portefeuille nécessite d&apos;être réédité : Merci de relancer l&apos;application Cleverbot</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Erreur lors du chargement du fichier wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Adresse -proxy invalide : « %s »</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Réseau inconnu spécifié sur -onlynet : « %s »</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Version inconnue de serveur mandataire -socks demandée : %i</translation> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Impossible de résoudre l&apos;adresse -bind : « %s »</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Impossible de résoudre l&apos;adresse -externalip : « %s »</translation> </message> <message> <location line="-23"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Montant invalide pour -paytxfee=&lt;montant&gt; : « %s »</translation> </message> <message> <location line="+60"/> <source>Sending...</source> <translation>Envoi...</translation> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Montant invalide</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Fonds insuffisants</translation> </message> <message> <location line="-40"/> <source>Loading block index...</source> <translation>Chargement de l’index des blocs…</translation> </message> <message> <location line="-110"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Ajouter un nœud auquel se connecter et tenter de garder la connexion ouverte</translation> </message> <message> <location line="+125"/> <source>Unable to bind to %s on this computer. Cleverbot is probably already running.</source> <translation>Connexion au port %s impossible. L&apos;application Cleverbot est probablement déjà en cours d&apos;exécution</translation> </message> <message> <location line="-101"/> <source>Fee per KB to add to transactions you send</source> <translation>Frais par KB à ajouter à vos transactions sortantes</translation> </message> <message> <location line="+34"/> <source>Minimize weight consumption (experimental) (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>How many blocks to check at startup (default: 500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Keep at most &lt;n&gt; unconnectable blocks in memory (default: %u)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Montant invalide pour -mininput=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Cleverbot is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Loading wallet...</source> <translation>Chargement du portefeuille…</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>Impossible de revenir à une version inférieure du portefeuille</translation> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>Impossible d&apos;écrire l&apos;adresse par défaut</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>Nouvelle analyse…</translation> </message> <message> <location line="+2"/> <source>Done loading</source> <translation>Chargement terminé</translation> </message> <message> <location line="-161"/> <source>To use the %s option</source> <translation>Pour utiliser l&apos;option %s</translation> </message> <message> <location line="+188"/> <source>Error</source> <translation>Erreur</translation> </message> <message> <location line="-18"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Vous devez ajouter la ligne rpcpassword=&lt;mot-de-passe&gt; au fichier de configuration : %s Si le fichier n&apos;existe pas, créez-le avec les droits de lecture seule accordés au propriétaire.</translation> </message> </context> </TS>
mit
crayygy/cpp-primer-notes
sources/9/find-str.cpp
1669
/* * This file contains code from "C++ Primer, Fifth Edition", by Stanley B. * Lippman, Josee Lajoie, and Barbara E. Moo, and is covered under the * copyright and warranty notices given in that book: * * "Copyright (c) 2013 by Objectwrite, Inc., Josee Lajoie, and Barbara E. Moo." * * * "The authors and publisher have taken care in the preparation of this book, * but make no expressed or implied warranty of any kind and assume no * responsibility for errors or omissions. No liability is assumed for * incidental or consequential damages in connection with or arising out of the * use of the information or programs contained herein." * * Permission is granted for this code to be used for educational purposes in * association with the book, given proper citation if and when posted or * reproduced.Any commercial use of this code requires the explicit written * permission of the publisher, Addison-Wesley Professional, a division of * Pearson Education, Inc. Send your request for permission, stating clearly * what code you would like to use, and in what specific way, to the following * address: * * Pearson Education, Inc. * Rights and Permissions Department * One Lake Street * Upper Saddle River, NJ 07458 * Fax: (201) 236-3290 */ #include <string> using std::string; #include <iostream> using std::cout; using std::endl; int main() { string name("AnnaBelle"); auto pos1 = name.find("Anna"); // pos1 == 0 cout << pos1 ; string lowercase("annabelle"); pos1 = lowercase.find("Anna"); // pos1 == npos cout << " " << pos1 << endl; return 0; }
mit
rmulton/lawen
webservice_caller/VelibAPICaller.py
496
from webservice_caller._ParisOpenDataAPICaller import _ParisOpenDataAPICaller from model.Transport.Velib import Velib class VelibAPICaller(_ParisOpenDataAPICaller): ''' Class that calls api to get itinirary using velib ''' def __init__(self,request): super().__init__(request) self._url = self._url.format('?dataset=stations-velib-disponibilites-en-temps-reel&facet=banking&facet=bonus&facet=status&facet=contract_name') self._modes = {'bicycling':Velib}
mit
Shahlal47/crud01
academicinfo/add.php
826
<?php //print_r($_POST); $level_of_education = $_POST['level_of_education']; $exam_title = $_POST['exam_title']; $subject = $_POST['subject']; $institution = $_POST['institution']; $result_type = $_POST['result_type']; $result = $_POST['result']; $passing_year = $_POST['passing_year']; $duration = $_POST['duration']; $achievement = $_POST['achievement']; $link = mysqli_connect("localhost", "root", "lict@2", "crud01"); $query = "INSERT INTO `crud01`.`academicinfo`(`level_of_education`, `exam_title`, `subject`, `institution`, `result_type`, `result`, `passing_year`, `duration`, `achievement`) VALUES ('$level_of_education', '$exam_title', '$subject', '$institution', '$result_type', '$result', '$passing_year', '$duration', '$achievement')"; mysqli_query($link, $query); header('location:list.php'); ?>
mit
jns300/TravelAgency.NET
TravelAgency.WF/Default.aspx.designer.cs
767
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace TravelAgency.WF { public partial class _Default { /// <summary> /// btnLogOut control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.LinkButton btnLogOut; } }
mit
SharpeRAD/Cake
src/Cake/Autofac/CakeModule.cs
4248
using Autofac; using Cake.Arguments; using Cake.Commands; using Cake.Core; using Cake.Core.Configuration; using Cake.Core.Diagnostics; using Cake.Core.IO; using Cake.Core.IO.NuGet; using Cake.Core.Packaging; using Cake.Core.Scripting; using Cake.Core.Scripting.Analysis; using Cake.Diagnostics; using Cake.NuGet; using Cake.Scripting; namespace Cake.Autofac { internal sealed class CakeModule : Module { protected override void Load(ContainerBuilder builder) { // Core services. builder.RegisterType<CakeEngine>().As<ICakeEngine>().SingleInstance(); builder.RegisterType<FileSystem>().As<IFileSystem>().SingleInstance(); builder.RegisterType<CakeEnvironment>().As<ICakeEnvironment>().SingleInstance(); builder.RegisterType<Globber>().As<IGlobber>().SingleInstance(); builder.RegisterType<ProcessRunner>().As<IProcessRunner>().SingleInstance(); builder.RegisterType<ScriptAliasFinder>().As<IScriptAliasFinder>().SingleInstance(); builder.RegisterType<CakeReportPrinter>().As<ICakeReportPrinter>().SingleInstance(); builder.RegisterType<CakeConsole>().As<IConsole>().SingleInstance(); builder.RegisterType<ScriptAnalyzer>().As<IScriptAnalyzer>().SingleInstance(); builder.RegisterType<ScriptProcessor>().As<IScriptProcessor>().SingleInstance(); builder.RegisterType<ScriptConventions>().As<IScriptConventions>().SingleInstance(); builder.RegisterType<NuGetToolResolver>().As<INuGetToolResolver>().SingleInstance(); builder.RegisterType<WindowsRegistry>().As<IRegistry>().SingleInstance(); builder.RegisterType<CakeContext>().As<ICakeContext>().SingleInstance(); // Configuration builder.RegisterType<CakeConfigurationProvider>().SingleInstance(); // NuGet addins support builder.RegisterType<NuGetVersionUtilityAdapter>().As<INuGetFrameworkCompatibilityFilter>().As<IFrameworkNameParser>().SingleInstance(); builder.RegisterType<NuGetPackageAssembliesLocator>().As<INuGetPackageAssembliesLocator>().SingleInstance(); builder.RegisterType<NuGetPackageReferenceBundler>().As<INuGetPackageReferenceBundler>().SingleInstance(); builder.RegisterType<NuGetAssemblyCompatibilityFilter>().As<INuGetAssemblyCompatibilityFilter>().SingleInstance(); builder.RegisterType<AssemblyFrameworkNameParser>().As<IAssemblyFrameworkNameParser>().SingleInstance(); // URI resource support. builder.RegisterType<NuGetPackageInstaller>().As<IPackageInstaller>().SingleInstance(); builder.RegisterType<NuGetPackageContentResolver>().As<INuGetPackageContentResolver>().SingleInstance(); // Cake services. builder.RegisterType<ArgumentParser>().As<IArgumentParser>().SingleInstance(); builder.RegisterType<CommandFactory>().As<ICommandFactory>().SingleInstance(); builder.RegisterType<CakeApplication>().SingleInstance(); builder.RegisterType<ScriptRunner>().As<IScriptRunner>().SingleInstance(); builder.RegisterType<CakeBuildLog>().As<ICakeLog>().As<IVerbosityAwareLog>().SingleInstance(); builder.RegisterType<VerbosityParser>().SingleInstance(); builder.RegisterType<CakeDebugger>().As<IDebugger>().SingleInstance(); // Register script hosts. builder.RegisterType<BuildScriptHost>().SingleInstance(); builder.RegisterType<DescriptionScriptHost>().SingleInstance(); builder.RegisterType<DryRunScriptHost>().SingleInstance(); // Register commands. builder.RegisterType<BuildCommand>().AsSelf().InstancePerDependency(); builder.RegisterType<DebugCommand>().AsSelf().InstancePerDependency(); builder.RegisterType<DescriptionCommand>().AsSelf().InstancePerDependency(); builder.RegisterType<DryRunCommand>().AsSelf().InstancePerDependency(); builder.RegisterType<HelpCommand>().AsSelf().InstancePerDependency(); builder.RegisterType<VersionCommand>().AsSelf().InstancePerDependency(); } } }
mit
kevinladkins/rails-library
app/models/book.rb
2317
class Book < ApplicationRecord extend Searchable::ClassMethods enum classification: {fiction: 0, non_fiction: 1} belongs_to :author has_many :loans has_many :borrowers, :through => :loans, :source => :patron has_many :book_categories has_many :categories, through: :book_categories validates :copies, :title, :classification, :author, presence: true validates :copies, numericality: {greater_than: 0} validates_associated :author before_save :set_alpha_title ## attribute builders ## def author_attributes=(author_attributes) if book_author = Author.find_by(first_name: author_attributes[:first_name], last_name: author_attributes[:last_name]) self.author = book_author else self.build_author(author_attributes) unless author_attributes[:last_name].blank? end end def category_ids=(ids) ids.delete("") rejected_ids = self.category_ids - ids new_ids = ids - self.category_ids rejected_ids.each {|id| self.categories.delete(id)} unless rejected_ids.empty? ids.empty? ? self.categories.destroy_all : new_ids.each {|id| self.categories << Category.find(id)} end def categories_attributes=(categories_attributes) name = categories_attributes["0"][:name] self.categories.build(name: name, classification: self.classification) unless name.blank? end def add_category(category) self.categories << category unless self.categories.include?(category) end ## alphabetize_title ## def set_alpha_title if self.title.split.first == "The" split = self.title.split split.shift self.alpha_title = split.join(" ").concat(", The") else self.alpha_title = self.title end end ## most_borrowed ## def self.most_borrowed joins(:loans).group("loans.book_id").order("count (*) desc").limit(5) end ## global stats ## def self.total_count sum(:copies) end ## availability status ## def available? available_copies > 0 end def available_copies self.copies - self.checked_out_copies end def checked_out_copies self.loans.checked_out.count(:book_id) end def add_copies(new_copies) self.copies = self.copies + new_copies end def check_out self.errors.add(:available_copies, "No copies available") unless available? end end
mit
fabricio-oliveira/tp_healthcheck
lib/tp_healthcheck.rb
109
# frozen_string_literal: true module TPHealthcheck require 'tp_healthcheck/engine' if defined?(Rails) end
mit
omniscale/anol
examples/dynamicgeojson.js
1536
proj4.defs("EPSG:25832","+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs"); var stationLayer; angular.module('example', ['anol.zoom']) .config(['MapServiceProvider', 'LayersServiceProvider', function(MapServiceProvider, LayersServiceProvider) { MapServiceProvider.addView(new ol.View({ projection: ol.proj.get('EPSG:25832'), center: ol.proj.transform( [949504, 6803691], ol.proj.get('EPSG:3857'), ol.proj.get('EPSG:25832') ), zoom: 18 })); var wms = new anol.layer.TiledWMS({ olLayer: { source: { url: 'http://maps.omniscale.net/wms/demo/default/service?', params: { 'LAYERS': 'osm', 'SRS': 'EPSG:25832' } } } }); stationLayer = new anol.layer.BBOXGeoJSON({ name: 'selectable_stations', displayInLayerswitcher: true, featureinfo: { properties: ['name', 'routes'] }, olLayer: { style: new ol.style.Style({ fill: new ol.style.Fill({ color: 'rgba(239, 130, 20, 0.5)' }), stroke: new ol.style.Stroke({ color: '#EF8214', width: 2 }) }), source: { featureProjection: ol.proj.get('EPSG:25832'), extentProjection: ol.proj.get('EPSG:4326'), dataProjection: ol.proj.get('EPSG:3857'), url: "http://localhost:5000/mobiel/stations.geojson?layer=mobiel_day" } } }); LayersServiceProvider.setLayers([stationLayer, wms]); }]);
mit
dpla/KriKri
lib/krikri/parsers/oai_parser_headers.rb
589
module Krikri ## # Concern for Krikri::XmlParsers with oai-style headers # @example # class MyOaiParser < Krikri::XmlParser # include Krikri::OaiParserHeaders # end module OaiParserHeaders extend ActiveSupport::Concern ## # @return [Krikri::Parser::ValueArray] a ValueArray containing the # header node as a `Value` of this parser class def header header_node = Nokogiri::XML(record.to_s).at_xpath('//xmlns:header') Krikri::Parser::ValueArray .new([self.class::Value.new(header_node, root.namespaces)]) end end end
mit
gionkunz/robolino
src/js/core/image-utilities.js
1221
export function isPowerOfTwo(length) { return (length & (length - 1)) === 0; } export function nextHighestPowerOfTwo(length) { --length; for (let i = 1; i < 32; i <<= 1) { length = length | length >> i; } return length + 1; } export function convertImageToPowerOfTwo(image) { if (!isPowerOfTwo(image.width) || !isPowerOfTwo(image.height)) { const canvas = document.createElement('canvas'); canvas.width = nextHighestPowerOfTwo(image.width); canvas.height = nextHighestPowerOfTwo(image.height); const ctx = canvas.getContext('2d'); ctx.drawImage(image, 0, 0, canvas.width, canvas.height); image = document.createElement('img'); image.src = canvas.toDataURL(); return new Promise((resolve) => { image.onload = function imageLoaded() { resolve(image); }; }); } return image; } export function loadImageFromUrl(url) { return fetch(url) .then((response) => response.blob()) .then((blob) => { const image = document.createElement('img'); image.src = URL.createObjectURL(blob); return new Promise((resolve) => { image.onload = function imageLoaded() { resolve(image); }; }); }); }
mit
Shartul/Page_Object_Framework
features/support/hooks.rb
709
include SauceLabs Before do ENV['BROWSER'] = "chrome" if ENV['BROWSER'].nil? ENV['WHERE'] = "local" if ENV['WHERE'].nil? if(ENV['WHERE']=="remote") @browser = SauceLabs.watir_browser(ENV['BROWSER'].to_sym,{url:"http://localhost:4444/wd/hub"}) else @browser = SauceLabs.watir_browser(ENV['BROWSER'].to_sym) end @browser.window.maximize end After do |scenario| if scenario.failed? Dir::mkdir('screenshots') if not File.directory?('screenshots') screenshot = "./screenshots/FAILED_#{scenario.name.gsub(' ','_').gsub(/[^0-9A-Za-z_]/, '')}.png" @browser.driver.save_screenshot(screenshot) embed screenshot, 'image/png' end @browser.cookies.clear @browser.quit end
mit
hsp-users-jp/pkg.hsp-users.jp
fuel/app/migrations/009_create_hsp_specifications.php
840
<?php /** * pkg.hsp-users.jp - HSP Package DB * * @author sharkpp * @license MIT License * @copyright 2014 sharkpp * @link http://www.sharkpp.net/ */ namespace Fuel\Migrations; class Create_hsp_specifications { public function up() { \DBUtil::create_table('hsp_specifications', array( 'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true, 'unsigned' => true), 'hsp_category_id' => array('constraint' => 11, 'type' => 'int'), 'version' => array('constraint' => 20, 'type' => 'varchar'), 'created_at' => array('type' => 'timestamp', 'null' => true), 'updated_at' => array('type' => 'timestamp', 'null' => true), 'deleted_at' => array('type' => 'timestamp', 'null' => true), ), array('id')); } public function down() { \DBUtil::drop_table('hsp_specifications'); } }
mit
layersol/schoolwork
SmartSchoolManagementSystem/SmartSchoolManagementSystem/AssignClass.cs
400
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace SmartSchoolManagementSystem { public partial class AssignClass : Form { public AssignClass() { InitializeComponent(); } } }
mit
deregenboog/ecd
src/IzBundle/Form/DoelgroepType.php
898
<?php namespace IzBundle\Form; use AppBundle\Form\BaseType; use IzBundle\Entity\Doelgroep; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; class DoelgroepType extends AbstractType { /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('naam') ->add('actief') ->add('submit', SubmitType::class, ['label' => 'Opslaan']) ; } /** * {@inheritdoc} */ public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ 'class' => Doelgroep::class, ]); } public function getParent() { return BaseType::class; } }
mit
GamerBet/lol-replay-downloader-cli
src/EloGank/Component/Configuration/Exception/ConfigurationFileNotFoundException.php
484
<?php /* * This file is part of the "EloGank League of Legends Replay Downloader" package. * * https://github.com/EloGank/lol-replay-downloader-cli * * For the full license information, please view the LICENSE * file that was distributed with this source code. */ namespace EloGank\Component\Configuration\Exception; /** * @author Sylvain Lorinet <sylvain.lorinet@gmail.com> */ class ConfigurationFileNotFoundException extends \InvalidArgumentException { }
mit
strawbrary/php-blake2
tests/b2sum.phpt
343
--TEST-- Verify the b2sum is an alias to blake2_file and have the same output --SKIPIF-- <?php if (!extension_loaded("blake2")) print "skip"; ?> --FILE-- <?php echo b2sum('tests/sample.txt').PHP_EOL; ?> --EXPECT-- a61b779ff667fbcc4775cbb02cd0763b9b5312fe6359a44a003f582ce6897c81a38a876122ce91dfec547d582fe269f6ea9bd291b60bccf95006dac10a4316f2
mit
kherge-abandoned/php-json
tests/KHerGe/JSON/JSONTest.php
8844
<?php namespace Test\KHerGe\JSON; use KHerGe\JSON\Exception\Decode\ControlCharacterException; use KHerGe\JSON\Exception\Decode\DepthException as DecodeDepthException; use KHerGe\JSON\Exception\Decode\StateMismatchException; use KHerGe\JSON\Exception\Decode\SyntaxException; use KHerGe\JSON\Exception\Decode\UTF8Exception; use KHerGe\JSON\Exception\DecodeException; use KHerGe\JSON\Exception\Encode\DepthException as EncodeDepthException; use KHerGe\JSON\Exception\Encode\InfiniteOrNotANumberException; use KHerGe\JSON\Exception\Encode\RecursionException; use KHerGe\JSON\Exception\Encode\UnsupportedTypeException; use KHerGe\JSON\Exception\EncodeException; use KHerGe\JSON\Exception\LintingException; use KHerGe\JSON\Exception\ValidationException; use KHerGe\JSON\JSON; use PHPUnit_Framework_TestCase as TestCase; use function KHerGe\File\remove; use function KHerGe\File\temp_file; /** * Verifies that the JSON data manager functions as intended. * * @author Kevin Herrera <kevin@herrera.io> * * @coversDefaultClass \KHerGe\JSON\JSON */ class JSONTest extends TestCase { /** * The JSON data manager. * * @var JSON */ private $json; /** * The temporary paths. * * @var string[] */ private $temp = []; /** * Returns exceptional decoding conditions and expected exceptions. * * @return array The everything. */ public function getExceptionalDecodingConditions() { return [ // #0 [ '[[1]]', DecodeDepthException::class ], // #1 [ '[1}', StateMismatchException::class ], // #2 [ '["' . chr(0) . 'test"]', ControlCharacterException::class ], // #3 [ '[', SyntaxException::class ], // #4 [ '["' . chr(193) . '"]', UTF8Exception::class ] ]; } /** * Returns exceptional encoding conditions and expected exceptions. * * @return array The everything. */ public function getExceptionalEncodingConditions() { return [ // #0 [ [[[[[[1]]]]]], EncodeDepthException::class ], // #1 [ call_user_func( function () { $value = (object) []; $value->value = $value; return $value; } ), RecursionException::class ], // #2 [ INF, InfiniteOrNotANumberException::class ], // #3 [ STDIN, UnsupportedTypeException::class ] ]; } /** * Verify that a JSON encoded value can be decoded. * * @covers ::decode * @covers ::hasError */ public function testDecodeAnEncodedJsonValue() { self::assertEquals( ['test' => 123], $this->json->decode('{"test":123}', true), 'The decoded value was not returned.' ); } /** * Verify that a decoding error throws the appropriate exception. * * @param string $json The invalid JSON value. * @param string $class The expected exception class. * * @covers ::decode * @covers ::hasError * * @dataProvider getExceptionalDecodingConditions */ public function testADecodingErrorThrowsTheAppropriateException( $json, $class ) { $this->expectException($class); $this->json->decode($json, false, 2); } /** * Verify that a JSON encoded file can be read and decoded. * * @covers ::decodeFile */ public function testDecodeAJsonEncodedFile() { $this->temp[] = $path = temp_file(); file_put_contents($path, '{"test":123}'); self::assertEquals( ['test' => 123], $this->json->decodeFile($path, true), 'The decoded value was not returned.' ); } /** * Verify that a a decoding error for a file includes the path in the exception. * * @covers ::decodeFile */ public function testADecodingErrorThrowsAnExceptionWithTheFilePathInIt() { $path = '/this/path/should/not/exist.json'; $this->expectException(DecodeException::class); $this->expectExceptionMessageRegExp( "#$path#" ); $this->json->decodeFile($path); } /** * Verify that a value can be encoded. * * @covers ::encode * @covers ::hasError */ public function testEncodeANativeValueIntoJson() { self::assertEquals( '{"test":123}', $this->json->encode(['test' => 123]), 'The encoded value was not returned.' ); } /** * Verify that an encoding error throws the appropriate exception. * * @param mixed $value The unencodable value. * @param string $class The expected exception class. * * @covers ::encode * @covers ::hasError * * @dataProvider getExceptionalEncodingConditions */ public function testAnEncodingErrorThrowsTheAppropriateException( $value, $class ) { $this->expectException($class); $this->json->encode($value, 0, 5); } /** * Verify that a value can be encoded and saved to a file. * * @covers ::encodeFile */ public function testEncodeANativeValueAndSaveItToAFile() { $this->temp[] = $path = temp_file(); $this->json->encodeFile(['test' => 123], $path); self::assertEquals( '{"test":123}', file_get_contents($path), 'The encoded value was not written to a file.' ); } /** * Verify that a a encoding error for a file includes the path in the exception. * * @covers ::encodeFile */ public function testAEncodingErrorThrowsAnExceptionWithTheFilePathInIt() { $path = '/this/path/should/not/exist.json'; $this->expectException(EncodeException::class); $this->expectExceptionMessageRegExp( "#$path#" ); $this->json->encodeFile(STDIN, $path); } /** * Verify that a failed lint throws an exception. * * @covers ::doLint * @covers ::lint */ public function testFailingLintingThrowsAnException() { $this->expectException(LintingException::class); $this->json->lint('{'); } /** * Verify that a failed file lint throws an exception with a path in it. * * @covers ::doLint * @covers ::lintFile */ public function testFailingFileLintingThrowsAnException() { $this->temp[] = $path = temp_file(); file_put_contents($path, '{'); $this->expectException(LintingException::class); $this->expectExceptionMessageRegExp("#$path#"); $this->json->lintFile($path); } /** * Verify that a failed validation throws an exception. * * @covers ::validate */ public function testFailingValidationThrowsAnException() { $schema = (object) [ 'type' => 'object', 'properties' => (object) [ 'test' => (object) [ 'description' => 'A test value.', 'type' => 'integer' ] ] ]; $this->expectException(ValidationException::class); $this->json->validate($schema, (object) ['test' => '123']); } /** * Verify that a successful validation does not throw an exception. * * @covers ::validate */ public function testSuccessfulValidationDoesNotThrowAnException() { $schema = (object) [ 'type' => 'object', 'properties' => (object) [ 'test' => (object) [ 'description' => 'A test value.', 'type' => 'integer' ] ] ]; $this->json->validate($schema, (object) ['test' => 123]); } /** * Creates a new JSON data manager. */ protected function setUp() { $this->json = new JSON(); } /** * Deletes the temporary paths. */ protected function tearDown() { foreach ($this->temp as $path) { if (file_exists($path)) { remove($path); } } } }
mit
knuu/competitive-programming
poj/poj3041.cpp
2666
// for poj (old g++ version, cannot use bits/stdc++.h) #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <map> #include <set> #include <queue> #include <vector> #include <iostream> #include <bitset> #include <algorithm> #include <complex> #include <string> #include <utility> using namespace std; typedef long long int ll; typedef pair<int, int> P; typedef pair<ll, ll> Pll; typedef vector<int> Vi; typedef pair<int, P> T; #define FOR(i,s,x) for(int i=s;i<(int)(x);i++) #define REP(i,x) FOR(i,0,x) #define ALL(c) c.begin(), c.end() #define DUMP( x ) cerr << #x << " = " << ( x ) << endl const int dr[4] = {-1, 0, 1, 0}; const int dc[4] = {0, 1, 0, -1}; #define INF 1<<29 template <typename T> struct BipartiteMatching { struct Edge { int to, rev; T cap; Edge(int to, int rev, T cap) : to(to), rev(rev), cap(cap) { } }; typedef vector<Edge> Edges; vector<Edges> G; int V, source, sink; vector<int> level, iter; BipartiteMatching(int V1, int V2) { V = V1 + V2 + 2, source = V-2, sink = V-1; G.resize(V); add_sink_source(V1, V2); } void add_edge(int from, int to) { G[from].push_back(Edge(to, G[to].size(), 1)); G[to].push_back(Edge(from, (int)G[from].size()-1, 0)); } void add_sink_source(int V1, int V2) { for (int i = 0; i < V1; i++) add_edge(source, i); for (int i = V1; i < V1+V2; i++) add_edge(i, sink); } void bfs(int source) { level.assign(V, -1); queue<int> que; que.push(source); level[source] = 0; while (!que.empty()) { int v = que.front(); que.pop(); for (int i = 0; i < (int)G[v].size(); i++) { Edge &e = G[v][i]; if (e.cap > 0 && level[e.to] < 0) { level[e.to] = level[v] + 1; que.push(e.to); } } } } T dfs(int v, int sink, T flow) { if (v == sink) return flow; for (int &i = iter[v]; i < (int)G[v].size(); i++) { Edge &e = G[v][i]; if (e.cap > 0 && level[v] < level[e.to]) { T d = dfs(e.to, sink, min(e.cap, flow)); if (d > 0) { e.cap -= d; G[e.to][e.rev].cap += d; return d; } } } return 0; } T dinic() { T flow = 0; while (true) { bfs(source); if (level[sink] < 0) return flow; iter.assign(V, 0); T f; while ((f = dfs(source, sink, INF)) > 0) { flow += f; } } } }; int main() { int N, K; scanf("%d %d", &N, &K); BipartiteMatching<int> bp(N, N); REP(_, K) { int r, c; scanf("%d %d", &r, &c); r--, c--; bp.add_edge(r, N+c); } printf("%d\n", bp.dinic()); return 0; }
mit
DennisWandschura/vxEngine
source/vxRenderAspectGL/dllExport.cpp
930
#include "dllExport.h" #include "RenderAspect.h" #include "EditorRenderAspect.h" #include <vxEngineLib/debugPrint.h> RenderAspectInterface* createRenderAspect() { auto result = (RenderAspect*)_aligned_malloc(sizeof(RenderAspect), __alignof(RenderAspect)); new (result) RenderAspect{}; return result; } void destroyRenderAspect(RenderAspectInterface *p) { if (p != nullptr) { auto ptr = (RenderAspect*)p; ptr->~RenderAspect(); _aligned_free(ptr); } } Editor::RenderAspectInterface* createEditorRenderAspect() { auto result = (Editor::RenderAspect*)_aligned_malloc(sizeof(Editor::RenderAspect), __alignof(Editor::RenderAspect)); new (result)Editor::RenderAspect{}; return result; } template<typename T> void destroy(T* ptr) { ptr->~T(); } void destroyEditorRenderAspect(Editor::RenderAspectInterface *p) { if (p != nullptr) { auto ptr = (Editor::RenderAspect*)p; destroy(ptr); _aligned_free(ptr); } }
mit
gabrielwr/React-Retirement-Calculator
server/index.js
934
const path = require('path'); const express = require('express'); const volleyball = require('volleyball'); const bodyParser = require('body-parser'); const session = require('express-session'); const app = express(); const PORT = process.env.PORT || 3000; app.use(express.static(path.join(__dirname, '../public'))); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use(session({ secret: 'a wildly insecure secret', resave: false, saveUninitialized: false })); app.use(volleyball); app.listen(PORT, () => { console.log('Server listening on port: ', PORT); }); app.use((err, req, res, next) => { console.error(err); console.error(err.stack); res.status(err.status || 500).send(err.message || 'Internal Server Error'); }); //Sends index.html file to client on all get requests app.get('*', (req, res, next) => { res.sendFile(path.join(__dirname, '../public/index.html')); });
mit
ppschweiz/MemberDatabase
Organigram/MemberAdmin/Resources.Designer.cs
35145
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace MemberAdmin { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MemberAdmin.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized string similar to Accept. /// </summary> internal static string Accept { get { return ResourceManager.GetString("Accept", resourceCulture); } } /// <summary> /// Looks up a localized string similar to After. /// </summary> internal static string After { get { return ResourceManager.GetString("After", resourceCulture); } } /// <summary> /// Looks up a localized string similar to (all). /// </summary> internal static string AllItems { get { return ResourceManager.GetString("AllItems", resourceCulture); } } /// <summary> /// Looks up a localized string similar to All members. /// </summary> internal static string AllMembers { get { return ResourceManager.GetString("AllMembers", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Anomalies. /// </summary> internal static string Anomaies { get { return ResourceManager.GetString("Anomaies", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Attachement. /// </summary> internal static string Attachement { get { return ResourceManager.GetString("Attachement", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Attribute. /// </summary> internal static string Attribute { get { return ResourceManager.GetString("Attribute", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Attributes. /// </summary> internal static string Attributes { get { return ResourceManager.GetString("Attributes", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Back. /// </summary> internal static string Back { get { return ResourceManager.GetString("Back", resourceCulture); } } /// <summary> /// Looks up a localized string similar to BCC. /// </summary> internal static string BCC { get { return ResourceManager.GetString("BCC", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Before. /// </summary> internal static string Before { get { return ResourceManager.GetString("Before", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Text. /// </summary> internal static string Body { get { return ResourceManager.GetString("Body", resourceCulture); } } /// <summary> /// Looks up a localized string similar to CC. /// </summary> internal static string CC { get { return ResourceManager.GetString("CC", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Activate. /// </summary> internal static string CertificateAccept { get { return ResourceManager.GetString("CertificateAccept", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Find and accept; Code:. /// </summary> internal static string CertificateAcceptInfo { get { return ResourceManager.GetString("CertificateAcceptInfo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Certificate Administration. /// </summary> internal static string CertificateAdmin { get { return ResourceManager.GetString("CertificateAdmin", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Find. /// </summary> internal static string CertificateFind { get { return ResourceManager.GetString("CertificateFind", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Certificate not found.. /// </summary> internal static string CertificateNotFound { get { return ResourceManager.GetString("CertificateNotFound", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Deactivate. /// </summary> internal static string CertificateRevoke { get { return ResourceManager.GetString("CertificateRevoke", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Commit. /// </summary> internal static string Commit { get { return ResourceManager.GetString("Commit", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Create data. /// </summary> internal static string CommitCreate { get { return ResourceManager.GetString("CommitCreate", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Delete data. /// </summary> internal static string CommitDelete { get { return ResourceManager.GetString("CommitDelete", resourceCulture); } } /// <summary> /// Looks up a localized string similar to No operation to commit.. /// </summary> internal static string CommitNoOperation { get { return ResourceManager.GetString("CommitNoOperation", resourceCulture); } } /// <summary> /// Looks up a localized string similar to There is no update to commit.. /// </summary> internal static string CommitNoUpdate { get { return ResourceManager.GetString("CommitNoUpdate", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Update data. /// </summary> internal static string CommitUpdate { get { return ResourceManager.GetString("CommitUpdate", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Create. /// </summary> internal static string Create { get { return ResourceManager.GetString("Create", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Notation {0}. /// </summary> internal static string DateInfo { get { return ResourceManager.GetString("DateInfo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Delete. /// </summary> internal static string Delete { get { return ResourceManager.GetString("Delete", resourceCulture); } } /// <summary> /// Looks up a localized string similar to If you really want to to delete this data, please enter the security code.. /// </summary> internal static string DeleteWarning { get { return ResourceManager.GetString("DeleteWarning", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Done. /// </summary> internal static string Done { get { return ResourceManager.GetString("Done", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Edit. /// </summary> internal static string Edit { get { return ResourceManager.GetString("Edit", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Email. /// </summary> internal static string Email { get { return ResourceManager.GetString("Email", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Please create a ticket for this error.&lt;br&gt;Bitte erstelle ein Ticket für diesen Fehler.. /// </summary> internal static string ErrorPageAdmin { get { return ResourceManager.GetString("ErrorPageAdmin", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Error / Fehler. /// </summary> internal static string ErrorPageError { get { return ResourceManager.GetString("ErrorPageError", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Unknown Error / Unbekannter Fehler. /// </summary> internal static string ErrorPageUnknownError { get { return ResourceManager.GetString("ErrorPageUnknownError", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Export. /// </summary> internal static string Export { get { return ResourceManager.GetString("Export", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Repair. /// </summary> internal static string Fix { get { return ResourceManager.GetString("Fix", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Repair (Member). /// </summary> internal static string FixToMember { get { return ResourceManager.GetString("FixToMember", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Repair (Non-member). /// </summary> internal static string FixToNonMember { get { return ResourceManager.GetString("FixToNonMember", resourceCulture); } } /// <summary> /// Looks up a localized string similar to From. /// </summary> internal static string From { get { return ResourceManager.GetString("From", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Groups. /// </summary> internal static string Groups { get { return ResourceManager.GetString("Groups", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Help. /// </summary> internal static string HelpText { get { return ResourceManager.GetString("HelpText", resourceCulture); } } /// <summary> /// Looks up a localized string similar to https://projects.piratenpartei.ch/knowledgebase/articles/86. /// </summary> internal static string HelpUrl { get { return ResourceManager.GetString("HelpUrl", resourceCulture); } } /// <summary> /// Looks up a localized string similar to https://projects.piratenpartei.ch/knowledgebase/articles/86#Search. /// </summary> internal static string HelpUrlSearch { get { return ResourceManager.GetString("HelpUrlSearch", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Id. /// </summary> internal static string Id { get { return ResourceManager.GetString("Id", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Join. /// </summary> internal static string Join { get { return ResourceManager.GetString("Join", resourceCulture); } } /// <summary> /// Looks up a localized string similar to This is a request to join the party. If you approve or reject the request, the person and its section, if any will be notified.. /// </summary> internal static string JoinRequestInfo { get { return ResourceManager.GetString("JoinRequestInfo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Joining. /// </summary> internal static string JoinRequestTitle { get { return ResourceManager.GetString("JoinRequestTitle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Kick. /// </summary> internal static string Kick { get { return ResourceManager.GetString("Kick", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Langauge. /// </summary> internal static string Language { get { return ResourceManager.GetString("Language", resourceCulture); } } /// <summary> /// Looks up a localized string similar to All Languages. /// </summary> internal static string LanguagesAll { get { return ResourceManager.GetString("LanguagesAll", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Leave. /// </summary> internal static string Leave { get { return ResourceManager.GetString("Leave", resourceCulture); } } /// <summary> /// Looks up a localized string similar to This is a request to leave the party. If you approve or reject the request, the person and its section, if any will be notified.. /// </summary> internal static string LeaveRequestInfo { get { return ResourceManager.GetString("LeaveRequestInfo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Leaving. /// </summary> internal static string LeaveRequestTitle { get { return ResourceManager.GetString("LeaveRequestTitle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Letter. /// </summary> internal static string Letter { get { return ResourceManager.GetString("Letter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Requests. /// </summary> internal static string ListRequest { get { return ResourceManager.GetString("ListRequest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Texts. /// </summary> internal static string ListText { get { return ResourceManager.GetString("ListText", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Load. /// </summary> internal static string Load { get { return ResourceManager.GetString("Load", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Load template. /// </summary> internal static string LoadTemplate { get { return ResourceManager.GetString("LoadTemplate", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Login. /// </summary> internal static string Login { get { return ResourceManager.GetString("Login", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Logoff. /// </summary> internal static string Logoff { get { return ResourceManager.GetString("Logoff", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mailer. /// </summary> internal static string Mailer { get { return ResourceManager.GetString("Mailer", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Mail not ready.. /// </summary> internal static string MailNotReady { get { return ResourceManager.GetString("MailNotReady", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Modify. /// </summary> internal static string Modify { get { return ResourceManager.GetString("Modify", resourceCulture); } } /// <summary> /// Looks up a localized string similar to One Date per row. Notation {0}. /// </summary> internal static string MultiDateInfo { get { return ResourceManager.GetString("MultiDateInfo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Non-member. /// </summary> internal static string NonMember { get { return ResourceManager.GetString("NonMember", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Not defined. /// </summary> internal static string NotDefined { get { return ResourceManager.GetString("NotDefined", resourceCulture); } } /// <summary> /// Looks up a localized string similar to OK. /// </summary> internal static string Ok { get { return ResourceManager.GetString("Ok", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Ordering. /// </summary> internal static string Ordering { get { return ResourceManager.GetString("Ordering", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Password. /// </summary> internal static string Password { get { return ResourceManager.GetString("Password", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Language. /// </summary> internal static string PreferredLanguage { get { return ResourceManager.GetString("PreferredLanguage", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Notification. /// </summary> internal static string PreferredNotificationMethod { get { return ResourceManager.GetString("PreferredNotificationMethod", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Prepare. /// </summary> internal static string Prepare { get { return ResourceManager.GetString("Prepare", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Reaccept. /// </summary> internal static string Reaccept { get { return ResourceManager.GetString("Reaccept", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Real Delete. /// </summary> internal static string RealDelete { get { return ResourceManager.GetString("RealDelete", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Reason. /// </summary> internal static string Reason { get { return ResourceManager.GetString("Reason", resourceCulture); } } /// <summary> /// Looks up a localized string similar to View. /// </summary> internal static string RequestView { get { return ResourceManager.GetString("RequestView", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Rollback. /// </summary> internal static string Rollback { get { return ResourceManager.GetString("Rollback", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Repeat. /// </summary> internal static string SaftyCodeDest { get { return ResourceManager.GetString("SaftyCodeDest", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Security code. /// </summary> internal static string SaftyCodeSource { get { return ResourceManager.GetString("SaftyCodeSource", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Save. /// </summary> internal static string Save { get { return ResourceManager.GetString("Save", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Save template. /// </summary> internal static string SaveTemplate { get { return ResourceManager.GetString("SaveTemplate", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Search. /// </summary> internal static string Search { get { return ResourceManager.GetString("Search", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Filter. /// </summary> internal static string SearchFilter { get { return ResourceManager.GetString("SearchFilter", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Output. /// </summary> internal static string SearchOutput { get { return ResourceManager.GetString("SearchOutput", resourceCulture); } } /// <summary> /// Looks up a localized string similar to All persons. /// </summary> internal static string SectionAll { get { return ResourceManager.GetString("SectionAll", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Members in no section. /// </summary> internal static string SectionMembers { get { return ResourceManager.GetString("SectionMembers", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Non-members. /// </summary> internal static string SectionPeople { get { return ResourceManager.GetString("SectionPeople", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Send. /// </summary> internal static string Send { get { return ResourceManager.GetString("Send", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sender. /// </summary> internal static string Sender { get { return ResourceManager.GetString("Sender", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sent. /// </summary> internal static string SentDate { get { return ResourceManager.GetString("SentDate", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Abroad. /// </summary> internal static string StateAbroad { get { return ResourceManager.GetString("StateAbroad", resourceCulture); } } /// <summary> /// Looks up a localized string similar to All Cantons. /// </summary> internal static string StateAll { get { return ResourceManager.GetString("StateAll", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Subject. /// </summary> internal static string Subject { get { return ResourceManager.GetString("Subject", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Templates. /// </summary> internal static string Templates { get { return ResourceManager.GetString("Templates", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Send test mail to me.... /// </summary> internal static string Test { get { return ResourceManager.GetString("Test", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Text. /// </summary> internal static string Text { get { return ResourceManager.GetString("Text", resourceCulture); } } /// <summary> /// Looks up a localized string similar to The body of the mail supports textile formatting. It will be rendered in text and HTML format. Supported markup is {0}. /// </summary> internal static string TextileSupportInfo { get { return ResourceManager.GetString("TextileSupportInfo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Titel. /// </summary> internal static string Title { get { return ResourceManager.GetString("Title", resourceCulture); } } /// <summary> /// Looks up a localized string similar to To. /// </summary> internal static string To { get { return ResourceManager.GetString("To", resourceCulture); } } /// <summary> /// Looks up a localized string similar to To languages. /// </summary> internal static string ToLanguages { get { return ResourceManager.GetString("ToLanguages", resourceCulture); } } /// <summary> /// Looks up a localized string similar to To notifications. /// </summary> internal static string ToNotificationMethods { get { return ResourceManager.GetString("ToNotificationMethods", resourceCulture); } } /// <summary> /// Looks up a localized string similar to To sections. /// </summary> internal static string ToSections { get { return ResourceManager.GetString("ToSections", resourceCulture); } } /// <summary> /// Looks up a localized string similar to To Cantons. /// </summary> internal static string ToStates { get { return ResourceManager.GetString("ToStates", resourceCulture); } } /// <summary> /// Looks up a localized string similar to This is a transfer to another section. If you approve or reject the request, the person and its former and new section, if any will be notified.. /// </summary> internal static string TransferRequestInfo { get { return ResourceManager.GetString("TransferRequestInfo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Section transfer. /// </summary> internal static string TransferRequestTitle { get { return ResourceManager.GetString("TransferRequestTitle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Unknown person.. /// </summary> internal static string UnknownPerson { get { return ResourceManager.GetString("UnknownPerson", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Username. /// </summary> internal static string Username { get { return ResourceManager.GetString("Username", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Variables. /// </summary> internal static string Variables { get { return ResourceManager.GetString("Variables", resourceCulture); } } /// <summary> /// Looks up a localized string similar to The requested action is not kown.. /// </summary> internal static string ViewActionError { get { return ResourceManager.GetString("ViewActionError", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Write. /// </summary> internal static string Write { get { return ResourceManager.GetString("Write", resourceCulture); } } } }
mit
nileshk/myconnector
src/main/java/com/myconnector/web/controller/ReleaseUserSelectionController.java
2516
package com.myconnector.web.controller; import java.util.Iterator; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.springframework.validation.BindException; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.SimpleFormController; import org.springframework.web.servlet.view.RedirectView; import com.myconnector.service.ReleaseUserService; import com.myconnector.service.UserService; import com.myconnector.web.ChecklistCommand; /** * * @author Nilesh Kapadia (nileshka@gmail.com) */ public class ReleaseUserSelectionController extends SimpleFormController { Logger logger = Logger.getLogger(ReleaseUserSelectionController.class); UserService userService; ReleaseUserService releaseUserService; public void setReleaseUserService(ReleaseUserService releaseUserService) { this.releaseUserService = releaseUserService; } public void setUserService(UserService userService) { this.userService = userService; } public ReleaseUserSelectionController() { setCommandClass(ChecklistCommand.class); } protected Object formBackingObject(HttpServletRequest request) throws Exception { return new ChecklistCommand(); } protected ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException errors) throws Exception { ModelAndView mv = super.showForm(request, response, errors); List userList = userService.getList(); mv.addObject("userList", userList); return mv; } protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception { ChecklistCommand checklistCommand = (ChecklistCommand) command; List list = checklistCommand.getChecks(); Iterator it = list.iterator(); while(it.hasNext()) { String id = (String) it.next(); logger.debug(id); if(id == null || id.length() < 1) { it.remove(); } } releaseUserService.addUserList(checklistCommand.getId(), list); String view = getSuccessView() + "?id=" + checklistCommand.getId(); return new ModelAndView(new RedirectView(view, false)); } }
mit
waltertschwe/guide-to-the-stars
app/AppKernel.php
1550
<?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(), new Symfony\Bundle\MonologBundle\MonologBundle(), new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), new Symfony\Bundle\AsseticBundle\AsseticBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new Entertainment\Bundle\GuideToTheStarsBundle\EntertainmentGuideToTheStarsBundle(), new Entertainment\Bundle\RedCarpetBundle\EntertainmentRedCarpetBundle(), new Entertainment\Bundle\ArrivalsBundle\EntertainmentArrivalsBundle(), ); if (in_array($this->getEnvironment(), array('dev', 'test'))) { $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); } return $bundles; } public function registerContainerConfiguration(LoaderInterface $loader) { $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); } }
mit
hakanensari/peddler
lib/peddler/xml_response_parser.rb
527
# frozen_string_literal: true require 'peddler/xml_parser' module Peddler # @!visibility private class XMLResponseParser < XMLParser MATCHER = /^Message$|^Node$|Report|Result/.freeze private_constant :MATCHER def next_token parse.fetch('NextToken', false) end private # FIXME: In next major version bump, stop assuming we know report internals. def find_data payload = xml.values.first found = payload.find { |k, _| k.match(MATCHER) } found&.last end end end
mit
ttasanen/ruby-ll
spec/ll/message_spec.rb
2355
require 'spec_helper' describe LL::Message do describe '#initialize' do before do @source_line = source_line('') @message = described_class.new(:error, 'Foobar', @source_line) end it 'sets the message type' do @message.type.should == :error end it 'sets the message' do @message.message.should == 'Foobar' end it 'sets the source line' do @message.source_line.should == @source_line end end describe '#to_s' do it 'returns an ANSI colored string' do path = File.expand_path(__FILE__) type = ANSI.ansi('error', :red, :bold) line = source_line('foo = bar;', 1, 7, path) message = described_class.new(:error, 'Foobar!', line) expected = <<-EOF.strip #{ANSI.ansi('spec/ll/message_spec.rb:1:7', :white, :bold)}:#{type}: Foobar! foo = bar; #{ANSI.ansi('^', :magenta, :bold)} EOF message.to_s.should == expected end end describe '#inspect' do it 'returns the inspect output' do line = source_line('') message = described_class.new(:error, 'foo', line) message.inspect.should == 'Message(type: :error, message: "foo", '\ 'file: "(ruby)", line: 1, column: 1)' end end describe '#determine_path' do it 'returns the raw path when it is a default path' do line = source_line('') message = described_class.new(:error, 'foo', line) message.determine_path.should == line.file end it 'returns a path relative to the current working directory' do line = source_line('', 1, 1, File.expand_path(__FILE__)) message = described_class.new(:error, 'foo', line) message.determine_path.should == 'spec/ll/message_spec.rb' end it 'returns an absolute path for paths outside of the working directory' do line = source_line('', 1, 1, '/tmp/foo.rb') message = described_class.new(:error, 'foo', line) message.determine_path.should == '/tmp/foo.rb' end end describe '#line' do it 'returns the line' do message = described_class.new(:error, 'foo', source_line('')) message.line.should == 1 end end describe '#column' do it 'returns the column' do message = described_class.new(:error, 'foo', source_line('')) message.column.should == 1 end end end
mit
CslaGenFork/CslaGenFork
branches/V4-3-RC/Solutions/CslaGenFork/Metadata/UnitOfWorkPropertyCollection.cs
805
using System.Collections.Generic; namespace CslaGenerator.Metadata { public class UnitOfWorkPropertyCollection : List<UnitOfWorkProperty> { public UnitOfWorkProperty Find(string name) { foreach (UnitOfWorkProperty c in this) { if (c.Name.Equals(name)) return c; } return null; } public UnitOfWorkProperty FindType(string typeName) { foreach (UnitOfWorkProperty c in this) { if (c.TypeName.Equals(typeName)) return c; } return null; } public bool Contains(string name) { return (Find(name) != null); } } }
mit
minha-vida/molotov-ads
build/src/plugins/rubicon-fastlane-dfp/rubicon.fastlane.dfp.plugin.js
5877
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var viewport_1 = require("../../modules/viewport"); var rubicon_fastlane_dfp_adslot_1 = require("./rubicon.fastlane.dfp.adslot"); var logger_1 = require("../../modules/logger"); var autorefresh_1 = require("../../modules/autorefresh"); var RubiconFastlaneDfp = (function () { function RubiconFastlaneDfp() { this.name = "RubiconFastlaneDfp"; this.slots = {}; this.loaded = false; } RubiconFastlaneDfp.prototype.init = function (options) { this.slots = this.getSlots(); var self = this; return new Promise(function (resolve, reject) { googletag.cmd.push(function () { googletag.pubads().disableInitialLoad(); }); rubicontag.cmd.push(function () { for (var slotName in self.slots) { if (!self.slots[slotName].rubiconPosition) continue; self.slots[slotName].defineSlot(); logger_1.Logger.log(self.name, 'Rubicon ad slot defined: ', self.slots[slotName]); } for (var item in options.setFPI) { var value = options.setFPI[item]; logger_1.Logger.log(self.name, 'targeting FPI', item, 'as', value); rubicontag.setFPI(item, value); } for (var item in options.setFPV) { var value = options.setFPV[item]; logger_1.Logger.log(self.name, 'targeting FPV', item, 'as', value); rubicontag.setFPV(item, value); } rubicontag.run(function () { if (options.rubicontagRun) options.rubicontagRun(); self.refreshAds(); self.loaded = true; }); googletag.cmd.push(function () { for (var slotName in self.slots) { self.slots[slotName].defineSlotDoubleclick(); logger_1.Logger.log(self.name, 'DFP ad slot defined: ', self.slots[slotName]); } for (var item in options.customTargets) { var value = options.customTargets[item]; logger_1.Logger.log('targeting', item, 'as', value); googletag.pubads().setTargeting(item, [value]); } googletag.pubads().addEventListener('slotRenderEnded', function (event) { logger_1.Logger.logWithTime(event.slot.getSlotElementId(), 'finished slot rendering'); var slot = self.slots[event.slot.getSlotElementId()]; autorefresh_1.AutoRefresh.start(slot, options, self.autoRefresh); if (options.onSlotRenderEnded) options.onSlotRenderEnded(event); }); logger_1.Logger.info('enabling services'); googletag.enableServices(); for (var slotName in self.slots) { googletag.display(self.slots[slotName].name); logger_1.Logger.logWithTime(self.slots[slotName].name, 'started displaying'); } self.onScrollRefreshLazyloadedSlots(); setTimeout(function () { if (self.loaded) return; self.refreshAds(); }, 1500); resolve(); }); }); }); }; RubiconFastlaneDfp.prototype.refreshAds = function () { for (var slotName in this.slots) { var slot = this.slots[slotName]; if (slot.lazyloadEnabled) continue; slot.setTargetingForGPTSlot(); slot.refresh(); } }; RubiconFastlaneDfp.prototype.onScrollRefreshLazyloadedSlots = function () { var self = this; window.addEventListener('scroll', function refreshAdsIfItIsInViewport(event) { for (var slotName in self.slots) { var slot = self.slots[slotName]; if (slot.lazyloadEnabled && viewport_1.Viewport.isElementInViewport(slot.HTMLElement, slot.lazyloadOffset)) { slot.setTargetingForGPTSlot(); slot.refresh(); slot.lazyloadEnabled = false; } } }); }; RubiconFastlaneDfp.prototype.autoRefresh = function (slot, options) { logger_1.Logger.logWithTime(slot.name, 'started refreshing'); if (slot.rubiconPosition) { rubicontag.cmd.push(function () { slot.defineSlot(); logger_1.Logger.log(self.name, 'Rubicon ad slot defined: ', slot); rubicontag.run(function () { slot.setTargetingForGPTSlot(); slot.refresh(); }, { slots: [slot.rubiconAdSlot] }); }); } else { slot.refresh(); } }; RubiconFastlaneDfp.prototype.getSlots = function () { var slots = {}; for (var slot in window._molotovAds.slots) { var el = window._molotovAds.slots[slot].HTMLElement; if (!el.dataset.madAdunit && !el.dataset.madRubicon) continue; slots[el.id] = new rubicon_fastlane_dfp_adslot_1.RubiconFastlaneDfpAdSlot(el); window._molotovAds.slots[el.id] = slots[el.id]; } return slots; }; return RubiconFastlaneDfp; }()); exports.RubiconFastlaneDfp = RubiconFastlaneDfp; window._molotovAds.loadPlugin(new RubiconFastlaneDfp());
mit
ShelbyZ/UCWA.NET
UCWA.NET/Transport/Response.cs
160
using System.Net; namespace UCWA.NET.Transport { public class Response : WebAction { public HttpStatusCode StatusCode { get; set; } } }
mit
bluntsoftware/glue-client
app/services/applicationPersistentToken/applicationPersistentToken.js
558
'use strict'; // UserManager ApplicationPersistentToken Service catwalkApp.factory('UserManagerApplicationPersistentToken', ['UserManagerBaseService',function (UserManagerBaseService) { var entityUrl = UserManagerBaseService.getEntityUrl('applicationPersistentToken'); return UserManagerBaseService.getResource(entityUrl,{},{ 'columns':{method: 'POST', params:{},url:entityUrl + 'columns'}, 'api':{method: 'POST', params:{},url:entityUrl + 'api'}, 'schema':{method: 'POST', params:{},url:entityUrl + 'schema'} }); } ]);
mit
openfact/openfact
src/main/java/org/openfact/core/files/ftp/FtpRouter.java
1815
package org.openfact.core.files.ftp; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.cdi.ContextName; import org.apache.camel.component.properties.PropertiesComponent; import org.jboss.logging.Logger; import org.wildfly.swarm.spi.runtime.annotations.ConfigurationValue; import org.wildfly.swarm.spi.runtime.annotations.Post; import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import java.text.MessageFormat; import java.util.Optional; @ApplicationScoped @ContextName("cdi-context") public class FtpRouter extends RouteBuilder { private static final Logger logger = Logger.getLogger(FtpRouter.class); public static final String DIRECT_FTP_UPLOAD = "direct:ftpUpload"; private static final String CAMEL_FTP_PATTERN = "ftp://{0}?username={1}&password={2}{3}"; @Inject @ConfigurationValue("openfact.files.ftp.host") private Optional<String> host; @Inject @ConfigurationValue("openfact.files.ftp.username") private Optional<String> username; @Inject @ConfigurationValue("openfact.files.ftp.password") private Optional<String> password; @Inject @ConfigurationValue("openfact.files.ftp.params") private Optional<String> params; @Override public void configure() throws Exception { from(DIRECT_FTP_UPLOAD) .log("Uploading file") .to(createFtpUri()) .log("Uploaded file complete."); } private String createFtpUri() { return MessageFormat.format(CAMEL_FTP_PATTERN, host.orElse("localhost:21"), username.orElse("admin"), password.orElse("admin"), params.orElse("?autoCreate=false&passiveMode=true&binary=true")); } }
mit
fabiosv/arquiteturadesoftware
asw.rpg1/src/com/github/awvalenti/arquiteturadesoftware/rpg1/versao5/arquiteturadefinida/logicajogo/Elemento.java
447
package com.github.awvalenti.arquiteturadesoftware.rpg1.versao5.arquiteturadefinida.logicajogo; public enum Elemento { AGUA("/agua.png"), MACA("/maca.png"), PERSONAGEM("/personagem.png"), GRAMA("/grama.png"), PORTAL("/passagem.png"), ; private final String caminhoImagem; Elemento(String caminhoImagem) { this.caminhoImagem = caminhoImagem; } public String getCaminhoImagem() { return caminhoImagem; } }
mit
mabsimms/azure-samples-events-sandbox
eph-reader/src/main/java/com/microsoft/azure/samples/ephreader/EventHubReaderConfiguration.java
751
package com.microsoft.azure.samples.ephreader; import java.time.Duration; import java.util.function.Function; public class EventHubReaderConfiguration { public String ConsumerGroupName; public String EventHubNamespace; public String EventHubName; public String SasKeyName; public String SasKeyValue; public String StorageAccountName; public String StorageAccountKey; public String StorageContainerName; public String HostName; public Boolean InvokeProcessorAfterReceiveTimeout; public int MaxBatchSize; public int PrefetchCount; public Duration ReceiveTimeout; public Function<String,Object> InitialOffsetProvider; public int DispatchConcurrency; public DispatchMode DispatchMode; }
mit
chooie/Aurelia-Playground
src/app.js
530
import {Router} from 'aurelia-router'; export class App { static inject() { return [Router]; } constructor(router) { this.router = router; this.router.configure(config => { config.title = 'Aurelia'; config.map([ { route: ['','welcome'], moduleId: 'welcome', nav: true, title:'Welcome' }, { route: 'flickr', moduleId: 'flickr', nav: true }, { route: 'child-router', moduleId: 'child-router', nav: true, title:'Child Router' } ]); }); } }
mit
my0sot1s/son-goku
globals.js
2491
var path = require('path'); const config = { dbGenUrl: dbInfor => { if (dbInfor.isLocal) { return `${dbInfor.url}:${dbInfor.port}/${dbInfor.dbName}`; } else { return `mongodb://${dbInfor.dbuser}:${dbInfor.dbpassword}@${dbInfor.url}:${dbInfor.port}/${dbInfor.dbName}`; } }, logFile: path.join(__dirname, '/private/logger.txt'),// eslint-disable-line listHost: [ 'localhost:8080', 'nodedata-api.herokuapp.com', 'localhost:3000', 'localhost:4000', 'son-goku.herokuapp.com', ], httpMiddleWare: { middleware: function (req, res, next) { res.set('Access-Control-Allow-Origin', '*'); res.set('Accept-Patch', 'javascript/json;charset=utf-8'); res.set('Allow', 'GET, HEAD, POST, DELETE, PUT, OPTION'); res.set('Connection', 'close'); next(); }, middlewareUpload: function (req, res, next) { res.set('Access-Control-Allow-Origin', '*'); res.set('Accept-Patch', 'javascript/json;charset=utf-8'); res.set('Accept-Ranges', 'bytes'); res.set('Allow', 'GET, HEAD, POST, OPTION'); res.set('Connection', 'close'); next(); }, multerConfig: { destination: function (req, file, cb) { cb(null, path.join(__dirname, 'uploads/'));// eslint-disable-line }, filename: function (req, file, cb) { crypto.pseudoRandomBytes(16, (err, raw) => {// eslint-disable-line cb(null, (raw.toString(`hex`) + Date.now()).substring(1, 32) + '.' + /\.(\w+)$/g.exec(file.originalname)[1]);// eslint-disable-line }); }, }, checkall: function (req, res, next) { const header = req.headers; if (config.listHost.indexOf(header.host) === -1) { res.status(404).send('NOT FOUND'); res.end(); } else { return next(); } }, }, toText: function (str) { str = str.toLowerCase();// eslint-disable-line str = str.replace(/\s+|\-+/g, '').replace(/ă|ằ|ắ|ẳ|ẵ|ặ|ạ|à|á|ã|ả|â|ấ|ầ|ẩ|ẫ|ậ/g, 'a')// eslint-disable-line .replace(/ô|ồ|ố|ổ|ỗ|ộ|ơ|ờ|ớ|ở|ỡ|ợ|ò|ó|ỏ|õ|ọ/g, 'o') .replace(/đ/g, 'd').replace(/ư|ứ|ừ|ử|ự/g, 'u').replace(/ê|ề|ế|ể|ễ|ệ/g, 'e') .replace(/!|@|%|\^|\*|\(|\)|\+|\=|\<|\>|\?|\/|,|\.|\:|\;|\'| |\"|\&|\#|\[|\]|~|$|_/g, '?')// eslint-disable-line .replace(/ỳ|ý|ỵ|ỷ|ỹ/g, 'y') .replace(/ì|í|ị|ỉ|ĩ/g, 'i'); return str; }, }; module.exports = { config, };
mit
xanthakita/toque
htdocs/phpwork/phpplot/classes/plotstyles/StylePointConnected.php
1481
<?php /* * Created on 02.12.2006 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ class StylePointConnected extends PlotStyle { private $linewidth; private $radius; private $vertices; public $color; public $labelcolor; private $lastPoint; function StylePointConnected($vertices, $radius, $colorpoint, $colorline=NULL, $colorlabel=NULL, $width=1) { $this->name="line"; $this->vertices=$vertices; $this->radius=$radius; $this->width=$width; $this->color[0]=$colorpoint; if (!empty($colorline)) $this->color[1] = $colorline; else $this->color[1] = $this->color[0]; if (!empty($colorlabel)) $this->color[2] = $colorlabel; else $this->color[2] = $this->color[0]; } function drawDataPoint($image,$x,$y) { $this->labelcolor = $this->color[2]; if (DEBUG) print "Drawing data point for $image at [$x, $y].\n"; $points=polygon_points(array('x'=>$x,'y'=>$y),$this->vertices,$this->radius); //var_dump(count($points)); if (DEBUG) var_dump($points); if (DEBUG) var_dump($this->vertices); imagefilledpolygon($image,$points,$this->vertices,$this->color[0]); if ($this->lastPoint) { if (DEBUG) print "Drawing data line for $image at [$x, $y].\n"; imageline($image, $this->lastPoint['x'], $this->lastPoint['y'], $x, $y, $this->color[1]); } $this->lastPoint=array('x'=>$x, 'y'=>$y); } } ?>
mit
bradyhullopeter/root
app/views/architecture/architecture.spec.js
397
'use strict'; import { assert } from 'chai'; import ArchCtrl from './architecture-controller'; let archCtrl; describe('app.architecture module', () => { beforeEach(() => { archCtrl = new ArchCtrl(); }); it('should be initialized', () => { assert.equal(archCtrl.name, 'Architecture Controller', 'The property name should be "Architecture Controller"'); }); });
mit
georgesks/sistema
versiones/v_1_11_0/views/header.php
26204
<?php defined('BASEPATH') OR exit('No se puede acceder al archivo directamente.'); ?> <!DOCTYPE html> <html lang="es"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="description" content=""> <meta name="keywords" content=""> <!-- cache --> <meta http-equiv="Expires" content="0"> <meta http-equiv="Last-Modified" content="0"> <meta http-equiv="Cache-Control" content="no-cache, mustrevalidate"> <meta http-equiv="Pragma" content="no-cache"> <meta name="author" content="LanceCoder"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <link rel="shortcut icon" href=""> <title>Sistema</title> <!-- Start Global plugin css --> <link href="<?php echo base_url("assets/css/global-plugins.css"); ?>" rel="stylesheet"> <link href="<?php echo base_url("assets/css/style.css"); ?>" rel="stylesheet"> <link href="<?php echo base_url("assets/vendors/jquery-icheck/skins/all.css"); ?>" rel="stylesheet" /> <link href="assets/vendors/font-awesome/css/font-awesome.css" rel="stylesheet"> <!-- End Global plugin css --> <!-- IOS SWITCH --> <link href="<?php echo base_url("assets/vendors/ios-switch/css/switch.css"); ?>" rel="stylesheet" /> <!--este es solamente para cargar tablas--> <link href="<?php echo base_url("assets/css/table-responsive.css"); ?>" rel="stylesheet"/> <link href="<?php echo base_url("assets/vendors/datatable/bootstrap/dataTables.bootstrap.css") ?>" rel="stylesheet"> <!-- sweetalert --> <link href="<?php echo base_url("assets/vendors/sweetalert/sweetalert.css"); ?>" rel="stylesheet" type="text/css"> <!-- This page plugin css start --> <link href="<?php echo base_url("assets/vendors/maps/css/jquery-jvectormap-2.0.1.css"); ?>" rel="stylesheet" type="text/css"/> <link href="<?php echo base_url("assets/vendors/morris-chart/morris.css"); ?>" rel="stylesheet" > <link href="<?php echo base_url("assets/vendors/bootstrap-daterangepicker/daterangepicker.css"); ?>" rel="stylesheet" /> <link href="<?php echo base_url("assets/vendors/jquery-ricksaw-chart/css/rickshaw.css"); ?>" rel="stylesheet"/> <link href="<?php echo base_url("assets/css/flot-chart.css"); ?>" rel="stylesheet"/> <!-- This page plugin css end --> <!-- Custom styles for this template --> <link href="<?php echo base_url("assets/css/theme.css"); ?>" rel="stylesheet"> <link href="<?php echo base_url("assets/css/style-responsive.css"); ?>" rel="stylesheet"/> <link href="<?php echo base_url("assets/css/class-helpers.css"); ?>" rel="stylesheet"/> <!--Color schemes--> <link href="<?php echo base_url("assets/css/colors/wet-asphalt.css"); ?>" rel="stylesheet"> <!--Fonts--> <link href="<?php echo base_url("assets/fonts/Indie-Flower/indie-flower.css"); ?>" rel="stylesheet" /> <link href="<?php echo base_url("assets/fonts/Open-Sans/open-sans.css?family=Open+Sans:300,400,700"); ?>" rel="stylesheet" /> <!-- Just for debugging purposes. Don't actually copy this line! --> <!--[if lt IE 9]> <script src="js/ie8-responsive-file-warning.js"></script><![endif]--> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> <![endif]--> </head> <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Thema Color Schemes * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Just add the attribute value to the attribute ID in <body> element * List of color scheme values that supported to this theme - default-scheme - the default is green color - alizarin-scheme - amethyst-scheme - blue-scheme - carrot-scheme - cloud-scheme - concrete-scheme - sun-flower-scheme - turquoise-scheme - wet-asphalt-scheme +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Thema Layout Options * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Lists of layout options just follow the instructions if you want to use this feature > Boxed Page - Just add class "fixed-width-unfixed-header" in <body> element - and add class "unfixed-header" also in <div class="leftside-navigation"> just search "leftside-navigation" - and add class also "unfixed-header" to the <section id="main-content"> element just search it > Boxed Page + Fixed Header - Just add class "fixed-width" in <body> element - and add class also "boxed-page-fixed-header" to the <section id="main-content"> element just search it > Boxed Page + No sidebar - Just add class "fixed-width-unfixed-header no-sidebar" in <body> element - and add class also "unfixed-header merge-left" to the <section id="main-content"> element just search it > Boxed Page + No sidebar + Fixed header - Just add class "fixed-width no-sidebar" in <body> element - and add class also "merge-left" to the <section id="main-content"> element just search it > Full width + Unfixed header - Just add class "full-content-unfixed-header" in <body> element - and add class also "merge-left" to the <section id="main-content"> element just search it > Right Sidebar - Just follow the sample page - the important to do is replace "<section id="main-content">" to "<section id="main-content-right">" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <body id="wet-asphalt-scheme"> <!--======== Start Style Switcher ========--> <!-- <i class="style-switcher-btn fa fa-cogs hidden-xs"></i> <div class="style-switcher"> <div class="style-swticher-header"> <div class="style-switcher-heading fg-white">Color Switcher</div> <div class="theme-close"><i class="icon-close"></i></div> </div> <div class="style-swticher-body"> <ul class="list-unstyled"> <li class="theme-default theme-active" data-style="default"></li> <li class="theme-turquoise" data-style="turquoise"></li> <li class="theme-blue" data-style="blue"></li> <li class="theme-amethyst" data-style="amethyst"></li> <li class="theme-cloud" data-style="cloud"></li> <li class="theme-sun-flower" data-style="sun-flower"></li> <li class="theme-carrot" data-style="carrot"></li> <li class="theme-alizarin" data-style="alizarin"></li> <li class="theme-concrete" data-style="concrete"></li> <li class="theme-wet-ashphalt" data-style="wet-ashphalt"></li> </ul> </div> </div>--><!--/style-switcher--> <!--======== End Style Switcher ========--> <section id="container"> <!--header start--> <header class="header fixed-top clearfix"> <!--logo start--> <div class="brand"> <a href="http://www.gigabyteplus.com" class="logo padding-left-30" target="_new"> <img src="<?php echo base_url("assets/images/logo.jpg") ?>" width="100" /> </a> <div class="sidebar-toggle-box"> <div class="fa fa-bars"></div> </div> </div> <!--logo end--> <!-- ***************************** ** Start of top navigation ** ***************************** --> <div class="top-nav"> <ul class="nav navbar-nav navbar-left" style="margin-left:30px;"> <!--<li> <a href="javascript:void(0)" class="btn-menu-grid" title="Menu Grid"> <span class="icon-grid"></span> </a> </li>--> <li class="dropdown"> <a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> Ayuda <span class=" fa fa-angle-down" style="font-size:12px;"></span> </a> <ul class="dropdown-menu animated fadeInUp pull-right"> <li data-toggle="modal" data-target="#version-sistema"> <a href="javascript:void(0);" class="hvr-bounce-to-right"> Version del Sistema</a> </li> <li> <a href="<?php echo base_url("version") ?>" class="hvr-bounce-to-right">Historial de Actualizaciones</a> </li> </ul> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li class="search-box"> <!--<input type="text" class="form-control search" placeholder=" Search">-->&nbsp; </li> <li role="presentation" class="dropdown"> <a href="javascript:void(0);" class="dropdown-toggle info-number" data-toggle="dropdown" aria-expanded="false"> <span class="pe-7s-mail" style="font-size:22.9px;"></span> <span class="badge bg-color label-danger">0</span> </a> <ul id="menu" class="dropdown-menu list-unstyled msg_list animated fadeInUp" role="menu"> <li> <a class="hvr-bounce-to-right"> <span class="image"> <img src="<?php echo base_url("assets/images/profile.jpg") ?>" alt="Profile Image" /> </span> <span> <span>Administrador</span> <span class="time">0 mins ago</span> </span> <span class="message"> Funcion en desarrollo </span> </a> </li> <li class='top-nav-li-see-all-alerts'> <div class="text-center"> <a href="inbox.html"> <strong>Mostrar todo</strong> <i class="fa fa-angle-right"></i> </a> </div> </li> </ul> </li> <li class="dropdown"> <a href="javascript:void(0);" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <img src="<?php echo base_url("assets/images/profile.jpg") ?>" alt="image"><?php echo $this->session->userdata("nombre") ?> <span class=" fa fa-angle-down"></span> </a> <ul class="dropdown-menu dropdown-usermenu animated fadeInUp pull-right"> <li> <a href="app-pages/page-profile-dashboard.html" class="hvr-bounce-to-right"> Perfil</a> </li> <li> <a href="app-pages/page-profile-settings.html" class="hvr-bounce-to-right"> <span>Configuracion</span> </a> </li> <li><a href="<?php echo base_url("login/salir") ?>" class="hvr-bounce-to-right"><i class=" icon-login pull-right"></i> Log Out</a> </li> </ul> </li> </ul> </div> <!-- ***************************** *** End of top navigation *** ***************************** --> </header> <!--header end--> <!--sidebar start--> <aside> <div id="sidebar" class="nav-collapse md-box-shadowed"> <!-- sidebar menu start--> <div class="leftside-navigation leftside-navigation-scroll"> <ul class="sidebar-menu" id="nav-accordion" style="padding-bottom: 15px;"> <li class="sidebar-profile"> <div class="profile-options-container"> <p class="text-right profile-options"><span class="profile-options-close pe-7s-close fa-2x font-bold"></span></p> <div class="profile-options-list animated zoomIn"> <p><a href="app-pages/page-profile-dashboard.html">Perfil</a></p> <p><a href="app-pages/page-profile-settings.html">Configuracion</a></p> <p><a href="<?php echo base_url("login/salir") ?>">Log Out</a></p> </div> </div> <div class="profile-main"> <p class="text-right profile-options"><i class="profile-options-open icon-options-vertical fa-2x"></i></p> <p class="image"> <img alt="image" src="<?php echo base_url("assets/images/profile.jpg") ?>" width="80"> <span class="status"><i class="fa fa-circle text-success"></i></span> </p> <p> <span class="name"><?php echo $this->session->userdata("nombre") ?></span><br> <span class="position" style="font-family: monospace;">&nbsp;</span> </p> </div> </li> <li class=''><a href="<?php echo base_url("dashboard"); ?>" class="hvr-bounce-to-right-sidebar-parent <?php echo ($menu == "dashboard")?"active":"" ?>"><span class='icon-sidebar fa fa-home fa-2x'></span><span>Dashboard</span></a> </li> <li class=''><a href="<?php echo base_url("clientes/controlClientes"); ?>" class="hvr-bounce-to-right-sidebar-parent <?php echo ($menu == "clientes")?"active":"" ?>"><span class='icon-sidebar fa fa-briefcase fa-2x'></span><span>Clientes</span></a></li> <li class=''><a href="<?php echo base_url("proveedores/proveedores"); ?>" class="hvr-bounce-to-right-sidebar-parent <?php echo ($menu == "proveedores")?"active":"" ?>"><span class='icon-sidebar pe-7s-id fa-2x'></span><span>Proveedores</span></a></li> <li class='sub-menu '><a href="#" class="hvr-bounce-to-right-sidebar-parent <?php echo ($menu == "ventas")?"active":"" ?>"><span class='icon-sidebar fa fa-usd fa-2x padding-left-10 padding-right-10'></span><span>Ventas</span></a> <ul class='sub'> <li><a href="<?php echo base_url("ventas/pedidos"); ?>">Control de Ventas</a> </li> <li><a href="<?php echo base_url("ventas/configuracion"); ?>">Configuracion</a> </li> </ul> </li> <li class='sub-menu '><a href="#" class="hvr-bounce-to-right-sidebar-parent <?php echo ($menu == "compras")?"active":"" ?>"><span class='icon-sidebar fa fa-shopping-cart fa-2x'></span><span>Compras</span></a> <ul class='sub'> <li><a href="<?php echo base_url("compras/compras"); ?>">Control de Compras</a> </li> </ul> </li> <li class='sub-menu '><a href="#" class="hvr-bounce-to-right-sidebar-parent <?php echo ($menu == "cobranza")?"active":"" ?>"><span class='icon-sidebar fa fa-money fa-2x '></span><span>Cobranza</span></a> <ul class='sub'> <li><a href="<?php echo base_url("cobranza/cxc"); ?>">Control de CxC</a> </li> <li><a href="<?php echo base_url("cobranza/recepcionPagos"); ?>">Recepcion de Pagos</a> </li> <li><a href="<?php echo base_url("cobranza/cxp"); ?>">Control de CxP</a> </li> </ul> </li> <li class='sub-menu '><a href="#" class="hvr-bounce-to-right-sidebar-parent <?php echo ($menu == "almacen")?"active":"" ?>"><span class='icon-sidebar pe-7s-box1 fa-2x'></span><span>Almacen</span></a> <ul class='sub'> <li><a href="<?php echo base_url("almacen/existencias"); ?>">Existencias</a> </li> <li><a href="<?php echo base_url("almacen/ordenes"); ?>">Ordenes de Salida</a> </li> <li><a href="<?php echo base_url("almacen/ajustes"); ?>">Ajustes de Inventario</a> </li> </ul> </li> <li class='sub-menu '><a href="#" class="hvr-bounce-to-right-sidebar-parent <?php echo ($menu == "productos")?"active":"" ?>"><span class='icon-sidebar fa fa-cubes fa-2x'></span><span>Productos</span></a> <ul class='sub'> <li><a href="<?php echo base_url("productos/controlProductos"); ?>">Control de Productos</a> </li> </ul> </li> <li class=''><a href="<?php echo base_url("reportes"); ?>" class="hvr-bounce-to-right-sidebar-parent <?php echo ($menu == "reportes")?"active":"" ?>"><span class='icon-sidebar fa fa-area-chart fa-2x'></span><span>Reportes</span></a> </li> <li class='sub-menu '><a href="#" class="hvr-bounce-to-right-sidebar-parent <?php echo ($menu == "empresas" || $menu == "sucursales" || $menu == "almacenes" || $menu == "usuarios" || $menu == "perfiles" || $menu == "departamentos")?"active":"" ?>"><span class='icon-sidebar pe-7s-config fa-2x'></span><span>Configuracion</span></a> <ul class='sub'> <li class="sub-menu"><a href="javascript:void(0);" class="<?php echo ($menu == "usuarios" || $menu == "perfiles" || $menu == "departamentos")?"active":"" ?>">Control de Usuarios</a> <ul class="sub"> <li> <a href="<?php echo base_url("usuarios/usuarios"); ?>">Usuarios</a> </li> <li> <a href="<?php echo base_url("perfiles/perfiles"); ?>">Perfiles de Usuario</a> </li> <li> <a href="<?php echo base_url("departamentos/departamentos"); ?>">Departamentos</a> </li> </ul> </li> <li class="sub-menu"><a href="javascript:void(0);" class="<?php echo ($menu == "empresas" || $menu == "sucursales" || $menu == "almacenes")?"active":"" ?>">Control de Empresa</a> <ul class="sub"> <li> <a href="<?php echo base_url("empresas/empresas"); ?>">Empresa</a> </li> <li> <a href="<?php echo base_url("sucursales/sucursales"); ?>">Sucursal</a> </li> <li> <a href="<?php echo base_url("almacenes/almacenes"); ?>">Almacen</a> </li> </ul> </li> </ul> </li> <!-- <li class='sub-menu '><a href="1" class="hvr-bounce-to-right-sidebar-parent"><span class='icon-sidebar icon-screen-desktop fa-2x'></span><span>Menu</span></a> <ul class='sub'> <li class="sub-menu"><a href="javascript:void(0);">Submenu</a> <ul class='sub'> <li><a href='layouts/boxed_page.html'>Item 1</a> </li> </ul> </li> <li><a href='layouts/full_width_content.html'>Item 1</a> </li> </ul> </li> --> </div> <!-- sidebar menu end--> </div> </aside> <!--sidebar end--> <!-- /menu footer buttons --> <!--<div class="sidebar-footer hidden-small"> <a class="tooltip-settings" title="Settings"> <span class="glyphicon glyphicon-cog" aria-hidden="true"></span> </a> <a class="tooltip-fullscreen" title="Full Screen"> <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span> </a> <a class="tooltip-resize-fullscreen" title="Resize Screen" style='display:none'> <span class="glyphicon glyphicon-resize-full" aria-hidden="true"></span> </a> <a class="tooltip-lock" title="Lock"> <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span> </a> <a class="tooltip-logout" title="Logout"> <span class="glyphicon glyphicon-off" aria-hidden="true"></span> </a> </div>--> <!-- /menu footer buttons --> <!--main content start--> <section id="main-content"> <section class="wrapper"> <!--======== Grid Menu Start ========--> <div id="grid-menu"> <div class="color-overlay grid-menu-overlay"> <div class="grid-icon-wrap grid-icon-effect-8"> <a href="#" class="grid-icon icon-envelope font-size-50 turquoise"></a> <a href="#" class="grid-icon icon-user font-size-50 teal"></a> <a href="#" class="grid-icon icon-support font-size-50 peter-river"></a> <a href="#" class="grid-icon icon-settings font-size-50 light-blue"></a> <a href="#" class="grid-icon icon-picture font-size-50 orange"></a> <a href="#" class="grid-icon icon-camrecorder font-size-50 light-orange"></a> </div> </div> </div> <!--======== Grid Menu End ========--> <!-- Modal para version del sistema --> <!--****** Start Basic Modal ******--> <div class="modal" id="version-sistema" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button> <h4 class="modal-title"><strong>Version del Sistema</strong></h4> </div> <div class="modal-body"> <div class="row"> <div class="col-xs-12 text-center"> <p><img src="<?php echo base_url("assets/images/logo.jpg") ?>" width="200"></p> <h2>Sistema de Facturacion</h2> <p><strong>Version <?php echo $this->session->userdata("version") ?></strong></p> <p>Última actualización: <?php echo $this->session->userdata("versionFecha") ?></p> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default btn-raised rippler rippler-default" data-dismiss="modal">Cerrar</button> </div> </div> </div> </div> <!--****** End Basic Modal ******--> <!-- ============ Aqui van los modulos =============== -->
mit
FloKnapp/faulancer
src/Controller/Controller.php
5481
<?php namespace Faulancer\Controller; use Faulancer\Exception\FileNotFoundException; use Faulancer\Exception\InvalidArgumentException; use Faulancer\Exception\ServiceNotFoundException; use Faulancer\Http\Http; use Faulancer\Http\Request; use Faulancer\Http\Response; use Faulancer\Service\AuthenticatorService; use Faulancer\Service\DbService; use Faulancer\Session\SessionManager; use Faulancer\ServiceLocator\ServiceInterface; use Faulancer\View\Helper\Route; use Faulancer\View\ViewController; use Faulancer\ServiceLocator\ServiceLocator; /** * Class AbstractController * * @category Controller * @package Faulancer\AbstractController * @author Florian Knapp <office@florianknapp.de> */ class Controller { /** * Contains the views per controller request * * @var array */ private $_viewArray = []; /** * Contains the current request * * @var Request */ protected $request; /** * AbstractController constructor. * * @param Request $request The request object */ public function __construct(Request $request) { $this->request = $request; } /** * Returns the service locator * * @return ServiceLocator */ public function getServiceLocator(): ServiceLocator { return ServiceLocator::instance(); } /** * Returns the session manager * * @return SessionManager|ServiceInterface */ public function getSessionManager(): SessionManager { return $this->getServiceLocator()->get(SessionManager::class); } /** * Returns the view controller * * @return ViewController */ public function getView(): ViewController { $calledClass = get_called_class(); if (in_array($calledClass, array_keys($this->_viewArray), true)) { return $this->_viewArray[$calledClass]; } $viewController = new ViewController(); $this->_viewArray[$calledClass] = $viewController; return $viewController; } /** * Returns the orm/entity manager * * @return DbService|ServiceInterface */ public function getDb(): DbService { return $this->getServiceLocator()->get(DbService::class); } /** * Render view with given template * * @param string $template The template to be rendered * @param array $variables The variables for the template * * @return Response */ public function render(string $template = '', array $variables = []) :Response { $this->addAssets(); try { /** @var Response $response */ $response = $this->getServiceLocator()->get(Response::class); $viewResult = $this->getView() ->setTemplate($template) ->setVariables($variables) ->render(); } catch (FileNotFoundException $e) { $viewResult = $e->getMessage(); } catch (ServiceNotFoundException $e) { $viewResult = $e->getMessage(); } return $response->setContent($viewResult); } /** * Check if user is permitted based on his role(s) * * @param array $roles The corresponding user roles * * @return bool */ public function isPermitted(array $roles = []): bool { /** @var AuthenticatorService $authService */ $authService = $this->getServiceLocator()->get(AuthenticatorService::class); return $authService->isPermitted($roles); } /** * Redirect to specific uri * * @param string $uri The target uri * * @return bool * * @throws InvalidArgumentException */ public function redirect(string $uri) :bool { /** @var Http $httpService */ $httpService = $this->getServiceLocator()->get(Http::class); return $httpService->redirect($uri); } /** * Set a generic text token which is valid for exactly one call * * @param string $key Key for the flash message * @param string $message Content for the flash message * * @return void */ public function setFlashMessage(string $key, string $message) { $sessionManager = $this->getSessionManager(); $sessionManager->setFlashMessage($key, $message); } /** * Retrieve a flash message * * @param string $key The flash message key * * @return string|null */ public function getFlashMessage(string $key) { $sessionManager = $this->getSessionManager(); return $sessionManager->getFlashMessage($key); } /** * Get the url for a specific route name * * @param string $name Name of the route * @param array $parameters Apply parameters where necessary * @param bool $absolute Return an absolute url with host as prefix * * @return string */ public function route(string $name, array $parameters = [], bool $absolute = false) { return (new Route())($name, $parameters, $absolute); } /** * Return the current request object * * @return Request */ public function getRequest() :Request { return $this->request; } /** * Add default assets for every action */ protected function addAssets() { // Should be inherited by child classes } }
mit
rokon12/Generic-CrudDao
CodeExplosion.GenericDAO/test/org/codexplo/cruder/dao/test/UserDaoTest.java
1625
/**************** * @author: Bazlur Rahman Rokon * @email: anm_brr@live.com * @Dated: Jun 20, 2012 **************/ package org.codexplo.cruder.dao.test; import static org.junit.Assert.assertNotNull; import java.util.List; import junit.framework.Assert; import org.codexplo.cruder.dao.IUserDao; import org.codexplo.cruder.domain.User; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; public class UserDaoTest extends AbstractTest { @Autowired(required = true) private IUserDao userDao; @Test public void count() { long count = userDao.count(); Assert.assertEquals(15, count); } // @Test public void CreateUser() { User user = new User(); user.setName("rokon"); user.setPassword("asdfasdf"); userDao.save(user); User user1 = userDao.findById(new Long(1)); // userDao.delete(new Long(1)); assertNotNull(user1); Assert.assertEquals("rokonoid", user1.getName()); } @Test public void delete() { // User user = userDao.findById(new Long(2)); // assertNotNull(user); userDao.delete(new Long(4)); List<User> users = userDao.findDeleted(); Assert.assertEquals(1, users.size()); } // @Test public void findByProperty() { User user = userDao.findByName("name", "rokonoid"); assertNotNull(user); Assert.assertEquals("rokonoid", user.getName()); } // @Test public void update() { User user = userDao.findById(new Long(1)); user.setName("rokonoid"); userDao.update(user); Assert.assertEquals("rokonoid", userDao.findById(new Long(1)).getName()); } }
mit
andruby/chef-suricata
recipes/pulledpork.rb
837
# Installs and configures pulled pork (to keep your rulesets up to date) # Install pre-requisites package "libcrypt-ssleay-perl" package "liblwp-protocol-https-perl" # Install latest version van svn trunk remote_file node['pulledpork']['bin'] do source node['pulledpork']['source_url'] end file node['pulledpork']['bin'] do mode 0755 end # Configuration files directory "/etc/pulledpork" template "/etc/pulledpork/pulledpork.conf" template "/etc/pulledpork/disablesid.conf" template "/etc/pulledpork/dropsid.conf" template "/etc/pulledpork/enablesid.conf" template "/etc/pulledpork/modifysid.conf" bash "run pulledpork" do code node['pulledpork']['run_cmd'] end # Run pulledpork once a day at 3:13am cron "pulledpork" do hour 3 minute 13 mailto node['pulledpork']['mailto'] command node['pulledpork']['run_cmd'] end
mit
hshn-labsw-nfc/schnitzel
client/src/app/admin/menue/menue.component.ts
767
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; @Component({ selector: 'app-admin-menue', templateUrl: './menue.component.html', styleUrls: ['./menue.component.css'] }) export class AdminMenueComponent implements OnInit { public menueItems: Array<string>; currentSelection = ''; @Input() adminToken: string; @Output() menueLogout: EventEmitter<any> = new EventEmitter(); constructor() { this.menueItems = []; this.menueItems.push('Status'); this.menueItems.push('Konfiguration'); this.menueItems.push('Orte'); this.menueItems.push('Rätsel'); this.menueItems.push('Tags'); this.currentSelection = 'Status'; } ngOnInit() { } logout(): void { this.menueLogout.emit(); } }
mit
sriram-mahavadi/extlp
tests/algo/test_stable_ksort.cpp
2042
/*************************************************************************** * tests/algo/test_stable_ksort.cpp * * Part of the STXXL. See http://stxxl.sourceforge.net * * Copyright (C) 2003, 2008 Roman Dementiev <dementiev@mpi-sb.mpg.de> * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) **************************************************************************/ //! \example algo/test_stable_ksort.cpp //! This is an example of how to use \c stxxl::ksort() algorithm #include <stxxl/mng> #include <stxxl/stable_ksort> #include <stxxl/ksort> #include <stxxl/vector> struct my_type { typedef unsigned key_type; key_type _key; char _data[128 - sizeof(key_type)]; key_type key() const { return _key; } my_type() { } my_type(key_type __key) : _key(__key) { } static my_type min_value() { return my_type(std::numeric_limits<key_type>::min()); } static my_type max_value() { return my_type(std::numeric_limits<key_type>::max()); } }; bool operator < (const my_type& a, const my_type& b) { return a.key() < b.key(); } int main() { #if STXXL_PARALLEL_MULTIWAY_MERGE STXXL_MSG("STXXL_PARALLEL_MULTIWAY_MERGE"); #endif unsigned memory_to_use = 44 * 1024 * 1024; typedef stxxl::vector<my_type> vector_type; const stxxl::int64 n_records = 2 * 32 * stxxl::int64(1024 * 1024) / sizeof(my_type); vector_type v(n_records); stxxl::random_number32 rnd; STXXL_MSG("Filling vector... " << rnd() << " " << rnd() << " " << rnd()); for (vector_type::size_type i = 0; i < v.size(); i++) v[i]._key = (rnd() / 2) * 2; STXXL_MSG("Checking order..."); STXXL_CHECK(!stxxl::is_sorted(v.begin(), v.end())); STXXL_MSG("Sorting..."); stxxl::stable_ksort(v.begin(), v.end(), memory_to_use); STXXL_MSG("Checking order..."); STXXL_CHECK(stxxl::is_sorted(v.begin(), v.end())); return 0; }
mit
Arakis/get-color-of-image
src/Properties/AssemblyInfo.cs
991
using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("GetColorOfImage")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("sebastian")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
mit
AnthonyClergeot/gsbfrais
src/ACYG/GsbFraisBundle/Entity/Lignefraisforfait.php
2741
<?php namespace ACYG\GsbFraisBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Lignefraisforfait * * @ORM\Table(name="LigneFraisForfait", indexes={@ORM\Index(name="FK_LigneFraisForfait_id_FraisForfait", columns={"id_FraisForfait"}), @ORM\Index(name="FK_LigneFraisForfait_id_FicheFrais", columns={"id_FicheFrais"})}) * @ORM\Entity */ class Lignefraisforfait { /** * @var integer * * @ORM\Column(name="id", type="integer", nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ private $id; /** * @var integer * * @ORM\Column(name="quantite", type="integer", nullable=true) */ private $quantite; /** * @var \Fichefrais * * @ORM\ManyToOne(targetEntity="Fichefrais", cascade={"persist"}) * @ORM\JoinColumns({ * @ORM\JoinColumn(name="id_FicheFrais", referencedColumnName="id") * }) */ private $idFichefrais; /** * @var \Fraisforfait * * @ORM\ManyToOne(targetEntity="Fraisforfait") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="id_FraisForfait", referencedColumnName="id") * }) */ private $idFraisforfait; /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set quantite * * @param integer $quantite * @return Lignefraisforfait */ public function setQuantite($quantite) { $this->quantite = $quantite; return $this; } /** * Get quantite * * @return integer */ public function getQuantite() { return $this->quantite; } /** * Set idFichefrais * * @param \ACYG\GsbFraisBundle\Entity\Fichefrais $idFichefrais * @return Lignefraisforfait */ public function setIdFichefrais(\ACYG\GsbFraisBundle\Entity\Fichefrais $idFichefrais = null) { $this->idFichefrais = $idFichefrais; return $this; } /** * Get idFichefrais * * @return \ACYG\GsbFraisBundle\Entity\Fichefrais */ public function getIdFichefrais() { return $this->idFichefrais; } /** * Set idFraisforfait * * @param \ACYG\GsbFraisBundle\Entity\Fraisforfait $idFraisforfait * @return Lignefraisforfait */ public function setIdFraisforfait(\ACYG\GsbFraisBundle\Entity\Fraisforfait $idFraisforfait = null) { $this->idFraisforfait = $idFraisforfait; return $this; } /** * Get idFraisforfait * * @return \ACYG\GsbFraisBundle\Entity\Fraisforfait */ public function getIdFraisforfait() { return $this->idFraisforfait; } }
mit
ChaseMalik/DestinyRaidReport
src/services/raid-report/util.ts
680
import { Observable, of as observableOf, throwError as observableThrowError } from 'rxjs'; import { map, mergeMap } from 'rxjs/operators'; import { RaidReportResponse } from '../../types/raid-report'; import { createRequest } from '../util'; import { API_PATH, RAID_REPORT_URL } from './constants'; export const createRaidReportRequest = <T>(path: Array<string | number>, qs: any = undefined): Observable<T> => { path.unshift(API_PATH); path.unshift(RAID_REPORT_URL); return createRequest<RaidReportResponse<T>>({}, path, qs).pipe( mergeMap(body => body.error ? observableThrowError(body.error) : observableOf(body)), map(body => body.response)); };
mit
welchbj/tt
docs/conf.py
1918
import codecs import os import sys from datetime import datetime HERE = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(HERE) TT_MODULE_DIR = os.path.join(BASE_DIR, 'tt') TT_VERSION_FILE = os.path.join(TT_MODULE_DIR, 'version.py') sys.path.insert(0, BASE_DIR) with codecs.open(TT_VERSION_FILE, encoding='utf-8') as f: exec(f.read()) # loads __version__ and __version_info__ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode'] intersphinx_mapping = {'python': ('https://docs.python.org/3', None)} autodoc_default_flags = ['members', 'special-members', 'show-inheritance'] suppress_warnings = ['image.nonlocal_uri'] html_theme = 'alabaster' html_sidebars = { '**': [ 'about.html', 'navigation.html', 'relations.html', 'searchbox.html' ] } html_theme_options = { 'logo': 'logo.png', 'logo_text_align': 'centered', 'description': 'logical tools for logic', 'github_user': 'welchbj', 'github_repo': 'tt', 'github_type': 'star', 'extra_nav_links': {}, 'sidebar_includehidden': True, 'fixed_sidebar': False, 'warn_bg': '#f9e3ed', 'warn_border': '#ffa5ce', 'note_bg': '#e8f0fc', 'note_border': '#c4daff', 'pre_bg': '#f9f4fc', 'font_family': "'PT Sans Caption', sans-serif", 'font_size': '1.0em', 'code_font_size': '0.8em', 'head_font_family': "'Amaranth', sans-serif" } exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] templates_path = ['_templates'] html_static_path = ['_static'] project = 'tt' year = datetime.now().year author = 'Brian Welch' copyright = '{}, {}'.format(year, author) version = '.'.join(str(i) for i in __version_info__[:2]) # noqa release = __version__ # noqa master_doc = 'index' source_suffix = '.rst' pygments_style = 'sphinx'
mit
steve9164/server-config
scripts/create_layer.py
18593
#!/usr/bin/env python3 # Written for Python 3.6 'Create vector tile layers with correspondong vector-tile-server (or Tessera) and TerriaMap configuration files' # Ideas: # - Main function that converts 1 GeoJSON/shapefile to a vector tile layer with TerriaMap config and test files # - Use asycnio from contextlib import contextmanager, redirect_stdout import sys import os import errno import json from collections import OrderedDict import uuid import re from osgeo import ogr, osr import boto3 import asyncio.subprocess from subprocess import Popen from asyncio.subprocess import PIPE, DEVNULL def yes_no_to_bool(string, default): # default should be a bool 'Convert a yes or no answer to a boolean' string = string.lower() if string == 'y' or string == 'yes': return True elif string == 'n' or string == 'no': return False else: print('Invalid yes or no format. Defaulting to: {}'.format(default)) return bool(default) def request_input(caption, default): 'Request input from the user, returning default if no input is given' response = input('\x1b[94m' + '{} '.format(caption) + ('({}): '.format(default) if default else '') + '\x1b[0m') return response if response != '' else default def unique_with_prop(data_source, layername, prop): 'Determine if the property prop uniquely identifies every feature in the given layer of the DataSource' layer = data_source.ExecuteSQL('SELECT COUNT(DISTINCT {1}) / COUNT(*) AS allunique FROM "{0}"'.format(layername, prop), dialect='SQLITE') # If one enjoys SQL attacking one's own files, then go ahead all_unique = bool(layer.GetFeature(0).GetField('allunique')) data_source.ReleaseResultSet(layer) return all_unique def select_name_prop(properties): 'Select a default name prop using Cesium FeatureInfo rules' # Adapted from Cesium ImageryLayerFeatureInfo.js (https://github.com/AnalyticalGraphicsInc/cesium/blob/1.19/Source/Scene/ImageryLayerFeatureInfo.js#L57) name_property_precedence = 10 name_property = '' for key in properties: lower_key = key.lower() if name_property_precedence > 1 and lower_key == 'name': name_property_precedence = 1 name_property = key elif name_property_precedence > 2 and lower_key == 'title': name_property_precedence = 2 name_property = key elif name_property_precedence > 3 and lower_key.find('name') != -1: name_property_precedence = 3 name_property = key elif name_property_precedence > 4 and lower_key.find('title') != -1: name_property_precedence = 4 name_property = key return request_input('Which attribute should be used as the name property?', name_property) def mbtiles_filename(layer_name): return os.path.join('data', '{}.mbtiles'.format(layer_name)) # async def to_geojson(geometry_file, input_layer_name, add_fid, start_future): # 'Convert geometry_file to a temporary GeoJSON (including cleaning geometry and adding an fid if requested) and return the temporary filename' # filename = 'temp/{}.json'.format(uuid.uuid4().hex) # print('Generated filename {}'.format(filename)) # o2o = await asyncio.create_subprocess_exec(*[ # 'ogr2ogr', # '-t_srs', 'EPSG:4326', # # '-clipsrc', '-180', '-85.0511', '180', '85.0511', # Clip to EPSG:4326 (not working) # '-f', 'GeoJSON', # '-dialect', 'SQLITE', # '-sql', 'SELECT ST_MakeValid(geometry) as geometry, * FROM {}'.format(input_layer_name), # filename, geometry_file # ]) # start_future.set_result(None) # Conversion started, let the prompts continue and wait on finished processing later # print('Running geometry cleaning & reprojection') # await o2o.wait() # print('Finished geometry cleaning & reprojection') # if add_fid: # filename2 = 'temp/{}.json'.format(uuid.uuid4().hex) # print('Generated filename {}'.format(filename2)) # o2o = await asyncio.create_subprocess_exec(*[ # 'ogr2ogr', # '-t_srs', 'EPSG:4326', # '-f', 'GeoJSON', # '-sql', 'select FID,* from OGRGeoJSON', # filename2, filename # ]) # print('Running FID generation') # await o2o.wait() # print('Finished FID generation') # os.remove(filename) # filename = filename2 # New geojson is now the geojson file to use # return filename class GeoJSONTemporaryFile: 'Context manager for creating a temporary GeoJSON file from a given geometry file' def __init__(self, geometry_file, input_layer_name, add_fid): self.geometry_file = geometry_file self.input_layer_name = input_layer_name self.add_fid = add_fid self.finished_future = None self.filename = '' async def start(self): 'Start loading of geojson files, and grab a future to the finished processing. Should resolve almost instantly (only waits on starting a subprocess)' filename = 'temp/{}.json'.format(uuid.uuid4().hex) print('Generated filename {}'.format(filename)) o2o = await asyncio.create_subprocess_exec(*[ 'ogr2ogr', '-t_srs', 'EPSG:4326', # '-clipsrc', '-180', '-85.0511', '180', '85.0511', # Clip to EPSG:4326 (not working) '-f', 'GeoJSON', '-dialect', 'SQLITE', '-sql', 'SELECT ST_MakeValid(geometry) as geometry, * FROM "{}"'.format(self.input_layer_name), filename, self.geometry_file ]) print('Running geometry cleaning & reprojection') async def finish_conversion(start_promise, filename, add_fid): 'Wait for initial conversion to finish, then add fid if needed and return a promise to the filename' await start_promise if add_fid: filename2 = 'temp/{}.json'.format(uuid.uuid4().hex) print('Generated filename {}'.format(filename2)) ds = ogr.GetDriverByName('GeoJSON').Open(filename) layer = ds.GetLayer() layername = layer.GetName() layer = None ds = None o2o = await asyncio.create_subprocess_exec(*[ 'ogr2ogr', '-t_srs', 'EPSG:4326', '-f', 'GeoJSON', '-sql', 'select FID,* from "{}"'.format(layername), filename2, filename ]) print('Running FID generation') await o2o.wait() print('Finished FID generation') os.remove(filename) filename = filename2 # New geojson is now the geojson file to use return filename self.finished_future = finish_conversion(o2o.wait(), filename, self.add_fid) async def __aenter__(self): if self.finished_future is None: await self.start() self.filename = await self.finished_future return self.filename async def __aexit__(self, exc_type, exc, tb): os.remove(self.filename) async def generate_tiles(geojson_file, layer_name, generate_tiles_to): 'Generate tiles with Tippecanoe' tippe = await asyncio.create_subprocess_exec(*[ 'tippecanoe', '-q', '-f', '-P', '-pp', '-pS', '-l', layer_name, '-z', str(generate_tiles_to), # Max zoom '-d', str(32-generate_tiles_to), # Detail '-o', './{0}'.format(mbtiles_filename(layer_name)), geojson_file ], stdout=DEVNULL, stderr=DEVNULL) return tippe.wait() # return finishing future (a future in a future) async def generate_test_csv(geometry_file, test_csv_file, input_layer_name, region_property, alias): 'Generate test csv for each region attribute. Attributes that require a disambiguation property are not supported' o2o = await asyncio.create_subprocess_exec(*[ 'ogr2ogr', '-f', 'CSV', '-dialect', 'SQLITE', '-sql', 'SELECT {0} as {1}, random() % 20 as randomval FROM "{2}"'.format(region_property, alias, input_layer_name), '/vsistdout/', geometry_file ], stdout=open(test_csv_file, 'w')) # CSV driver is problematic writing files, so deal with that in Python return o2o.wait() # return finishing future (a future in a future) async def create_layer(geometry_file): ''' Create a vector tile layer with a given geometry file complete with mbtiles, server config, TerriaMap files and test csvs ''' data_source = ogr.Open(geometry_file) if data_source is None: print('{} could not be opened by ogr'.format(geometry_file)) return layers = [data_source.GetLayerByIndex(i).GetName() for i in range(data_source.GetLayerCount())] print('File {} has the following layers: {}'.format(geometry_file, ', '.join(layers))) input_layer_name = request_input('Which layer should be used?', layers[0] if len(layers) == 1 else '') if input_layer_name not in layers: print('Layer {} is not in file {}'.format(input_layer_name, geometry_file)) return layer_name = request_input('What should this layer be called?', input_layer_name) layer = data_source.GetLayerByName(input_layer_name) generate_tiles_to = int(request_input('What zoom level should tiles be generated to?', 12)) layer_defn = layer.GetLayerDefn() attributes = [layer_defn.GetFieldDefn(i).name for i in range(layer_defn.GetFieldCount())] layer_defn = None print('Attributes in file: {}'.format(', '.join(attributes))) has_fid = yes_no_to_bool(request_input('Is there an FID attribute?', 'n'), False) geojson_tempfile = GeoJSONTemporaryFile(geometry_file, input_layer_name, not has_fid) # Start geojson conversion. Must wait on the processing finished future sometime before Python execution ends await geojson_tempfile.start() # Ask for the current FID attribute if there is one, otherwise add an FID and use that # Test FID attribute fid_attribute = request_input('Which attribute should be used as an FID?', 'FID') if has_fid else 'FID' num_features = layer.GetFeatureCount() if has_fid and set(layer.GetFeature(i).GetField(fid_attribute) for i in range(num_features)) != set(range(num_features)): print('Attribute not an appropriate FID (must number features from 0 to #features - 1 in any order)') return server_url = request_input('Where is the vector tile server hosted?', 'http://localhost:8000/{}/{{z}}/{{x}}/{{y}}.pbf'.format(layer_name)) description = request_input('What is the description of this region map?', '') regionMapping_entries = OrderedDict() regionMapping_entry_name = request_input('Name another regionMapping.json entry (leave blank to finish)', '') regionId_columns = set() # All the columns that need regionId file generation test_csv_futures = [] while regionMapping_entry_name != '': o = OrderedDict([ ('layerName', layer_name), ('server', server_url), ('serverType', 'MVT'), ('serverMaxNativeZoom', generate_tiles_to), ('serverMaxZoom', 28), ('bbox', None), # bbox is calculated asynchronously ('uniqueIdProp', fid_attribute), ('regionProp', None), ('nameProp', select_name_prop(attributes)), ('aliases', None), ('description', description) ]) # Get regionProp, aliases and disambigProp (if needed) for regionMapping.json file while True: o['regionProp'] = request_input('Which attribute should be used as the region property?', '') if o['regionProp'] in attributes: break print('Attribute {} not found'.format(o['regionProp'])) regionId_columns.add(o['regionProp']) o['regionIdsFile'] = 'data/regionids/region_map-{0}_{1}.json'.format(layer_name, o['regionProp']) all_unique = unique_with_prop(data_source, input_layer_name, o['regionProp']) print('The given region property {} each region.'.format('uniquely defines' if all_unique else 'does not uniquely define')) o['aliases'] = request_input('What aliases should this be available under? Separate aliases with a comma and space', '').split(', ') if not all_unique: while True: o['disambigProp'] = request_input('Which attribute should be used to disambiguate region matching?', '') if o['disambigProp'] in attributes: break print('Attribute {} not found'.format(o['disambigProp'])) regionId_columns.add(o['disambigProp']) o['regionDisambigIdsFile'] = 'data/regionids/region_map-{0}_{1}.json'.format(layer_name, o['disambigProp']) o['disambigRegionId'] = request_input('Which regionMapping definition does this disambiguation property come from?', '') print('No test CSV generated for this regionMapping entry (test CSV generation does not currently support disambiguation properties)') else: # Make test CSVs (only when no disambiguation property needed) test_csv_file = os.path.join('output_files', 'test-{0}_{1}.csv'.format(layer_name, o['regionProp'])) test_csv_futures.append(await generate_test_csv(geometry_file, test_csv_file, input_layer_name, o['regionProp'], o['aliases'][0])) regionMapping_entries[regionMapping_entry_name] = o regionMapping_entry_name = request_input('Name another regionMapping.json entry (leave blank to finish)', '') # Close data source layer = None data_source = None # Make vector-tile-server config file config_json = { '/{0}'.format(layer_name): OrderedDict([ ('headers', {'Cache-Control': 'public,max-age=86400'}), ('source', 'mbtiles:///etc/vector-tiles/{0}'.format(mbtiles_filename(layer_name))) ]) } config_filename = os.path.join('config', '{0}.json'.format(layer_name)) json.dump(config_json, open(config_filename, 'w')) async def finish_processing(): # Wait for geojson conversion here, then add bbox to regionMapping entries, generate regionids and generate vector tiles async with geojson_tempfile as geojson_filename: # Start tippecanoe tippecanoe_future = await generate_tiles(geojson_filename, layer_name, generate_tiles_to) # Calculate bounding box upadte regionMapping entries, then write to file geojson_ds = ogr.GetDriverByName('GeoJSON').Open(geojson_filename) geojson_layer = geojson_ds.GetLayer() w, e, s, n = geojson_layer.GetExtent() for entry in regionMapping_entries.values(): entry['bbox'] = [w, s, e, n] # Make regionMapping file regionMapping_filename = os.path.join('output_files', 'regionMapping-{0}.json'.format(layer_name)) json.dump({'regionWmsMap': regionMapping_entries}, open(regionMapping_filename, 'w'), indent=4) # Make regionid files # Extract all the variables needed for the regionid files # Doesn't assume that fids are sequential # Make a dict of the attributes from the features first, then put them in the right order geojson_layer.ResetReading() # Reset layer reading before iterating over layer regionID_values_dict = {feature.GetField(fid_attribute): tuple(feature.GetField(column) for column in regionId_columns) for feature in geojson_layer} # The FID attribute has already been checked to allow this transformation regionID_values = [regionID_values_dict[i] for i in range(num_features)] for column, values in zip(regionId_columns, zip(*regionID_values)): regionId_json = OrderedDict([ # Make string comparison of files possible ('layer', layer_name), ('property', column), ('values', list(values)) ]) regionId_filename = os.path.join('output_files', 'region_map-{0}_{1}.json'.format(layer_name, column)) json.dump(regionId_json, open(regionId_filename, 'w')) geojson_layer = None geojson_ds = None await tippecanoe_future # Wait for tippecanoe to finish before destroying the geojson file await asyncio.gather(*test_csv_futures) # Wait for csv generation to finish (almost definitely finished by here anyway, but correctness yay) return layer_name return finish_processing() # Return a future to a future to the layer_name async def main(): # geometries = ['geoserver_shapefiles/FID_SA4_2011_AUST.shp'] geometries = sys.argv[1:] or request_input('Which geometries do you want to add? Seperate geometry files with a comma and space', '').split(', ') finished_layers = await asyncio.gather(*[await create_layer(geometry_file) for geometry_file in geometries]) try: terria_aws = boto3.session.Session(profile_name='terria') s3 = terria_aws.resource('s3') bucket = s3.Bucket('vector-tile-server') for layer_name in finished_layers: # Get the highest version of this layer and add 1 maxversion = max([int(re.search(r'v(\d*).json$', obj.key).group(1)) for obj in bucket.objects.filter(Prefix='config/{}'.format(layer_name))] + [0]) # Default to 0 print('Uploading {}-v{} to S3'.format(layer_name, maxversion+1)) bucket.upload_file('config/{}.json'.format(layer_name), 'config/{}-v{}.json'.format(layer_name, maxversion+1)) bucket.upload_file('data/{}.mbtiles'.format(layer_name), 'mbtiles/{}-v{}.mbtiles'.format(layer_name, maxversion+1)) except: print('Uploading to S3 failed. New config saved to config/{layerName}.json and vector tiles to data/{layerName}.mbtiles') if __name__ == '__main__': # Create folders if they don't exist for directory in ['data', 'config', 'output_files', 'temp']: try: os.mkdir(directory) except OSError as err: if err.errno == errno.EEXIST and os.path.isdir(directory): pass else: raise loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() #create_layer('geoserver_shapefiles/CED_2016_AUST.shp')
mit
Logi-CE/fmup
tests/Import/Config/Field/Formatter/TextToBool.php
2444
<?php /** * TextToBool.php * @author: jmoulin@castelis.com */ namespace FMUPTests\Import\Config\Field\Formatter; class TextToBoolTest extends \PHPUnit_Framework_TestCase { public function testFormatErrorWhenEmpty() { $formatter = new \FMUP\Import\Config\Field\Formatter\TextToBool(); $this->assertInstanceOf(\FMUP\Import\Config\Field\Formatter::class, $formatter); $this->assertFalse($formatter->hasError()); $this->assertSame('', $formatter->format('')); $this->assertTrue($formatter->hasError()); $this->assertSame("La valeur n'est pas convertible", $formatter->getErrorMessage('')); } public function testFormatErrorWhenNotAllowedValue() { $formatter = new \FMUP\Import\Config\Field\Formatter\TextToBool(); $this->assertInstanceOf(\FMUP\Import\Config\Field\Formatter::class, $formatter); $this->assertFalse($formatter->hasError()); $this->assertSame('', $formatter->format('yes')); $this->assertFalse($formatter->hasError()); $this->assertSame("La valeur yes n'est pas convertible", $formatter->getErrorMessage('yes')); } public function testFormatWhenValueAreOk() { $formatter = new \FMUP\Import\Config\Field\Formatter\TextToBool(); $this->assertInstanceOf(\FMUP\Import\Config\Field\Formatter::class, $formatter); $this->assertFalse($formatter->hasError()); $this->assertTrue($formatter->format('oui')); $this->assertFalse($formatter->hasError()); $this->assertTrue($formatter->format('Oui')); $this->assertFalse($formatter->hasError()); $this->assertTrue($formatter->format('OuI')); $this->assertFalse($formatter->hasError()); $this->assertTrue($formatter->format('OUI')); $this->assertFalse($formatter->hasError()); $this->assertTrue($formatter->format('oUI')); $this->assertFalse($formatter->hasError()); $this->assertFalse($formatter->format('non')); $this->assertFalse($formatter->hasError()); $this->assertFalse($formatter->format('Non')); $this->assertFalse($formatter->hasError()); $this->assertFalse($formatter->format('NoN')); $this->assertFalse($formatter->hasError()); $this->assertFalse($formatter->format('NON')); $this->assertFalse($formatter->hasError()); $this->assertFalse($formatter->format('nON')); } }
mit
williangringo/php-framework
lib/Mremi/UrlShortener/Provider/ChainProvider.php
1696
<?php /* * This file is part of the Mremi\UrlShortener library. * * (c) Rémi Marseille <marseille.remi@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Mremi\UrlShortener\Provider; /** * Chain provider class * * @author Rémi Marseille <marseille.remi@gmail.com> */ class ChainProvider { /** * @var array */ private $providers = array(); /** * Adds the given provider to the chain * * @param UrlShortenerProviderInterface $provider A provider instance */ public function addProvider(UrlShortenerProviderInterface $provider) { $this->providers[$provider->getName()] = $provider; } /** * Gets a provider by name * * @param string $name A provider name * * @return UrlShortenerProviderInterface * * @throws \RuntimeException If the provider does not exist */ public function getProvider($name) { if (!$this->hasProvider($name)) { throw new \RuntimeException(sprintf('Unable to retrieve the provider named: "%s"', $name)); } return $this->providers[$name]; } /** * Gets the chain providers * * @return UrlShortenerProviderInterface[] */ public function getProviders() { return $this->providers; } /** * Returns TRUE whether the given name identifies a configured provider * * @param string $name A provider name * * @return boolean */ public function hasProvider($name) { return array_key_exists($name, $this->providers); } }
mit
elumbantoruan/epi-csharp
15-BinarySearchTree/15.04-ComputeLCA/Program.cs
1728
using System; using System.Diagnostics; using _15._00_Tree; namespace _15._04_ComputeLCA { class Program { static void Main(string[] args) { Tree<int> tree = new Tree<int>(19); tree.Insert(7); tree.Insert(3); tree.Insert(2); tree.Insert(5); tree.Insert(11); tree.Insert(17); tree.Insert(13); tree.Insert(43); tree.Insert(23); tree.Insert(37); tree.Insert(29); tree.Insert(41); tree.Insert(31); tree.Insert(47); tree.Insert(53); int a = 3; int b = 17; Tree<int> lcaNode = FindLCA<int>(tree, a,b); Debug.Assert(lcaNode.Value == 7); Console.WriteLine(lcaNode.Value); a = 13; b = 53; lcaNode = FindLCA<int>(tree, a,b); Debug.Assert(lcaNode.Value == 19); Console.WriteLine(lcaNode.Value); } // The time complexity is O(h) where h is the height of tree static Tree<T> FindLCA<T>(Tree<T> root, int node1, int node2) where T : IComparable<T> { Tree<T> current = root; while (Convert.ToInt32(current.Value) < node1 || Convert.ToInt32(current.Value) > node2) { while (Convert.ToInt32(current.Value) < node1 ) { current = current.Right; } while (Convert.ToInt32(current.Value) > node2 ) { current = current.Left; } } return current; } } }
mit