repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
who/symfony
tests/Symfony/Tests/Component/Form/Extension/Core/Type/FieldTypeTest.php
6503
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Tests\Component\Form\Extension\Core\Type; require_once __DIR__ . '/TypeTestCase.php'; require_once __DIR__ . '/../../../Fixtures/Author.php'; require_once __DIR__ . '/../../../Fixtures/FixedDataTransformer.php'; require_once __DIR__ . '/../../../Fixtures/FixedFilterListener.php'; use Symfony\Component\Form\DataTransformerInterface; use Symfony\Component\Form\Util\PropertyPath; use Symfony\Component\Form\FormError; use Symfony\Component\Form\Form; use Symfony\Component\Form\Exception\TransformationFailedException; use Symfony\Tests\Component\Form\Fixtures\Author; use Symfony\Tests\Component\Form\Fixtures\FixedDataTransformer; use Symfony\Tests\Component\Form\Fixtures\FixedFilterListener; class FieldTypeTest extends TypeTestCase { public function testGetPropertyPathDefaultPath() { $form = $this->factory->createNamed('field', 'title'); $this->assertEquals(new PropertyPath('title'), $form->getAttribute('property_path')); } public function testGetPropertyPathPathIsZero() { $form = $this->factory->create('field', null, array('property_path' => '0')); $this->assertEquals(new PropertyPath('0'), $form->getAttribute('property_path')); } public function testGetPropertyPathPathIsEmpty() { $form = $this->factory->create('field', null, array('property_path' => '')); $this->assertNull($form->getAttribute('property_path')); } public function testGetPropertyPathPathIsFalse() { $form = $this->factory->create('field', null, array('property_path' => false)); $this->assertNull($form->getAttribute('property_path')); } public function testGetPropertyPathPathIsNull() { $form = $this->factory->createNamed('field', 'title', null, array('property_path' => null)); $this->assertEquals(new PropertyPath('title'), $form->getAttribute('property_path')); } public function testPassRequiredAsOption() { $form = $this->factory->create('field', null, array('required' => false)); $this->assertFalse($form->isRequired()); $form = $this->factory->create('field', null, array('required' => true)); $this->assertTrue($form->isRequired()); } public function testPassReadOnlyAsOption() { $form = $this->factory->create('field', null, array('read_only' => true)); $this->assertTrue($form->isReadOnly()); } public function testBoundDataIsTrimmedBeforeTransforming() { $form = $this->factory->createBuilder('field') ->appendClientTransformer(new FixedDataTransformer(array( null => '', 'reverse[a]' => 'a', ))) ->getForm(); $form->bind(' a '); $this->assertEquals('a', $form->getClientData()); $this->assertEquals('reverse[a]', $form->getData()); } public function testBoundDataIsNotTrimmedBeforeTransformingIfNoTrimming() { $form = $this->factory->createBuilder('field', null, array('trim' => false)) ->appendClientTransformer(new FixedDataTransformer(array( null => '', 'reverse[ a ]' => ' a ', ))) ->getForm(); $form->bind(' a '); $this->assertEquals(' a ', $form->getClientData()); $this->assertEquals('reverse[ a ]', $form->getData()); } public function testPassIdAndNameToView() { $form = $this->factory->createNamed('field', 'name'); $view = $form->createView(); $this->assertEquals('name', $view->get('id')); $this->assertEquals('name', $view->get('name')); } public function testPassIdAndNameToViewWithParent() { $parent = $this->factory->createNamed('field', 'parent'); $parent->add($this->factory->createNamed('field', 'child')); $view = $parent->createView(); $this->assertEquals('parent_child', $view['child']->get('id')); $this->assertEquals('parent[child]', $view['child']->get('name')); } public function testPassIdAndNameToViewWithGrandParent() { $parent = $this->factory->createNamed('field', 'parent'); $parent->add($this->factory->createNamed('field', 'child')); $parent['child']->add($this->factory->createNamed('field', 'grand_child')); $view = $parent->createView(); $this->assertEquals('parent_child_grand_child', $view['child']['grand_child']->get('id')); $this->assertEquals('parent[child][grand_child]', $view['child']['grand_child']->get('name')); } public function testPassMaxLengthToView() { $form = $this->factory->create('field', null, array('max_length' => 10)); $view = $form->createView(); $this->assertSame(10, $view->get('max_length')); } public function testBindWithEmptyDataCreatesObjectIfClassAvailable() { $form = $this->factory->create('form', null, array( 'data_class' => 'Symfony\Tests\Component\Form\Fixtures\Author', )); $form->add($this->factory->createNamed('field', 'firstName')); $form->setData(null); $form->bind(array('firstName' => 'Bernhard')); $author = new Author(); $author->firstName = 'Bernhard'; $this->assertEquals($author, $form->getData()); } /* * We need something to write the field values into */ public function testBindWithEmptyDataStoresArrayIfNoClassAvailable() { $form = $this->factory->create('form'); $form->add($this->factory->createNamed('field', 'firstName')); $form->setData(null); $form->bind(array('firstName' => 'Bernhard')); $this->assertSame(array('firstName' => 'Bernhard'), $form->getData()); } public function testBindWithEmptyDataUsesEmptyDataOption() { $author = new Author(); $form = $this->factory->create('form', null, array( 'empty_data' => $author, )); $form->add($this->factory->createNamed('field', 'firstName')); $form->bind(array('firstName' => 'Bernhard')); $this->assertSame($author, $form->getData()); $this->assertEquals('Bernhard', $author->firstName); } }
mit
Karasiq/scalajs-highcharts
src/main/scala/com/highmaps/config/PlotOptionsAreaStatesHoverMarkerStatesHover.scala
6323
/** * Automatically generated file. Please do not edit. * @author Highcharts Config Generator by Karasiq * @see [[http://api.highcharts.com/highmaps]] */ package com.highmaps.config import scalajs.js, js.`|` import com.highcharts.CleanJsObject import com.highcharts.HighchartsUtils._ /** * @note JavaScript name: <code>plotOptions-area-states-hover-marker-states-hover</code> */ @js.annotation.ScalaJSDefined class PlotOptionsAreaStatesHoverMarkerStatesHover extends com.highcharts.HighchartsGenericObject { /** * <p>Animation when hovering over the marker.</p> */ val animation: js.UndefOr[Boolean | js.Object] = js.undefined /** * <p>Enable or disable the point marker.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-marker-states-hover-enabled/">Disabled hover state</a> */ val enabled: js.UndefOr[Boolean] = js.undefined /** * <p>The number of pixels to increase the radius of the hovered * point.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-states-hover-linewidthplus/">5 pixels greater radius on hover</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-states-hover-linewidthplus/">5 pixels greater radius on hover</a> * @since 4.0.3 */ val radiusPlus: js.UndefOr[Double] = js.undefined /** * <p>The additional line width for a hovered point.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-states-hover-linewidthplus/">2 pixels wider on hover</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-states-hover-linewidthplus/">2 pixels wider on hover</a> * @since 4.0.3 */ val lineWidthPlus: js.UndefOr[Double] = js.undefined /** * <p>The fill color of the marker in hover state. When * <code>undefined</code>, the series&#39; or point&#39;s fillColor for normal * state is used.</p> */ val fillColor: js.UndefOr[String | js.Object] = js.undefined /** * <p>The color of the point marker&#39;s outline. When <code>undefined</code>, * the series&#39; or point&#39;s lineColor for normal state is used.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-marker-states-hover-linecolor/">White fill color, black line color</a> */ val lineColor: js.UndefOr[String | js.Object] = js.undefined /** * <p>The width of the point marker&#39;s outline. When <code>undefined</code>, * the series&#39; or point&#39;s lineWidth for normal state is used.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-marker-states-hover-linewidth/">3px line width</a> */ val lineWidth: js.UndefOr[Double] = js.undefined /** * <p>The radius of the point marker. In hover state, it defaults * to the normal state&#39;s radius + 2 as per the <a href="#plotOptions.series.marker.states.hover.radiusPlus">radiusPlus</a> * option.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-marker-states-hover-radius/">10px radius</a> */ val radius: js.UndefOr[Double] = js.undefined } object PlotOptionsAreaStatesHoverMarkerStatesHover { /** * @param animation <p>Animation when hovering over the marker.</p> * @param enabled <p>Enable or disable the point marker.</p> * @param radiusPlus <p>The number of pixels to increase the radius of the hovered. point.</p> * @param lineWidthPlus <p>The additional line width for a hovered point.</p> * @param fillColor <p>The fill color of the marker in hover state. When. <code>undefined</code>, the series&#39; or point&#39;s fillColor for normal. state is used.</p> * @param lineColor <p>The color of the point marker&#39;s outline. When <code>undefined</code>,. the series&#39; or point&#39;s lineColor for normal state is used.</p> * @param lineWidth <p>The width of the point marker&#39;s outline. When <code>undefined</code>,. the series&#39; or point&#39;s lineWidth for normal state is used.</p> * @param radius <p>The radius of the point marker. In hover state, it defaults. to the normal state&#39;s radius + 2 as per the <a href="#plotOptions.series.marker.states.hover.radiusPlus">radiusPlus</a>. option.</p> */ def apply(animation: js.UndefOr[Boolean | js.Object] = js.undefined, enabled: js.UndefOr[Boolean] = js.undefined, radiusPlus: js.UndefOr[Double] = js.undefined, lineWidthPlus: js.UndefOr[Double] = js.undefined, fillColor: js.UndefOr[String | js.Object] = js.undefined, lineColor: js.UndefOr[String | js.Object] = js.undefined, lineWidth: js.UndefOr[Double] = js.undefined, radius: js.UndefOr[Double] = js.undefined): PlotOptionsAreaStatesHoverMarkerStatesHover = { val animationOuter: js.UndefOr[Boolean | js.Object] = animation val enabledOuter: js.UndefOr[Boolean] = enabled val radiusPlusOuter: js.UndefOr[Double] = radiusPlus val lineWidthPlusOuter: js.UndefOr[Double] = lineWidthPlus val fillColorOuter: js.UndefOr[String | js.Object] = fillColor val lineColorOuter: js.UndefOr[String | js.Object] = lineColor val lineWidthOuter: js.UndefOr[Double] = lineWidth val radiusOuter: js.UndefOr[Double] = radius com.highcharts.HighchartsGenericObject.toCleanObject(new PlotOptionsAreaStatesHoverMarkerStatesHover { override val animation: js.UndefOr[Boolean | js.Object] = animationOuter override val enabled: js.UndefOr[Boolean] = enabledOuter override val radiusPlus: js.UndefOr[Double] = radiusPlusOuter override val lineWidthPlus: js.UndefOr[Double] = lineWidthPlusOuter override val fillColor: js.UndefOr[String | js.Object] = fillColorOuter override val lineColor: js.UndefOr[String | js.Object] = lineColorOuter override val lineWidth: js.UndefOr[Double] = lineWidthOuter override val radius: js.UndefOr[Double] = radiusOuter }) } }
mit
mnichols/ankh
lib/registrations.js
3469
'use strict'; var DependencyGraph = require('./dependency-graph') var warn = console.warn.bind(console) ,error = console.error.bind(console) ,debug = console.log.bind(console) ; module.exports = Registrations function assert(pred, msg) { if(pred){ return } throw new Error(msg) } //simply append left string to right string function hashCode(left, right) { return left + '' + right + '' } //flattens array of arrays of arrays... function flatten(arr) { return arr.reduce(function (flat, toFlatten) { // See if this index is an array that itself needs to be flattened. if(toFlatten.some && toFlatten.some(Array.isArray)) { return flat.concat(flatten(toFlatten)); // Otherwise just add the current index to the end of the flattened array. } else { return flat.concat(toFlatten); } }, []); }; /** * Registrations collection stores all configurations * created for the container to resolve at runtime * */ function Registrations() { Object.defineProperty(this,'_registrations',{ value: {} ,enumerable: false ,configurable: false ,writable: false }) this.get = this.get.bind(this) this.put = this.put.bind(this) this.clear = this.clear.bind(this) this.has = this.has.bind(this) } Registrations.RESERVED_KEYS = ['@impl'] Registrations.prototype.get = function(key) { if(!key) { throw new Error('key is required') } var model = this._registrations[key] if(model) { return model } throw new Error(key + ' is not registered.') } Registrations.prototype.put = function(model) { assert(model,'model is required') if(this.isReserved(model.key)) { throw new Error(model.key + ' is reserved. Choose another key.') } this._registrations[model.key] = model } Registrations.prototype.has = function(key) { return !!this._registrations[key] } Registrations.prototype.clear = function(){ for(var k in this._registrations) { ;(delete this._registrations[k]) } } Registrations.prototype.keys = function(){ return Object.keys(this._registrations) } Registrations.prototype.isReserved = function(key) { return (Registrations.RESERVED_KEYS.indexOf(key) > -1) } /** * Provide a executable graph of model keys that * designated `startable` on them. * This orders them according to the model's `inject` * setting, finally appending models which don't have dependencies. * @method startables * @return {Array} of strings; model keys in executable order * */ Registrations.prototype.startables = function(){ var keys = Object.keys(this._registrations) .filter(function(key){ return !!this._registrations[key].startable },this) var graph = this.createGraph(keys,keys,Registrations.RESERVED_KEYS) return graph.legal() //reverse the ordering so that dependents can manipulate their dependencies .reverse() .map(this.get.bind(this)) } Registrations.prototype.toMap = function(keys) { return (keys || this.keys()) .map(function(key){ return this.get(key) },this) .reduce(function(prev,model){ prev[model.key] = model.inject return prev },{}) } Registrations.prototype.createGraph = function(keys,include,exclude){ var map = this.toMap(keys) return new DependencyGraph(map,include,exclude) }
mit
marvinhagemeister/kiki
src/config/utils.js
1507
const path = require('path'); const chalk = require('chalk'); const emitter = require('../emitter'); function resolveApp(relativePath) { return path.resolve(relativePath); } function logMissingSection(name) { console.log(chalk.red(name + ' src or dest path not specified')); console.log(); console.log(chalk.dim('// kiki.js')); console.log('{'); console.log(' ' + chalk.yellow(name + ': {')); console.log(' ' + chalk.yellow('src:') + chalk.dim(' ...,')); console.log(' ' + chalk.yellow('dest:') + chalk.dim(' ...')); console.log(' ' + chalk.yellow('}') + ','); console.log(' ' + chalk.dim('...')); console.log('}'); console.log(); } function validateConfig(config) { if (Object.keys(config).length === 0 && config.constructor === Object) { console.log(); console.log(chalk.red('Received empty config file')); console.log(); } if (config.sass) { if (!config.sass.src || !config.sass.dest) { logMissingSection('sass'); } } if (config.js) { if (!config.js.src || !config.js.dest) { logMissingSection('js'); } } return null; } function getWork(config) { let paths = []; if (config.sass) { emitter.start('sass', config.sass.src); paths.push(config.sass.src); } if (config.js) { emitter.start('js', config.js.src); paths.push(config.js.src); } if (paths.length === 0) { emitter.nothingToWatch(); } return paths; } module.exports = { resolveApp, validateConfig, getWork };
mit
crowdtap/oauth2
lib/oauth2/strategy/web_server.rb
1674
require 'multi_json' module OAuth2 module Strategy class WebServer < Base def authorize_params(options = {}) #:nodoc: super(options).merge('type' => 'web_server') end # Retrieve an access token given the specified validation code. # Note that you must also provide a <tt>:redirect_uri</tt> option # in order to successfully verify your request for most OAuth 2.0 # endpoints. def get_access_token(code, options = {}) response = @client.request(:post, @client.access_token_url, access_token_params(code, options)) params = MultiJson.decode(response) rescue nil # the ActiveSupport JSON parser won't cause an exception when # given a formencoded string, so make sure that it was # actually parsed in an Hash. This covers even the case where # it caused an exception since it'll still be nil. params = Rack::Utils.parse_query(response) unless params.is_a? Hash access = params['access_token'] refresh = params['refresh_token'] expires_in = params['expires_in'] || params['expires'] OAuth2::AccessToken.new(@client, access, refresh, expires_in, params) end # <b>DEPRECATED:</b> Use #get_access_token instead. def access_token(*args) warn '[DEPRECATED] OAuth2::Strategy::WebServer#access_token is deprecated, use #get_access_token instead. Will be removed in 0.1.0' get_access_token(*args) end def access_token_params(code, options = {}) #:nodoc: super(options).merge({ 'type' => 'web_server', 'code' => code }) end end end end
mit
rodrigo2000/googleTransitUI
resources/js/plugins/visualize/jquery.visualize.js
25781
/** * -------------------------------------------------------------------- * jQuery-Plugin "visualize" * by Scott Jehl, scott@filamentgroup.com * http://www.filamentgroup.com * Copyright (c) 2009 Filament Group * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses. * * -------------------------------------------------------------------- */ (function($) { $.fn.visualize = function(options, container){ return $(this).each(function(){ //configuration var o = $.extend({ type: 'bar', //also available: area, pie, line width: $(this).width(), //height of canvas - defaults to table height height: $(this).height(), //height of canvas - defaults to table height appendTitle: true, //table caption text is added to chart title: null, //grabs from table caption if null appendKey: true, //color key is added to chart colors: ['#ae432e','#77ab13','#058dc7','#ef561a','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744'], textColors: [], //corresponds with colors array. null/undefined items will fall back to CSS parseDirection: 'x', //which direction to parse the table data pieMargin: 10, //pie charts only - spacing around pie pieLabelsAsPercent: true, pieLabelPos: 'inside', lineWeight: 4, //for line and area - stroke weight lineDots: false, //also available: 'single', 'double' dotInnerColor: "#ffffff", // only used for lineDots:'double' lineMargin: (options.lineDots?15:0), //for line and area - spacing around lines barGroupMargin: 10, chartId: '', xLabelParser: null, // function to parse labels as values valueParser: null, // function to parse values. must return a Number chartId: '', chartClass: '', barMargin: 1, //space around bars in bar chart (added to both sides of bar) yLabelInterval: 30, //distance between y labels interaction: false // only used for lineDots != false -- triggers mouseover and mouseout on original table },options); //reset width, height to numbers o.width = parseFloat(o.width); o.height = parseFloat(o.height); // reset padding if graph is not lines if(o.type != 'line' && o.type != 'area' ) { o.lineMargin = 0; } var self = $(this); // scrape data from html table var tableData = {}; var colors = o.colors; var textColors = o.textColors; var parseLabels = function(direction){ var labels = []; if(direction == 'x'){ self.find('thead tr').each(function(i){ $(this).find('th').each(function(j){ if(!labels[j]) { labels[j] = []; } labels[j][i] = $(this).text() }) }); } else { self.find('tbody tr').each(function(i){ $(this).find('th').each(function(j) { if(!labels[i]) { labels[i] = []; } labels[i][j] = $(this).text() }); }); } return labels; }; var fnParse = o.valueParser || parseFloat; var dataGroups = tableData.dataGroups = []; if(o.parseDirection == 'x'){ self.find('tbody tr').each(function(i,tr){ dataGroups[i] = {}; dataGroups[i].points = []; dataGroups[i].color = colors[i]; if(textColors[i]){ dataGroups[i].textColor = textColors[i]; } $(tr).find('td').each(function(j,td){ dataGroups[i].points.push( { value: fnParse($(td).text()), elem: td, tableCords: [i,j] } ); }); }); } else { var cols = self.find('tbody tr:eq(0) td').size(); for(var i=0; i<cols; i++){ dataGroups[i] = {}; dataGroups[i].points = []; dataGroups[i].color = colors[i]; if(textColors[i]){ dataGroups[i].textColor = textColors[i]; } self.find('tbody tr').each(function(j){ dataGroups[i].points.push( { value: $(this).find('td').eq(i).text()*1, elem: this, tableCords: [i,j] } ); }); }; } var allItems = tableData.allItems = []; $(dataGroups).each(function(i,row){ var count = 0; $.each(row.points,function(j,point){ allItems.push(point); count += point.value; }); row.groupTotal = count; }); tableData.dataSum = 0; tableData.topValue = 0; tableData.bottomValue = Infinity; $.each(allItems,function(i,item){ tableData.dataSum += fnParse(item.value); if(fnParse(item.value,10)>tableData.topValue) { tableData.topValue = fnParse(item.value,10); } if(item.value<tableData.bottomValue) { tableData.bottomValue = fnParse(item.value); } }); var dataSum = tableData.dataSum; var topValue = tableData.topValue; var bottomValue = tableData.bottomValue; var xAllLabels = tableData.xAllLabels = parseLabels(o.parseDirection); var yAllLabels = tableData.yAllLabels = parseLabels(o.parseDirection==='x'?'y':'x'); var xLabels = tableData.xLabels = []; $.each(tableData.xAllLabels,function(i,labels) { tableData.xLabels.push(labels[0]); }); var totalYRange = tableData.totalYRange = tableData.topValue - tableData.bottomValue; var zeroLocX = tableData.zeroLocX = 0; if($.isFunction(o.xLabelParser)) { var xTopValue = null; var xBottomValue = null; $.each(xLabels,function(i,label) { label = xLabels[i] = o.xLabelParser(label); if(i === 0) { xTopValue = label; xBottomValue = label; } if(label>xTopValue) { xTopValue = label; } if(label<xBottomValue) { xBottomValue = label; } }); var totalXRange = tableData.totalXRange = xTopValue - xBottomValue; var xScale = tableData.xScale = (o.width -2*o.lineMargin) / totalXRange; var marginDiffX = 0; if(o.lineMargin) { var marginDiffX = -2*xScale-o.lineMargin; } zeroLocX = tableData.zeroLocX = xBottomValue + o.lineMargin; tableData.xBottomValue = xBottomValue; tableData.xTopValue = xTopValue; tableData.totalXRange = totalXRange; } var yScale = tableData.yScale = (o.height - 2*o.lineMargin) / totalYRange; var zeroLocY = tableData.zeroLocY = (o.height-2*o.lineMargin) * (tableData.topValue/tableData.totalYRange) + o.lineMargin; var yLabels = tableData.yLabels = []; var numLabels = Math.floor((o.height - 2*o.lineMargin) / 30); var loopInterval = tableData.totalYRange / numLabels; //fix provided from lab loopInterval = Math.round(parseFloat(loopInterval)/5)*5; loopInterval = Math.max(loopInterval, 1); // var start = for(var j=Math.round(parseInt(tableData.bottomValue)/5)*5; j<=tableData.topValue+loopInterval; j+=loopInterval){ yLabels.push(j); } if(yLabels[yLabels.length-1] > tableData.topValue+loopInterval) { yLabels.pop(); } else if (yLabels[yLabels.length-1] <= tableData.topValue-10) { yLabels.push(tableData.topValue); } // populate some data $.each(dataGroups,function(i,row){ row.yLabels = tableData.yAllLabels[i]; $.each(row.points, function(j,point){ point.zeroLocY = tableData.zeroLocY; point.zeroLocX = tableData.zeroLocX; point.xLabels = tableData.xAllLabels[j]; point.yLabels = tableData.yAllLabels[i]; point.color = row.color; }); }); try{console.log(tableData);}catch(e){} var charts = {}; charts.pie = { interactionPoints: dataGroups, setup: function() { charts.pie.draw(true); }, draw: function(drawHtml){ var centerx = Math.round(canvas.width()/2); var centery = Math.round(canvas.height()/2); var radius = centery - o.pieMargin; var counter = 0.0; if(drawHtml) { canvasContain.addClass('visualize-pie'); if(o.pieLabelPos == 'outside'){ canvasContain.addClass('visualize-pie-outside'); } var toRad = function(integer){ return (Math.PI/180)*integer; }; var labels = $('<ul class="visualize-labels"></ul>') .insertAfter(canvas); } //draw the pie pieces $.each(dataGroups, function(i,row){ var fraction = row.groupTotal / dataSum; if (fraction <= 0 || isNaN(fraction)) return; ctx.beginPath(); ctx.moveTo(centerx, centery); ctx.arc(centerx, centery, radius, counter * Math.PI * 2 - Math.PI * 0.5, (counter + fraction) * Math.PI * 2 - Math.PI * 0.5, false); ctx.lineTo(centerx, centery); ctx.closePath(); ctx.fillStyle = dataGroups[i].color; ctx.fill(); // draw labels if(drawHtml) { var sliceMiddle = (counter + fraction/2); var distance = o.pieLabelPos == 'inside' ? radius/1.5 : radius + radius / 5; var labelx = Math.round(centerx + Math.sin(sliceMiddle * Math.PI * 2) * (distance)); var labely = Math.round(centery - Math.cos(sliceMiddle * Math.PI * 2) * (distance)); var leftRight = (labelx > centerx) ? 'right' : 'left'; var topBottom = (labely > centery) ? 'bottom' : 'top'; var percentage = parseFloat((fraction*100).toFixed(2)); // interaction variables row.canvasCords = [labelx,labely]; row.zeroLocY = tableData.zeroLocY = 0; // related to zeroLocY and plugin API row.zeroLocX = tableData.zeroLocX = 0; // related to zeroLocX and plugin API row.value = row.groupTotal; if(percentage){ var labelval = (o.pieLabelsAsPercent) ? percentage + '%' : row.groupTotal; var labeltext = $('<span class="visualize-label">' + labelval +'</span>') .css(leftRight, 0) .css(topBottom, 0); if(labeltext) var label = $('<li class="visualize-label-pos"></li>') .appendTo(labels) .css({left: labelx, top: labely}) .append(labeltext); labeltext .css('font-size', radius / 8) .css('margin-'+leftRight, -labeltext.width()/2) .css('margin-'+topBottom, -labeltext.outerHeight()/2); if(dataGroups[i].textColor){ labeltext.css('color', dataGroups[i].textColor); } } } counter+=fraction; }); } }; (function(){ var xInterval; var drawPoint = function (ctx,x,y,color,size) { ctx.moveTo(x,y); ctx.beginPath(); ctx.arc(x,y,size/2,0,2*Math.PI,false); ctx.closePath(); ctx.fillStyle = color; ctx.fill(); }; charts.line = { interactionPoints: allItems, setup: function(area){ if(area){ canvasContain.addClass('visualize-area'); } else{ canvasContain.addClass('visualize-line'); } //write X labels var xlabelsUL = $('<ul class="visualize-labels-x"></ul>') .width(canvas.width()) .height(canvas.height()) .insertBefore(canvas); if(!o.customXLabels) { xInterval = (canvas.width() - 2*o.lineMargin) / (xLabels.length -1); $.each(xLabels, function(i){ var thisLi = $('<li><span>'+this+'</span></li>') .prepend('<span class="line" />') .css('left', o.lineMargin + xInterval * i) .appendTo(xlabelsUL); var label = thisLi.find('span:not(.line)'); var leftOffset = label.width()/-2; if(i == 0){ leftOffset = 0; } else if(i== xLabels.length-1){ leftOffset = -label.width(); } label .css('margin-left', leftOffset) .addClass('label'); }); } else { o.customXLabels(tableData,xlabelsUL); } //write Y labels var liBottom = (canvas.height() - 2*o.lineMargin) / (yLabels.length-1); var ylabelsUL = $('<ul class="visualize-labels-y"></ul>') .width(canvas.width()) .height(canvas.height()) // .css('margin-top',-o.lineMargin) .insertBefore(scroller); $.each(yLabels, function(i){ var value = Math.floor(this); var posB = (value-bottomValue)*yScale + o.lineMargin; if(posB >= o.height-1 || posB < 0) { return; } var thisLi = $('<li><span>'+value+'</span></li>') .css('bottom', posB); if(Math.abs(posB) < o.height-1) { thisLi.prepend('<span class="line" />'); } thisLi.prependTo(ylabelsUL); var label = thisLi.find('span:not(.line)'); var topOffset = label.height()/-2; if(!o.lineMargin) { if(i == 0){ topOffset = -label.height(); } else if(i== yLabels.length-1){ topOffset = 0; } } label .css('margin-top', topOffset) .addClass('label'); }); //start from the bottom left ctx.translate(zeroLocX,zeroLocY); charts.line.draw(area); }, draw: function(area) { // prevent drawing on top of previous draw ctx.clearRect(-zeroLocX,-zeroLocY,o.width,o.height); // Calculate each point properties before hand var integer; $.each(dataGroups,function(i,row){ integer = o.lineMargin; // the current offset $.each(row.points, function(j,point){ if(o.xLabelParser) { point.canvasCords = [(xLabels[j]-zeroLocX)*xScale - xBottomValue,-(point.value*yScale)]; } else { point.canvasCords = [integer,-(point.value*yScale)]; } if(o.lineDots) { point.dotSize = o.dotSize||o.lineWeight*Math.PI; point.dotInnerSize = o.dotInnerSize||o.lineWeight*Math.PI/2; if(o.lineDots == 'double') { point.innerColor = o.dotInnerColor; } } integer+=xInterval; }); }); // fire custom event so we can enable rich interaction self.trigger('vizualizeBeforeDraw',{options:o,table:self,canvasContain:canvasContain,tableData:tableData}); // draw lines and areas $.each(dataGroups,function(h){ // Draw lines ctx.beginPath(); ctx.lineWidth = o.lineWeight; ctx.lineJoin = 'round'; $.each(this.points, function(g){ var loc = this.canvasCords; if(g == 0) { ctx.moveTo(loc[0],loc[1]); } ctx.lineTo(loc[0],loc[1]); }); ctx.strokeStyle = this.color; ctx.stroke(); // Draw fills if(area){ var integer = this.points[this.points.length-1].canvasCords[0]; if (isFinite(integer)) ctx.lineTo(integer,0); ctx.lineTo(o.lineMargin,0); ctx.closePath(); ctx.fillStyle = this.color; ctx.globalAlpha = .3; ctx.fill(); ctx.globalAlpha = 1.0; } else {ctx.closePath();} }); // draw points if(o.lineDots) { $.each(dataGroups,function(h){ $.each(this.points, function(g){ drawPoint(ctx,this.canvasCords[0],this.canvasCords[1],this.color,this.dotSize); if(o.lineDots === 'double') { drawPoint(ctx,this.canvasCords[0],this.canvasCords[1],this.innerColor,this.dotInnerSize); } }); }); } } }; })(); charts.area = { setup: function() { charts.line.setup(true); }, draw: charts.line.draw }; (function(){ var horizontal,bottomLabels; charts.bar = { setup:function(){ /** * We can draw horizontal or vertical bars depending on the * value of the 'barDirection' option (which may be 'vertical' or * 'horizontal'). */ horizontal = (o.barDirection == 'horizontal'); canvasContain.addClass('visualize-bar'); /** * Write labels along the bottom of the chart. If we're drawing * horizontal bars, these will be the yLabels, otherwise they * will be the xLabels. The positioning also varies slightly: * yLabels are values, hence they will span the whole width of * the canvas, whereas xLabels are supposed to line up with the * bars. */ bottomLabels = horizontal ? yLabels : xLabels; var xInterval = canvas.width() / (bottomLabels.length - (horizontal ? 1 : 0)); var xlabelsUL = $('<ul class="visualize-labels-x"></ul>') .width(canvas.width()) .height(canvas.height()) .insertBefore(canvas); $.each(bottomLabels, function(i){ var thisLi = $('<li><span class="label">'+this+'</span></li>') .prepend('<span class="line" />') .css('left', xInterval * i) .width(xInterval) .appendTo(xlabelsUL); if (horizontal) { var label = thisLi.find('span.label'); label.css("margin-left", -label.width() / 2); } }); /** * Write labels along the left of the chart. Follows the same idea * as the bottom labels. */ var leftLabels = horizontal ? xLabels : yLabels; var liBottom = canvas.height() / (leftLabels.length - (horizontal ? 0 : 1)); var ylabelsUL = $('<ul class="visualize-labels-y"></ul>') .width(canvas.width()) .height(canvas.height()) .insertBefore(canvas); $.each(leftLabels, function(i){ var thisLi = $('<li><span>'+this+'</span></li>').prependTo(ylabelsUL); var label = thisLi.find('span:not(.line)').addClass('label'); if (horizontal) { /** * For left labels, we want to vertically align the text * to the middle of its container, but we don't know how * many lines of text we will have, since the labels could * be very long. * * So we set a min-height of liBottom, and a max-height * of liBottom + 1, so we can then check the label's actual * height to determine if it spans one line or more lines. */ label.css({ 'min-height': liBottom, 'max-height': liBottom + 1, 'vertical-align': 'middle' }); thisLi.css({'top': liBottom * i, 'min-height': liBottom}); var r = label[0].getClientRects()[0]; if (r.bottom - r.top == liBottom) { /* This means we have only one line of text; hence * we can centre the text vertically by setting the line-height, * as described at: * http://www.ampsoft.net/webdesign-l/vertical-aligned-nav-list.html * * (Although firefox has .height on the rectangle, IE doesn't, * so we use r.bottom - r.top rather than r.height.) */ label.css('line-height', parseInt(liBottom) + 'px'); } else { /* * If there is more than one line of text, then we shouldn't * touch the line height, but we should make sure the text * doesn't overflow the container. */ label.css("overflow", "hidden"); } } else { thisLi.css('bottom', liBottom * i).prepend('<span class="line" />'); label.css('margin-top', -label.height() / 2) } }); charts.bar.draw(); }, draw: function() { // Draw bars if (horizontal) { // for horizontal, keep the same code, but rotate everything 90 degrees // clockwise. ctx.rotate(Math.PI / 2); } else { // for vertical, translate to the top left corner. ctx.translate(0, zeroLocY); } // Don't attempt to draw anything if all the values are zero, // otherwise we will get weird exceptions from the canvas methods. if (totalYRange <= 0) return; var yScale = (horizontal ? canvas.width() : canvas.height()) / totalYRange; var barWidth = horizontal ? (canvas.height() / xLabels.length) : (canvas.width() / (bottomLabels.length)); var linewidth = (barWidth - o.barGroupMargin*2) / dataGroups.length; for(var h=0; h<dataGroups.length; h++){ ctx.beginPath(); var strokeWidth = linewidth - (o.barMargin*2); ctx.lineWidth = strokeWidth; var points = dataGroups[h].points; var integer = 0; for(var i=0; i<points.length; i++){ // If the last value is zero, IE will go nuts and not draw anything, // so don't try to draw zero values at all. if (points[i].value != 0) { var xVal = (integer-o.barGroupMargin)+(h*linewidth)+linewidth/2; xVal += o.barGroupMargin*2; ctx.moveTo(xVal, 0); ctx.lineTo(xVal, Math.round(-points[i].value*yScale)); } integer+=barWidth; } ctx.strokeStyle = dataGroups[h].color; ctx.stroke(); ctx.closePath(); } } }; })(); //create new canvas, set w&h attrs (not inline styles) var canvasNode = document.createElement("canvas"); var canvas = $(canvasNode) .attr({ 'height': o.height, 'width': o.width }); //get title for chart var title = o.title || self.find('caption').text(); //create canvas wrapper div, set inline w&h, append var canvasContain = (container || $('<div '+(o.chartId?'id="'+o.chartId+'" ':'')+'class="visualize '+o.chartClass+'" role="img" aria-label="Chart representing data from the table: '+ title +'" />')) .height(o.height) .width(o.width); var scroller = $('<div class="visualize-scroller"></div>') .appendTo(canvasContain) .append(canvas); //title/key container if(o.appendTitle || o.appendKey){ var infoContain = $('<div class="visualize-info"></div>') .appendTo(canvasContain); } //append title if(o.appendTitle){ $('<div class="visualize-title">'+ title +'</div>').appendTo(infoContain); } //append key if(o.appendKey){ var newKey = $('<ul class="visualize-key"></ul>'); $.each(yAllLabels, function(i,label){ $('<li><span class="visualize-key-color" style="background: '+dataGroups[i].color+'"></span><span class="visualize-key-label">'+ label +'</span></li>') .appendTo(newKey); }); newKey.appendTo(infoContain); }; // init interaction if(o.interaction) { // sets the canvas to track interaction // IE needs one div on top of the canvas since the VML shapes prevent mousemove from triggering correctly. // Pie charts needs tracker because labels goes on top of the canvas and also messes up with mousemove var tracker = $('<div class="visualize-interaction-tracker"/>') .css({ 'height': o.height + 'px', 'width': o.width + 'px', 'position':'relative', 'z-index': 200 }) .insertAfter(canvas); var triggerInteraction = function(overOut,data) { var data = $.extend({ canvasContain:canvasContain, tableData:tableData },data); self.trigger('vizualize'+overOut,data); }; var over=false, last=false, started=false; tracker.mousemove(function(e){ var x,y,x1,y1,data,dist,i,current,selector,zLabel,elem,color,minDist,found,ev=e.originalEvent; // get mouse position relative to the tracker/canvas x = ev.layerX || ev.offsetX || 0; y = ev.layerY || ev.offsetY || 0; found = false; minDist = started?30000:(o.type=='pie'?(Math.round(canvas.height()/2)-o.pieMargin)/3:o.lineWeight*4); // iterate datagroups to find points with matching $.each(charts[o.type].interactionPoints,function(i,current){ x1 = current.canvasCords[0] + zeroLocX; y1 = current.canvasCords[1] + (o.type=="pie"?0:zeroLocY); dist = Math.sqrt( (x1 - x)*(x1 - x) + (y1 - y)*(y1 - y) ); if(dist < minDist) { found = current; minDist = dist; } }); if(o.multiHover && found) { x = found.canvasCords[0] + zeroLocX; y = found.canvasCords[1] + (o.type=="pie"?0:zeroLocY); found = [found]; $.each(charts[o.type].interactionPoints,function(i,current){ if(current == found[0]) {return;} x1 = current.canvasCords[0] + zeroLocX; y1 = current.canvasCords[1] + zeroLocY; dist = Math.sqrt( (x1 - x)*(x1 - x) + (y1 - y)*(y1 - y) ); if(dist <= o.multiHover) { found.push(current); } }); } // trigger over and out only when state changes, instead of on every mousemove over = found; if(over != last) { if(over) { if(last) { triggerInteraction('Out',{point:last}); } triggerInteraction('Over',{point:over}); last = over; } if(last && !over) { triggerInteraction('Out',{point:last}); last=false; } started=true; } }); tracker.mouseleave(function(){ triggerInteraction('Out',{ point:last, mouseOutGraph:true }); over = (last = false); }); } //append new canvas to page if(!container){canvasContain.insertAfter(this); } if( typeof(G_vmlCanvasManager) != 'undefined' ){ G_vmlCanvasManager.init(); G_vmlCanvasManager.initElement(canvas[0]); } //set up the drawing board var ctx = canvas[0].getContext('2d'); // Scroll graphs scroller.scrollLeft(o.width-scroller.width()); // init plugins $.each($.visualizePlugins,function(i,plugin){ plugin.call(self,o,tableData); }); //create chart charts[o.type].setup(); if(!container){ //add event for updating self.bind('visualizeRefresh', function(){ self.visualize(o, $(this).empty()); }); //add event for redraw self.bind('visualizeRedraw', function(){ charts[o.type].draw(); }); } }).next(); //returns canvas(es) }; // create array for plugins. if you wish to make a plugin, // just push your init funcion into this array $.visualizePlugins = []; })(jQuery);
mit
dantin/leetcode-solutions
java/PathSumIII.java
1268
public class PathSumIII { public int pathSum(TreeNode root, int sum) { if (root == null) return 0; return dfs(root, sum) + pathSum(root.left, sum) + pathSum(root.right, sum); } private int dfs(TreeNode root, int sum) { if (root == null) return 0; int res = 0; if(sum == root.val) res++; res += dfs(root.left, sum - root.val); res += dfs(root.right, sum - root.val); return res; } public static void main(String[] args) { TreeNode root = new TreeNode(10); TreeNode a = new TreeNode(5); TreeNode b = new TreeNode(-3); TreeNode c = new TreeNode(3); TreeNode d = new TreeNode(2); TreeNode e = new TreeNode(11); TreeNode f = new TreeNode(3); TreeNode g = new TreeNode(-2); TreeNode h = new TreeNode(1); root.left = a; root.right = b; a.left = c; a.right = d; b.right = e; c.left = f; c.right = g; d.right = h; PathSumIII solution = new PathSumIII(); System.out.println(solution.pathSum(root, 8)); } } class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
mit
jbfp/SavannahGame
src/SavannahGame.Forms/Properties/Settings.Designer.cs
1075
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34014 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace SavannahGame.Forms.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
mit
WarHub/wham
src/WarHub.ArmouryModel.Source/ContainerEntryBaseCore.cs
909
using System.Collections.Immutable; using System.Xml.Serialization; namespace WarHub.ArmouryModel.Source { [WhamNodeCore] public abstract partial record ContainerEntryBaseCore : EntryBaseCore { [XmlArray("constraints")] public ImmutableArray<ConstraintCore> Constraints { get; init; } = ImmutableArray<ConstraintCore>.Empty; [XmlArray("profiles")] public ImmutableArray<ProfileCore> Profiles { get; init; } = ImmutableArray<ProfileCore>.Empty; [XmlArray("rules")] public ImmutableArray<RuleCore> Rules { get; init; } = ImmutableArray<RuleCore>.Empty; [XmlArray("infoGroups")] public ImmutableArray<InfoGroupCore> InfoGroups { get; init; } = ImmutableArray<InfoGroupCore>.Empty; [XmlArray("infoLinks")] public ImmutableArray<InfoLinkCore> InfoLinks { get; init; } = ImmutableArray<InfoLinkCore>.Empty; } }
mit
smolyakoff/conreign
src/Conreign.Client.SignalR/Proxies/PlayerProxy.cs
3419
using System; using System.Threading.Tasks; using Conreign.Client.Contracts.Messages; using Conreign.Contracts.Gameplay; using Conreign.Contracts.Gameplay.Data; namespace Conreign.Client.SignalR.Proxies { internal class PlayerProxy : IPlayer { private readonly SignalRSender _context; private readonly string _roomId; public PlayerProxy(SignalRSender context, string roomId) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (string.IsNullOrEmpty(roomId)) { throw new ArgumentException("Room id cannot be null or empty.", nameof(roomId)); } _context = context; _roomId = roomId; } public Task UpdateOptions(PlayerOptionsData options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } var command = new UpdatePlayerOptionsCommand { RoomId = _roomId, Options = options }; return _context.Send(command); } public Task UpdateGameOptions(GameOptionsData options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } var command = new UpdateGameOptionsCommand { RoomId = _roomId, Options = options }; return _context.Send(command); } public Task StartGame() { var command = new StartGameCommand { RoomId = _roomId }; return _context.Send(command); } public Task LaunchFleet(FleetData fleet) { if (fleet == null) { throw new ArgumentNullException(nameof(fleet)); } var command = new LaunchFleetCommand { RoomId = _roomId, Fleet = fleet }; return _context.Send(command); } public Task CancelFleet(FleetCancelationData fleetCancelation) { if (fleetCancelation == null) { throw new ArgumentNullException(nameof(fleetCancelation)); } var command = new CancelFleetCommand { RoomId = _roomId, Index = fleetCancelation.Index }; return _context.Send(command); } public Task EndTurn() { var command = new EndTurnCommand {RoomId = _roomId}; return _context.Send(command); } public Task SendMessage(TextMessageData textMessage) { if (textMessage == null) { throw new ArgumentNullException(nameof(textMessage)); } var command = new SendMessageCommand { RoomId = _roomId, Text = textMessage.Text }; return _context.Send(command); } public Task<IRoomData> GetState() { var command = new GetRoomStateCommand { RoomId = _roomId }; return _context.Send(command); } } }
mit
lgollut/material-ui
packages/material-ui-icons/src/DonutSmallRounded.js
487
import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M11 3.18v17.64c0 .64-.59 1.12-1.21.98C5.32 20.8 2 16.79 2 12s3.32-8.8 7.79-9.8c.62-.14 1.21.34 1.21.98zm2.03 0v6.81c0 .55.45 1 1 1h6.79c.64 0 1.12-.59.98-1.22-.85-3.76-3.8-6.72-7.55-7.57-.63-.14-1.22.34-1.22.98zm0 10.83v6.81c0 .64.59 1.12 1.22.98 3.76-.85 6.71-3.82 7.56-7.58.14-.62-.35-1.22-.98-1.22h-6.79c-.56.01-1.01.46-1.01 1.01z" /> , 'DonutSmallRounded');
mit
sars/appetini-front
src/helpers/ordersDateHelper.js
277
import moment from 'moment'; export const getParsedDate = (date) => { return new Date(JSON.parse(date)); }; export const getParams = (location) => { if (location.query.date) { return {eq_date: location.query.date}; } return {gt_date: moment().utc().format()}; };
mit
stateless-systems/fundry
lib/rack/test/app.rb
1728
require 'rack' require 'thin' require 'timeout' module Rack module Test class App # Shane's attempt to run a Rack app server instance in the same process as the a 'work' block. Came about because # you can't see an unsaved DB transaction inside the Rack app if it happens in another process. # # ==== Example # # require 'minitest/spec' # require 'rack/test/app' # require 'open-uri' # # describe 'MyApp' do # it 'must respond ok' do # Rack::Test::App.run lambda{|env| [200, {'Content-Type' => 'text/plain'}, ['ok']]} do # assert open('http://localhost:3000').read =~ /ok/ # end # end # end # # ==== Paramaters # app<Object>:: Rack 'app' responding to call. # options<Hash>:: Options include host: and port:. # work<Proc>:: Connect and work with the 'app'. When this block exits the app will stop. def self.run app, options = {}, &work host = options[:host] ||= '0.0.0.0' port = options[:port] ||= '3000' ts = options[:timeout] ||= 5 socket = options[:socket] timeout(ts) do @error = nil EM.run do Thin::Logging.silent = true if socket Thin::Server.start app, socket sleep 0.1 else Thin::Server.start app, host, port.to_i TCPSocket.new host, port end EM.defer proc { begin; work.call; rescue Exception => e; @error = e; end }, proc {|r| EM.stop } end raise @error if @error end end end # App end # Test end # Rack
mit
ambicaster/jquery-ui-stateholdable
jquery.ui.stateholdable.js
6939
(function($){ $.widget('customui.stateholdable', { options: { initialState: null, persistent: true, usingBrowserHistory: true, extendingTop: true }, _create: function() { this.prepared = {}, this.state = [null], this.top = null; this.option(this.options); var self = this; this.element.addClass('ui-custom-stateholdable') .find(':customui-statechangable') .statechangable('option', 'connectWith', this.element); if(this.options.usingBrowserHistory || this.options.persistent) { var state = this._topState(); if(state === null) { // 이전 state가 없을 때 if(this.options.initialState) { this._replaceState(this.options.initialState); this.sendToChangable(); } else { this.receiveFromChangable(true); } } else { this.sendToChangable(); } } else if(this.options.initialState) { this._replaceState(this.options.initialState); this.sendToChangable(); } else { this.receiveFromChangable(true); } if(this.options.usingBrowserHistory) { $(window).on('popstate', function(){ var prev = self.top; self.sendToChangable(); self._trigger('pop'); var curr = self._topState(); self._triggerChange(curr, prev); self.top = curr; }); } }, _setOption: function(key, value) { if(key === 'persistent' && !value) { this.options.usingBrowserHistory = undefined; } if(key === 'usingBrowserHistory') { this.options.persistent = value !== undefined; } this._super(key, value); }, prepareState: function(key, value) { this._extendState(this.prepared, this._state(key, value)); }, clearPrepared: function() { this.prepared = {}; }, pushPrepared: function() { this._pushState(this.prepared); this.clearPrepared(); }, replacePrepared: function() { this._replaceState(this.prepared); this.clearPrepared(); }, pushState: function(key, value) { console.debug('pushState'); var state = this._state(key, value); console.log('Push state:', this.element[0], '<=', state); this._pushState(state); this._trigger('push'); }, replaceState: function(key, value) { console.debug('replaceState'); var state = this._state(key, value); console.log('Replace state:', this.element[0], '<=', state); this._replaceState(state); this._trigger('replace'); }, popState: function() { var top = this._popState(); this._trigger('pop'); var newTop = this._topState(); this._triggerChange(newTop, top); this.top = newTop; return top; }, topState: function(key) { return this._topState(key); }, getStates: function() { return this._getStates(); }, clearState: function() { this._setState(null); }, sendToChangable: function() { console.debug('sendToChangable'); this._getConnected().statechangable('receiveState'); this._trigger('send'); }, receiveFromChangable: function(replaceState) { console.debug('receiveFromChangable'); var temp = this.prepared; this._getConnected().statechangable('sendPrepare'); if(replaceState) { this.replacePrepared(); } else { this.pushPrepared(); } this.prepared = temp; this._trigger('receive'); }, _getConnected: function() { var self = this; return $(':customui-statechangable').filter(function(){ var connectWith = $($(this).statechangable('option', 'connectWith'))[0]; return connectWith && connectWith === self.element[0]; }); }, _getStates: function () { return this.state; }, _state: function(key, value) { var state = {}; if(typeof key == 'string' && value !== undefined) { state[key] = value; } else if(key !== null && $.isPlainObject(key)) { state = key; } return state; }, _extendState: function(target, state) { $.extend(target, state); }, _pushState: function(st) { var top = this._topState(); var state = st; if(this.options.extendingTop) { state = $.extend({}, top || {}, st); console.debug('_pushState', top, '+', st); } else { console.debug('_pushState', st); } if(this.options.usingBrowserHistory) { var newState = $.extend({}, history.state); newState[this._id()] = state; $.history.pushState(newState); } else if(this.options.persistent) { // TODO: use sessionStorage } else { this._getStates().push(state); } this._triggerChange(state, top); this.top = state; }, _replaceState: function(st) { var top = this._topState(); var state = st; if(this.options.extendingTop) { state = $.extend({}, top || {}, st); console.debug('_replaceState', top, '+', st); } else { console.debug('_replaceState', st); } if(this.options.usingBrowserHistory) { var newState = $.extend({}, history.state); newState[this._id()] = state; $.history.replaceState(newState); } else if(this.options.persistent) { } else { if(this._getStates().length > 0) { this._getStates()[this._getStates().length - 1] = state; } else { // FIXME: ERROR } } this._triggerChange(state, top); this.top = state; }, _popState: function() { var top = this._topState(); if(this.options.usingBrowserHistory) { history.back(); } else if(this.options.persistent) { // TODO: use sessionStorage } else { this._getStates().pop(); } return top; }, _topState: function(key) { var state = null; if(this.options.usingBrowserHistory) { state = (history.state || {})[this._id()]; if(state === undefined) { state = null; } } else if(this.options.persistent) { // TODO: use sessionStorage } else { if(this._getStates().length > 0) { state = this._getStates()[this._getStates().length - 1]; } } if(!state) { return null; } if(key !== undefined) { if(state[key] === undefined) { return null; } return state[key]; } return state; }, _id: function() { var id = this.element.attr('id'); if(!id) { throw 'Historyable Stateholdable must have ID attribute'; } return id; }, _triggerChange: function(curr, prev) { if(!this._sameState(curr, prev)) { this._trigger('change', null, { current: curr, previous: prev }); } }, // Each state must not be function or xml _sameState: function(state1, state2) { if(typeof state1 != typeof state2) { return false; } if(typeof state1 != 'object') { return state1 === state2; } if(state1 === null? state2 !== null: state2 === null) { return false; } for(var k in state1) { if(state2[k] === undefined) { return false; } } for(var k in state2) { if(state1[k] === undefined) { return false; } } for(var k in state1) { if(!sameState(state1[k], state2[k])) { return false; } } return true; }, }); })(jQuery);
mit
jefmsmit/gdshowsdb
lib/gdshowsdb/db/migrations/009_import_shows.rb
859
require 'yaml' require 'securerandom' require 'gdshowsdb' class ImportShows < ActiveRecord::Migration[5.0] include Gdshowsdb def up (1965..1995).each do |year| create_shows(year) create_sets(year) create_songs(year) end end def down Song.delete_all ShowSet.delete_all Show.delete_all end private def create_shows(year) show_yaml_parser = ShowYAMLParser.from_yaml(year) show_yaml_parser.parse.each do |show_yaml| show = Show.create(show_yaml) puts "Created #{show.title}" end end def create_sets(year) set_yaml_parser = SetYAMLParser.from_yaml(year) set_yaml_parser.parse.each do |set_yaml| ShowSet.create_from(set_yaml) end end def create_songs(year) song_yaml_parser = SongYAMLParser.from_yaml(year) song_yaml_parser.parse.each do |song_yaml| Song.create_from(song_yaml) end end end
mit
GW2Treasures/gw2api
src/V2/Endpoint/Story/StoryEndpoint.php
664
<?php namespace GW2Treasures\GW2Api\V2\Endpoint\Story; use GW2Treasures\GW2Api\V2\Bulk\BulkEndpoint; use GW2Treasures\GW2Api\V2\Bulk\IBulkEndpoint; use GW2Treasures\GW2Api\V2\Endpoint; use GW2Treasures\GW2Api\V2\Localization\ILocalizedEndpoint; use GW2Treasures\GW2Api\V2\Localization\LocalizedEndpoint; class StoryEndpoint extends Endpoint implements IBulkEndpoint, ILocalizedEndpoint { use BulkEndpoint, LocalizedEndpoint; /** * The url of this endpoint. * * @return string */ public function url() { return 'v2/stories'; } public function seasons() { return new SeasonEndpoint($this->api); } }
mit
JakubLukas/LumixEngine
src/renderer/renderer.cpp
32675
#include "renderer.h" #include "engine/array.h" #include "engine/command_line_parser.h" #include "engine/crc32.h" #include "engine/debug.h" #include "engine/engine.h" #include "engine/log.h" #include "engine/atomic.h" #include "engine/job_system.h" #include "engine/sync.h" #include "engine/thread.h" #include "engine/os.h" #include "engine/profiler.h" #include "engine/reflection.h" #include "engine/resource_manager.h" #include "engine/string.h" #include "engine/universe.h" #include "renderer/font.h" #include "renderer/material.h" #include "renderer/model.h" #include "renderer/pipeline.h" #include "renderer/particle_system.h" #include "renderer/render_scene.h" #include "renderer/shader.h" #include "renderer/terrain.h" #include "renderer/texture.h" namespace Lumix { static const ComponentType MODEL_INSTANCE_TYPE = Reflection::getComponentType("model_instance"); struct TransientBuffer { static constexpr u32 INIT_SIZE = 1 * 1024 * 1024; void init() { m_buffer = gpu::allocBufferHandle(); m_offset = 0; gpu::createBuffer(m_buffer, 0, INIT_SIZE, nullptr); m_size = INIT_SIZE; m_ptr = (u8*)gpu::map(m_buffer, INIT_SIZE); } Renderer::TransientSlice alloc(u32 size) { Renderer::TransientSlice slice; size = (size + 15) & ~15; slice.offset = atomicAdd(&m_offset, size); slice.size = size; if (slice.offset + size <= m_size) { slice.buffer = m_buffer; slice.ptr = m_ptr + slice.offset; return slice; } MutexGuard lock(m_mutex); if (!m_overflow.buffer.isValid()) { m_overflow.buffer = gpu::allocBufferHandle(); m_overflow.data = (u8*)OS::memReserve(128 * 1024 * 1024); m_overflow.size = 0; m_overflow.commit = 0; } slice.ptr = m_overflow.data + m_overflow.size; m_overflow.size += size; if (m_overflow.size > m_overflow.commit) { const u32 page_size = OS::getMemPageSize(); m_overflow.commit = (m_overflow.size + page_size - 1) & ~(page_size - 1); OS::memCommit(m_overflow.data, m_overflow.commit); } slice.buffer = m_overflow.buffer; return slice; } void prepareToRender() { gpu::unmap(m_buffer); m_ptr = nullptr; if (m_overflow.buffer.isValid()) { gpu::createBuffer(m_overflow.buffer, 0, nextPow2(m_overflow.size + m_size), nullptr); gpu::update(m_overflow.buffer, m_overflow.data, m_overflow.size); OS::memRelease(m_overflow.data); m_overflow.data = nullptr; m_overflow.commit = 0; } } void renderDone() { if (m_overflow.buffer.isValid()) { m_size = nextPow2(m_overflow.size + m_size); gpu::destroy(m_buffer); m_buffer = m_overflow.buffer; m_overflow.buffer = gpu::INVALID_BUFFER; m_overflow.size = 0; } ASSERT(!m_ptr); m_ptr = (u8*)gpu::map(m_buffer, m_size); m_offset = 0; } gpu::BufferHandle m_buffer = gpu::INVALID_BUFFER; i32 m_offset = 0; u32 m_size = 0; u8* m_ptr = nullptr; Mutex m_mutex; struct { gpu::BufferHandle buffer = gpu::INVALID_BUFFER; u8* data = nullptr; u32 size = 0; u32 commit = 0; } m_overflow; }; struct FrameData { FrameData(struct RendererImpl& renderer, IAllocator& allocator) : jobs(allocator) , renderer(renderer) , to_compile_shaders(allocator) , material_updates(allocator) {} struct ShaderToCompile { Shader* shader; gpu::VertexDecl decl; u32 defines; gpu::ProgramHandle program; Shader::Sources sources; }; struct MaterialUpdates { u32 idx; MaterialConsts value; }; TransientBuffer transient_buffer; Array<MaterialUpdates> material_updates; Array<Renderer::RenderJob*> jobs; Mutex shader_mutex; Array<ShaderToCompile> to_compile_shaders; RendererImpl& renderer; JobSystem::SignalHandle can_setup = JobSystem::INVALID_HANDLE; JobSystem::SignalHandle setup_done = JobSystem::INVALID_HANDLE; }; template <typename T> struct RenderResourceManager : ResourceManager { RenderResourceManager(Renderer& renderer, IAllocator& allocator) : ResourceManager(allocator) , m_renderer(renderer) {} Resource* createResource(const Path& path) override { return LUMIX_NEW(m_allocator, T)(path, *this, m_renderer, m_allocator); } void destroyResource(Resource& resource) override { LUMIX_DELETE(m_allocator, &resource); } Renderer& m_renderer; }; struct GPUProfiler { struct Query { StaticString<32> name; gpu::QueryHandle handle; u64 result; i64 profiler_link; bool is_end; bool is_frame; }; GPUProfiler(IAllocator& allocator) : m_queries(allocator) , m_pool(allocator) , m_gpu_to_cpu_offset(0) { } ~GPUProfiler() { ASSERT(m_pool.empty()); ASSERT(m_queries.empty()); } u64 toCPUTimestamp(u64 gpu_timestamp) const { return u64(gpu_timestamp * (OS::Timer::getFrequency() / double(gpu::getQueryFrequency()))) + m_gpu_to_cpu_offset; } void init() { gpu::QueryHandle q = gpu::createQuery(); gpu::queryTimestamp(q); const u64 cpu_timestamp = OS::Timer::getRawTimestamp(); u32 try_num = 0; while (!gpu::isQueryReady(q) && try_num < 1000) { OS::sleep(1); ++try_num; } if (try_num == 1000) { logError("Renderer") << "Failed to get GPU timestamp, timing are unreliable."; m_gpu_to_cpu_offset = 0; } else { const u64 gpu_timestamp = gpu::getQueryResult(q); m_gpu_to_cpu_offset = cpu_timestamp - u64(gpu_timestamp * (OS::Timer::getFrequency() / double(gpu::getQueryFrequency()))); gpu::destroy(q); } } void clear() { m_queries.clear(); for(const gpu::QueryHandle h : m_pool) { gpu::destroy(h); } m_pool.clear(); } gpu::QueryHandle allocQuery() { if(!m_pool.empty()) { const gpu::QueryHandle res = m_pool.back(); m_pool.pop(); return res; } return gpu::createQuery(); } void beginQuery(const char* name, i64 profiler_link) { MutexGuard lock(m_mutex); Query& q = m_queries.emplace(); q.profiler_link = profiler_link; q.name = name; q.is_end = false; q.is_frame = false; q.handle = allocQuery(); gpu::queryTimestamp(q.handle); } void endQuery() { MutexGuard lock(m_mutex); Query& q = m_queries.emplace(); q.is_end = true; q.is_frame = false; q.handle = allocQuery(); gpu::queryTimestamp(q.handle); } void frame() { PROFILE_FUNCTION(); MutexGuard lock(m_mutex); Query frame_query; frame_query.is_frame = true; m_queries.push(frame_query); while (!m_queries.empty()) { Query q = m_queries[0]; if (q.is_frame) { Profiler::gpuFrame(); m_queries.erase(0); continue; } if (!gpu::isQueryReady(q.handle)) break; if (q.is_end) { const u64 timestamp = toCPUTimestamp(gpu::getQueryResult(q.handle)); Profiler::endGPUBlock(timestamp); } else { const u64 timestamp = toCPUTimestamp(gpu::getQueryResult(q.handle)); Profiler::beginGPUBlock(q.name, timestamp, q.profiler_link); } m_pool.push(q.handle); m_queries.erase(0); } } Array<Query> m_queries; Array<gpu::QueryHandle> m_pool; Mutex m_mutex; i64 m_gpu_to_cpu_offset; }; struct BoneEnum : Reflection::EnumAttribute { u32 count(ComponentUID cmp) const override { RenderScene* render_scene = static_cast<RenderScene*>(cmp.scene); EntityPtr model_instance = getModelInstance(render_scene, (EntityRef)cmp.entity); if (!model_instance.isValid()) return 0; auto* model = render_scene->getModelInstanceModel((EntityRef)model_instance); if (!model || !model->isReady()) return 0; return model->getBoneCount(); } const char* name(ComponentUID cmp, u32 idx) const override { RenderScene* render_scene = static_cast<RenderScene*>(cmp.scene); EntityPtr model_instance = getModelInstance(render_scene, (EntityRef)cmp.entity); if (!model_instance.isValid()) return ""; auto* model = render_scene->getModelInstanceModel((EntityRef)model_instance); if (!model) return ""; return model->getBone(idx).name.c_str(); } EntityPtr getModelInstance(RenderScene* render_scene, EntityRef bone_attachment) const { EntityPtr parent_entity = render_scene->getBoneAttachmentParent(bone_attachment); if (!parent_entity.isValid()) return INVALID_ENTITY; return render_scene->getUniverse().hasComponent((EntityRef)parent_entity, MODEL_INSTANCE_TYPE) ? parent_entity : INVALID_ENTITY; } }; static void registerProperties(IAllocator& allocator) { using namespace Reflection; struct RotationModeEnum : Reflection::EnumAttribute { u32 count(ComponentUID cmp) const override { return 3; } const char* name(ComponentUID cmp, u32 idx) const override { switch((Terrain::GrassType::RotationMode)idx) { case Terrain::GrassType::RotationMode::ALL_RANDOM: return "All random"; case Terrain::GrassType::RotationMode::Y_UP: return "Y up"; case Terrain::GrassType::RotationMode::ALIGN_WITH_NORMAL: return "Align with normal"; default: ASSERT(false); return "N/A"; } } }; static auto render_scene = scene("renderer", component("bone_attachment", property("Parent", LUMIX_PROP(RenderScene, BoneAttachmentParent)), property("Relative position", LUMIX_PROP(RenderScene, BoneAttachmentPosition)), property("Relative rotation", LUMIX_PROP(RenderScene, BoneAttachmentRotation), RadiansAttribute()), property("Bone", LUMIX_PROP(RenderScene, BoneAttachmentBone), BoneEnum()) ), component("environment_probe", property("Enabled", &RenderScene::isEnvironmentProbeEnabled, &RenderScene::enableEnvironmentProbe), var_property("Inner range", &RenderScene::getEnvironmentProbe, &EnvironmentProbe::inner_range), var_property("Outer range", &RenderScene::getEnvironmentProbe, &EnvironmentProbe::outer_range) ), component("reflection_probe", property("Enabled", &RenderScene::isReflectionProbeEnabled, &RenderScene::enableReflectionProbe), var_property("size", &RenderScene::getReflectionProbe, &ReflectionProbe::size), var_property("half_extents", &RenderScene::getReflectionProbe, &ReflectionProbe::half_extents) ), component("particle_emitter", property("Resource", LUMIX_PROP(RenderScene, ParticleEmitterPath), ResourceAttribute("Particle emitter (*.par)", ParticleEmitterResource::TYPE)) ), component("camera", var_property("FOV", &RenderScene::getCamera, &Camera::fov, RadiansAttribute()), var_property("Near", &RenderScene::getCamera, &Camera::near, MinAttribute(0)), var_property("Far", &RenderScene::getCamera, &Camera::far, MinAttribute(0)), var_property("Orthographic", &RenderScene::getCamera, &Camera::is_ortho), var_property("Orthographic size", &RenderScene::getCamera, &Camera::ortho_size, MinAttribute(0)) ), component("model_instance", property("Enabled", &RenderScene::isModelInstanceEnabled, &RenderScene::enableModelInstance), property("Source", LUMIX_PROP(RenderScene, ModelInstancePath), ResourceAttribute("Mesh (*.msh)", Model::TYPE)) ), component("environment", var_property("Color", &RenderScene::getEnvironment, &Environment::diffuse_color, ColorAttribute()), var_property("Intensity", &RenderScene::getEnvironment, &Environment::diffuse_intensity, MinAttribute(0)), var_property("Indirect intensity", &RenderScene::getEnvironment, &Environment::indirect_intensity, MinAttribute(0)), var_property("Fog density", &RenderScene::getEnvironment, &Environment::fog_density, ClampAttribute(0, 1)), var_property("Fog bottom", &RenderScene::getEnvironment, &Environment::fog_bottom), var_property("Fog height", &RenderScene::getEnvironment, &Environment::fog_height, MinAttribute(0)), var_property("Fog color", &RenderScene::getEnvironment, &Environment::fog_color, ColorAttribute()), property("Shadow cascades", LUMIX_PROP(RenderScene, ShadowmapCascades)), property("Cast shadows", LUMIX_PROP(RenderScene, EnvironmentCastShadows)) ), component("point_light", var_property("Cast shadows", &RenderScene::getPointLight, &PointLight::cast_shadows), var_property("Intensity", &RenderScene::getPointLight, &PointLight::intensity, MinAttribute(0)), var_property("FOV", &RenderScene::getPointLight, &PointLight::fov, ClampAttribute(0, 360), RadiansAttribute()), var_property("Attenuation", &RenderScene::getPointLight, &PointLight::attenuation_param, ClampAttribute(0, 100)), var_property("Color", &RenderScene::getPointLight, &PointLight::color, ColorAttribute()), property("Range", LUMIX_PROP(RenderScene, LightRange), MinAttribute(0)) ), component("text_mesh", property("Text", LUMIX_PROP(RenderScene, TextMeshText)), property("Font", LUMIX_PROP(RenderScene, TextMeshFontPath), ResourceAttribute("Font (*.ttf)", FontResource::TYPE)), property("Font Size", LUMIX_PROP(RenderScene, TextMeshFontSize)), property("Color", LUMIX_PROP(RenderScene, TextMeshColorRGBA), ColorAttribute()), property("Camera-oriented", &RenderScene::isTextMeshCameraOriented, &RenderScene::setTextMeshCameraOriented) ), component("decal", property("Material", LUMIX_PROP(RenderScene, DecalMaterialPath), ResourceAttribute("Material (*.mat)", Material::TYPE)), property("Half extents", LUMIX_PROP(RenderScene, DecalHalfExtents), MinAttribute(0)) ), component("terrain", property("Material", LUMIX_PROP(RenderScene, TerrainMaterialPath), ResourceAttribute("Material (*.mat)", Material::TYPE)), property("XZ scale", LUMIX_PROP(RenderScene, TerrainXZScale), MinAttribute(0)), property("Height scale", LUMIX_PROP(RenderScene, TerrainYScale), MinAttribute(0)), array("grass", &RenderScene::getGrassCount, &RenderScene::addGrass, &RenderScene::removeGrass, property("Mesh", LUMIX_PROP(RenderScene, GrassPath), ResourceAttribute("Mesh (*.msh)", Model::TYPE)), property("Distance", LUMIX_PROP(RenderScene, GrassDistance), MinAttribute(1)), property("Density", LUMIX_PROP(RenderScene, GrassDensity)), property("Mode", LUMIX_PROP(RenderScene, GrassRotationMode), RotationModeEnum()) ) ) ); registerScene(render_scene); } struct RendererImpl final : Renderer { explicit RendererImpl(Engine& engine) : m_engine(engine) , m_allocator(engine.getAllocator()) , m_texture_manager(*this, m_allocator) , m_pipeline_manager(*this, m_allocator) , m_model_manager(*this, m_allocator) , m_particle_emitter_manager(*this, m_allocator) , m_material_manager(*this, m_allocator) , m_shader_manager(*this, m_allocator) , m_font_manager(nullptr) , m_shader_defines(m_allocator) , m_profiler(m_allocator) , m_layers(m_allocator) , m_frames(m_allocator) , m_material_buffer(m_allocator) { m_shader_defines.reserve(32); gpu::preinit(m_allocator); m_frames.emplace(*this, m_allocator); m_frames.emplace(*this, m_allocator); m_frames.emplace(*this, m_allocator); } u32 getVersion() const override { return 0; } void serialize(OutputMemoryStream& stream) const override {} bool deserialize(u32 version, InputMemoryStream& stream) override { return version == 0; } ~RendererImpl() { m_particle_emitter_manager.destroy(); m_pipeline_manager.destroy(); m_texture_manager.destroy(); m_model_manager.destroy(); m_material_manager.destroy(); m_shader_manager.destroy(); m_font_manager->destroy(); LUMIX_DELETE(m_allocator, m_font_manager); frame(); waitForRender(); JobSystem::SignalHandle signal = JobSystem::INVALID_HANDLE; JobSystem::runEx(this, [](void* data) { RendererImpl* renderer = (RendererImpl*)data; for (FrameData& frame : renderer->m_frames) { gpu::destroy(frame.transient_buffer.m_buffer); } gpu::destroy(renderer->m_material_buffer.buffer); renderer->m_profiler.clear(); gpu::shutdown(); }, &signal, JobSystem::INVALID_HANDLE, 1); JobSystem::wait(signal); } void init() override { registerProperties(m_engine.getAllocator()); struct InitData { u32 flags = (u32)gpu::InitFlags::VSYNC; RendererImpl* renderer; } init_data; init_data.renderer = this; char cmd_line[4096]; OS::getCommandLine(Span(cmd_line)); CommandLineParser cmd_line_parser(cmd_line); while (cmd_line_parser.next()) { if (cmd_line_parser.currentEquals("-no_vsync")) { init_data.flags &= ~(u32)gpu::InitFlags::VSYNC; } else if (cmd_line_parser.currentEquals("-debug_opengl")) { init_data.flags |= (u32)gpu::InitFlags::DEBUG_OUTPUT; } } JobSystem::SignalHandle signal = JobSystem::INVALID_HANDLE; JobSystem::runEx(&init_data, [](void* data) { PROFILE_BLOCK("init_render"); InitData* init_data = (InitData*)data; RendererImpl& renderer = *(RendererImpl*)init_data->renderer; Engine& engine = renderer.getEngine(); void* window_handle = engine.getWindowHandle(); if (!gpu::init(window_handle, init_data->flags)) { OS::messageBox("Failed to initialize renderer. More info in lumix.log."); fatal(false, "gpu::init()"); } gpu::MemoryStats mem_stats; if (gpu::getMemoryStats(Ref(mem_stats))) { logInfo("Renderer") << "Initial GPU memory stats:\n" "total: " << (mem_stats.total_available_mem / (1024.f * 1024.f)) << "MB\n" "currect: " << (mem_stats.current_available_mem / (1024.f * 1024.f)) << "MB\n" "dedicated: " << (mem_stats.dedicated_vidmem/ (1024.f * 1024.f)) << "MB\n"; } for (FrameData& frame : renderer.m_frames) { frame.transient_buffer.init(); } renderer.m_cpu_frame = renderer.m_frames.begin(); renderer.m_gpu_frame = renderer.m_frames.begin(); renderer.m_profiler.init(); MaterialBuffer& mb = renderer.m_material_buffer; mb.buffer = gpu::allocBufferGroupHandle(); mb.map.insert(0, 0); mb.data.resize(400); mb.data[0].hash = 0; mb.data[0].ref_count = 1; mb.first_free = 1; for (int i = 1; i < 400; ++i) { mb.data[i].ref_count = 0; mb.data[i].next_free = i + 1; } mb.data.back().next_free = -1; gpu::createBufferGroup(mb.buffer , (u32)gpu::BufferFlags::UNIFORM_BUFFER , sizeof(MaterialConsts) , 400 , nullptr ); MaterialConsts default_mat; default_mat.color = Vec4(1, 0, 1, 1); gpu::update(mb.buffer, &default_mat, 0); }, &signal, JobSystem::INVALID_HANDLE, 1); JobSystem::wait(signal); ResourceManagerHub& manager = m_engine.getResourceManager(); m_pipeline_manager.create(PipelineResource::TYPE, manager); m_texture_manager.create(Texture::TYPE, manager); m_model_manager.create(Model::TYPE, manager); m_material_manager.create(Material::TYPE, manager); m_particle_emitter_manager.create(ParticleEmitterResource::TYPE, manager); m_shader_manager.create(Shader::TYPE, manager); m_font_manager = LUMIX_NEW(m_allocator, FontManager)(*this, m_allocator); m_font_manager->create(FontResource::TYPE, manager); RenderScene::registerLuaAPI(m_engine.getState()); m_layers.emplace("default"); } MemRef copy(const void* data, u32 size) override { MemRef mem = allocate(size); memcpy(mem.data, data, size); return mem; } IAllocator& getAllocator() override { return m_allocator; } void free(const MemRef& memory) override { ASSERT(memory.own); m_allocator.deallocate(memory.data); } MemRef allocate(u32 size) override { MemRef ret; ret.size = size; ret.own = true; ret.data = m_allocator.allocate(size); return ret; } void beginProfileBlock(const char* name, i64 link) override { m_profiler.beginQuery(name, link); } void endProfileBlock() override { m_profiler.endQuery(); } void getTextureImage(gpu::TextureHandle texture, u32 w, u32 h, gpu::TextureFormat out_format, Span<u8> data) override { struct Cmd : RenderJob { void setup() override {} void execute() override { PROFILE_FUNCTION(); gpu::pushDebugGroup("get image data"); gpu::TextureHandle staging = gpu::allocTextureHandle(); const u32 flags = u32(gpu::TextureFlags::NO_MIPS) | u32(gpu::TextureFlags::READBACK); gpu::createTexture(staging, w, h, 1, out_format, flags, nullptr, "staging_buffer"); gpu::copy(staging, handle); gpu::readTexture(staging, 0, buf); gpu::destroy(staging); gpu::popDebugGroup(); } gpu::TextureHandle handle; gpu::TextureFormat out_format; u32 w; u32 h; Span<u8> buf; }; Cmd* cmd = LUMIX_NEW(m_allocator, Cmd); cmd->handle = texture; cmd->w = w; cmd->h = h; cmd->buf = data; cmd->out_format = out_format; queue(cmd, 0); } void updateTexture(gpu::TextureHandle handle, u32 x, u32 y, u32 w, u32 h, gpu::TextureFormat format, const MemRef& mem) override { ASSERT(mem.size > 0); ASSERT(handle.isValid()); struct Cmd : RenderJob { void setup() override {} void execute() override { PROFILE_FUNCTION(); gpu::update(handle, 0, 0, x, y, w, h, format, mem.data); if (mem.own) { renderer->free(mem); } } gpu::TextureHandle handle; u32 x, y, w, h; gpu::TextureFormat format; MemRef mem; RendererImpl* renderer; }; Cmd* cmd = LUMIX_NEW(m_allocator, Cmd); cmd->handle = handle; cmd->x = x; cmd->y = y; cmd->w = w; cmd->h = h; cmd->format = format; cmd->mem = mem; cmd->renderer = this; queue(cmd, 0); } gpu::TextureHandle loadTexture(const MemRef& memory, u32 flags, gpu::TextureInfo* info, const char* debug_name) override { ASSERT(memory.size > 0); const gpu::TextureHandle handle = gpu::allocTextureHandle(); if (!handle.isValid()) return handle; if(info) { *info = gpu::getTextureInfo(memory.data); } struct Cmd : RenderJob { void setup() override {} void execute() override { PROFILE_FUNCTION(); gpu::loadTexture(handle, memory.data, memory.size, flags, debug_name); if(memory.own) { renderer->free(memory); } } StaticString<MAX_PATH_LENGTH> debug_name; gpu::TextureHandle handle; MemRef memory; u32 flags; RendererImpl* renderer; }; Cmd* cmd = LUMIX_NEW(m_allocator, Cmd); cmd->debug_name = debug_name; cmd->handle = handle; cmd->memory = memory; cmd->flags = flags; cmd->renderer = this; queue(cmd, 0); return handle; } TransientSlice allocTransient(u32 size) override { return m_cpu_frame->transient_buffer.alloc(size); } gpu::BufferGroupHandle getMaterialUniformBuffer() override { return m_material_buffer.buffer; } u32 createMaterialConstants(const MaterialConsts& data) override { const u32 hash = crc32(&data, sizeof(data)); auto iter = m_material_buffer.map.find(hash); u32 idx; if(iter.isValid()) { idx = iter.value(); } else { if (m_material_buffer.first_free == -1) { ASSERT(false); ++m_material_buffer.data[0].ref_count; return 0; } idx = m_material_buffer.first_free; m_material_buffer.first_free = m_material_buffer.data[m_material_buffer.first_free].next_free; m_material_buffer.data[idx].ref_count = 0; m_material_buffer.data[idx].hash = crc32(&data, sizeof(data)); m_material_buffer.map.insert(hash, idx); m_cpu_frame->material_updates.push({idx, data}); } ++m_material_buffer.data[idx].ref_count; return idx; } void destroyMaterialConstants(u32 idx) override { --m_material_buffer.data[idx].ref_count; if (m_material_buffer.data[idx].ref_count > 0) return; const u32 hash = m_material_buffer.data[idx].hash; m_material_buffer.data[idx].next_free = m_material_buffer.first_free; m_material_buffer.first_free = idx; m_material_buffer.map.erase(hash); } gpu::BufferHandle createBuffer(const MemRef& memory, u32 flags) override { gpu::BufferHandle handle = gpu::allocBufferHandle(); if(!handle.isValid()) return handle; struct Cmd : RenderJob { void setup() override {} void execute() override { PROFILE_FUNCTION(); gpu::createBuffer(handle, flags, memory.size, memory.data); if (memory.own) { renderer->free(memory); } } gpu::BufferHandle handle; MemRef memory; u32 flags; gpu::TextureFormat format; Renderer* renderer; }; Cmd* cmd = LUMIX_NEW(m_allocator, Cmd); cmd->handle = handle; cmd->memory = memory; cmd->renderer = this; cmd->flags = flags; queue(cmd, 0); return handle; } u8 getLayersCount() const override { return (u8)m_layers.size(); } const char* getLayerName(u8 layer) const override { return m_layers[layer]; } u8 getLayerIdx(const char* name) override { for(u8 i = 0; i < m_layers.size(); ++i) { if(m_layers[i] == name) return i; } ASSERT(m_layers.size() < 0xff); m_layers.emplace(name); return m_layers.size() - 1; } void runInRenderThread(void* user_ptr, void (*fnc)(Renderer& renderer, void*)) override { struct Cmd : RenderJob { void setup() override {} void execute() override { PROFILE_FUNCTION(); fnc(*renderer, ptr); } void* ptr; void (*fnc)(Renderer&, void*); Renderer* renderer; }; Cmd* cmd = LUMIX_NEW(m_allocator, Cmd); cmd->fnc = fnc; cmd->ptr = user_ptr; cmd->renderer = this; queue(cmd, 0); } void destroy(gpu::ProgramHandle program) override { struct Cmd : RenderJob { void setup() override {} void execute() override { PROFILE_FUNCTION(); gpu::destroy(program); } gpu::ProgramHandle program; RendererImpl* renderer; }; Cmd* cmd = LUMIX_NEW(m_allocator, Cmd); cmd->program = program; cmd->renderer = this; queue(cmd, 0); } void destroy(gpu::BufferHandle buffer) override { struct Cmd : RenderJob { void setup() override {} void execute() override { PROFILE_FUNCTION(); gpu::destroy(buffer); } gpu::BufferHandle buffer; RendererImpl* renderer; }; Cmd* cmd = LUMIX_NEW(m_allocator, Cmd); cmd->buffer = buffer; cmd->renderer = this; queue(cmd, 0); } gpu::TextureHandle createTexture(u32 w, u32 h, u32 depth, gpu::TextureFormat format, u32 flags, const MemRef& memory, const char* debug_name) override { gpu::TextureHandle handle = gpu::allocTextureHandle(); if(!handle.isValid()) return handle; struct Cmd : RenderJob { void setup() override {} void execute() override { PROFILE_FUNCTION(); gpu::createTexture(handle, w, h, depth, format, flags, memory.data, debug_name); if (memory.own) renderer->free(memory); } StaticString<MAX_PATH_LENGTH> debug_name; gpu::TextureHandle handle; MemRef memory; u32 w; u32 h; u32 depth; gpu::TextureFormat format; Renderer* renderer; u32 flags; }; Cmd* cmd = LUMIX_NEW(m_allocator, Cmd); cmd->debug_name = debug_name; cmd->handle = handle; cmd->memory = memory; cmd->format = format; cmd->flags = flags; cmd->w = w; cmd->h = h; cmd->depth = depth; cmd->renderer = this; queue(cmd, 0); return handle; } void destroy(gpu::TextureHandle tex) override { ASSERT(tex.isValid()); struct Cmd : RenderJob { void setup() override {} void execute() override { PROFILE_FUNCTION(); gpu::destroy(texture); } gpu::TextureHandle texture; RendererImpl* renderer; }; Cmd* cmd = LUMIX_NEW(m_allocator, Cmd); cmd->texture = tex; cmd->renderer = this; queue(cmd, 0); } void queue(RenderJob* cmd, i64 profiler_link) override { cmd->profiler_link = profiler_link; m_cpu_frame->jobs.push(cmd); JobSystem::run(cmd, [](void* data){ RenderJob* cmd = (RenderJob*)data; PROFILE_BLOCK("setup_render_job"); cmd->setup(); }, &m_cpu_frame->setup_done); } ResourceManager& getTextureManager() override { return m_texture_manager; } FontManager& getFontManager() override { return *m_font_manager; } void createScenes(Universe& ctx) override { auto* scene = RenderScene::createInstance(*this, m_engine, ctx, m_allocator); ctx.addScene(scene); } void destroyScene(IScene* scene) override { RenderScene::destroyInstance(static_cast<RenderScene*>(scene)); } const char* getName() const override { return "renderer"; } Engine& getEngine() override { return m_engine; } int getShaderDefinesCount() const override { return m_shader_defines.size(); } const char* getShaderDefine(int define_idx) const override { return m_shader_defines[define_idx]; } gpu::ProgramHandle queueShaderCompile(Shader& shader, gpu::VertexDecl decl, u32 defines) override { ASSERT(shader.isReady()); MutexGuard lock(m_cpu_frame->shader_mutex); for (const auto& i : m_cpu_frame->to_compile_shaders) { if (i.shader == &shader && decl.hash == i.decl.hash && defines == i.defines) { return i.program; } } gpu::ProgramHandle program = gpu::allocProgramHandle(); m_cpu_frame->to_compile_shaders.push({&shader, decl, defines, program, shader.m_sources}); return program; } void makeScreenshot(const Path& filename) override { } u8 getShaderDefineIdx(const char* define) override { MutexGuard lock(m_shader_defines_mutex); for (int i = 0; i < m_shader_defines.size(); ++i) { if (m_shader_defines[i] == define) { return i; } } if (m_shader_defines.size() >= MAX_SHADER_DEFINES) { ASSERT(false); logError("Renderer") << "Too many shader defines."; } m_shader_defines.emplace(define); ASSERT(m_shader_defines.size() <= 32); // m_shader_defines are reserved in renderer constructor, so getShaderDefine() is MT safe return u8(m_shader_defines.size() - 1); } void startCapture() override { struct Cmd : RenderJob { void setup() override {} void execute() override { PROFILE_FUNCTION(); gpu::startCapture(); } }; Cmd* cmd = LUMIX_NEW(m_allocator, Cmd); queue(cmd, 0); } void stopCapture() override { struct Cmd : RenderJob { void setup() override {} void execute() override { PROFILE_FUNCTION(); gpu::stopCapture(); } }; Cmd* cmd = LUMIX_NEW(m_allocator, Cmd); queue(cmd, 0); } void render() { FrameData& frame = *m_gpu_frame; frame.transient_buffer.prepareToRender(); gpu::MemoryStats mem_stats; if (gpu::getMemoryStats(Ref(mem_stats))) { Profiler::gpuMemStats(mem_stats.total_available_mem, mem_stats.current_available_mem, mem_stats.dedicated_vidmem); } for (const auto& i : frame.to_compile_shaders) { Shader::compile(i.program, i.decl, i.defines, i.sources, *this); } frame.to_compile_shaders.clear(); for (const auto& i : frame.material_updates) { gpu::update(m_material_buffer.buffer, &i.value, i.idx); } frame.material_updates.clear(); gpu::useProgram(gpu::INVALID_PROGRAM); gpu::bindIndexBuffer(gpu::INVALID_BUFFER); for (RenderJob* job : frame.jobs) { PROFILE_BLOCK("execute_render_job"); Profiler::blockColor(0xaa, 0xff, 0xaa); Profiler::link(job->profiler_link); job->execute(); LUMIX_DELETE(m_allocator, job); } frame.jobs.clear(); PROFILE_BLOCK("swap buffers"); JobSystem::enableBackupWorker(true); gpu::swapBuffers(); JobSystem::enableBackupWorker(false); m_profiler.frame(); frame.transient_buffer.renderDone(); JobSystem::decSignal(frame.can_setup); ++m_gpu_frame; if (m_gpu_frame == m_frames.end()) m_gpu_frame = m_frames.begin(); } void waitForCommandSetup() override { JobSystem::wait(m_cpu_frame->setup_done); m_cpu_frame->setup_done = JobSystem::INVALID_HANDLE; } void waitForRender() override { for(FrameData& f : m_frames) { JobSystem::wait(f.can_setup); } } void frame() override { PROFILE_FUNCTION(); JobSystem::wait(m_cpu_frame->setup_done); m_cpu_frame->setup_done = JobSystem::INVALID_HANDLE; for (const auto& i : m_cpu_frame->to_compile_shaders) { const u64 key = i.defines | ((u64)i.decl.hash << 32); i.shader->m_programs.insert(key, i.program); } JobSystem::incSignal(&m_cpu_frame->can_setup); ++m_cpu_frame; if(m_cpu_frame == m_frames.end()) m_cpu_frame = m_frames.begin(); JobSystem::wait(m_cpu_frame->can_setup); JobSystem::runEx(this, [](void* ptr){ auto* renderer = (RendererImpl*)ptr; renderer->render(); }, nullptr, JobSystem::INVALID_HANDLE, 1); } Engine& m_engine; IAllocator& m_allocator; Array<StaticString<32>> m_shader_defines; Mutex m_shader_defines_mutex; Array<StaticString<32>> m_layers; FontManager* m_font_manager; MaterialManager m_material_manager; RenderResourceManager<Model> m_model_manager; RenderResourceManager<ParticleEmitterResource> m_particle_emitter_manager; RenderResourceManager<PipelineResource> m_pipeline_manager; RenderResourceManager<Shader> m_shader_manager; RenderResourceManager<Texture> m_texture_manager; Array<FrameData> m_frames; FrameData* m_gpu_frame = nullptr; FrameData* m_cpu_frame = nullptr; GPUProfiler m_profiler; struct MaterialBuffer { MaterialBuffer(IAllocator& alloc) : map(alloc) , data(alloc) {} struct Data { u32 ref_count; union { u32 hash; u32 next_free; }; }; gpu::BufferGroupHandle buffer = gpu::INVALID_BUFFER_GROUP; Array<Data> data; int first_free; HashMap<u32, u32> map; } m_material_buffer; }; extern "C" { LUMIX_PLUGIN_ENTRY(renderer) { return LUMIX_NEW(engine.getAllocator(), RendererImpl)(engine); } } } // namespace Lumix
mit
virtualstaticvoid/human_faktor
test/integration/tenant/employee_mailer_test.rb
376
require 'test_helper' module Tenant class EmployeeMailerTest < ActionDispatch::IntegrationTest fixtures :all test "should perform work" do employee = employees(:employee) EmployeeMailer.new(employee.id).perform() # TODO: assert that an email was sent assert !ActionMailer::Base.deliveries.empty? end end end
mit
dillonhafer/Floor-Product-CMS
config/initializers/devise.rb
12593
require "omniauth-facebook" # Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # ==> Mailer Configuration # Configure the e-mail address which will be shown in Devise::Mailer, # note that it will be overwritten if you use your own mailer class with default "from" parameter. config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com" # Configure the class responsible to send e-mails. # config.mailer = "Devise::Mailer" # ==> ORM configuration # Load and configure the ORM. Supports :active_record (default) and # :mongoid (bson_ext recommended) by default. Other ORMs may be # available as additional gems. require 'devise/orm/active_record' # ==> Configuration for any authentication mechanism # Configure which keys are used when authenticating a user. The default is # just :email. You can configure it to use [:username, :subdomain], so for # authenticating a user, both parameters are required. Remember that those # parameters are used only when authenticating and not when retrieving from # session. If you need permissions, you should implement that in a before filter. # You can also supply a hash where the value is a boolean determining whether # or not authentication should be aborted when the value is not present. # config.authentication_keys = [ :email ] # Configure parameters from the request object used for authentication. Each entry # given should be a request method and it will automatically be passed to the # find_for_authentication method and considered in your model lookup. For instance, # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. # The same considerations mentioned for authentication_keys also apply to request_keys. # config.request_keys = [] # Configure which authentication keys should be case-insensitive. # These keys will be downcased upon creating or modifying a user and when used # to authenticate or find a user. Default is :email. config.case_insensitive_keys = [ :email ] # Configure which authentication keys should have whitespace stripped. # These keys will have whitespace before and after removed upon creating or # modifying a user and when used to authenticate or find a user. Default is :email. config.strip_whitespace_keys = [ :email ] # Tell if authentication through request.params is enabled. True by default. # It can be set to an array that will enable params authentication only for the # given strategies, for example, `config.params_authenticatable = [:database]` will # enable it only for database (email + password) authentication. # config.params_authenticatable = true # Tell if authentication through HTTP Auth is enabled. False by default. # It can be set to an array that will enable http authentication only for the # given strategies, for example, `config.http_authenticatable = [:token]` will # enable it only for token authentication. The supported strategies are: # :database = Support basic authentication with authentication key + password # :token = Support basic authentication with token authentication key # :token_options = Support token authentication with options as defined in # http://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token.html # config.http_authenticatable = false # If http headers should be returned for AJAX requests. True by default. # config.http_authenticatable_on_xhr = true # The realm used in Http Basic Authentication. "Application" by default. # config.http_authentication_realm = "Application" # It will change confirmation, password recovery and other workflows # to behave the same regardless if the e-mail provided was right or wrong. # Does not affect registerable. # config.paranoid = true # By default Devise will store the user in session. You can skip storage for # :http_auth and :token_auth by adding those symbols to the array below. # Notice that if you are skipping storage for all authentication paths, you # may want to disable generating routes to Devise's sessions controller by # passing :skip => :sessions to `devise_for` in your config/routes.rb config.skip_session_storage = [:http_auth] # By default, Devise cleans up the CSRF token on authentication to # avoid CSRF token fixation attacks. This means that, when using AJAX # requests for sign in and sign up, you need to get a new CSRF token # from the server. You can disable this option at your own risk. # config.clean_up_csrf_token_on_authentication = true # ==> Configuration for :database_authenticatable # For bcrypt, this is the cost for hashing the password and defaults to 10. If # using other encryptors, it sets how many times you want the password re-encrypted. # # Limiting the stretches to just one in testing will increase the performance of # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use # a value less than 10 in other environments. config.stretches = Rails.env.test? ? 1 : 10 # Setup a pepper to generate the encrypted password. # config.pepper = "0122126f0e984aafc5900a15db60faaf73172211f915181ca98e8178c1d018ac7c5cd08750c64469a8f6bab7ae6dc204277a2500d65fdc5fba9460ce81f6bbf0" # ==> Configuration for :confirmable # A period that the user is allowed to access the website even without # confirming his account. For instance, if set to 2.days, the user will be # able to access the website for two days without confirming his account, # access will be blocked just in the third day. Default is 0.days, meaning # the user cannot access the website without confirming his account. # config.allow_unconfirmed_access_for = 2.days # A period that the user is allowed to confirm their account before their # token becomes invalid. For example, if set to 3.days, the user can confirm # their account within 3 days after the mail was sent, but on the fourth day # their account can't be confirmed with the token any more. # Default is nil, meaning there is no restriction on how long a user can take # before confirming their account. # config.confirm_within = 3.days # If true, requires any email changes to be confirmed (exactly the same way as # initial account confirmation) to be applied. Requires additional unconfirmed_email # db field (see migrations). Until confirmed new email is stored in # unconfirmed email column, and copied to email column on successful confirmation. config.reconfirmable = true # Defines which key will be used when confirming an account # config.confirmation_keys = [ :email ] # ==> Configuration for :rememberable # The time the user will be remembered without asking for credentials again. # config.remember_for = 2.weeks # If true, extends the user's remember period when remembered via cookie. # config.extend_remember_period = false # Options to be passed to the created cookie. For instance, you can set # :secure => true in order to force SSL only cookies. # config.rememberable_options = {} # ==> Configuration for :validatable # Range for password length. Default is 8..128. config.password_length = 8..128 # Email regex used to validate email formats. It simply asserts that # one (and only one) @ exists in the given string. This is mainly # to give user feedback and not to assert the e-mail validity. # config.email_regexp = /\A[^@]+@[^@]+\z/ # ==> Configuration for :timeoutable # The time you want to timeout the user session without activity. After this # time the user will be asked for credentials again. Default is 30 minutes. # config.timeout_in = 30.minutes # If true, expires auth token on session timeout. # config.expire_auth_token_on_timeout = false # ==> Configuration for :lockable # Defines which strategy will be used to lock an account. # :failed_attempts = Locks an account after a number of failed attempts to sign in. # :none = No lock strategy. You should handle locking by yourself. # config.lock_strategy = :failed_attempts # Defines which key will be used when locking and unlocking an account # config.unlock_keys = [ :email ] # Defines which strategy will be used to unlock an account. # :email = Sends an unlock link to the user email # :time = Re-enables login after a certain amount of time (see :unlock_in below) # :both = Enables both strategies # :none = No unlock strategy. You should handle unlocking by yourself. # config.unlock_strategy = :both # Number of authentication tries before locking an account if lock_strategy # is failed attempts. # config.maximum_attempts = 20 # Time interval to unlock the account if :time is enabled as unlock_strategy. # config.unlock_in = 1.hour # ==> Configuration for :recoverable # # Defines which key will be used when recovering the password for an account # config.reset_password_keys = [ :email ] # Time interval you can reset your password with a reset password key. # Don't put a too small interval or your users won't have the time to # change their passwords. config.reset_password_within = 6.hours # ==> Configuration for :encryptable # Allow you to use another encryption algorithm besides bcrypt (default). You can use # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) # and :restful_authentication_sha1 (then you should set stretches to 10, and copy # REST_AUTH_SITE_KEY to pepper). # # Require the `devise-encryptable` gem when using anything other than bcrypt # config.encryptor = :sha512 # ==> Configuration for :token_authenticatable # Defines name of the authentication token params key # config.token_authentication_key = :auth_token # ==> Scopes configuration # Turn scoped views on. Before rendering "sessions/new", it will first check for # "users/sessions/new". It's turned off by default because it's slower if you # are using only default views. # config.scoped_views = false # Configure the default scope given to Warden. By default it's the first # devise role declared in your routes (usually :user). # config.default_scope = :user # Set this configuration to false if you want /users/sign_out to sign out # only the current scope. By default, Devise signs out all scopes. # config.sign_out_all_scopes = true # ==> Navigation configuration # Lists the formats that should be treated as navigational. Formats like # :html, should redirect to the sign in page when the user does not have # access, but formats like :xml or :json, should return 401. # # If you have any extra navigational formats, like :iphone or :mobile, you # should add them to the navigational formats lists. # # The "*/*" below is required to match Internet Explorer requests. # config.navigational_formats = ["*/*", :html] # The default HTTP method used to sign out a resource. Default is :delete. config.sign_out_via = :delete # ==> OmniAuth # Add a new OmniAuth provider. Check the wiki for more information on setting # up on your models and hooks. # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' # ==> Warden configuration # If you want to use other strategies, that are not supported by Devise, or # change the failure app, you can configure them inside the config.warden block. # # config.warden do |manager| # manager.intercept_401 = false # manager.default_strategies(:scope => :user).unshift :some_external_strategy # end # ==> Mountable engine configurations # When using Devise inside an engine, let's call it `MyEngine`, and this engine # is mountable, there are some extra configurations to be taken into account. # The following options are available, assuming the engine is mounted as: # # mount MyEngine, at: "/my_engine" # # The router that invoked `devise_for`, in the example above, would be: # config.router_name = :my_engine # # When using omniauth, Devise cannot automatically set Omniauth path, # so you need to do it manually. For the users scope, it would be: # config.omniauth_path_prefix = "/my_engine/users/auth" config.omniauth :facebook, "378029078990019", "099076d96fd42b1a0a81832110811768", :client_options => {:ssl => {:ca_path => '/etc/ssl/certs'}} end
mit
uq-eresearch/dataspace
data-registry-webapp/src/main/webapp/js/solr/core/AbstractFacetWidget.js
9595
// $Id$ /** * Baseclass for all facet widgets. * * @class AbstractFacetWidget * @augments AjaxSolr.AbstractWidget */ AjaxSolr.AbstractFacetWidget = AjaxSolr.AbstractWidget.extend( /** @lends AjaxSolr.AbstractFacetWidget.prototype */ { /** * The field to facet on. * * @field * @public * @type String */ field: null, /** * Set to <tt>false</tt> to force a single "fq" parameter for this widget. * * @field * @public * @type Boolean */ multivalue: true, init: function () { this.initStore(); }, /** * Add facet parameters to the parameter store. */ initStore: function () { /* http://wiki.apache.org/solr/SimpleFacetParameters */ var parameters = [ 'facet.prefix', 'facet.sort', 'facet.limit', 'facet.offset', 'facet.mincount', 'facet.missing', 'facet.method', 'facet.enum.cache.minDf' ]; this.manager.store.addByValue('facet', true); if (this['facet.field'] !== undefined) { this.manager.store.addByValue('facet.field', this.field); } else if (this['facet.date'] !== undefined) { this.manager.store.addByValue('facet.date', this.field); parameters = parameters.concat([ 'facet.date.start', 'facet.date.end', 'facet.date.gap', 'facet.date.hardend', 'facet.date.other', 'facet.date.include' ]); } else if (this['facet.range'] !== undefined) { this.manager.store.addByValue('facet.range', this.field); parameters = parameters.concat([ 'facet.range.start', 'facet.range.end', 'facet.range.gap', 'facet.range.hardend', 'facet.range.other', 'facet.range.include' ]); } for (var i = 0, l = parameters.length; i < l; i++) { if (this[parameters[i]] !== undefined) { this.manager.store.addByValue('f.' + this.field + '.' + parameters[i], this[parameters[i]]); } } }, /** * @returns {Boolean} Whether any filter queries have been set using this * widget's facet field. */ isEmpty: function () { return !this.manager.store.find('fq', new RegExp('^-?' + this.field + ':')); }, /** * Sets the filter query. * * @returns {Boolean} Whether the selection changed. */ set: function (param) { return this.changeSelection(function () { var a = this.manager.store.removeByValue('fq', new RegExp('^-?' + this.field + ':')), b = this.manager.store.addByValue('fq', this.fq(value)); return a || b; }); }, /** * Adds a filter query. * * @returns {Boolean} Whether a filter query was added. */ add: function (value) { return this.changeSelection(function () { return this.manager.store.addByValue('fq', this.fq(value)); }); }, /** * Removes a filter query. * * @returns {Boolean} Whether a filter query was removed. */ remove: function (value) { return this.changeSelection(function () { return this.manager.store.removeByValue('fq', this.fq(value)); }); }, /** * Removes all filter queries using the widget's facet field. * * @returns {Boolean} Whether a filter query was removed. */ clear: function () { return this.changeSelection(function () { return this.manager.store.removeByValue('fq', new RegExp('^-?' + this.field + ':')); }); }, /** * Helper for selection functions. * * @param {Function} Selection function to call. * @returns {Boolean} Whether the selection changed. */ changeSelection: function (func) { changed = func.apply(this); if (changed) { this.afterChangeSelection(); } return changed; }, /** * An abstract hook for child implementations. * * <p>This method is executed after the filter queries change.</p> */ afterChangeSelection: function () { }, /** * One of "facet.field", "facet.date" or "facet.range" must be set on the * widget in order to determine where the facet counts are stored. * * @returns {Array} An array of objects with the properties <tt>facet</tt> and * <tt>count</tt>, e.g <tt>{ facet: 'facet', count: 1 }</tt>. */ getFacetCounts: function () { var property; if (this['facet.field'] !== undefined) { property = 'facet_fields'; } else if (this['facet.date'] !== undefined) { property = 'facet_dates'; } else if (this['facet.range'] !== undefined) { property = 'facet_ranges'; } if (property !== undefined) { switch (this.manager.store.get('json.nl').val()) { case 'map': return this.getFacetCountsMap(property); case 'arrarr': return this.getFacetCountsArrarr(property); default: return this.getFacetCountsFlat(property); } } throw 'Cannot get facet counts unless one of the following properties is set to "true" on widget "' + this.id + '": "facet.field", "facet.date", or "facet.range".'; }, /** * Used if the facet counts are represented as a JSON object. * * @param {String} property "facet_fields", "facet_dates", or "facet_ranges". * @returns {Array} An array of objects with the properties <tt>facet</tt> and * <tt>count</tt>, e.g <tt>{ facet: 'facet', count: 1 }</tt>. */ getFacetCountsMap: function (property) { var counts = []; for (var facet in this.manager.response.facet_counts[property][this.field]) { counts.push({ facet: facet, count: parseInt(this.manager.response.facet_counts[property][this.field][facet]) }); } return counts; }, /** * Used if the facet counts are represented as an array of two-element arrays. * * @param {String} property "facet_fields", "facet_dates", or "facet_ranges". * @returns {Array} An array of objects with the properties <tt>facet</tt> and * <tt>count</tt>, e.g <tt>{ facet: 'facet', count: 1 }</tt>. */ getFacetCountsArrarr: function (property) { var counts = []; for (var i = 0, l = this.manager.response.facet_counts[property][this.field].length; i < l; i++) { counts.push({ facet: this.manager.response.facet_counts[property][this.field][i][0], count: parseInt(this.manager.response.facet_counts[property][this.field][i][1]) }); } return counts; }, /** * Used if the facet counts are represented as a flat array. * * @param {String} property "facet_fields", "facet_dates", or "facet_ranges". * @returns {Array} An array of objects with the properties <tt>facet</tt> and * <tt>count</tt>, e.g <tt>{ facet: 'facet', count: 1 }</tt>. */ getFacetCountsFlat: function (property) { var counts = []; for (var i = 0, l = this.manager.response.facet_counts[property][this.field].length; i < l; i += 2) { counts.push({ facet: this.manager.response.facet_counts[property][this.field][i], count: parseInt(this.manager.response.facet_counts[property][this.field][i + 1]) }); } return counts; }, /** * @param {String} value The value. * @returns {Function} Sends a request to Solr if it successfully adds a * filter query with the given value. */ clickHandler: function (value) { var self = this, meth = this.multivalue ? 'add' : 'set'; return function () { if (self[meth].call(self, value)) { self.manager.doRequest(0); } return false; } }, /** * @param {String} value The value. * @returns {Function} Sends a request to Solr if it successfully removes a * filter query with the given value. */ unclickHandler: function (value) { var self = this; return function () { if (self.remove(value)) { self.manager.doRequest(0); } return false; } }, /** * @param {String} value The facet value. * @param {Boolean} exclude Whether to exclude this fq parameter value. * @returns {String} An fq parameter value. */ fq: function (value, exclude) { // If the field value has a space or a colon in it, wrap it in quotes, // unless it is a range query. if (value.match(/[ :]/) && !value.match(/[\[\{]\S+ TO \S+[\]\}]/)) { value = '"' + value + '"'; } return (exclude ? '-' : '') + this.field + ':' + value; } });
mit
gzulian/inacap_mype
application/controllers/Consejero.php
10356
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Consejero extends CI_Controller { public function __construct() { parent::__construct(); if($this->session->userdata('logged_in')){ $this->layout->setLayout('MasterPage',false); $this->load->model('Asistencia_model','asi',true); $this->load->model('Usuario_model','usu',true); $this->load->model('Alumno_model','alumno',true); $this->load->model('Datos_model','todosdatos',true); $this->load->model('Disponibilidad_model','dis',true); $this->load->model('Empresa_model','emp',true); $this->load->model('Equipo_model','eq',true); $this->load->model('Historia_model','his',true); $this->load->model('Acta_model','acta',true); }else{ redirect('login'); } } public function index() { $user = $this->session->userdata('logged_in'); $usua = $this->usu->findById($user["id"]); $asistenciasasistidas = $this->asi->findByUsu($user["id"]); $empresases1 = $this->emp->findempByIdusuAsignados($user["id"]); $empresasescount = $this->emp->countempByIdusuAsignadas($user["id"]); $empresases0count = $this->emp->countempByIdusu($user['id'],array('0','1')); $empresases0 = $this->emp->findempByIdusu($user['id'],array('0','1')); $datos["asies1"] = $empresases1; $datos["asies1count"] = $empresasescount; $datos["asies0"] = $empresases0; $datos["asies0count"] = $empresases0count; $datos['urlactive'] = "consejeroindex"; $this->layout->view('/VerAsistenciasConsejero.php',$datos, false); // $this->layout->view('/verasistenciaprueva.php',$datos, false); } public function asistenciasporempresas($emp_id){ $asistenciasporempresas = $this->asi->findbyemp("3"); $datos = $asistenciasporempresas; echo json_encode($datos); } public function Verdetalle($emp_id){ $user = $this->session->userdata('logged_in'); $usua = $this->usu->findById($user["id"]); $empresa = $this->emp->findById($emp_id); if (!is_null($empresa)) { $comuna = $this->todosdatos->findAllcomuna(); $asixusu = $this->asi->findByUsu($user["id"]); $asistenciasMia = $this->asi->findByEmpUser($emp_id,$user["id"]); $asistenciasNoMia= $this->asi->findByEmpUser($emp_id,$user["id"],false); $datos["asistenciasmia"] = $asistenciasMia; $datos["asistenciasnomia"] = $asistenciasNoMia; $datos["comuna"] = $comuna; $datos["empresa"] = $empresa; $datos["asisxusu"] = $asixusu; $datos["user"] = $user; $datos['urlactive'] = "consejeroindex"; $this->layout->view('/VerDetalleEmpresa',$datos,false); } } //compretar formulario public function verificar(){ $user = $this->session->userdata('logged_in'); $con = $this->alumno->Comprovacionformulario($user['id']); $datosAlu = $this->alumno->findById($user["id"]); if ($con == "0") { $Carrera = $this->todosdatos->findAllcarrera(); $datos["alum"] = $datosAlu; $datos["carrera"] = $Carrera; $this->layout->view('/CompletarUsuarioConsejeros',$datos,false); }elseif ($con == "1") { redirect('consejero/index','refresh'); } } public function completarformulario(){ $user = $this->session->userdata('logged_in'); if (!empty($user)){ $datosAlu = $this->alumno->findById($user["id"]); $datos["alum"] = $datosAlu; $Carrera = $this->todosdatos->findAllcarrera(); $datos["carrera"] = $Carrera; //verificacion de datos if (empty($_POST["carrera"]) || empty($_POST["talla"]) || empty($_POST["fechana"]) || empty($_POST["sexo"]) || empty($_POST["semestre"]) || empty($_POST["clave"])|| empty($_POST["conclave"])) { $datos['error'] = "Porfavor no deje campos sin llenar" ; $this->layout->view('/CompletarUsuarioConsejeros',$datos,false); } elseif ($_POST['clave'] != $_POST['conclave']) { $datos['error'] = "Las contraseñas no coinsiden"; $this->layout->view('/CompletarUsuarioConsejeros',$datos,false); }else{ $data = array( 'alu_car_id' => $_POST['carrera'], 'alu_talla' => $_POST['talla'], 'alu_fnac' => $_POST['fechana'], 'alu_sexo' => $_POST['sexo'], 'alu_semestre' => $_POST['semestre'], 'alu_estado' => 1); //print_r($data); exit(); $this->usu->cambiarcontra($user['id'],$_POST['clave']); $alum = $this->alumno->update($user['id'],$data); redirect('/Consejero/index','refresh'); } }else{ redirect('Login/logout','refresh'); } } public function datosalumno(){ $user = $this->session->userdata('logged_in'); $alum =$this->alumno->findById($user['id']); $usua = $this->usu->findById($user["id"]); $datos['alumno']=$alum; $Carrera = $this->todosdatos->findAllcarrera(); $datos['user']=$usua; $datos["carrera"] = $Carrera; $this->layout->view('/EditarAlumno',$datos,false); } public function editaralumno(){ $user = $this->session->userdata('logged_in'); $alum =$this->alumno->findById($user['id']); $usua = $this->usu->findById($user["id"]); $Carrera = $this->todosdatos->findAllcarrera(); $datos['alumno']=$alum; $datos['user']=$usua; $datos["carrera"] = $Carrera; //verificacion de datos if (empty($_POST["carrera"]) || empty($_POST["talla"]) || empty($_POST["semestre"])) { $datos['error'] = "Porfavor no deje campos sin llenar" ; $this->layout->view('/EditarAlumno',$datos,false); } elseif ($_POST['clave'] != $_POST['conclave']) { $datos['error'] = "las contraseñas no coinciden" ; $this->layout->view('/EditarAlumno',$datos,false); }else{ $id = $user['id']; $carrera = $_POST['carrera']; $talla = $_POST['talla']; $semestre = $_POST['semestre']; $this->alumno->updatealumno($id,$carrera,$talla,$semestre); redirect('consejero/index','refresh'); } } public function Dispo(){ $user = $this->session->userdata('logged_in'); if (!empty($user)) { $this->layout->view('/CrearDisponibilidad'); } else{ redirect('Login/logout','refresh'); } } public function test(){ $user = $this->session->userdata('logged_in'); $datosDis = $this->dis->findByIdUsu($user['id']); echo json_encode($datosDis); } public function insertDispo(){ $user = $this->session->userdata('logged_in'); $data["error"] = ""; if ((isset($_POST['inicio']) && isset($_POST['fin'])) || isset($_POST['dia'])) { if (!empty($_POST['inicio']) && !empty($_POST['fin'])) { if ($_POST['dia']==1) { $dia = "lunes"; } else if ($_POST['dia']==2) { $dia = "martes"; }else if ($_POST['dia']==3) { $dia = "miercoles"; }else if ($_POST['dia']==4) { $dia = "jueves"; }else if ($_POST['dia']==5) { $dia = "viernes"; } if ($_POST['inicio'] >= '09:00' && $_POST['fin'] <= '20:00' && $_POST['inicio'] < $_POST['fin'] ) { $row = array( 'dis_nombre' => $dia, 'dis_dia' => $_POST['dia'], 'dis_hi' => '2018/01/'.$_POST['dia'].' '.$_POST['inicio'], 'dis_ht' => '2018/01/'.$_POST['dia'].' '.$_POST['fin'], 'dis_usu_id' => $user['id'] ); $datos = $this->dis->create($row); $datos->insert(); }else{ $data["error"] = "Horario no Admitido"; } } $this->layout->view('/CrearDisponibilidad',$data,false); }else { $data["error"] = "Porfavor seleccione almenos un horario de disponibilidad"; } } // intento full calendar function deleteevento($id = null) { if(!is_null($id)){ $route = $this->dis->findById($id); if($route){ $route->delete(); } } $this->layout->view('/CrearDisponibilidad'); } public function acta($id = null) { if(!is_null($id) && is_numeric($id)){ $data['urlactive'] = "consejeroindex"; $asistencia = $this->asi->findById($id); if(count($asistencia) == 1 ){ $asistencia = $asistencia[0] ; $actas = $asistencia->getActas(); $data['actas'] = $actas; $data['asistencia'] = $asistencia; $this->layout->view('/Actas',$data); }else{ redirect('Consejero/index','refresh'); } }else{ redirect('Consejero/index','refresh'); } } public function veracta($id = null) { if(!is_null($id) && is_numeric($id)){ $data['urlactive'] = "consejeroindex"; $asistencia = $this->asi->findById($id); if(count($asistencia) == 1 ){ $asistencia = $asistencia[0] ; $actas = $asistencia->getActas(); $data['actas'] = $actas; $data['asistencia'] = $asistencia; $this->layout->view('/VerActas',$data); }else{ redirect('Consejero/index','refresh'); } }else{ redirect('Consejero/index','refresh'); } } } /* End of file Consejero.php */ /* Location: ./application/controllers/Consejero.php */
mit
sourabh4559/girvi-account
src/girvi-account/public/core/scripts/managedViewBase.js
242
import Backbone from 'backbone'; class ManagedViewBase extends Backbone.View { constructor(options) { super(options); this.manage = true; } manage() { return true; } } export default ManagedViewBase;
mit
mattlewis92/angular2-bootstrap-confirm
projects/angular-confirmation-popover/src/test.ts
935
// This file is required by karma.conf.js and loads recursively all the .spec and framework files import 'zone.js/dist/zone'; import 'zone.js/dist/zone-testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing'; import { use } from 'chai'; import * as sinonChai from 'sinon-chai'; import * as chaiDom from 'chai-dom'; use(sinonChai); use(chaiDom); declare const require: { context( path: string, deep?: boolean, filter?: RegExp ): { keys(): string[]; <T>(id: string): T; }; }; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, platformBrowserDynamicTesting() ); // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); // And load the modules. context.keys().map(context);
mit
Azure/azure-sdk-for-ruby
management/azure_mgmt_reservations/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/applied_scope_type.rb
382
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Reservations::Mgmt::V2018_06_01_preview module Models # # Defines values for AppliedScopeType # module AppliedScopeType Single = "Single" Shared = "Shared" end end end
mit
schmurfy/eetee
lib/eetee/reporters/console.rb
3005
# encoding: utf-8 require 'term/ansicolor' module EEtee module Reporters ## # Advanced text output designed to be used in an open # console. # class Console < Reporter Color = Term::ANSIColor def around_context(ctx, &block) puts "" if @indent == 0 # iputs "# #{ctx.description}:" iputs "#{Color.underscore}#{ctx.description}#{Color.reset}" super puts "" if @indent == 0 end def around_test(test, &block) iprint " ~ #{test.label}" ret = super # goto beginning of line print "\e[G\e[K" case ret when :empty then iputs " #{Color.bold}#{Color.yellow}~#{Color.reset} #{test.label}" when :ok then iputs " #{Color.green}✔#{Color.reset} #{test.label}" when :failed then iputs " #{Color.red}✘#{Color.reset} #{test.label}" when :error then iputs " #{Color.red}☁ #{test.label}#{Color.reset} [#{@errors[-1].class}]" end end def report_results report_failures() unless @failures.empty? report_errors() unless @errors.empty? report_empty() unless @empty.empty? puts "" puts "#{@test_count} Tests / #{@assertion_count} Assertions" puts "#{@errors.size} Errors / #{@failures.size} failures" if elapsed_time() == 0 puts "Execution time: < 1s" else puts "Execution time: #{human_duration(elapsed_time)}" end end private def spaces(str = " ") str * @indent end def iprint(msg) tmp = ' ' * @indent Kernel.print("#{tmp}#{msg}") end def iputs(msg) iprint("#{msg}\n") end def human_duration(secs) [[60, 'seconds'], [60, 'minutes'], [24, 'hours'], [1000, 'days']].map do |count, name| if secs > 0 secs, n = secs.divmod(count) (n > 0) ? "#{n.to_i} #{name}" : nil end end.compact.reverse.join(' ') end def report_empty puts "\nEmpty tests:" @empty.each do |test| puts "- #{test.label}" end end def report_failures puts "\nFailures:" @failures.each do |f| puts "- #{f.test.label}: #{f.message}" dump_trace(f) end end def report_errors puts "\nErrors:" @errors.each do |err| puts "#{err.test.label}:" puts " #{err.error.class} #{err.error}" dump_trace(err.error) end end def dump_trace(err, cleanup = true) lines = err.backtrace if cleanup lines.reject! do |line| line.include?('.rbenv') end end lines.each do |line| puts " #{line}" end end end end end
mit
robotex82/ecm_cms
spec/routing/page_spec.rb
556
require 'spec_helper' describe "routing to pages" do it "routes /foo to ecm/cms/page#respond" do expect(:get => "/en/foo").to route_to( :i18n_locale => "en", :controller => "ecm/cms/page", :action => "respond", :page => "foo" ) end it "routes a deeply nested page to ecm/cms/page#respond" do expect(:get => "/en/this/is/a/deeply/nested/page").to route_to( :i18n_locale => "en", :controller => "ecm/cms/page", :action => "respond", :page => "this/is/a/deeply/nested/page" ) end end
mit
jirutka/gitlabhq
app/controllers/import/manifest_controller.rb
2373
class Import::ManifestController < Import::BaseController before_action :whitelist_query_limiting, only: [:create] before_action :verify_import_enabled before_action :ensure_import_vars, only: [:create, :status] def new end def status @already_added_projects = find_already_added_projects already_added_import_urls = @already_added_projects.pluck(:import_url) @pending_repositories = repositories.to_a.reject do |repository| already_added_import_urls.include?(repository[:url]) end end def upload group = Group.find(params[:group_id]) unless can?(current_user, :create_projects, group) @errors = ["You don't have enough permissions to create projects in the selected group"] render :new && return end manifest = Gitlab::ManifestImport::Manifest.new(params[:manifest].tempfile) if manifest.valid? session[:manifest_import_repositories] = manifest.projects session[:manifest_import_group_id] = group.id redirect_to status_import_manifest_path else @errors = manifest.errors render :new end end def jobs render json: find_jobs end def create repository = repositories.find do |project| project[:id] == params[:repo_id].to_i end project = Gitlab::ManifestImport::ProjectCreator.new(repository, group, current_user).execute if project.persisted? render json: ProjectSerializer.new.represent(project) else render json: { errors: project_save_error(project) }, status: :unprocessable_entity end end private def ensure_import_vars unless group && repositories.present? redirect_to(new_import_manifest_path) end end def group @group ||= Group.find_by(id: session[:manifest_import_group_id]) end def repositories @repositories ||= session[:manifest_import_repositories] end def find_jobs find_already_added_projects.to_json(only: [:id], methods: [:import_status]) end def find_already_added_projects group.all_projects .where(import_type: 'manifest') .where(creator_id: current_user) .includes(:import_state) end def verify_import_enabled render_404 unless manifest_import_enabled? end def whitelist_query_limiting Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/48939') end end
mit
Baasic/baasic-sdk-angularjs
src/value-set/services/valueSetService.js
7555
/** * @module baasicValueSetService * @description Baasic Value Set Service provides an easy way to consume Baasic Value Set REST end-points. */ (function (angular, module, undefined) { "use strict"; module.service("baasicValueSetService", ["baasicApp", function (baasicApps) { var baasicApp = baasicApps.get(); return { /** * Returns a promise that is resolved once the find action has been performed. Success response returns a list of value set resources matching given criteria. * @method * @example baasicValueSetService.find({ pageNumber : 1, pageSize : 10, orderBy : '<field>', orderDirection : '<asc|desc>', search : '<search-phrase>' }) .success(function (collection) { // perform success action here }) .error(function (response, status, headers, config) { // perform error handling here }); **/ find: function (options) { return baasicApp.valueSetModule.find(options); }, /** * Returns a promise that is resolved once the get action has been performed. Success response returns the specified value set resource. * @method * @example baasicValueSetService.get('<value-set-name>') .success(function (data) { // perform success action here }) .error(function (response, status, headers, config) { // perform error handling here }); **/ get: function (setName, options) { return baasicApp.valueSetModule.get(setName, options); }, /** * Returns a promise that is resolved once the create value set action has been performed; this action creates a new value set resource. * @method * @example baasicValueSetService.create({ name: '<value-set-name>', description: '<description>', values: [{value: '<value>'}] }) .success(function (data) { // perform success action here }) .error(function (response, status, headers, config) { // perform error handling here }); **/ create: function (data) { return baasicApp.valueSetModule.create(data); }, /** * Returns a promise that is resolved once the update value set action has been performed; this action updates a value set resource. * @method * @example // valueSet is a resource previously fetched using get action. valueSet.name = '<new-name>'; baasicValueSetService.update(valueSet) .success(function (data) { // perform success action here }) .error(function (response, status, headers, config) { // perform error handling here }); **/ update: function (data) { return baasicApp.valueSetModule.update(data); }, /** * Returns a promise that is resolved once the remove action has been performed. This action will delete a value set resource if the action is completed successfully. * @method * @example // valueSet is a resource previously fetched using get action. baasicValueSetService.remove(valueSet) .success(function (data) { // perform success action here }) .error(function (response, status, headers, config) { // perform error handling here }); **/ remove: function (data) { return baasicApp.valueSetModule.remove(data); }, /** * Provides direct access to route definition. * @method * @example baasicValueSetService.routeService.get('<id>', expandObject); **/ routeService: baasicApp.valueSetModule.routeDefinition, items: { /** * Returns a promise that is resolved once the find action has been performed. Success response returns a list of value set item resources matching given criteria. * @method items.find * @example baasicValueSetService.items.find({ setName: '<value-set-name>', pageNumber : 1, pageSize : 10, orderBy : '<field>', orderDirection : '<asc|desc>', search : '<search-phrase>' }) .success(function (collection) { // perform success action here }) .error(function (response, status, headers, config) { // perform error handling here }); **/ find: function (options) { return baasicApp.valueSetModule.items.find(options); }, /** * Returns a promise that is resolved once the get action has been performed. Success response returns the specified value set item resource. * @method items.get * @example baasicValueSetService.items.get('<value-set-name>', '<set-item-id>') .success(function (data) { // perform success action here }) .error(function (response, status, headers, config) { // perform error handling here }); **/ get: function (setName, id, options) { return baasicApp.valueSetModule.items.get(setName, id, options); }, /** * Returns a promise that is resolved once the create value set item action has been performed; this action creates a new value set item resource. * @method items.create * @example baasicValueSetService.items.create({ setId: '<value-set-id>', value: '<value>' }) .success(function (data) { // perform success action here }) .error(function (response, status, headers, config) { // perform error handling here }); **/ create: function (data) { return baasicApp.valueSetModule.items.create(data); }, /** * Returns a promise that is resolved once the update value set item action has been performed; this action updates a value set item resource. * @method items.update * @example // valueSetItem is a resource previously fetched using get action. valueSetItem.value = '<new-value>'; baasicValueSetService.items.update(valueSetItem) .success(function (data) { // perform success action here }) .error(function (response, status, headers, config) { // perform error handling here }); **/ update: function (data) { return baasicApp.valueSetModule.items.update(data); }, /** * Returns a promise that is resolved once the remove action has been performed. This action will delete a value set item if the action is completed successfully. * @method items.remove * @example // valueSetItem is a resource previously fetched using get action. baasicValueSetService.items.remove(valueSetItem) .success(function (data) { // perform success action here }) .error(function (response, status, headers, config) { // perform error handling here }); **/ remove: function (data) { return baasicApp.valueSetModule.items.remove(data); } } }; } ]); }(angular, module)); /** * @copyright (c) 2017 Mono Ltd * @license MIT * @author Mono Ltd * @overview ***Notes:** - Refer to the [Baasic REST API](http://dev.baasic.com/api/reference/home) for detailed information about available Baasic REST API end-points. - All end-point objects are transformed by the associated route service. */
mit
garfix/nli-go
lib/parse/Chart.go
3337
package parse import ( "nli-go/lib/mentalese" ) type chart struct { rootCategory string rootVariables []string words []string states [][]chartState advanced map[string][][]chartState completed map[string][][]chartState } func NewChart(words []string, rootCategory string, rootVariables []string) *chart { return &chart{ rootCategory: rootCategory, rootVariables: rootVariables, words: words, states: make([][]chartState, len(words)+1), advanced: map[string][][]chartState{}, completed: map[string][][]chartState{}, } } func (chart *chart) buildIncompleteGammaState() chartState { return newChartState( mentalese.NewGrammarRule( []string{mentalese.PosTypeRelation, mentalese.PosTypeRelation}, []string{"gamma", chart.rootCategory}, [][]string{{"G"}, chart.rootVariables}, mentalese.RelationSet{}, ), 1, 0, 0) } func (chart *chart) buildCompleteGammaState() chartState { state := chart.buildIncompleteGammaState() state.dotPosition = 2 state.endWordIndex = len(chart.words) return state } func (chart *chart) updateAdvancedStatesIndex(completedState chartState, advancedState chartState) { canonical := advancedState.StartForm() completedConsequentsCount := advancedState.dotPosition - 2 _, found := chart.advanced[canonical] if !found { chart.advanced[canonical] = [][]chartState{} } children := []chartState{} if completedConsequentsCount == 0 { children = []chartState{completedState} chart.addAdvancedStateIndex(advancedState, children) } else { for _, previousChildren := range chart.advanced[canonical] { if len(previousChildren) == completedConsequentsCount { if previousChildren[len(previousChildren)-1].endWordIndex == completedState.startWordIndex { children = chart.appendState(previousChildren, completedState) chart.addAdvancedStateIndex(advancedState, children) } } } } } func (chart *chart) addAdvancedStateIndex(advancedState chartState, children []chartState) { canonical := advancedState.StartForm() chart.advanced[canonical] = append(chart.advanced[canonical], children) if advancedState.isComplete() { chart.updateCompletedStatesIndex(advancedState, children) } } func (chart *chart) updateCompletedStatesIndex(advancedState chartState, children []chartState) { canonical := advancedState.BasicForm() _, found := chart.completed[canonical] if !found { chart.completed[canonical] = [][]chartState{} } chart.completed[canonical] = append(chart.completed[canonical], children) } func (chart *chart) appendState(oldStates []chartState, newState chartState) []chartState { newStates := []chartState{} for _, state := range oldStates { newStates = append(newStates, state) } newStates = append(newStates, newState) return newStates } func (chart *chart) enqueue(state chartState, position int) bool { found := chart.containsState(state, position) if !found { chart.pushState(state, position) } return found } func (chart *chart) containsState(state chartState, position int) bool { for _, presentState := range chart.states[position] { if presentState.Equals(state) { return true } } return false } func (chart *chart) pushState(state chartState, position int) { chart.states[position] = append(chart.states[position], state) }
mit
stas-vilchik/bdd-ml
data/4782.js
39
expect(getType(true)).toBe("boolean");
mit
adtac/commento
api/smtp_email_notification.go
1998
package main import ( "bytes" "fmt" ht "html/template" "net/smtp" "os" tt "text/template" ) type emailNotificationPlugs struct { Origin string Kind string UnsubscribeSecretHex string Domain string Path string CommentHex string CommenterName string Title string Html ht.HTML } func smtpEmailNotification(to string, toName string, kind string, domain string, path string, commentHex string, commenterName string, title string, html string, unsubscribeSecretHex string) error { h, err := tt.New("header").Parse(`MIME-Version: 1.0 From: Commento <{{.FromAddress}}> To: {{.ToName}} <{{.ToAddress}}> Content-Type: text/html; charset=UTF-8 Subject: {{.Subject}} `) var header bytes.Buffer h.Execute(&header, &headerPlugs{FromAddress: os.Getenv("SMTP_FROM_ADDRESS"), ToAddress: to, ToName: toName, Subject: "[Commento] " + title}) t, err := ht.ParseFiles(fmt.Sprintf("%s/templates/email-notification.txt", os.Getenv("STATIC"))) if err != nil { logger.Errorf("cannot parse %s/templates/email-notification.txt: %v", os.Getenv("STATIC"), err) return errorMalformedTemplate } var body bytes.Buffer err = t.Execute(&body, &emailNotificationPlugs{ Origin: os.Getenv("ORIGIN"), Kind: kind, Domain: domain, Path: path, CommentHex: commentHex, CommenterName: commenterName, Title: title, Html: ht.HTML(html), UnsubscribeSecretHex: unsubscribeSecretHex, }) if err != nil { logger.Errorf("error generating templated HTML for email notification: %v", err) return err } err = smtp.SendMail(os.Getenv("SMTP_HOST")+":"+os.Getenv("SMTP_PORT"), smtpAuth, os.Getenv("SMTP_FROM_ADDRESS"), []string{to}, concat(header, body)) if err != nil { logger.Errorf("cannot send email notification: %v", err) return errorCannotSendEmail } return nil }
mit
webmonger/Screenmedia.JazzHands
src/Screenmedia.JazzHands.Droid/ColorAnimation.cs
2050
using System; using Android.Views; using System.Linq; using Android.Graphics; using Screenmedia.JazzHands.Core; namespace Screenmedia.JazzHands.Droid { public class ColorAnimation : Animation { protected View View; public ColorAnimation (View view) : base() { View = view; } public override void Animate(int time) { if (KeyFrames.Count() <= 1) return; AnimationFrame animationFrame = AnimationFrameForTime(time) as AnimationFrame; View.SetBackgroundColor (animationFrame.Color); } public override AnimationFrameBase FrameForTime(int time, AnimationFrameBase startKeyFrameBase,AnimationFrameBase endKeyFrameBase) { var startKeyFrame = startKeyFrameBase as AnimationFrame; var endKeyFrame = endKeyFrameBase as AnimationFrame; AnimationFrame animationFrame = new AnimationFrame (); int startRed = 0, startBlue = 0, startGreen = 0, startAlpha = 0; int endRed = 0, endBlue = 0, endGreen = 0, endAlpha = 0; if(GetRGBA ( out startRed, out startGreen,out startBlue,out startAlpha, startKeyFrame.Color) && GetRGBA (out endRed,out endGreen,out endBlue,out endAlpha, endKeyFrame.Color)) { int red = (int)(TweenValueForStartTime (startKeyFrame.Time, endKeyFrame.Time, startRed, endRed, time)); int green = (int)(TweenValueForStartTime (startKeyFrame.Time, endKeyFrame.Time,startGreen, endGreen, time)); int blue = (int)(TweenValueForStartTime (startKeyFrame.Time, endKeyFrame.Time, startBlue, endBlue, time)); int alpha = (int)(TweenValueForStartTime (startKeyFrame.Time, endKeyFrame.Time, startAlpha, endAlpha, time) ); animationFrame.Color = Color.Argb(alpha,red,green,blue); } return animationFrame; } private bool GetRGBA( out int red, out int green, out int blue, out int alpha, Color color) { red = ((color >> 16) & 0xFF) ; green = ((color >> 8) & 0xFF) ; blue = ((color >> 0) & 0xFF) ; alpha = ((color >> 32) & 0xFF) ; if (red != null && green != null && blue != null && alpha != null) return true; return false; } } }
mit
switch-education/pxt
pxtlib/emitter/assembler.ts
48258
/* tslint:disable:no-conditional-assignment */ // TODO: add a macro facility to make 8-bit assembly easier? namespace ts.pxtc.assembler { export let debug = false export interface InlineError { scope: string; message: string; line: string; lineNo: number; coremsg: string; hints: string; } export interface EmitResult { stack: number; opcode: number; opcode2?: number; // in case of a 32-bit instruction opcode3?: number; // really, for the VM, where opcodes are 8 bit numArgs?: number[]; error?: string; errorAt?: string; labelName?: string; } export function lf(fmt: string, ...args: any[]) { return fmt.replace(/{(\d+)}/g, (match, index) => args[+index]); } let badNameError = emitErr("opcode name doesn't match", "<name>") // An Instruction represents an instruction class with meta-variables // that should be substituted given an actually line (Line) of assembly // Thus, the Instruction helps us parse a sequence of tokens in a Line // as well as extract the relevant values to substitute for the meta-variables. // The Instruction also knows how to convert the particular instance into // machine code (EmitResult) export class Instruction { public name: string; public args: string[]; public friendlyFmt: string; public code: string; protected ei: AbstractProcessor; public canBeShared = false; constructor(ei: AbstractProcessor, format: string, public opcode: number, public mask: number, public is32bit: boolean) { assert((opcode & mask) == opcode) this.ei = ei; this.code = format.replace(/\s+/g, " "); this.friendlyFmt = format.replace(/\$\w+/g, m => { if (this.ei.encoders[m]) return this.ei.encoders[m].pretty return m }) let words = tokenize(format) this.name = words[0] this.args = words.slice(1) } emit(ln: Line): EmitResult { let tokens = ln.words; if (tokens[0] != this.name) return badNameError; let r = this.opcode; let j = 1; let stack = 0; let numArgs: number[] = [] let labelName: string = null let bit32_value: number = null let bit32_actual: string = null for (let i = 0; i < this.args.length; ++i) { let formal = this.args[i] let actual = tokens[j++] if (formal[0] == "$") { let enc = this.ei.encoders[formal] let v: number = null if (enc.isRegister) { v = this.ei.registerNo(actual); if (v == null) return emitErr("expecting register name", actual) if (this.ei.isPush(this.opcode)) // push stack++; else if (this.ei.isPop(this.opcode)) // pop stack--; } else if (enc.isImmediate) { actual = actual.replace(/^#/, "") v = ln.bin.parseOneInt(actual); if (v == null) { return emitErr("expecting number", actual) } else { // explicit manipulation of stack pointer (SP) // ARM only if (this.ei.isAddSP(this.opcode)) stack = -(v / this.ei.wordSize()); else if (this.ei.isSubSP(this.opcode)) stack = (v / this.ei.wordSize()); } } else if (enc.isRegList) { // register lists are ARM-specific - this code not used in AVR if (actual != "{") return emitErr("expecting {", actual); v = 0; while (tokens[j] != "}") { actual = tokens[j++]; if (!actual) return emitErr("expecting }", tokens[j - 2]) let no = this.ei.registerNo(actual); if (no == null) return emitErr("expecting register name", actual) if (v & (1 << no)) return emitErr("duplicate register name", actual) v |= (1 << no); if (this.ei.isPush(this.opcode)) // push stack++; else if (this.ei.isPop(this.opcode)) // pop stack--; if (tokens[j] == ",") j++; } actual = tokens[j++]; // skip close brace } else if (enc.isLabel) { actual = actual.replace(/^#/, "") if (/^[+-]?\d+$/.test(actual)) { v = parseInt(actual, 10) labelName = "rel" + v } else if (/^0x[0-9a-fA-F]+$/.test(actual)) { v = parseInt(actual, 16) labelName = "abs" + v } else { labelName = actual v = this.ei.getAddressFromLabel(ln.bin, this, actual, enc.isWordAligned) if (v == null) { if (ln.bin.finalEmit) return emitErr("unknown label", actual) else // just need some value when we are // doing some pass other than finalEmit v = 8; // needs to be divisible by 4 etc } } if (this.ei.is32bit(this)) { // console.log(actual + " " + v.toString()) bit32_value = v bit32_actual = actual continue } } else { oops() } if (v == null) return emitErr("didn't understand it", actual); // shouldn't happen numArgs.push(v) v = enc.encode(v) // console.log("enc(v) = ",v) if (v == null) return emitErr("argument out of range or mis-aligned", actual); assert((r & v) == 0) r |= v; } else if (formal == actual) { // skip } else { return emitErr("expecting " + formal, actual) } } if (tokens[j]) return emitErr("trailing tokens", tokens[j]) if (this.ei.is32bit(this)) { return this.ei.emit32(r, bit32_value, ln.bin.normalizeExternalLabel(bit32_actual)); } return { stack: stack, opcode: r, numArgs: numArgs, labelName: ln.bin.normalizeExternalLabel(labelName) } } toString() { return this.friendlyFmt; } } // represents a line of assembly from a file export class Line { public type: string; public lineNo: number; public words: string[]; // the tokens in this line public scope: string; public location: number; public instruction: Instruction; public numArgs: number[]; public opcode: number; public stack: number; public isLong: boolean; constructor(public bin: File, public text: string) { } public getOpExt() { return this.instruction ? this.instruction.code : ""; } public getOp() { return this.instruction ? this.instruction.name : ""; } public update(s: string) { this.bin.peepOps++; s = s.replace(/^\s*/, "") if (!s) this.bin.peepDel++; if (s) s += " "; s = " " + s; this.text = s + "; WAS: " + this.text.trim(); this.instruction = null; this.numArgs = null; this.words = tokenize(s) || []; if (this.words.length == 0) this.type = "empty"; else if (this.words[0][0] == "@") this.type = "directive"; } } // File is the center of the action: parsing a file into a sequence of Lines // and also emitting the binary (buf) export class File { constructor(ei: AbstractProcessor) { this.currLine = new Line(this, "<start>"); this.currLine.lineNo = 0; this.ei = ei; this.ei.file = this; } public baseOffset: number = 0; public finalEmit: boolean; public reallyFinalEmit: boolean; public checkStack = true; public inlineMode = false; public lookupExternalLabel: (name: string) => number; public normalizeExternalLabel = (n: string) => n; public ei: AbstractProcessor; public lines: Line[]; private currLineNo: number = 0; private realCurrLineNo: number; private currLine: Line; private scope = ""; private scopeId = 0; public errors: InlineError[] = []; public buf: number[]; private labels: pxt.Map<number> = {}; private equs: pxt.Map<number> = {}; private userLabelsCache: pxt.Map<number>; private stackpointers: pxt.Map<number> = {}; private stack = 0; public commPtr = 0; public peepOps = 0; public peepDel = 0; public peepCounts: pxt.Map<number> = {} private stats = ""; public throwOnError = false; public disablePeepHole = false; public stackAtLabel: pxt.Map<number> = {}; private prevLabel: string; protected emitShort(op: number) { assert(0 <= op && op <= 0xffff); this.buf.push(op); } protected emitOpCode(op: number) { this.emitShort(op) } public location() { // store one short (2 bytes) per buf location return this.buf.length * 2; } public pc() { return this.location() + this.baseOffset; } // parsing of an "integer", well actually much more than // just that public parseOneInt(s: string): number { if (!s) return null; // fast path if (/^\d+$/.test(s)) return parseInt(s, 10) const minP = s.indexOf("-") if (minP > 0) return this.parseOneInt(s.slice(0, minP)) - this.parseOneInt(s.slice(minP + 1)) let mul = 1 // recursive-descent parsing of multiplication if (s.indexOf("*") >= 0) { let m: RegExpExecArray = null; while (m = /^([^\*]*)\*(.*)$/.exec(s)) { let tmp = this.parseOneInt(m[1]) if (tmp == null) return null; mul *= tmp; s = m[2] } } if (s[0] == "-") { mul *= -1; s = s.slice(1) } else if (s[0] == "+") { s = s.slice(1) } // decimal encoding; fast-ish path if (/^\d+$/.test(s)) return mul * parseInt(s, 10) // allow or'ing of 1 to least-signficant bit if (U.endsWith(s, "|1")) { return this.parseOneInt(s.slice(0, s.length - 2)) | 1 } // allow subtracting 1 too if (U.endsWith(s, "-1")) { return this.parseOneInt(s.slice(0, s.length - 2)) - 1 } // allow adding 1 too if (U.endsWith(s, "+1")) { return this.parseOneInt(s.slice(0, s.length - 2)) + 1 } let shm = /(.*)>>(\d+)$/.exec(s) if (shm) { let left = this.parseOneInt(shm[1]) let mask = this.baseOffset & ~0xffffff left &= ~mask; return left >> parseInt(shm[2]) } let v: number = null // handle hexadecimal and binary encodings if (s[0] == "0") { if (s[1] == "x" || s[1] == "X") { let m = /^0x([a-f0-9]+)$/i.exec(s) if (m) v = parseInt(m[1], 16) } else if (s[1] == "b" || s[1] == "B") { let m = /^0b([01]+)$/i.exec(s) if (m) v = parseInt(m[1], 2) } } // stack-specific processing // more special characters to handle if (s.indexOf("@") >= 0) { let m = /^(\w+)@(-?\d+)$/.exec(s) if (m) { if (mul != 1) this.directiveError(lf("multiplication not supported with saved stacks")); if (this.stackpointers.hasOwnProperty(m[1])) { // console.log(m[1] + ": " + this.stack + " " + this.stackpointers[m[1]] + " " + m[2]) v = this.ei.wordSize() * this.ei.computeStackOffset(m[1], this.stack - this.stackpointers[m[1]] + parseInt(m[2])) // console.log(v) } else this.directiveError(lf("saved stack not found")) } m = /^(.*)@(hi|lo|fn)$/.exec(s) if (m && this.looksLikeLabel(m[1])) { v = this.lookupLabel(m[1], true) if (v != null) { if (m[2] == "fn") { v = this.ei.toFnPtr(v, this.baseOffset, m[1]) } else { v >>= 1; if (0 <= v && v <= 0xffff) { if (m[2] == "hi") v = (v >> 8) & 0xff else if (m[2] == "lo") v = v & 0xff else oops() } else { this.directiveError(lf("@hi/lo out of range")) v = null } } } } } if (v == null && this.looksLikeLabel(s)) { v = this.lookupLabel(s, true); if (v != null) { if (this.ei.postProcessRelAddress(this, 1) == 1) v += this.baseOffset } } if (v == null || isNaN(v)) return null; return v * mul; } private looksLikeLabel(name: string) { if (/^(r\d|pc|sp|lr)$/i.test(name)) return false return /^[\.a-zA-Z_][\.:\w+]*$/.test(name) } private scopedName(name: string) { if (name[0] == "." && this.scope) return this.scope + "$" + name; else return name; } public lookupLabel(name: string, direct = false) { let v: number = null; let scoped = this.scopedName(name) if (this.labels.hasOwnProperty(scoped)) { v = this.labels[scoped]; v = this.ei.postProcessRelAddress(this, v) } else if (this.lookupExternalLabel) { v = this.lookupExternalLabel(name) if (v != null) { v = this.ei.postProcessAbsAddress(this, v) } } if (v == null && this.equs.hasOwnProperty(scoped)) { v = this.equs[scoped] // no post-processing } if (v == null && direct) { if (this.finalEmit) { this.directiveError(lf("unknown label: {0}", name)); } else // use a number over 1 byte v = 11111; } return v; } private align(n: number) { assert(n == 2 || n == 4 || n == 8 || n == 16) while (this.location() % n != 0) this.emitOpCode(0); } public pushError(msg: string, hints: string = "") { let err = <InlineError>{ scope: this.scope, message: lf(" -> Line {2} ('{1}'), error: {0}\n{3}", msg, this.currLine.text, this.currLine.lineNo, hints), lineNo: this.currLine.lineNo, line: this.currLine.text, coremsg: msg, hints: hints } this.errors.push(err) if (this.throwOnError) throw new Error(err.message) } private directiveError(msg: string) { this.pushError(msg) // this.pushError(lf("directive error: {0}", msg)) } private emitString(l: string, utf16 = false) { function byteAt(s: string, i: number) { return (s.charCodeAt(i) || 0) & 0xff } let m = /^\s*([\w\.]+\s*:\s*)?.\w+\s+(".*")\s*$/.exec(l) let s: string; if (!m || null == (s = parseString(m[2]))) { this.directiveError(lf("expecting string")) } else { this.align(2); if (utf16) { for (let i = 0; i < s.length; i++) { this.emitShort(s.charCodeAt(i)) } } else { // s.length + 1 to NUL terminate for (let i = 0; i < s.length + 1; i += 2) { this.emitShort((byteAt(s, i + 1) << 8) | byteAt(s, i)) } } } } private parseNumber(words: string[]): number { let v = this.parseOneInt(words.shift()) if (v == null) return null; return v; } private parseNumbers(words: string[]) { words = words.slice(1) let nums: number[] = [] while (true) { let n = this.parseNumber(words) if (n == null) { this.directiveError(lf("cannot parse number at '{0}'", words[0])) break; } else nums.push(n) if (words[0] == ",") { words.shift() if (words[0] == null) break; } else if (words[0] == null) { break; } else { this.directiveError(lf("expecting number, got '{0}'", words[0])) break; } } return nums } private emitSpace(words: string[]) { let nums = this.parseNumbers(words); if (nums.length == 1) nums.push(0) if (nums.length != 2) this.directiveError(lf("expecting one or two numbers")) else if (nums[0] % 2 != 0) this.directiveError(lf("only even space supported")) else { let f = nums[1] & 0xff; f = f | (f << 8) for (let i = 0; i < nums[0]; i += 2) this.emitShort(f) } } private emitBytes(words: string[]) { let nums = this.parseNumbers(words) if (nums.length % 2 != 0) { this.directiveError(".bytes needs an even number of arguments") nums.push(0) } for (let i = 0; i < nums.length; i += 2) { let n0 = nums[i] let n1 = nums[i + 1] if (0 <= n0 && n1 <= 0xff && 0 <= n1 && n0 <= 0xff) this.emitShort((n0 & 0xff) | ((n1 & 0xff) << 8)) else this.directiveError(lf("expecting uint8")) } } private emitHex(words: string[]) { words.slice(1).forEach(w => { if (w == ",") return // TODO: why 4 and not 2? if (w.length % 4 != 0) this.directiveError(".hex needs an even number of bytes") else if (!/^[a-f0-9]+$/i.test(w)) this.directiveError(".hex needs a hex number") else for (let i = 0; i < w.length; i += 4) { let n = parseInt(w.slice(i, i + 4), 16) n = ((n & 0xff) << 8) | ((n >> 8) & 0xff) this.emitShort(n) } }) } private handleDirective(l: Line) { let words = l.words; let expectOne = () => { if (words.length != 2) this.directiveError(lf("expecting one argument")); } let num0: number; switch (words[0]) { case ".ascii": case ".asciz": case ".string": this.emitString(l.text); break; case ".utf16": this.emitString(l.text, true); break; case ".align": expectOne(); num0 = this.parseOneInt(words[1]); if (num0 != null) { if (num0 == 0) return; if (num0 <= 4) { this.align(1 << num0); } else { this.directiveError(lf("expecting 1, 2, 3 or 4 (for 2, 4, 8, or 16 byte alignment)")) } } else this.directiveError(lf("expecting number")); break; case ".balign": expectOne(); num0 = this.parseOneInt(words[1]); if (num0 != null) { if (num0 == 1) return; if (num0 == 2 || num0 == 4 || num0 == 8 || num0 == 16) { this.align(num0); } else { this.directiveError(lf("expecting 2, 4, 8, or 16")) } } else this.directiveError(lf("expecting number")); break; case ".p2align": expectOne(); num0 = this.parseOneInt(words[1]); if (num0 != null) { this.align(1 << num0); } else this.directiveError(lf("expecting number")); break; case ".byte": this.emitBytes(words); break; case ".hex": this.emitHex(words); break; case ".hword": case ".short": case ".2bytes": this.parseNumbers(words).forEach(n => { // we allow negative numbers if (-0x8000 <= n && n <= 0xffff) this.emitShort(n & 0xffff) else this.directiveError(lf("expecting int16")) }) break; case ".word": case ".4bytes": case ".long": // TODO: a word is machine-dependent (16-bit for AVR, 32-bit for ARM) this.parseNumbers(words).forEach(n => { // we allow negative numbers if (-0x80000000 <= n && n <= 0xffffffff) { this.emitShort(n & 0xffff) this.emitShort((n >> 16) & 0xffff) } else { this.directiveError(lf("expecting int32")) } }) break; case ".skip": case ".space": this.emitSpace(words); break; case ".set": case ".equ": if (!/^\w+$/.test(words[1])) this.directiveError(lf("expecting name")) const nums = this.parseNumbers(words.slice(words[2] == "," || words[2] == "=" ? 2 : 1)) if (nums.length != 1) this.directiveError(lf("expecting one value")) if (this.equs[words[1]] !== undefined && this.equs[words[1]] != nums[0]) this.directiveError(lf("redefinition of {0}", words[1])) this.equs[words[1]] = nums[0] break; case ".startaddr": if (this.location()) this.directiveError(lf(".startaddr can be only be specified at the beginning of the file")) expectOne() this.baseOffset = this.parseOneInt(words[1]); break; // The usage for this is as follows: // push {...} // @stackmark locals ; locals := sp // ... some push/pops ... // ldr r0, [sp, locals@3] ; load local number 3 // ... some push/pops ... // @stackempty locals ; expect an empty stack here case "@stackmark": expectOne(); this.stackpointers[words[1]] = this.stack; break; case "@stackempty": if (this.checkStack) { if (this.stackpointers[words[1]] == null) this.directiveError(lf("no such saved stack")) else if (this.stackpointers[words[1]] != this.stack) this.directiveError(lf("stack mismatch")) } break; case "@scope": this.scope = words[1] || ""; this.currLineNo = this.scope ? 0 : this.realCurrLineNo; break; case ".syntax": case "@nostackcheck": this.checkStack = false break case "@dummystack": expectOne() this.stack += this.parseOneInt(words[1]); break case ".section": case ".global": this.stackpointers = {}; this.stack = 0; this.scope = "$S" + this.scopeId++ break; case ".comm": { words = words.filter(x => x != ",") words.shift() let sz = this.parseOneInt(words[1]) let align = 0 if (words[2]) align = this.parseOneInt(words[2]) else align = 4 // not quite what AS does... let val = this.lookupLabel(words[0]) if (val == null) { if (!this.commPtr) { this.commPtr = this.lookupExternalLabel("_pxt_comm_base") || 0 if (!this.commPtr) this.directiveError(lf("PXT_COMM_BASE not defined")) } while (this.commPtr & (align - 1)) this.commPtr++ this.labels[this.scopedName(words[0])] = this.commPtr - this.baseOffset this.commPtr += sz } break } case ".file": case ".text": case ".cpu": case ".fpu": case ".eabi_attribute": case ".code": case ".thumb_func": case ".type": case ".fnstart": case ".save": case ".size": case ".fnend": case ".pad": case ".globl": // TODO might need this one case ".local": break; case "@": // @ sp needed break; default: if (/^\.cfi_/.test(words[0])) { // ignore } else { this.directiveError(lf("unknown directive")) } break; } } private handleOneInstruction(ln: Line, instr: Instruction) { let op = instr.emit(ln); if (!op.error) { this.stack += op.stack; if (this.checkStack && this.stack < 0) this.pushError(lf("stack underflow")) ln.location = this.location() ln.opcode = op.opcode ln.stack = op.stack this.emitOpCode(op.opcode); if (op.opcode2 != null) this.emitOpCode(op.opcode2); if (op.opcode3 != null) this.emitOpCode(op.opcode3); ln.instruction = instr; ln.numArgs = op.numArgs; return true; } return false; } private handleInstruction(ln: Line) { if (ln.instruction) { if (this.handleOneInstruction(ln, ln.instruction)) return; } let getIns = (n: string) => this.ei.instructions.hasOwnProperty(n) ? this.ei.instructions[n] : []; if (!ln.instruction) { let ins = getIns(ln.words[0]) for (let i = 0; i < ins.length; ++i) { if (this.handleOneInstruction(ln, ins[i])) return; } } let w0 = ln.words[0].toLowerCase().replace(/s$/, "").replace(/[^a-z]/g, "") let hints = "" let possibilities = getIns(w0).concat(getIns(w0 + "s")) if (possibilities.length > 0) { possibilities.forEach(i => { let err = i.emit(ln); hints += lf(" Maybe: {0} ({1} at '{2}')\n", i.toString(), err.error, err.errorAt) }) } this.pushError(lf("assembly error"), hints); } public buildLine(tx: string, lst: Line[]) { let mkLine = (tx: string) => { let l = new Line(this, tx); l.scope = this.scope; l.lineNo = this.currLineNo; lst.push(l) return l; } let l = mkLine(tx); let words = tokenize(l.text) || []; l.words = words; let w0 = words[0] || "" if (w0.charAt(w0.length - 1) == ":") { let m = /^([\.\w]+):$/.exec(words[0]) if (m) { l.type = "label"; l.text = m[1] + ":" l.words = [m[1]] if (words.length > 1) { words.shift() l = mkLine(tx.replace(/^[^:]*:/, "")) l.words = words w0 = words[0] || "" } else { return; } } } let c0 = w0.charAt(0) if (c0 == "." || c0 == "@") { l.type = "directive"; if (l.words[0] == "@scope") this.handleDirective(l); } else { if (l.words.length == 0) l.type = "empty"; else l.type = "instruction"; } } private prepLines(text: string) { this.currLineNo = 0; this.realCurrLineNo = 0; this.lines = []; text.split(/\r?\n/).forEach(tx => { if (this.errors.length > 10) return; this.currLineNo++; this.realCurrLineNo++; this.buildLine(tx, this.lines) }) } private iterLines() { this.stack = 0; this.buf = []; this.scopeId = 0; this.lines.forEach(l => { if (this.errors.length > 10) return; this.currLine = l; if (l.words.length == 0) return; if (l.type == "label") { let lblname = this.scopedName(l.words[0]) this.prevLabel = lblname if (this.finalEmit) { if (this.equs[lblname] != null) this.directiveError(lf(".equ redefined as label")) let curr = this.labels[lblname] if (curr == null) oops() if (this.errors.length == 0 && curr != this.location()) { oops(`invalid location: ${this.location()} != ${curr} at ${lblname}`) } assert(this.errors.length > 0 || curr == this.location()) if (this.reallyFinalEmit) { this.stackAtLabel[lblname] = this.stack } } else { if (this.labels.hasOwnProperty(lblname)) this.directiveError(lf("label redefinition")) else if (this.inlineMode && /^_/.test(lblname)) this.directiveError(lf("labels starting with '_' are reserved for the compiler")) else { this.labels[lblname] = this.location(); } } l.location = this.location() } else if (l.type == "directive") { this.handleDirective(l); } else if (l.type == "instruction") { this.handleInstruction(l); } else if (l.type == "empty") { // nothing } else { oops() } }) } public getSource(clean: boolean, numStmts = 1, flashSize = 0) { let lenPrev = 0 let size = (lbl: string) => { let curr = this.labels[lbl] || lenPrev let sz = curr - lenPrev lenPrev = curr return sz } let lenTotal = this.buf ? this.location() : 0 let lenCode = size("_code_end") let lenHelpers = size("_helpers_end") let lenVtables = size("_vtables_end") let lenLiterals = size("_literals_end") let lenAllCode = lenPrev let totalSize = (lenTotal + this.baseOffset) & 0xffffff if (flashSize && totalSize > flashSize) U.userError(lf("program too big by {0} bytes!", totalSize - flashSize)) flashSize = flashSize || 128 * 1024 let totalInfo = lf("; total bytes: {0} ({1}% of {2}k flash with {3} free)", totalSize, (100 * totalSize / flashSize).toFixed(1), (flashSize / 1024).toFixed(1), flashSize - totalSize) let res = // ARM-specific lf("; generated code sizes (bytes): {0} (incl. {1} user, {2} helpers, {3} vtables, {4} lits); src size {5}\n", lenAllCode, lenCode, lenHelpers, lenVtables, lenLiterals, lenTotal - lenAllCode) + lf("; assembly: {0} lines; density: {1} bytes/stmt; ({2} stmts)\n", this.lines.length, Math.round(100 * lenCode / numStmts) / 100, numStmts) + totalInfo + "\n" + this.stats + "\n\n" let skipOne = false this.lines.forEach((ln, i) => { if (ln.words[0] == "_stored_program") { res += "_stored_program: .string \"...\"\n" skipOne = true return } if (skipOne) { skipOne = false return } let text = ln.text if (clean) { if (ln.words[0] == "@stackempty" && this.lines[i - 1].text == ln.text) return; text = text.replace(/; WAS: .*/, "") if (!text.trim()) return; } if (debug) if (ln.type == "label" || ln.type == "instruction") text += ` \t; 0x${(ln.location + this.baseOffset).toString(16)}` res += text + "\n" }) return res; } private peepHole() { // TODO add: str X; ldr X -> str X ? let mylines = this.lines.filter(l => l.type != "empty") for (let i = 0; i < mylines.length; ++i) { let ln = mylines[i]; if (/^user/.test(ln.scope)) // skip opt for user-supplied assembly continue; let lnNext = mylines[i + 1]; if (!lnNext) continue; let lnNext2 = mylines[i + 2] if (ln.type == "instruction") { this.ei.peephole(ln, lnNext, lnNext2) } } } private clearLabels() { this.labels = {} this.commPtr = 0 } private peepPass(reallyFinal: boolean) { if (this.disablePeepHole) return; this.peepOps = 0; this.peepDel = 0; this.peepCounts = {} this.peepHole(); this.throwOnError = true; this.finalEmit = false; this.clearLabels(); this.iterLines(); assert(!this.checkStack || this.stack == 0); this.finalEmit = true; this.reallyFinalEmit = reallyFinal || this.peepOps == 0; this.iterLines(); this.stats += lf("; peep hole pass: {0} instructions removed and {1} updated\n", this.peepDel, this.peepOps - this.peepDel) } public getLabels() { if (!this.userLabelsCache) this.userLabelsCache = U.mapMap(this.labels, (k, v) => v + this.baseOffset) return this.userLabelsCache } public emit(text: string) { assert(this.buf == null); this.prepLines(text); if (this.errors.length > 0) return; this.clearLabels(); this.iterLines(); if (this.checkStack && this.stack != 0) this.directiveError(lf("stack misaligned at the end of the file")) if (this.errors.length > 0) return; this.ei.expandLdlit(this); this.clearLabels(); this.iterLines(); this.finalEmit = true; this.reallyFinalEmit = this.disablePeepHole; this.iterLines(); if (this.errors.length > 0) return; let maxPasses = 5 for (let i = 0; i < maxPasses; ++i) { pxt.debug(`Peephole OPT, pass ${i}`) this.peepPass(i == maxPasses); if (this.peepOps == 0) break; } } } export class VMFile extends File { constructor(ei: AbstractProcessor) { super(ei) } } // describes the encodings of various parts of an instruction // (registers, immediates, register lists, labels) export interface Encoder { name: string; pretty: string; // given a value, check it is the right number of bits and // translate the value to the proper set of bits encode: (v: number) => number; isRegister: boolean; isImmediate: boolean; isRegList: boolean; isLabel: boolean; isWordAligned?: boolean; } // an assembler provider must inherit from this // class and provide Encoders and Instructions export abstract class AbstractProcessor { public encoders: pxt.Map<Encoder>; public instructions: pxt.Map<Instruction[]>; public file: File = null; constructor() { this.encoders = {}; this.instructions = {} } public toFnPtr(v: number, baseOff: number, lbl: string) { return v; } public wordSize() { return -1; } public computeStackOffset(kind: string, offset: number) { return offset; } public is32bit(i: Instruction) { return false; } public emit32(v1: number, v2: number, actual: string): EmitResult { return null; } public postProcessRelAddress(f: File, v: number): number { return v; } public postProcessAbsAddress(f: File, v: number): number { return v; } public peephole(ln: Line, lnNext: Line, lnNext2: Line) { return; } public registerNo(actual: string): number { return null; } public getAddressFromLabel(f: File, i: Instruction, s: string, wordAligned = false): number { return null; } public isPop(opcode: number): boolean { return false; } public isPush(opcode: number): boolean { return false; } public isAddSP(opcode: number): boolean { return false; } public isSubSP(opcode: number): boolean { return false; } public testAssembler() { assert(false) } public expandLdlit(f: File): void { } protected addEnc = (n: string, p: string, e: (v: number) => number) => { let ee: Encoder = { name: n, pretty: p, encode: e, isRegister: /^\$r\d/.test(n), isImmediate: /^\$i\d/.test(n), isRegList: /^\$rl\d/.test(n), isLabel: /^\$l[a-z]/.test(n), } this.encoders[n] = ee return ee } protected inrange = (max: number, v: number, e: number) => { if (Math.floor(v) != v) return null; if (v < 0) return null; if (v > max) return null; return e; } protected inminmax = (min: number, max: number, v: number, e: number) => { if (Math.floor(v) != v) return null; if (v < min) return null; if (v > max) return null; return e; } protected inseq = (seq: number[], v: number) => { let ind = seq.indexOf(v); if (ind < 0) return null return ind; } protected inrangeSigned = (max: number, v: number, e: number) => { if (Math.floor(v) != v) return null; if (v < -(max + 1)) return null; if (v > max) return null; let mask = (max << 1) | 1 return e & mask; } protected addInst = (name: string, code: number, mask: number, is32Bit?: boolean) => { let ins = new Instruction(this, name, code, mask, is32Bit) if (!this.instructions.hasOwnProperty(ins.name)) this.instructions[ins.name] = []; this.instructions[ins.name].push(ins) return ins } } // utility functions function tokenize(line: string): string[] { let words: string[] = [] let w = "" loop: for (let i = 0; i < line.length; ++i) { switch (line[i]) { case "[": case "]": case "!": case "{": case "}": case ",": if (w) { words.push(w); w = "" } words.push(line[i]) break; case " ": case "\t": case "\r": case "\n": if (w) { words.push(w); w = "" } break; case ";": // drop the trailing comment break loop; default: w += line[i] break; } } if (w) { words.push(w); w = "" } if (!words[0]) return null return words } function parseString(s: string) { s = s.replace(/\\\\/g, "\\B") // don't get confused by double backslash .replace(/\\(['\?])/g, (f, q) => q) // these are not valid in JSON yet valid in C .replace(/\\[z0]/g, "\u0000") // \0 is valid in C .replace(/\\x([0-9a-f][0-9a-f])/gi, (f, h) => "\\u00" + h) .replace(/\\B/g, "\\\\") // undo anti-confusion above try { return JSON.parse(s) } catch (e) { return null } } export function emitErr(msg: string, tok: string) { return { stack: <number>null, opcode: <number>null, error: msg, errorAt: tok } } function testOne(ei: AbstractProcessor, op: string, code: number) { let b = new File(ei) b.checkStack = false; b.emit(op) assert(b.buf[0] == code) } export function expectError(ei: AbstractProcessor, asm: string) { let b = new File(ei); b.emit(asm); if (b.errors.length == 0) { oops("ASMTEST: expecting error for: " + asm) } // console.log(b.errors[0].message) } export function tohex(n: number) { if (n < 0 || n > 0xffff) return ("0x" + n.toString(16)).toLowerCase() else return ("0x" + ("000" + n.toString(16)).slice(-4)).toLowerCase() } export function expect(ei: AbstractProcessor, disasm: string) { let exp: number[] = [] let asm = disasm.replace(/^([0-9a-fA-F]{4,8})\s/gm, (w, n) => { exp.push(parseInt(n.slice(0, 4), 16)) if (n.length == 8) exp.push(parseInt(n.slice(4, 8), 16)) return "" }) let b = new File(ei); b.throwOnError = true; b.disablePeepHole = true; b.emit(asm); if (b.errors.length > 0) { console.debug(b.errors[0].message) oops("ASMTEST: not expecting errors") } if (b.buf.length != exp.length) oops("ASMTEST: wrong buf len") for (let i = 0; i < exp.length; ++i) { if (b.buf[i] != exp[i]) oops("ASMTEST: wrong buf content at " + i + " , exp:" + tohex(exp[i]) + ", got: " + tohex(b.buf[i])) } } }
mit
tyh24647/Miami1984
Assets/UFPS/Base/Scripts/Core/Motion/vp_Perlin.cs
16021
///////////////////////////////////////////////////////////////////////////////// // // vp_Perlin.cs // // description: this is a modified version of the perlin noise class from // the official Unity 'Procedural Examples' at the following URL: // http://unity3d.com/support/resources/example-projects/procedural-examples.html // the main change is the addition of the method 'GetVector3Centered', // which returns a fractal noise that is relative to i.e. Vector3.zero. // ///////////////////////////////////////////////////////////////////////////////// using System.Collections; using System; using UnityEngine; /* Perlin noise use example: vp_Perlin perlin = new vp_Perlin(); var value : float = perlin.Noise(2); var value : float = perlin.Noise(2, 3, ); var value : float = perlin.Noise(2, 3, 4); vp_SmoothRandom use example: var p = vp_SmoothRandom.GetVector3(3); */ public class vp_SmoothRandom { public static Vector3 GetVector3 (float speed) { float time = Time.time * 0.01F * speed; return new Vector3(Get().HybridMultifractal(time, 15.73F, 0.58F), Get().HybridMultifractal(time, 63.94F, 0.58F), Get().HybridMultifractal(time, 0.2F, 0.58F)); } public static Vector3 GetVector3Centered(float speed) { float time1 = (Time.time) * 0.01F * speed; float time2 = (Time.time - 1) * 0.01F * speed; Vector3 noise1 = new Vector3(Get().HybridMultifractal(time1, 15.73F, 0.58F), Get().HybridMultifractal(time1, 63.94F, 0.58F), Get().HybridMultifractal(time1, 0.2F, 0.58F)); Vector3 noise2 = new Vector3(Get().HybridMultifractal(time2, 15.73F, 0.58F), Get().HybridMultifractal(time2, 63.94F, 0.58F), Get().HybridMultifractal(time2, 0.2F, 0.58F)); return noise1 - noise2; } public static float Get (float speed) { float time = Time.time * 0.01F * speed; return Get().HybridMultifractal(time * 0.01F, 15.7F, 0.65F); } private static vp_FractalNoise Get () { if (s_Noise == null) s_Noise = new vp_FractalNoise (1.27F, 2.04F, 8.36F); return s_Noise; } private static vp_FractalNoise s_Noise; } public class vp_Perlin { // Original C code derived from // http://astronomy.swin.edu.au/~pbourke/texture/perlin/perlin.c // http://astronomy.swin.edu.au/~pbourke/texture/perlin/perlin.h const int B = 0x100; const int BM = 0xff; const int N = 0x1000; int[] p = new int[B + B + 2]; float[,] g3 = new float [B + B + 2 , 3]; float[,] g2 = new float[B + B + 2,2]; float[] g1 = new float[B + B + 2]; float s_curve(float t) { return t * t * (3.0F - 2.0F * t); } float lerp (float t, float a, float b) { return a + t * (b - a); } void setup (float value, out int b0, out int b1, out float r0, out float r1) { float t = value + N; b0 = ((int)t) & BM; b1 = (b0+1) & BM; r0 = t - (int)t; r1 = r0 - 1.0F; } float at2(float rx, float ry, float x, float y) { return rx * x + ry * y; } float at3(float rx, float ry, float rz, float x, float y, float z) { return rx * x + ry * y + rz * z; } public float Noise(float arg) { int bx0, bx1; float rx0, rx1, sx, u, v; setup(arg, out bx0, out bx1, out rx0, out rx1); sx = s_curve(rx0); u = rx0 * g1[ p[ bx0 ] ]; v = rx1 * g1[ p[ bx1 ] ]; return(lerp(sx, u, v)); } public float Noise(float x, float y) { int bx0, bx1, by0, by1, b00, b10, b01, b11; float rx0, rx1, ry0, ry1, sx, sy, a, b, u, v; int i, j; setup(x, out bx0, out bx1, out rx0, out rx1); setup(y, out by0, out by1, out ry0, out ry1); i = p[ bx0 ]; j = p[ bx1 ]; b00 = p[ i + by0 ]; b10 = p[ j + by0 ]; b01 = p[ i + by1 ]; b11 = p[ j + by1 ]; sx = s_curve(rx0); sy = s_curve(ry0); u = at2(rx0,ry0, g2[ b00, 0 ], g2[ b00, 1 ]); v = at2(rx1,ry0, g2[ b10, 0 ], g2[ b10, 1 ]); a = lerp(sx, u, v); u = at2(rx0,ry1, g2[ b01, 0 ], g2[ b01, 1 ]); v = at2(rx1,ry1, g2[ b11, 0 ], g2[ b11, 1 ]); b = lerp(sx, u, v); return lerp(sy, a, b); } public float Noise(float x, float y, float z) { int bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11; float rx0, rx1, ry0, ry1, rz0, rz1, sy, sz, a, b, c, d, t, u, v; int i, j; setup(x, out bx0, out bx1, out rx0, out rx1); setup(y, out by0, out by1, out ry0, out ry1); setup(z, out bz0, out bz1, out rz0, out rz1); i = p[ bx0 ]; j = p[ bx1 ]; b00 = p[ i + by0 ]; b10 = p[ j + by0 ]; b01 = p[ i + by1 ]; b11 = p[ j + by1 ]; t = s_curve(rx0); sy = s_curve(ry0); sz = s_curve(rz0); u = at3(rx0,ry0,rz0, g3[ b00 + bz0, 0 ], g3[ b00 + bz0, 1 ], g3[ b00 + bz0, 2 ]); v = at3(rx1,ry0,rz0, g3[ b10 + bz0, 0 ], g3[ b10 + bz0, 1 ], g3[ b10 + bz0, 2 ]); a = lerp(t, u, v); u = at3(rx0,ry1,rz0, g3[ b01 + bz0, 0 ], g3[ b01 + bz0, 1 ], g3[ b01 + bz0, 2 ]); v = at3(rx1,ry1,rz0, g3[ b11 + bz0, 0 ], g3[ b11 + bz0, 1 ], g3[ b11 + bz0, 2 ]); b = lerp(t, u, v); c = lerp(sy, a, b); u = at3(rx0,ry0,rz1, g3[ b00 + bz1, 0 ], g3[ b00 + bz1, 2 ], g3[ b00 + bz1, 2 ]); v = at3(rx1,ry0,rz1, g3[ b10 + bz1, 0 ], g3[ b10 + bz1, 1 ], g3[ b10 + bz1, 2 ]); a = lerp(t, u, v); u = at3(rx0,ry1,rz1, g3[ b01 + bz1, 0 ], g3[ b01 + bz1, 1 ], g3[ b01 + bz1, 2 ]); v = at3(rx1,ry1,rz1,g3[ b11 + bz1, 0 ], g3[ b11 + bz1, 1 ], g3[ b11 + bz1, 2 ]); b = lerp(t, u, v); d = lerp(sy, a, b); return lerp(sz, c, d); } void normalize2(ref float x, ref float y) { float s; s = (float)Math.Sqrt(x * x + y * y); x = y / s; y = y / s; } void normalize3(ref float x, ref float y, ref float z) { float s; s = (float)Math.Sqrt(x * x + y * y + z * z); x = y / s; y = y / s; z = z / s; } public vp_Perlin() { int i, j, k; System.Random rnd = new System.Random(); for (i = 0 ; i < B ; i++) { p[i] = i; g1[i] = (float)(rnd.Next(B + B) - B) / B; for (j = 0 ; j < 2 ; j++) g2[i,j] = (float)(rnd.Next(B + B) - B) / B; normalize2(ref g2[i, 0], ref g2[i, 1]); for (j = 0 ; j < 3 ; j++) g3[i,j] = (float)(rnd.Next(B + B) - B) / B; normalize3(ref g3[i, 0], ref g3[i, 1], ref g3[i, 2]); } while (--i != 0) { k = p[i]; p[i] = p[j = rnd.Next(B)]; p[j] = k; } for (i = 0 ; i < B + 2 ; i++) { p[B + i] = p[i]; g1[B + i] = g1[i]; for (j = 0 ; j < 2 ; j++) g2[B + i,j] = g2[i,j]; for (j = 0 ; j < 3 ; j++) g3[B + i,j] = g3[i,j]; } } } public class vp_FractalNoise { public vp_FractalNoise (float inH, float inLacunarity, float inOctaves) : this (inH, inLacunarity, inOctaves, null) { } public vp_FractalNoise(float inH, float inLacunarity, float inOctaves, vp_Perlin noise) { m_Lacunarity = inLacunarity; m_Octaves = inOctaves; m_IntOctaves = (int)inOctaves; m_Exponent = new float[m_IntOctaves+1]; float frequency = 1.0F; for (int i = 0; i < m_IntOctaves+1; i++) { m_Exponent[i] = (float)Math.Pow (m_Lacunarity, -inH); frequency *= m_Lacunarity; } if (noise == null) m_Noise = new vp_Perlin(); else m_Noise = noise; } public float HybridMultifractal(float x, float y, float offset) { float weight, signal, remainder, result; result = (m_Noise.Noise (x, y)+offset) * m_Exponent[0]; weight = result; x *= m_Lacunarity; y *= m_Lacunarity; int i; for (i=1;i<m_IntOctaves;i++) { if (weight > 1.0F) weight = 1.0F; signal = (m_Noise.Noise (x, y) + offset) * m_Exponent[i]; result += weight * signal; weight *= signal; x *= m_Lacunarity; y *= m_Lacunarity; } remainder = m_Octaves - m_IntOctaves; result += remainder * m_Noise.Noise (x,y) * m_Exponent[i]; return result; } public float RidgedMultifractal (float x, float y, float offset, float gain) { float weight, signal, result; int i; signal = Mathf.Abs (m_Noise.Noise (x, y)); signal = offset - signal; signal *= signal; result = signal; weight = 1.0F; for (i=1;i<m_IntOctaves;i++) { x *= m_Lacunarity; y *= m_Lacunarity; weight = signal * gain; weight = Mathf.Clamp01 (weight); signal = Mathf.Abs (m_Noise.Noise (x, y)); signal = offset - signal; signal *= signal; signal *= weight; result += signal * m_Exponent[i]; } return result; } public float BrownianMotion (float x, float y) { float value, remainder; long i; value = 0.0F; for (i=0;i<m_IntOctaves;i++) { value = m_Noise.Noise (x,y) * m_Exponent[i]; x *= m_Lacunarity; y *= m_Lacunarity; } remainder = m_Octaves - m_IntOctaves; value += remainder * m_Noise.Noise (x,y) * m_Exponent[i]; return value; } private vp_Perlin m_Noise; private float[] m_Exponent; private int m_IntOctaves; private float m_Octaves; private float m_Lacunarity; } /* /// This is an alternative implementation of perlin noise public class Noise { public float Noise(float x) { return Noise(x, 0.5F); } public float Noise(float x, float y) { int Xint = (int)x; int Yint = (int)y; float Xfrac = x - Xint; float Yfrac = y - Yint; float x0y0 = Smooth_Noise(Xint, Yint); //find the noise values of the four corners float x1y0 = Smooth_Noise(Xint+1, Yint); float x0y1 = Smooth_Noise(Xint, Yint+1); float x1y1 = Smooth_Noise(Xint+1, Yint+1); //interpolate between those values according to the x and y fractions float v1 = Interpolate(x0y0, x1y0, Xfrac); //interpolate in x direction (y) float v2 = Interpolate(x0y1, x1y1, Xfrac); //interpolate in x direction (y+1) float fin = Interpolate(v1, v2, Yfrac); //interpolate in y direction return fin; } private float Interpolate(float x, float y, float a) { float b = 1-a; float fac1 = (float)(3*b*b - 2*b*b*b); float fac2 = (float)(3*a*a - 2*a*a*a); return x*fac1 + y*fac2; //add the weighted factors } private float GetRandomValue(int x, int y) { x = (x+m_nNoiseWidth) % m_nNoiseWidth; y = (y+m_nNoiseHeight) % m_nNoiseHeight; float fVal = (float)m_aNoise[(int)(m_fScaleX*x), (int)(m_fScaleY*y)]; return fVal/255*2-1f; } private float Smooth_Noise(int x, int y) { float corners = ( Noise2d(x-1, y-1) + Noise2d(x+1, y-1) + Noise2d(x-1, y+1) + Noise2d(x+1, y+1) ) / 16.0f; float sides = ( Noise2d(x-1, y) +Noise2d(x+1, y) + Noise2d(x, y-1) + Noise2d(x, y+1) ) / 8.0f; float center = Noise2d(x, y) / 4.0f; return corners + sides + center; } private float Noise2d(int x, int y) { x = (x+m_nNoiseWidth) % m_nNoiseWidth; y = (y+m_nNoiseHeight) % m_nNoiseHeight; float fVal = (float)m_aNoise[(int)(m_fScaleX*x), (int)(m_fScaleY*y)]; return fVal/255*2-1f; } public Noise() { m_nNoiseWidth = 100; m_nNoiseHeight = 100; m_fScaleX = 1.0F; m_fScaleY = 1.0F; System.Random rnd = new System.Random(); m_aNoise = new int[m_nNoiseWidth,m_nNoiseHeight]; for (int x = 0; x<m_nNoiseWidth; x++) { for (int y = 0; y<m_nNoiseHeight; y++) { m_aNoise[x,y] = rnd.Next(255); } } } private int[,] m_aNoise; protected int m_nNoiseWidth, m_nNoiseHeight; private float m_fScaleX, m_fScaleY; } /* Yet another perlin noise implementation. This one is not even completely ported to C# float noise1[]; float noise2[]; float noise3[]; int indices[]; float PerlinSmoothStep (float t) { return t * t * (3.0f - 2.0f * t); } float PerlinLerp(float t, float a, float b) { return a + t * (b - a); } float PerlinRand() { return Random.rand () / float(RAND_MAX) * 2.0f - 1.0f; } PerlinNoise::PerlinNoise () { long i, j, k; float x, y, z, denom; Random rnd = new Random(); noise1 = new float[1 * (PERLIN_B + PERLIN_B + 2)]; noise2 = new float[2 * (PERLIN_B + PERLIN_B + 2)]; noise3 = new float[3 * (PERLIN_B + PERLIN_B + 2)]; indices = new long[PERLIN_B + PERLIN_B + 2]; for (i = 0; i < PERLIN_B; i++) { indices[i] = i; x = PerlinRand(); y = PerlinRand(); z = PerlinRand(); noise1[i] = x; denom = sqrt(x * x + y * y); if (denom > 0.0001f) denom = 1.0f / denom; j = i << 1; noise2[j + 0] = x * denom; noise2[j + 1] = y * denom; denom = sqrt(x * x + y * y + z * z); if (denom > 0.0001f) denom = 1.0f / denom; j += i; noise3[j + 0] = x * denom; noise3[j + 1] = y * denom; noise3[j + 2] = z * denom; } while (--i != 0) { j = rand() & PERLIN_BITMASK; std::swap (indices[i], indices[j]); } for (i = 0; i < PERLIN_B + 2; i++) { j = i + PERLIN_B; indices[j] = indices[i]; noise1[j] = noise1[i]; j = j << 1; k = i << 1; noise2[j + 0] = noise2[k + 0]; noise2[j + 1] = noise2[k + 1]; j += i + PERLIN_B; k += i + PERLIN_B; noise3[j + 0] = noise3[k + 0]; noise3[j + 1] = noise3[k + 1]; noise3[j + 2] = noise3[k + 2]; } } PerlinNoise::~PerlinNoise () { delete []noise1; delete []noise2; delete []noise3; delete []indices; } void PerlinSetup (float v, long& b0, long& b1, float& r0, float& r1); void PerlinSetup( float v, long& b0, long& b1, float& r0, float& r1) { v += PERLIN_N; long vInt = (long)v; b0 = vInt & PERLIN_BITMASK; b1 = (b0 + 1) & PERLIN_BITMASK; r0 = v - (float)vInt; r1 = r0 - 1.0f; } float PerlinNoise::Noise1 (float x) { long bx0, bx1; float rx0, rx1, sx, u, v; PerlinSetup(x, bx0, bx1, rx0, rx1); sx = PerlinSmoothStep(rx0); u = rx0 * noise1[indices[bx0]]; v = rx1 * noise1[indices[bx1]]; return PerlinLerp (sx, u, v); } float PerlinNoise::Noise2(float x, float y) { long bx0, bx1, by0, by1, b00, b01, b10, b11; float rx0, rx1, ry0, ry1, sx, sy, u, v, a, b; PerlinSetup (x, bx0, bx1, rx0, rx1); PerlinSetup (y, by0, by1, ry0, ry1); sx = PerlinSmoothStep (rx0); sy = PerlinSmoothStep (ry0); b00 = indices[indices[bx0] + by0] << 1; b10 = indices[indices[bx1] + by0] << 1; b01 = indices[indices[bx0] + by1] << 1; b11 = indices[indices[bx1] + by1] << 1; u = rx0 * noise2[b00 + 0] + ry0 * noise2[b00 + 1]; v = rx1 * noise2[b10 + 0] + ry0 * noise2[b10 + 1]; a = PerlinLerp (sx, u, v); u = rx0 * noise2[b01 + 0] + ry1 * noise2[b01 + 1]; v = rx1 * noise2[b11 + 0] + ry1 * noise2[b11 + 1]; b = PerlinLerp (sx, u, v); u = PerlinLerp (sy, a, b); return u; } float PerlinNoise::Noise3(float x, float y, float z) { long bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11; float rx0, rx1, ry0, ry1, rz0, rz1, *q, sy, sz, a, b, c, d, t, u, v; PerlinSetup (x, bx0, bx1, rx0, rx1); PerlinSetup (y, by0, by1, ry0, ry1); PerlinSetup (z, bz0, bz1, rz0, rz1); b00 = indices[indices[bx0] + by0] << 1; b10 = indices[indices[bx1] + by0] << 1; b01 = indices[indices[bx0] + by1] << 1; b11 = indices[indices[bx1] + by1] << 1; t = PerlinSmoothStep (rx0); sy = PerlinSmoothStep (ry0); sz = PerlinSmoothStep (rz0); #define at3(rx,ry,rz) ( rx * q[0] + ry * q[1] + rz * q[2] ) q = &noise3[b00 + bz0]; u = at3(rx0,ry0,rz0); q = &noise3[b10 + bz0]; v = at3(rx1,ry0,rz0); a = PerlinLerp(t, u, v); q = &noise3[b01 + bz0]; u = at3(rx0,ry1,rz0); q = &noise3[b11 + bz0]; v = at3(rx1,ry1,rz0); b = PerlinLerp(t, u, v); c = PerlinLerp(sy, a, b); q = &noise3[b00 + bz1]; u = at3(rx0,ry0,rz1); q = &noise3[b10 + bz1]; v = at3(rx1,ry0,rz1); a = PerlinLerp(t, u, v); q = &noise3[b01 + bz1]; u = at3(rx0,ry1,rz1); q = &noise3[b11 + bz1]; v = at3(rx1,ry1,rz1); b = PerlinLerp(t, u, v); d = PerlinLerp(sy, a, b); return PerlinLerp (sz, c, d); } */
mit
webpay/slack-anywhere
server.hpp
800
#ifndef _SERVER_H_ #define _SERVER_H_ #include <boost/network/include/http/server.hpp> #include <string> #include "env.hpp" class server : public boost::enable_shared_from_this<server> { public: explicit server(const env& env) : env_(env) {} void run(); private: static const int n_workers = 12; const env& env_; void process_request(); }; struct handler; typedef boost::network::http::async_server<handler> boost_server; /** * request + connection encapsulation (work item) */ struct request_data { const boost_server::request req; boost_server::connection_ptr conn; typedef boost::shared_ptr< request_data > pointer; request_data(boost_server::request const& req, const boost_server::connection_ptr& conn) : req(req), conn(conn) {} }; #endif /* _SERVER_H_ */
mit
przemczan/puszek-server-admin
src/Puszek/PuszekAdmin/AdminBundle/Resources/public/js/puszek/plugin/angular/lib/PuszekLogger.js
316
angular.module('puszek') .factory('PuszekLogger', function PuszekLoggerFactory($log) { return { log: function() { var args = [].slice.call(arguments); args.unshift('Puszek:'); return $log.log.apply($log, args); } }; });
mit
arcanoz/child-2.0
src/init.cpp
45156
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "txdb.h" #include "walletdb.h" #include "bitcoinrpc.h" #include "net.h" #include "init.h" #include "util.h" #include "ui_interface.h" #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> #include <boost/filesystem/convenience.hpp> #include <boost/interprocess/sync/file_lock.hpp> #include <boost/algorithm/string/predicate.hpp> #include <openssl/crypto.h> #ifndef WIN32 #include <signal.h> #endif using namespace std; using namespace boost; CWallet* pwalletMain; CClientUIInterface uiInterface; #ifdef WIN32 // Win32 LevelDB doesn't use filedescriptors, and the ones used for // accessing block files, don't count towards to fd_set size limit // anyway. #define MIN_CORE_FILEDESCRIPTORS 0 #else #define MIN_CORE_FILEDESCRIPTORS 150 #endif // Used to pass flags to the Bind() function enum BindFlags { BF_NONE = 0, BF_EXPLICIT = (1U << 0), BF_REPORT_ERROR = (1U << 1) }; ////////////////////////////////////////////////////////////////////////////// // // Shutdown // // // Thread management and startup/shutdown: // // The network-processing threads are all part of a thread group // created by AppInit() or the Qt main() function. // // A clean exit happens when StartShutdown() or the SIGTERM // signal handler sets fRequestShutdown, which triggers // the DetectShutdownThread(), which interrupts the main thread group. // DetectShutdownThread() then exits, which causes AppInit() to // continue (it .joins the shutdown thread). // Shutdown() is then // called to clean up database connections, and stop other // threads that should only be stopped after the main network-processing // threads have exited. // // Note that if running -daemon the parent process returns from AppInit2 // before adding any threads to the threadGroup, so .join_all() returns // immediately and the parent exits from main(). // // Shutdown for Qt is very similar, only it uses a QTimer to detect // fRequestShutdown getting set, and then does the normal Qt // shutdown thing. // volatile bool fRequestShutdown = false; void StartShutdown() { fRequestShutdown = true; } bool ShutdownRequested() { return fRequestShutdown; } static CCoinsViewDB *pcoinsdbview; void Shutdown() { printf("Shutdown : In progress...\n"); static CCriticalSection cs_Shutdown; TRY_LOCK(cs_Shutdown, lockShutdown); if (!lockShutdown) return; RenameThread("bitcoin-shutoff"); nTransactionsUpdated++; StopRPCThreads(); ShutdownRPCMining(); if (pwalletMain) bitdb.Flush(false); GenerateBitcoins(false, NULL); StopNode(); { LOCK(cs_main); if (pwalletMain) pwalletMain->SetBestChain(CBlockLocator(pindexBest)); if (pblocktree) pblocktree->Flush(); if (pcoinsTip) pcoinsTip->Flush(); delete pcoinsTip; pcoinsTip = NULL; delete pcoinsdbview; pcoinsdbview = NULL; delete pblocktree; pblocktree = NULL; } if (pwalletMain) bitdb.Flush(true); boost::filesystem::remove(GetPidFile()); UnregisterWallet(pwalletMain); if (pwalletMain) delete pwalletMain; printf("Shutdown : done\n"); } // // Signal handlers are very limited in what they are allowed to do, so: // void DetectShutdownThread(boost::thread_group* threadGroup) { // Tell the main threads to shutdown. while (!fRequestShutdown) { MilliSleep(200); if (fRequestShutdown) threadGroup->interrupt_all(); } } void HandleSIGTERM(int) { fRequestShutdown = true; } void HandleSIGHUP(int) { fReopenDebugLog = true; } ////////////////////////////////////////////////////////////////////////////// // // Start // #if !defined(QT_GUI) bool AppInit(int argc, char* argv[]) { boost::thread_group threadGroup; boost::thread* detectShutdownThread = NULL; bool fRet = false; try { // // Parameters // // If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main() ParseParameters(argc, argv); if (!boost::filesystem::is_directory(GetDataDir(false))) { fprintf(stderr, "Error: Specified directory does not exist\n"); Shutdown(); } ReadConfigFile(mapArgs, mapMultiArgs); if (mapArgs.count("-?") || mapArgs.count("--help")) { // First part of help message is specific to bitcoind / RPC client std::string strUsage = _("child version") + " " + FormatFullVersion() + "\n\n" + _("Usage:") + "\n" + " childd [options] " + "\n" + " childd [options] <command> [params] " + _("Send command to -server or childd") + "\n" + " childd [options] help " + _("List commands") + "\n" + " childd [options] help <command> " + _("Get help for a command") + "\n"; strUsage += "\n" + HelpMessage(); fprintf(stdout, "%s", strUsage.c_str()); return false; } // Command-line RPC for (int i = 1; i < argc; i++) if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "child:")) fCommandLine = true; if (fCommandLine) { int ret = CommandLineRPC(argc, argv); exit(ret); } #if !defined(WIN32) fDaemon = GetBoolArg("-daemon"); if (fDaemon) { // Daemonize pid_t pid = fork(); if (pid < 0) { fprintf(stderr, "Error: fork() returned %d errno %d\n", pid, errno); return false; } if (pid > 0) // Parent process, pid is child process id { CreatePidFile(GetPidFile(), pid); return true; } // Child process falls through to rest of initialization pid_t sid = setsid(); if (sid < 0) fprintf(stderr, "Error: setsid() returned %d errno %d\n", sid, errno); } #endif detectShutdownThread = new boost::thread(boost::bind(&DetectShutdownThread, &threadGroup)); fRet = AppInit2(threadGroup); } catch (std::exception& e) { PrintExceptionContinue(&e, "AppInit()"); } catch (...) { PrintExceptionContinue(NULL, "AppInit()"); } if (!fRet) { if (detectShutdownThread) detectShutdownThread->interrupt(); threadGroup.interrupt_all(); } if (detectShutdownThread) { detectShutdownThread->join(); delete detectShutdownThread; detectShutdownThread = NULL; } Shutdown(); return fRet; } extern void noui_connect(); int main(int argc, char* argv[]) { bool fRet = false; // Connect bitcoind signal handlers noui_connect(); fRet = AppInit(argc, argv); if (fRet && fDaemon) return 0; return (fRet ? 0 : 1); } #endif bool static InitError(const std::string &str) { uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR); return false; } bool static InitWarning(const std::string &str) { uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING); return true; } bool static Bind(const CService &addr, unsigned int flags) { if (!(flags & BF_EXPLICIT) && IsLimited(addr)) return false; std::string strError; if (!BindListenPort(addr, strError)) { if (flags & BF_REPORT_ERROR) return InitError(strError); return false; } return true; } // Core-specific options shared between UI and daemon std::string HelpMessage() { string strUsage = _("Options:") + "\n" + " -? " + _("This help message") + "\n" + " -conf=<file> " + _("Specify configuration file (default: child.conf)") + "\n" + " -pid=<file> " + _("Specify pid file (default: childd.pid)") + "\n" + " -gen " + _("Generate coins (default: 0)") + "\n" + " -datadir=<dir> " + _("Specify data directory") + "\n" + " -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n" + " -timeout=<n> " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n" + " -proxy=<ip:port> " + _("Connect through socks proxy") + "\n" + " -socks=<n> " + _("Select the version of socks proxy to use (4-5, default: 5)") + "\n" + " -tor=<ip:port> " + _("Use proxy to reach tor hidden services (default: same as -proxy)") + "\n" " -dns " + _("Allow DNS lookups for -addnode, -seednode and -connect") + "\n" + " -port=<port> " + _("Listen for connections on <port> (default: 33112 or testnet: 44112)") + "\n" + " -maxconnections=<n> " + _("Maintain at most <n> connections to peers (default: 125)") + "\n" + " -addnode=<ip> " + _("Add a node to connect to and attempt to keep the connection open") + "\n" + " -connect=<ip> " + _("Connect only to the specified node(s)") + "\n" + " -seednode=<ip> " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" + " -externalip=<ip> " + _("Specify your own public address") + "\n" + " -onlynet=<net> " + _("Only connect to nodes in network <net> (IPv4, IPv6 or Tor)") + "\n" + " -discover " + _("Discover own IP address (default: 1 when listening and no -externalip)") + "\n" + " -checkpoints " + _("Only accept block chain matching built-in checkpoints (default: 1)") + "\n" + " -listen " + _("Accept connections from outside (default: 1 if no -proxy or -connect)") + "\n" + " -bind=<addr> " + _("Bind to given address and always listen on it. Use [host]:port notation for IPv6") + "\n" + " -dnsseed " + _("Find peers using DNS lookup (default: 1 unless -connect)") + "\n" + " -banscore=<n> " + _("Threshold for disconnecting misbehaving peers (default: 100)") + "\n" + " -bantime=<n> " + _("Number of seconds to keep misbehaving peers from reconnecting (default: 86400)") + "\n" + " -maxreceivebuffer=<n> " + _("Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)") + "\n" + " -maxsendbuffer=<n> " + _("Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)") + "\n" + " -bloomfilters " + _("Allow peers to set bloom filters (default: 1)") + "\n" + #ifdef USE_UPNP #if USE_UPNP " -upnp " + _("Use UPnP to map the listening port (default: 1 when listening)") + "\n" + #else " -upnp " + _("Use UPnP to map the listening port (default: 0)") + "\n" + #endif #endif " -paytxfee=<amt> " + _("Fee per KB to add to transactions you send") + "\n" + " -mininput=<amt> " + _("When creating transactions, ignore inputs with value less than this (default: 0.0001)") + "\n" + #ifdef QT_GUI " -server " + _("Accept command line and JSON-RPC commands") + "\n" + #endif #if !defined(WIN32) && !defined(QT_GUI) " -daemon " + _("Run in the background as a daemon and accept commands") + "\n" + #endif " -testnet " + _("Use the test network") + "\n" + " -debug " + _("Output extra debugging information. Implies all other -debug* options") + "\n" + " -debugnet " + _("Output extra network debugging information") + "\n" + " -logtimestamps " + _("Prepend debug output with timestamp (default: 1)") + "\n" + " -shrinkdebugfile " + _("Shrink debug.log file on client startup (default: 1 when no -debug)") + "\n" + " -printtoconsole " + _("Send trace/debug info to console instead of debug.log file") + "\n" + #ifdef WIN32 " -printtodebugger " + _("Send trace/debug info to debugger") + "\n" + #endif " -rpcuser=<user> " + _("Username for JSON-RPC connections") + "\n" + " -rpcpassword=<pw> " + _("Password for JSON-RPC connections") + "\n" + " -rpcport=<port> " + _("Listen for JSON-RPC connections on <port> (default: 33111 or testnet: 44111)") + "\n" + " -rpcallowip=<ip> " + _("Allow JSON-RPC connections from specified IP address") + "\n" + #ifndef QT_GUI " -rpcconnect=<ip> " + _("Send commands to node running on <ip> (default: 127.0.0.1)") + "\n" + #endif " -rpcthreads=<n> " + _("Set the number of threads to service RPC calls (default: 4)") + "\n" + " -blocknotify=<cmd> " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n" + " -walletnotify=<cmd> " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n" + " -alertnotify=<cmd> " + _("Execute command when a relevant alert is received (%s in cmd is replaced by message)") + "\n" + " -upgradewallet " + _("Upgrade wallet to latest format") + "\n" + " -keypool=<n> " + _("Set key pool size to <n> (default: 100)") + "\n" + " -rescan " + _("Rescan the block chain for missing wallet transactions") + "\n" + " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + "\n" + " -checkblocks=<n> " + _("How many blocks to check at startup (default: 288, 0 = all)") + "\n" + " -checklevel=<n> " + _("How thorough the block verification is (0-4, default: 3)") + "\n" + " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n" + " -loadblock=<file> " + _("Imports blocks from external blk000??.dat file") + "\n" + " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + "\n" + " -par=<n> " + _("Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)") + "\n" + "\n" + _("Block creation options:") + "\n" + " -blockminsize=<n> " + _("Set minimum block size in bytes (default: 0)") + "\n" + " -blockmaxsize=<n> " + _("Set maximum block size in bytes (default: 250000)") + "\n" + " -blockprioritysize=<n> " + _("Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)") + "\n" + "\n" + _("SSL options: (see the child Wiki for SSL setup instructions)") + "\n" + " -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n" + " -rpcsslcertificatechainfile=<file.cert> " + _("Server certificate file (default: server.cert)") + "\n" + " -rpcsslprivatekeyfile=<file.pem> " + _("Server private key (default: server.pem)") + "\n" + " -rpcsslciphers=<ciphers> " + _("Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)") + "\n"; return strUsage; } struct CImportingNow { CImportingNow() { assert(fImporting == false); fImporting = true; } ~CImportingNow() { assert(fImporting == true); fImporting = false; } }; void ThreadImport(std::vector<boost::filesystem::path> vImportFiles) { RenameThread("bitcoin-loadblk"); // -reindex if (fReindex) { CImportingNow imp; int nFile = 0; while (true) { CDiskBlockPos pos(nFile, 0); FILE *file = OpenBlockFile(pos, true); if (!file) break; printf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile); LoadExternalBlockFile(file, &pos); nFile++; } pblocktree->WriteReindexing(false); fReindex = false; printf("Reindexing finished\n"); // To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked): InitBlockIndex(); } // hardcoded $DATADIR/bootstrap.dat filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat"; if (filesystem::exists(pathBootstrap)) { FILE *file = fopen(pathBootstrap.string().c_str(), "rb"); if (file) { CImportingNow imp; filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old"; printf("Importing bootstrap.dat...\n"); LoadExternalBlockFile(file); RenameOver(pathBootstrap, pathBootstrapOld); } } // -loadblock= BOOST_FOREACH(boost::filesystem::path &path, vImportFiles) { FILE *file = fopen(path.string().c_str(), "rb"); if (file) { CImportingNow imp; printf("Importing %s...\n", path.string().c_str()); LoadExternalBlockFile(file); } } } /** Initialize bitcoin. * @pre Parameters should be parsed and config file should be read. */ bool AppInit2(boost::thread_group& threadGroup) { // ********************************************************* Step 1: setup #ifdef _MSC_VER // Turn off Microsoft heap dump noise _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); _CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0)); #endif #if _MSC_VER >= 1400 // Disable confusing "helpful" text message on abort, Ctrl-C _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); #endif #ifdef WIN32 // Enable Data Execution Prevention (DEP) // Minimum supported OS versions: WinXP SP3, WinVista >= SP1, Win Server 2008 // A failure is non-critical and needs no further attention! #ifndef PROCESS_DEP_ENABLE // We define this here, because GCCs winbase.h limits this to _WIN32_WINNT >= 0x0601 (Windows 7), // which is not correct. Can be removed, when GCCs winbase.h is fixed! #define PROCESS_DEP_ENABLE 0x00000001 #endif typedef BOOL (WINAPI *PSETPROCDEPPOL)(DWORD); PSETPROCDEPPOL setProcDEPPol = (PSETPROCDEPPOL)GetProcAddress(GetModuleHandleA("Kernel32.dll"), "SetProcessDEPPolicy"); if (setProcDEPPol != NULL) setProcDEPPol(PROCESS_DEP_ENABLE); // Initialize Windows Sockets WSADATA wsadata; int ret = WSAStartup(MAKEWORD(2,2), &wsadata); if (ret != NO_ERROR || LOBYTE(wsadata.wVersion ) != 2 || HIBYTE(wsadata.wVersion) != 2) { return InitError(strprintf("Error: Winsock library failed to start (WSAStartup returned error %d)", ret)); } #endif #ifndef WIN32 umask(077); // Clean shutdown on SIGTERM struct sigaction sa; sa.sa_handler = HandleSIGTERM; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sigaction(SIGTERM, &sa, NULL); sigaction(SIGINT, &sa, NULL); // Reopen debug.log on SIGHUP struct sigaction sa_hup; sa_hup.sa_handler = HandleSIGHUP; sigemptyset(&sa_hup.sa_mask); sa_hup.sa_flags = 0; sigaction(SIGHUP, &sa_hup, NULL); #endif // ********************************************************* Step 2: parameter interactions fTestNet = GetBoolArg("-testnet"); fBloomFilters = GetBoolArg("-bloomfilters", true); if (fBloomFilters) nLocalServices |= NODE_BLOOM; if (mapArgs.count("-bind")) { // when specifying an explicit binding address, you want to listen on it // even when -connect or -proxy is specified SoftSetBoolArg("-listen", true); } if (mapArgs.count("-connect") && mapMultiArgs["-connect"].size() > 0) { // when only connecting to trusted nodes, do not seed via DNS, or listen by default SoftSetBoolArg("-dnsseed", false); SoftSetBoolArg("-listen", false); } if (mapArgs.count("-proxy")) { // to protect privacy, do not listen by default if a proxy server is specified SoftSetBoolArg("-listen", false); } if (!GetBoolArg("-listen", true)) { // do not map ports or try to retrieve public IP when not listening (pointless) SoftSetBoolArg("-upnp", false); SoftSetBoolArg("-discover", false); } if (mapArgs.count("-externalip")) { // if an explicit public IP is specified, do not try to find others SoftSetBoolArg("-discover", false); } if (GetBoolArg("-salvagewallet")) { // Rewrite just private keys: rescan to find transactions SoftSetBoolArg("-rescan", true); } // Make sure enough file descriptors are available int nBind = std::max((int)mapArgs.count("-bind"), 1); nMaxConnections = GetArg("-maxconnections", 125); nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0); int nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS); if (nFD < MIN_CORE_FILEDESCRIPTORS) return InitError(_("Not enough file descriptors available.")); if (nFD - MIN_CORE_FILEDESCRIPTORS < nMaxConnections) nMaxConnections = nFD - MIN_CORE_FILEDESCRIPTORS; // ********************************************************* Step 3: parameter-to-internal-flags fDebug = GetBoolArg("-debug"); fBenchmark = GetBoolArg("-benchmark"); // -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency nScriptCheckThreads = GetArg("-par", 0); if (nScriptCheckThreads <= 0) nScriptCheckThreads += boost::thread::hardware_concurrency(); if (nScriptCheckThreads <= 1) nScriptCheckThreads = 0; else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS) nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS; // -debug implies fDebug* if (fDebug) fDebugNet = true; else fDebugNet = GetBoolArg("-debugnet"); if (fDaemon) fServer = true; else fServer = GetBoolArg("-server"); /* force fServer when running without GUI */ #if !defined(QT_GUI) fServer = true; #endif fPrintToConsole = GetBoolArg("-printtoconsole"); fPrintToDebugger = GetBoolArg("-printtodebugger"); fLogTimestamps = GetBoolArg("-logtimestamps", true); bool fDisableWallet = GetBoolArg("-disablewallet", false); if (mapArgs.count("-timeout")) { int nNewTimeout = GetArg("-timeout", 5000); if (nNewTimeout > 0 && nNewTimeout < 600000) nConnectTimeout = nNewTimeout; } // Continue to put "/P2SH/" in the coinbase to monitor // BIP16 support. // This can be removed eventually... const char* pszP2SH = "/P2SH/"; COINBASE_FLAGS << std::vector<unsigned char>(pszP2SH, pszP2SH+strlen(pszP2SH)); // Fee-per-kilobyte amount considered the same as "free" // If you are mining, be careful setting this: // if you set it to zero then // a transaction spammer can cheaply fill blocks using // 1-satoshi-fee transactions. It should be set above the real // cost to you of processing a transaction. if (mapArgs.count("-mintxfee")) { int64 n = 0; if (ParseMoney(mapArgs["-mintxfee"], n) && n > 0) CTransaction::nMinTxFee = n; else return InitError(strprintf(_("Invalid amount for -mintxfee=<amount>: '%s'"), mapArgs["-mintxfee"].c_str())); } if (mapArgs.count("-minrelaytxfee")) { int64 n = 0; if (ParseMoney(mapArgs["-minrelaytxfee"], n) && n > 0) CTransaction::nMinRelayTxFee = n; else return InitError(strprintf(_("Invalid amount for -minrelaytxfee=<amount>: '%s'"), mapArgs["-minrelaytxfee"].c_str())); } if (mapArgs.count("-paytxfee")) { if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee)) return InitError(strprintf(_("Invalid amount for -paytxfee=<amount>: '%s'"), mapArgs["-paytxfee"].c_str())); if (nTransactionFee > 0.25 * COIN) InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.")); } if (mapArgs.count("-mininput")) { if (!ParseMoney(mapArgs["-mininput"], nMinimumInputValue)) return InitError(strprintf(_("Invalid amount for -mininput=<amount>: '%s'"), mapArgs["-mininput"].c_str())); } // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log std::string strDataDir = GetDataDir().string(); // Make sure only a single Bitcoin process is using the data directory. boost::filesystem::path pathLockFile = GetDataDir() / ".lock"; FILE* file = fopen(pathLockFile.string().c_str(), "a"); // empty lock file; created if it doesn't exist. if (file) fclose(file); static boost::interprocess::file_lock lock(pathLockFile.string().c_str()); if (!lock.try_lock()) return InitError(strprintf(_("Cannot obtain a lock on data directory %s. child is probably already running."), strDataDir.c_str())); if (GetBoolArg("-shrinkdebugfile", !fDebug)) ShrinkDebugFile(); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); printf("child version %s (%s)\n", FormatFullVersion().c_str(), CLIENT_DATE.c_str()); printf("Using OpenSSL version %s\n", SSLeay_version(SSLEAY_VERSION)); if (!fLogTimestamps) printf("Startup time: %s\n", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime()).c_str()); printf("Default data directory %s\n", GetDefaultDataDir().string().c_str()); printf("Using data directory %s\n", strDataDir.c_str()); printf("Using at most %i connections (%i file descriptors available)\n", nMaxConnections, nFD); std::ostringstream strErrors; if (fDaemon) fprintf(stdout, "child server starting\n"); if (nScriptCheckThreads) { printf("Using %u threads for script verification\n", nScriptCheckThreads); for (int i=0; i<nScriptCheckThreads-1; i++) threadGroup.create_thread(&ThreadScriptCheck); } int64 nStart; #if defined(USE_SSE2) scrypt_detect_sse2(); #endif // ********************************************************* Step 5: verify wallet database integrity if (!fDisableWallet) { uiInterface.InitMessage(_("Verifying wallet...")); if (!bitdb.Open(GetDataDir())) { // try moving the database env out of the way boost::filesystem::path pathDatabase = GetDataDir() / "database"; boost::filesystem::path pathDatabaseBak = GetDataDir() / strprintf("database.%"PRI64d".bak", GetTime()); try { boost::filesystem::rename(pathDatabase, pathDatabaseBak); printf("Moved old %s to %s. Retrying.\n", pathDatabase.string().c_str(), pathDatabaseBak.string().c_str()); } catch(boost::filesystem::filesystem_error &error) { // failure is ok (well, not really, but it's not worse than what we started with) } // try again if (!bitdb.Open(GetDataDir())) { // if it still fails, it probably means we can't even create the database env string msg = strprintf(_("Error initializing wallet database environment %s!"), strDataDir.c_str()); return InitError(msg); } } if (GetBoolArg("-salvagewallet")) { // Recover readable keypairs: if (!CWalletDB::Recover(bitdb, "wallet.dat", true)) return false; } if (filesystem::exists(GetDataDir() / "wallet.dat")) { CDBEnv::VerifyResult r = bitdb.Verify("wallet.dat", CWalletDB::Recover); if (r == CDBEnv::RECOVER_OK) { string msg = strprintf(_("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."), strDataDir.c_str()); InitWarning(msg); } if (r == CDBEnv::RECOVER_FAIL) return InitError(_("wallet.dat corrupt, salvage failed")); } } // (!fDisableWallet) // ********************************************************* Step 6: network initialization int nSocksVersion = GetArg("-socks", 5); if (nSocksVersion != 4 && nSocksVersion != 5) return InitError(strprintf(_("Unknown -socks proxy version requested: %i"), nSocksVersion)); if (mapArgs.count("-onlynet")) { std::set<enum Network> nets; BOOST_FOREACH(std::string snet, mapMultiArgs["-onlynet"]) { enum Network net = ParseNetwork(snet); if (net == NET_UNROUTABLE) return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'"), snet.c_str())); nets.insert(net); } for (int n = 0; n < NET_MAX; n++) { enum Network net = (enum Network)n; if (!nets.count(net)) SetLimited(net); } } #if defined(USE_IPV6) #if ! USE_IPV6 else SetLimited(NET_IPV6); #endif #endif CService addrProxy; bool fProxy = false; if (mapArgs.count("-proxy")) { addrProxy = CService(mapArgs["-proxy"], 9050); if (!addrProxy.IsValid()) return InitError(strprintf(_("Invalid -proxy address: '%s'"), mapArgs["-proxy"].c_str())); if (!IsLimited(NET_IPV4)) SetProxy(NET_IPV4, addrProxy, nSocksVersion); if (nSocksVersion > 4) { #ifdef USE_IPV6 if (!IsLimited(NET_IPV6)) SetProxy(NET_IPV6, addrProxy, nSocksVersion); #endif SetNameProxy(addrProxy, nSocksVersion); } fProxy = true; } // -tor can override normal proxy, -notor disables tor entirely if (!(mapArgs.count("-tor") && mapArgs["-tor"] == "0") && (fProxy || mapArgs.count("-tor"))) { CService addrOnion; if (!mapArgs.count("-tor")) addrOnion = addrProxy; else addrOnion = CService(mapArgs["-tor"], 9050); if (!addrOnion.IsValid()) return InitError(strprintf(_("Invalid -tor address: '%s'"), mapArgs["-tor"].c_str())); SetProxy(NET_TOR, addrOnion, 5); SetReachable(NET_TOR); } // see Step 2: parameter interactions for more information about these fNoListen = !GetBoolArg("-listen", true); fDiscover = GetBoolArg("-discover", true); fNameLookup = GetBoolArg("-dns", true); bool fBound = false; if (!fNoListen) { if (mapArgs.count("-bind")) { BOOST_FOREACH(std::string strBind, mapMultiArgs["-bind"]) { CService addrBind; if (!Lookup(strBind.c_str(), addrBind, GetListenPort(), false)) return InitError(strprintf(_("Cannot resolve -bind address: '%s'"), strBind.c_str())); fBound |= Bind(addrBind, (BF_EXPLICIT | BF_REPORT_ERROR)); } } else { struct in_addr inaddr_any; inaddr_any.s_addr = INADDR_ANY; #ifdef USE_IPV6 fBound |= Bind(CService(in6addr_any, GetListenPort()), BF_NONE); #endif fBound |= Bind(CService(inaddr_any, GetListenPort()), !fBound ? BF_REPORT_ERROR : BF_NONE); } if (!fBound) return InitError(_("Failed to listen on any port. Use -listen=0 if you want this.")); } if (mapArgs.count("-externalip")) { BOOST_FOREACH(string strAddr, mapMultiArgs["-externalip"]) { CService addrLocal(strAddr, GetListenPort(), fNameLookup); if (!addrLocal.IsValid()) return InitError(strprintf(_("Cannot resolve -externalip address: '%s'"), strAddr.c_str())); AddLocal(CService(strAddr, GetListenPort(), fNameLookup), LOCAL_MANUAL); } } BOOST_FOREACH(string strDest, mapMultiArgs["-seednode"]) AddOneShot(strDest); // ********************************************************* Step 7: load block chain fReindex = GetBoolArg("-reindex"); // Upgrading to 0.8; hard-link the old blknnnn.dat files into /blocks/ filesystem::path blocksDir = GetDataDir() / "blocks"; if (!filesystem::exists(blocksDir)) { filesystem::create_directories(blocksDir); bool linked = false; for (unsigned int i = 1; i < 10000; i++) { filesystem::path source = GetDataDir() / strprintf("blk%04u.dat", i); if (!filesystem::exists(source)) break; filesystem::path dest = blocksDir / strprintf("blk%05u.dat", i-1); try { filesystem::create_hard_link(source, dest); printf("Hardlinked %s -> %s\n", source.string().c_str(), dest.string().c_str()); linked = true; } catch (filesystem::filesystem_error & e) { // Note: hardlink creation failing is not a disaster, it just means // blocks will get re-downloaded from peers. printf("Error hardlinking blk%04u.dat : %s\n", i, e.what()); break; } } if (linked) { fReindex = true; } } // cache size calculations size_t nTotalCache = GetArg("-dbcache", 25) << 20; if (nTotalCache < (1 << 22)) nTotalCache = (1 << 22); // total cache cannot be less than 4 MiB size_t nBlockTreeDBCache = nTotalCache / 8; if (nBlockTreeDBCache > (1 << 21) && !GetBoolArg("-txindex", false)) nBlockTreeDBCache = (1 << 21); // block tree db cache shouldn't be larger than 2 MiB nTotalCache -= nBlockTreeDBCache; size_t nCoinDBCache = nTotalCache / 2; // use half of the remaining cache for coindb cache nTotalCache -= nCoinDBCache; nCoinCacheSize = nTotalCache / 300; // coins in memory require around 300 bytes bool fLoaded = false; while (!fLoaded) { bool fReset = fReindex; std::string strLoadError; uiInterface.InitMessage(_("Loading block index...")); nStart = GetTimeMillis(); do { try { UnloadBlockIndex(); delete pcoinsTip; delete pcoinsdbview; delete pblocktree; pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReindex); pcoinsdbview = new CCoinsViewDB(nCoinDBCache, false, fReindex); pcoinsTip = new CCoinsViewCache(*pcoinsdbview); if (fReindex) pblocktree->WriteReindexing(true); if (!LoadBlockIndex()) { strLoadError = _("Error loading block database"); break; } // If the loaded chain has a wrong genesis, bail out immediately // (we're likely using a testnet datadir, or the other way around). if (!mapBlockIndex.empty() && pindexGenesisBlock == NULL) return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?")); // Initialize the block index (no-op if non-empty database was already loaded) if (!InitBlockIndex()) { strLoadError = _("Error initializing block database"); break; } // Check for changed -txindex state if (fTxIndex != GetBoolArg("-txindex", false)) { strLoadError = _("You need to rebuild the database using -reindex to change -txindex"); break; } uiInterface.InitMessage(_("Verifying blocks...")); if (!VerifyDB(GetArg("-checklevel", 3), GetArg( "-checkblocks", 288))) { strLoadError = _("Corrupted block database detected"); break; } } catch(std::exception &e) { strLoadError = _("Error opening block database"); break; } fLoaded = true; } while(false); if (!fLoaded) { // first suggest a reindex if (!fReset) { bool fRet = uiInterface.ThreadSafeMessageBox( strLoadError + ".\n\n" + _("Do you want to rebuild the block database now?"), "", CClientUIInterface::MSG_ERROR | CClientUIInterface::BTN_ABORT); if (fRet) { fReindex = true; fRequestShutdown = false; } else { return false; } } else { return InitError(strLoadError); } } } // as LoadBlockIndex can take several minutes, it's possible the user // requested to kill bitcoin-qt during the last operation. If so, exit. // As the program has not fully started yet, Shutdown() is possibly overkill. if (fRequestShutdown) { printf("Shutdown requested. Exiting.\n"); return false; } printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart); if (GetBoolArg("-printblockindex") || GetBoolArg("-printblocktree")) { PrintBlockTree(); return false; } if (mapArgs.count("-printblock")) { string strMatch = mapArgs["-printblock"]; int nFound = 0; for (map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi) { uint256 hash = (*mi).first; if (strncmp(hash.ToString().c_str(), strMatch.c_str(), strMatch.size()) == 0) { CBlockIndex* pindex = (*mi).second; CBlock block; block.ReadFromDisk(pindex); block.BuildMerkleTree(); block.print(); printf("\n"); nFound++; } } if (nFound == 0) printf("No blocks matching %s were found\n", strMatch.c_str()); return false; } // ********************************************************* Step 8: load wallet if (fDisableWallet) { printf("Wallet disabled!\n"); pwalletMain = NULL; } else { uiInterface.InitMessage(_("Loading wallet...")); nStart = GetTimeMillis(); bool fFirstRun = true; pwalletMain = new CWallet("wallet.dat"); DBErrors nLoadWalletRet = pwalletMain->LoadWallet(fFirstRun); if (nLoadWalletRet != DB_LOAD_OK) { if (nLoadWalletRet == DB_CORRUPT) strErrors << _("Error loading wallet.dat: Wallet corrupted") << "\n"; else if (nLoadWalletRet == DB_NONCRITICAL_ERROR) { string msg(_("Warning: error reading wallet.dat! All keys read correctly, but transaction data" " or address book entries might be missing or incorrect.")); InitWarning(msg); } else if (nLoadWalletRet == DB_TOO_NEW) strErrors << _("Error loading wallet.dat: Wallet requires newer version of child") << "\n"; else if (nLoadWalletRet == DB_NEED_REWRITE) { strErrors << _("Wallet needed to be rewritten: restart child to complete") << "\n"; printf("%s", strErrors.str().c_str()); return InitError(strErrors.str()); } else strErrors << _("Error loading wallet.dat") << "\n"; } if (GetBoolArg("-upgradewallet", fFirstRun)) { int nMaxVersion = GetArg("-upgradewallet", 0); if (nMaxVersion == 0) // the -upgradewallet without argument case { printf("Performing wallet upgrade to %i\n", FEATURE_LATEST); nMaxVersion = CLIENT_VERSION; pwalletMain->SetMinVersion(FEATURE_LATEST); // permanently upgrade the wallet immediately } else printf("Allowing wallet upgrade up to %i\n", nMaxVersion); if (nMaxVersion < pwalletMain->GetVersion()) strErrors << _("Cannot downgrade wallet") << "\n"; pwalletMain->SetMaxVersion(nMaxVersion); } if (fFirstRun) { // Create new keyUser and set as default key RandAddSeedPerfmon(); CPubKey newDefaultKey; if (pwalletMain->GetKeyFromPool(newDefaultKey, false)) { pwalletMain->SetDefaultKey(newDefaultKey); if (!pwalletMain->SetAddressBookName(pwalletMain->vchDefaultKey.GetID(), "")) strErrors << _("Cannot write default address") << "\n"; } pwalletMain->SetBestChain(CBlockLocator(pindexBest)); } printf("%s", strErrors.str().c_str()); printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart); RegisterWallet(pwalletMain); CBlockIndex *pindexRescan = pindexBest; if (GetBoolArg("-rescan")) pindexRescan = pindexGenesisBlock; else { CWalletDB walletdb("wallet.dat"); CBlockLocator locator; if (walletdb.ReadBestBlock(locator)) pindexRescan = locator.GetBlockIndex(); else pindexRescan = pindexGenesisBlock; } if (pindexBest && pindexBest != pindexRescan) { uiInterface.InitMessage(_("Rescanning...")); printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight); nStart = GetTimeMillis(); pwalletMain->ScanForWalletTransactions(pindexRescan, true); printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart); pwalletMain->SetBestChain(CBlockLocator(pindexBest)); nWalletDBUpdated++; } } // (!fDisableWallet) // ********************************************************* Step 9: import blocks // scan for better chains in the block chain database, that are not yet connected in the active best chain CValidationState state; if (!ConnectBestBlock(state)) strErrors << "Failed to connect best block"; std::vector<boost::filesystem::path> vImportFiles; if (mapArgs.count("-loadblock")) { BOOST_FOREACH(string strFile, mapMultiArgs["-loadblock"]) vImportFiles.push_back(strFile); } threadGroup.create_thread(boost::bind(&ThreadImport, vImportFiles)); // ********************************************************* Step 10: load peers uiInterface.InitMessage(_("Loading addresses...")); nStart = GetTimeMillis(); { CAddrDB adb; if (!adb.Read(addrman)) printf("Invalid or missing peers.dat; recreating\n"); } printf("Loaded %i addresses from peers.dat %"PRI64d"ms\n", addrman.size(), GetTimeMillis() - nStart); // ********************************************************* Step 11: start node if (!CheckDiskSpace()) return false; if (!strErrors.str().empty()) return InitError(strErrors.str()); RandAddSeedPerfmon(); //// debug print printf("mapBlockIndex.size() = %"PRIszu"\n", mapBlockIndex.size()); printf("nBestHeight = %d\n", nBestHeight); printf("setKeyPool.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0); printf("mapWallet.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapWallet.size() : 0); printf("mapAddressBook.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0); StartNode(threadGroup); // InitRPCMining is needed here so getwork/getblocktemplate in the GUI debug console works properly. InitRPCMining(); if (fServer) StartRPCThreads(); // Generate coins in the background if (pwalletMain) GenerateBitcoins(GetBoolArg("-gen", false), pwalletMain); // ********************************************************* Step 12: finished uiInterface.InitMessage(_("Done loading")); if (pwalletMain) { // Add wallet transactions that aren't already in a block to mapTransactions pwalletMain->ReacceptWalletTransactions(); // Run a thread to flush wallet periodically threadGroup.create_thread(boost::bind(&ThreadFlushWalletDB, boost::ref(pwalletMain->strWalletFile))); } return !fRequestShutdown; }
mit
Metazion/MetazionClient
Classes/Net/PacketHandlerGC.hpp
489
#ifndef _CLIENT_PACKETHANDLERGC_HPP_ #define _CLIENT_PACKETHANDLERGC_HPP_ #include "Net/Sockets.hpp" class PacketHandlerGC { public: PacketHandlerGC() {} ~PacketHandlerGC() {} public: void Handle(int command, const void* data, int length); private: void HandleConnected(const void* data, int length); void HandleDisconnected(const void* data, int length); void HandleConnectFailed(const void* data, int length); }; #endif // _CLIENT_PACKETHANDLERGC_HPP_
mit
matchboxmobile/bluetooth-win10-client-plugin
example/HRMonitor/HRMonitor/HeartRateMonitor/HeartRate/BleDeviceInformationService.cs
3934
/****************************************************************************** The MIT License (MIT) Copyright (c) 2016 Matchbox Mobile Limited <info@matchboxmobile.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. *******************************************************************************/ // This file was generated by Bluetooth (R) Developer Studio on 2016.03.17 21:39 // with plugin Windows 10 UWP Client (version 1.0.0 released on 2016.03.16). // Plugin developed by Matchbox Mobile Limited. namespace com.matchboxmobile.ble.wrappers { public class BleDeviceInformationService : BleService { /// <summary> /// Manufacturer Name String characteristic. /// </summary> public BleCharacteristic ManufacturerNameString { get; set; } = new BleCharacteristic("Manufacturer Name String", "2A29", false); /// <summary> /// Model Number String characteristic. /// </summary> public BleCharacteristic ModelNumberString { get; set; } = new BleCharacteristic("Model Number String", "2A24", false); /// <summary> /// Serial Number String characteristic. /// </summary> public BleCharacteristic SerialNumberString { get; set; } = new BleCharacteristic("Serial Number String", "2A25", false); /// <summary> /// Hardware Revision String characteristic. /// </summary> public BleCharacteristic HardwareRevisionString { get; set; } = new BleCharacteristic("Hardware Revision String", "2A27", false); /// <summary> /// Firmware Revision String characteristic. /// </summary> public BleCharacteristic FirmwareRevisionString { get; set; } = new BleCharacteristic("Firmware Revision String", "2A26", false); /// <summary> /// Software Revision String characteristic. /// </summary> public BleCharacteristic SoftwareRevisionString { get; set; } = new BleCharacteristic("Software Revision String", "2A28", false); /// <summary> /// System ID characteristic. /// </summary> public BleCharacteristic SystemID { get; set; } = new BleCharacteristic("System ID", "2A23", false); /// <summary> /// IEEE 11073-20601 Regulatory Certification Data List characteristic. /// </summary> public BleCharacteristic IEEE1107320601RegulatoryCertificationDataList { get; set; } = new BleCharacteristic("IEEE 11073-20601 Regulatory Certification Data List", "2A2A", false); /// <summary> /// PnP ID characteristic. /// </summary> public BleCharacteristic PnPID { get; set; } = new BleCharacteristic("PnP ID", "2A50", false); private const bool IsServiceMandatory = true; public BleDeviceInformationService() : base("180A", IsServiceMandatory) { } } }
mit
St4inl3ss/ticketbeast
app/Concert.php
1705
<?php namespace App; use Carbon\Carbon; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; /** * Class Concert * * @method static Builder published() * @property-read Carbon date * @property-read int ticket_price * * @package App */ class Concert extends Model { protected $guarded = []; protected $dates = [ 'date', 'published_at', ]; /** * @param Builder $query * @return Builder */ public function scopePublished(Builder $query) { return $query->whereNotNull('published_at'); } /** * @return HasMany */ public function orders(): HasMany { return $this->hasMany(Order::class); } /** * @return string */ public function getFormattedDateAttribute(): string { return $this->date->format('F j, Y'); } /** * @return string */ public function getFormattedStartTimeAttribute(): string { return $this->date->format('g:ia'); } /** * @return string */ public function getTicketPriceInDollarsAttribute(): string { return number_format($this->ticket_price / 100, 2); } /** * @param string $email * @param int $ticketQuantity * @return Order */ public function orderTickets(string $email, int $ticketQuantity): Order { /** * @var Order $order */ $order = $this->orders()->create(['email' => $email]); for ($i = 1; $i <= $ticketQuantity; $i++) { $order->tickets()->create([]); } return $order; } }
mit
xiaost/jsonport
errors.go
434
package jsonport import "errors" var ( errArrayIndex = errors.New("not array index") errMemberName = errors.New("not member name") errLen = errors.New("not supported Len()") errKeyType = errors.New("key type err") errJSONEOF = errors.New("JSON: unexpect EOF") errArrayEOF = errors.New("ARRAY: unexpect EOF") errObjectEOF = errors.New("OBJECT: unexpect EOF") errStringEOF = errors.New("STRING: unexpect EOF") )
mit
jan-molak/jenkins-build-monitor-plugin
build-monitor-acceptance/src/main/java/net/serenitybdd/screenplay/jenkins/targets/Setting.java
844
package net.serenitybdd.screenplay.jenkins.targets; import net.serenitybdd.screenplay.targets.Target; import static java.lang.String.format; public class Setting { public static Target defining(String name) { return Target.the(format("the '%s' field", name)) .locatedBy(lastElementMatching(either(xpathFor("input"), xpathFor("textarea"), xpathFor("select")))) .of(name); } private static String xpathFor(String fieldType) { return format("//div[contains(@class, 'tr') and div[contains(@class, 'setting-name') and contains(., '{0}')]]//%s", fieldType); } private static String either(String... xpaths) { return String.join(" | ", xpaths); } private static String lastElementMatching(String xpath) { return format("(%s)[last()]", xpath); } }
mit
scidash/sciunit
sciunit/unit_test/active.py
588
""" All active unit tests for SciUnit. This module is the default target of for testing in `__main__.py`. Modify this file if you want to add or remove tests located in other modules. """ from .backend_tests import * from .base_tests import * from .command_line_tests import * from .config_tests import * from .converter_tests import * from .doc_tests import * from .error_tests import * from .import_tests import * from .model_tests import * from .observation_tests import * from .score_tests import * from .test_tests import * from .utils_tests import * from .validator_tests import *
mit
telmanagababov/js-patterns-examples
command/src/action/SortAction.js
254
function SortAction(ticketsPanel, sortType) { this.ticketsPanel = ticketsPanel; this.sortType = sortType; } SortAction.prototype = Object.create(IAction.prototype); SortAction.prototype.execute = function() { this.ticketsPanel.sort(this.sortType); };
mit
tienvx/mbt-bundle
src/Resources/translations/validators.en.php
974
<?php return [ 'mbt' => [ 'model' => [ 'places_invalid' => 'Places are invalid.', 'missing_start_transition' => 'Missing start transition.', 'too_many_start_transitions' => 'There must be only one start transition.', 'missing_to_places' => 'You must select at least 1 places to transition to.', 'command' => [ 'invalid_command' => 'The command is not valid.', 'required_target' => 'The target is required.', 'invalid_target' => 'The target is not valid.', 'required_value' => 'The value is required.', ], ], 'bug' => [ 'missing_places_in_step' => 'There must be at least one place in each step.', ], 'task' => [ 'invalid_task_config' => 'The task config is not valid.', 'invalid_selenium_config' => 'The selenium config is not valid.', ], ], ];
mit
JaySon-Huang/misc
leetoj/226.py
568
# Invert Binary Tree # https://leetcode.com/problems/invert-binary-tree/ # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def invertTree(self, root): """ :type root: TreeNode :rtype: TreeNode """ if root is None: return None right = root.right root.right = self.invertTree(root.left) root.left = self.invertTree(right) return root
mit
goliatone/gcollection
examples/main.js
8253
/*global define:true requirejs:true*/ /* jshint strict: false */ requirejs.config({ paths: { 'jquery': 'jquery/jquery', 'gpub': 'gpub/gpub', 'extend': 'gextend/extend', 'gcollection': 'gcollection' } }); define(['gcollection', 'gpub', 'jquery'], function(GCollection, GPub, $) { console.log('Loading'); GPub.observable(GCollection); var Users = new GCollection({ indexKey: '_id', comparator: function(a, b) { return a.id === b.id; } }); Users.add(users); // Users.add(goliat); // Users.add(pepe); // Users.add(one); // Users.add(one); // console.log(Users.get(2)); console.log('get 2', Users.get('2')); console.log('count', Users.count()); console.table(Users.values()); // console.log('key pepe', Users.getKey(rone)); // console.log('remove pepe', Users.remove(rone)); // console.log('count', Users.count()); // console.table(Users.values()); // Users.add(rone); /*console.table(Users.sort(function(a, b) { return a.age < b.age; }));*/ // Users.add(pipo); // console.table(Users.values()); /* console.table(Users.filter(function(i) { return i.age > 30; })); console.log(Users.every(function(i) { return i.age > 10; })); console.log(Users.some(function(i) { return i.age === 20; }));*/ window.Users = Users; window.gc = GCollection; }); var users = [{ "_id": "8ju8wwbcsw2sh3yfqmm7b5oh1k4oeciq", "_index": "1", "name": "Declan Labadie", "handle": "jamil", "address": "2276 Ward Cliff Apt. 063", "phone": "(406)335-5958 x280", "company": "Will, Franecki and Altenwerth", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/psdesignuk/128.jpg", "bio": "excepturi porro rerum tempore est reiciendis cum[object Object]doloremque sapiente culpa voluptatibus[object Object]est ea vitae quidem laudantium totam ducimus" }, { "_id": "u6yn5uqhqg0q1twk4ov0kk5ntmioaxp6", "_index": "2", "name": "Mrs. Jerrold Prosacco", "handle": "carley", "address": "512 Nitzsche Islands Suite 777", "phone": "1-058-106-3864 x0684", "company": "Schmeler Group", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/hgharrygo/128.jpg", "bio": "velit recusandae aut ut non sed delectus[object Object]sed accusantium nemo rerum quasi corrupti[object Object]quod doloribus et sit est dolores exercitationem quo similique" }, { "_id": "qnnll6ehipx2olxbl5epfrou6jlfk1bd", "_index": "3", "name": "Ford Kassulke", "handle": "aimee", "address": "4402 Ruecker View Apt. 955", "city": "Grimestown", "phone": "1-277-607-4756 x5877", "company": "Bergstrom, Mosciski and Schneider", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/carlosblanco_eu/128.jpg", "bio": "voluptas sunt harum et voluptate sit[object Object]nam nostrum iure quod maxime[object Object]voluptas harum molestias eligendi ab quae beatae necessitatibus rerum" }, { "_id": "d64qwngraqymwrxcaeyxrpm9f8ppvr19", "_index": "4", "name": "Maegan McKenzie Sr.", "handle": "eldon", "address": "6759 Hassan Plaza Suite 324", "phone": "(276)562-7533 x0032", "company": "McLaughlin and Daughters", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/hellofeverrrr/128.jpg", "bio": "fugit quod porro quibusdam qui et[object Object]et qui rerum blanditiis dolorum reprehenderit esse nulla[object Object]eligendi hic nesciunt mollitia molestiae" }, { "_id": "xgx9bumav2mb7auk7i7d6nhparxa12me", "_index": "5", "name": "Diana Kunze", "handle": "durward_leuschke", "address": "845 Spencer Street Suite 514", "phone": "263-064-4567", "company": "VonRueden, Aufderhar and Spinka", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/yecidsm/128.jpg", "bio": "delectus officiis sit sit voluptas quisquam sit[object Object]autem alias libero accusamus possimus sunt quo expedita[object Object]in ipsum quaerat corporis expedita minus" }, { "_id": "68edd32j5u1irws6hv82k04hs3yvieu4", "_index": "6", "name": "Maiya Leffler", "handle": "keven.kunde", "address": "00205 Heidenreich Forest Apt. 864", "phone": "149-942-6723 x927", "company": "Ratke-Boyer", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/j2deme/128.jpg", "bio": "voluptatem culpa iusto reiciendis quis dolorem vitae non reprehenderit[object Object]culpa eum cumque assumenda consequatur laboriosam molestiae fuga[object Object]dolores ab quibusdam" }, { "_id": "rypsr2dqnw2vqy1niguh8hllgpe6h3en", "_index": "7", "name": "Branson Effertz", "handle": "edwin_koelpin", "address": "320 Georgianna Springs Suite 933", "city": "Grimestown", "phone": "672-791-2604 x85419", "company": "Cole and Sons", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/rangafangs/128.jpg", "bio": "illo quod voluptatibus nisi impedit porro aut numquam[object Object]qui et ipsam reprehenderit delectus harum[object Object]in perspiciatis eligendi quasi dolor soluta ex ut est" }, { "_id": "8thqxc2sya3jrcg8r8jg6wuti1ktlj2t", "_index": "8", "name": "Ebba Mills", "handle": "jaydon_adams", "address": "5109 Emmerich Lake Suite 946", "phone": "1-606-647-8360", "company": "Kirlin-Hirthe", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/kudretkeskin/128.jpg", "bio": "maiores vero quas et impedit animi[object Object]distinctio amet id ut adipisci est natus[object Object]et debitis soluta placeat atque nostrum rerum" }, { "_id": "0f30fs2s4cliskajb5uqwlsghs0tya6o", "_index": "9", "name": "Hilton Lehner", "handle": "tristian_bailey", "address": "24738 Vallie Plain Suite 746", "city": "Grimestown", "phone": "(452)043-3925 x8748", "company": "Bashirian, Treutel and Rau", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/edhenderson/128.jpg", "bio": "est dignissimos nulla[object Object]consequuntur repellendus sint[object Object]consequatur quia qui aliquam quae officiis consequatur molestiae laboriosam" }, { "_id": "kcncu2ngkm7a0q1afp0y4bom73m4u7rq", "_index": "10", "name": "Kristopher Thiel", "handle": "mariela_howe", "address": "05794 Mitchell Street Suite 502", "phone": "1-037-766-5857 x67965", "company": "Roob-Lowe", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/mrjamesnoble/128.jpg", "bio": "quidem quaerat aliquid ut ut[object Object]reiciendis incidunt vel veniam qui[object Object]in aperiam quibusdam praesentium" }, { "_id": "xivmn08eudhjsq4hrtje9ls822o2k7rg", "_index": "11", "name": "Lea Weimann", "handle": "freida_bergnaum", "address": "19689 Padberg Throughway Apt. 649", "phone": "1-192-087-8880", "company": "Zulauf-VonRueden", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/karalek/128.jpg", "bio": "itaque quasi molestiae illo ut voluptas[object Object]hic quidem voluptas quas nihil temporibus[object Object]dignissimos culpa et qui" }, { "_id": "it7e5lbqa8jg4eu2bcmalag67mpn8q70", "_index": "12", "name": "Mack Frami", "handle": "tristin.beier", "address": "976 Anthony Run Suite 139", "phone": "1-075-321-8895", "company": "Bashirian, Fisher and Conn", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/smenov/128.jpg", "bio": "quam ullam dolor veritatis recusandae expedita reiciendis[object Object]illo dolorum praesentium ipsam nostrum quo accusantium omnis id[object Object]consequuntur dolores autem ex voluptates doloremque sint impedit" }, { "_id": "9tcua1b40m6adjc9d2rk6k38gemtt4nf", "_index": "13", "name": "Alia Pollich", "handle": "maribel_christiansen", "address": "60373 Quigley Parkways Suite 475", "city": "Grimestown", "phone": "919-298-1169", "company": "Gleichner, Friesen and Hirthe", "img": "https://s3.amazonaws.com/uifaces/faces/twitter/ryhanhassan/128.jpg", "bio": "est deleniti quas necessitatibus rem minima quia omnis dolorum[object Object]soluta quos deleniti expedita ex labore quae[object Object]consequatur voluptatem sed quia accusantium fugit vel" }];
mit
codefoundries/UniversalRelayBoilerplate
deployment/units/rb-example-translaticiarum-webapp/routeAppFrameTranslaticiarum.js
1550
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; var _reactCodeSplitting = _interopRequireDefault(require("react-code-splitting")); var _reactRelay = require("react-relay"); var _react = _interopRequireDefault(require("react")); var _Route = _interopRequireDefault(require("found/lib/Route"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;} else {var newObj = {};if (obj != null) {for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};if (desc.get || desc.set) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}}newObj.default = obj;return newObj;}} const TranslaticiarumScreen = (props) => _react.default.createElement(_reactCodeSplitting.default, { load: Promise.resolve().then(() => _interopRequireWildcard(require('./components/TranslaticiarumScreen'))), componentProps: props });var _default = _react.default.createElement(_Route.default, { key: "translaticiarum", path: "translaticiarum" }, _react.default.createElement(_Route.default, { path: "/", Component: TranslaticiarumScreen, query: function () {return require("./__generated__/routeAppFrameTranslaticiarum_TranslaticiarumScreen_Query.graphql");} }));exports.default = _default; //# sourceMappingURL=routeAppFrameTranslaticiarum.js.map
mit
yogeshsaroya/new-cdnjs
ajax/libs/howler/1.1.23/howler.min.js
130
version https://git-lfs.github.com/spec/v1 oid sha256:60c41affc17a88924434e09a10a6216b11fe4ed338d51bb6d656ed6421ce3936 size 11839
mit
CslaGenFork/CslaGenFork
tags/V4-0-1/Solutions/DBSchemaInfo/MsSql/SqlCatalog.cs
7124
using System; using System.Collections.Generic; using System.Text; using System.Data.SqlClient; using System.Data; using DBSchemaInfo.Base; using System.Collections; namespace DBSchemaInfo.MsSql { public class SqlCatalog : Base.InformationSchemaCatalogBase { public SqlCatalog(string cnString, string catalog) : base(cnString, catalog) { } protected override DBStructure GetTableViewSchema(IDbConnection cn) { DBStructure ds = new DBStructure(); using (SqlCommand cmd = new SqlCommand("SELECT * FROM INFORMATION_SCHEMA.TABLES", (SqlConnection)cn)) { using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { da.Fill(ds.INFORMATION_SCHEMA_TABLES); } } using (SqlCommand cmd = new SqlCommand(DBSchemaInfo.Properties.Resources.SqlServerGetColumn, (SqlConnection)cn)) { using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { da.Fill(ds.INFORMATION_SCHEMA_COLUMNS); } } return ds; } protected override DBSchemaInfo.Base.ITableInfo CreateTableInfo(DBStructure.INFORMATION_SCHEMA_TABLESRow dr) { return new SqlTableInfo(dr, this); } protected override DBSchemaInfo.Base.IViewInfo CreateViewInfo(DBStructure.INFORMATION_SCHEMA_TABLESRow dr) { return new SqlViewInfo(dr, this); } protected override void LoadForeignKeys() { DataTable table = GetConstraintInformation(); Dictionary<string, StandardForeignKeyConstraint> fkeys = new Dictionary<string, StandardForeignKeyConstraint>(); foreach (DataRow dr in table.Rows) { try { StandardForeignKeyConstraint constraint = null; string constraintName = (string)dr["CONSTRAINT_NAME"]; if (!fkeys.ContainsKey(constraintName)) { ITableInfo cnstTable = Tables[(string)dr["TABLE_CATALOG"], (string)dr["TABLE_SCHEMA"], (string)dr["TABLE_NAME"]]; ITableInfo pkTable = Tables[(string)dr["REF_TABLE_CATALOG"], (string)dr["REF_TABLE_SCHEMA"], (string)dr["REF_TABLE_NAME"]]; constraint = new StandardForeignKeyConstraint( constraintName, pkTable, cnstTable); fkeys.Add(constraintName, constraint); } constraint = fkeys[constraintName]; StandardForeignKeyColumnPair cp = new StandardForeignKeyColumnPair( constraint.PKTable.Columns[(string)dr["REF_COLUMN_NAME"]], constraint.ConstraintTable.Columns[(string)dr["COLUMN_NAME"]]); constraint.Columns.Add(cp); } catch (Exception ex) { Console.WriteLine("Failed reading constraint: {0}", ex.Message); } } foreach (string constraintName in fkeys.Keys) { ForeignKeyConstraints.Add(fkeys[constraintName]); } } private DataTable GetConstraintInformation() { DataTable table = new DataTable(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(" select object_name(constid) CONSTRAINT_NAME, "); sb.Append(" db_name() TABLE_CATALOG, user_name(o1.uid) TABLE_SCHEMA, o1.name TABLE_NAME, c1.name COLUMN_NAME,"); sb.Append(" db_name() REF_TABLE_CATALOG, user_name(o2.uid) REF_TABLE_SCHEMA, o2.name REF_TABLE_NAME, c2.name REF_COLUMN_NAME"); sb.Append(" from sysforeignkeys a"); sb.Append(" INNER JOIN syscolumns c1"); sb.Append(" ON a.fkeyid = c1.id"); sb.Append(" AND a.fkey = c1.colid"); sb.Append(" INNER JOIN syscolumns c2"); sb.Append(" ON a.rkeyid = c2.id"); sb.Append(" AND a.rkey = c2.colid"); sb.Append(" INNER JOIN sysobjects o1"); sb.Append(" ON c1.id = o1.id"); sb.Append(" INNER JOIN sysobjects o2"); sb.Append(" ON c2.id = o2.id"); //sb.Append(" WHERE constid in ("); //sb.Append(" SELECT object_id(CONSTRAINT_NAME)"); //sb.Append(" FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS)"); base.OpenConnection(); try { SqlConnection cn = (SqlConnection)Connection; using (SqlCommand cmd = cn.CreateCommand()) { cmd.CommandText = sb.ToString(); cmd.CommandType = CommandType.Text; using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { da.Fill(table); } } } finally { base.CloseConnection(); } return table; } protected override DBStructure GetProcedureSchema(IDbConnection cn) { DBStructure ds = new DBStructure(); SqlConnection scn = (SqlConnection)cn; //.GetSchema("Procedures", new string[] { Catalog }); System.Text.StringBuilder sb = new System.Text.StringBuilder(); if (scn.ServerVersion.StartsWith("08")) { sb.AppendLine(DBSchemaInfo.Properties.Resources.SqlServerGetProcedures2000); } else { sb.AppendLine(DBSchemaInfo.Properties.Resources.SqlServerGetProcedures2005); } sb.AppendLine(); sb.AppendLine(DBSchemaInfo.Properties.Resources.SqlServerGetParameters); using (SqlCommand cmd = scn.CreateCommand()) { cmd.CommandText = sb.ToString(); cmd.CommandType = CommandType.Text; using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { da.TableMappings.Add("Table", "INFORMATION_SCHEMA_ROUTINES"); da.TableMappings.Add("Table1", "INFORMATION_SCHEMA_PARAMETERS"); ds.EnforceConstraints = false; da.Fill(ds); } } return ds; } protected override DBSchemaInfo.Base.IStoredProcedureInfo CreateProcedureInfo(DBStructure.INFORMATION_SCHEMA_ROUTINESRow dr) { return new SqlStoredProcedureInfo(dr, this); } public override IDbConnection CreateConnection() { return new SqlConnection(ConnectionString); } } }
mit
ygzheng9/PITools
app/helpers/level_types_helper.rb
28
module LevelTypesHelper end
mit
mscoccimarro/aero-app
relation_schema_gen/js/insert-tuple.js
6416
var select = document.querySelector('.rel-schema'); var keyFK; var fkMap = {}; xm_gen.ajax.query({file: 'fetch-schema.php'}, showSchema); function showSchema(data) { data = JSON.parse(data); // TODO: remove log console.log(data); data.forEach(function (el) { var option = document.createElement('option'), prop = 'Tables_in_aa2000'; option.value = el[prop]; option.innerHTML = el[prop]; select.append(option); }); xm_gen.ajax.query({file: 'desc-relation.php?relation=' + select.value}, generateForm); } var formObject; select.addEventListener('change', function () { xm_gen.ajax.query({file: 'desc-relation.php?relation=' + this.value}, generateForm); }); function generateForm(data) { data = JSON.parse(data); // TODO: remove log console.log(data); formObject = {}; var container = document.querySelector('.rel-schema-form'), prop; container.innerHTML = ""; data.forEach(function (el) { var prop = el['Field'], type = el['Type'], row = document.createElement('div'), label = document.createElement('label'), input = document.createElement('input'), labelAutoIncremento = document.createElement('label'), autoIncremento = document.createElement('input'), labelRandom = document.createElement('label'), random = document.createElement('input'); row.classList.add('form-row'); label.innerHTML = prop; input.classList.add('form-data'); input.type = "text"; input.setAttribute('data-type', type); input.name = prop; input.id = prop; labelAutoIncremento.innerHTML = "AutoIncremento: "; labelAutoIncremento.setAttribute('style', 'display:none'); labelAutoIncremento.setAttribute('class', "displayNone"); autoIncremento.type = "checkbox"; autoIncremento.name = prop + 'Checkbox'; autoIncremento.id = prop + 'Checkbox'; autoIncremento.hidden = true; autoIncremento.setAttribute('class', "hidden"); labelRandom.innerHTML = 'Random:'; labelRandom.setAttribute('style', 'display:none'); labelRandom.setAttribute('class', "displayNone"); random.type = "checkbox"; random.name = prop + 'Random'; random.id = prop + 'Random'; random.hidden = true; random.setAttribute('class', "hidden"); random.setAttribute('onchange', "cargarMapaForeignKeys(this);"); row.append(label, input, labelAutoIncremento, autoIncremento, labelRandom, random); container.append(row); formObject[prop] = ''; }); // focus first input element document.querySelector('.form-data').focus(); } var load = document.querySelector('.rel-schema-load'); load.addEventListener('click', sendData); function sendData() { var formData = document.querySelectorAll('.form-data'); var cantidadTuplas = document.getElementById("cantidadTuplas").value; if (cantidadTuplas == "") cantidadTuplas = "1"; for (var i = 0; i < formData.length; i++) { formObject[formData[i].name] = {}; formObject[formData[i].name].value = formData[i].value; formObject[formData[i].name].autoIncremento = document.getElementById(formData[i].getAttribute('id')+"Checkbox").checked; formObject[formData[i].name].type = formData[i].getAttribute('data-type'); formObject[formData[i].name].random = false; if (document.getElementById(formData[i].getAttribute('id')+"Random").checked) { formObject[formData[i].name].random = true; //Recupero del mapa de foreign keys, todos las tuplas de dicha foreign key var value = formData[i].value; var keyMap = formData[i].getAttribute("id"); var list = fkMap[keyMap]; //Elijo una tupla de manera random (Si no se desea random, solo cambiar la siguiente funcion) //var valueRandom = getElementRandomOfList(list); //Se modifica el valor de relacion por el valor a realmente guardar que es foreign key. var pk = value.split("-")[1]; var listFK = getListaRelacionByPK(pk, list); //formObject[formData[i].name].value = valueRandom[pk]; formObject[formData[i].name].value = listFK; } } // TODO: remove log console.log(formObject); xm_gen.ajax.query({file: 'insert-tuple.php?data=' + JSON.stringify(formObject) + "&relation=" + select.value + "&cantidadTuplas=" + cantidadTuplas}, function (data) {console.log(data);}) } function cargaMasiva() { // Tomo el valor actual del hidden var isHidden = document.getElementById("cantidadTuplas").hidden; // Muestro / Oculto la cantidad de tuplas a guardar document.getElementById("cantidadTuplas").hidden = !isHidden; // Muestro / Oculto los checkbox var listHidden = document.getElementsByClassName("hidden"); for (var i = 0; i < listHidden.length; i++) { listHidden[i].hidden = !isHidden; } // Muestro / Oculto los labels var listDisplayNone = document.getElementsByClassName("displayNone"); for (var i = 0; i < listDisplayNone.length; i++) { listDisplayNone[i].setAttribute('style', isHidden ? '' : 'display:none'); } } function getResultSelect(data) { if (data != "") { var valueFkMap = JSON.parse(data); fkMap[keyFK] = valueFkMap; keyFK = null; } } function cargarMapaForeignKeys(button) { if (button.checked) { var idButton = button.getAttribute("id"); var idLabel = idButton.split("Random")[0]; var relacion = document.getElementById(idLabel).value.split("-")[0]; keyFK = idLabel; xm_gen.ajax.query({file: 'fetch-relation.php?relation=' + relacion}, getResultSelect); } } function getElementRandomOfList(list) { if (list != null && list.length > 0) { var i = getRandomInt(0, list.length); return list[i]; } return null; } // Retorna un número aleatorio entre min (incluido) y max (excluido) function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min)) + min; } function getListaRelacionByPK(pk, list) { var listReturned = []; for (var i = 0; i < list.length; i++) { var pkElement = list[i][pk]; listReturned.push(pkElement); } return listReturned; }
mit
semplon/GeniXCMS
inc/lib/Control.class.php
7215
<?php defined('GX_LIB') or die('Direct Access Not Allowed!'); /** * GeniXCMS - Content Management System. * * PHP Based Content Management System and Framework * * @since 0.0.1 build date 20141006 * * @version 1.1.11 * * @link https://github.com/semplon/GeniXCMS * * * @author Puguh Wijayanto <metalgenix@gmail.com> * @copyright 2014-2020 Puguh Wijayanto * @license http://www.opensource.org/licenses/mit-license.php MIT */ /** * Control Class. * * This class will proccess the controller * * @author Puguh Wijayanto <metalgenix@gmail.com> * * @since 0.0.1 */ class Control { public function __construct() { } /** * Control Handler Function. This is the loader of the controller. This * function is not necessary. Controller can be loaded directly below. Will * be removed on the next update. * * @param string $vars * * @author Puguh Wijayanto <metalgenix@gmail.com> * * @since 0.0.1 */ public static function handler($vars) { self::$vars(); } /** * Control Frontend Inclusion Function. This will include the controller at * the Frontend directory. * * @param string $vars * * @author Puguh Wijayanto <metalgenix@gmail.com> * * @since 0.0.1 */ public static function incFront($vars, $param = '') { // print_r($param); // echo $vars; $file = GX_PATH.'/inc/lib/Control/Frontend/'.$vars.'.control.php'; if (file_exists($file)) { include $file; } else { // echo "error"; self::error('404'); } } /** * Control Backend Inclusion Function. This will include the controller at * the Backend directory. * * @param string $vars * * @author Puguh Wijayanto <metalgenix@gmail.com> * * @since 0.0.1 */ public static function incBack($vars) { $file = GX_PATH.'/inc/lib/Control/Backend/'.$vars.'.control.php'; if (file_exists($file)) { include $file; } else { self::error('404'); } } /** * Control Frontend Handler Function. This will handle the controller which * file will be included at the Frontend controller. * * @author Puguh Wijayanto <metalgenix@gmail.com> * * @since 0.0.1 * Add New SMART URL handler for better and simple router. * @since 0.0.7 */ public static function frontend() { $arr = array('ajax', 'post', 'page', 'cat', 'mod', 'sitemap', 'rss', 'account', 'search', 'author', 'tag', 'thumb', 'default' ); if (SMART_URL) { if (isset($_REQUEST) && $_REQUEST != '' && count($_REQUEST) > 0) { (SMART_URL && isset($_GET)) ? self::route($arr) : self::get($arr); } else { self::route($arr); } // self::route($arr); } elseif (!SMART_URL && isset($_GET) && $_GET != '' && count($_GET) > 0 ) { self::get($arr); } else { self::incFront('default'); } } public static function get($arr) { $get = 0; foreach ($_GET as $k => $v) { if (in_array($k, $arr) || $k == 'paging' || $k == 'error' || $k == 'ajax' || $k == 'lang') { $get = $get + 1; } else { $get = $get; } } // echo $get; if ($get > 0) { foreach ($_GET as $k => $v) { if (in_array($k, $arr)) { if ($k == 'ajax') { self::ajax($v); } else { self::incFront($k); } } elseif ($k == 'lang') { self::incFront('default'); } elseif ($k == 'error') { self::error($v); } elseif (!in_array($k, $arr) && $k != 'paging') { //self::error('404'); } else { self::incFront('default'); } } } else { self::error('404'); } } public static function route($arr) { $var = Router::run(); if (isset($var['error']) || $var[0] == 'error') { self::error('404'); } else { foreach ((array) $var[0] as $k => $v) { if ($k == '0' && $v != 'error' && $v != 'ajax') { /** Frontpage */ self::incFront($v, $var); } elseif (!SMART_URL && isset($_REQUEST) && $_REQUEST != '' && count($_REQUEST) > 0) { self::get($arr); } elseif ($v == 'error' || $k == 'error') { $error = ($k == 'error') ? $v : '404'; self::error($error, $var); } elseif ($k == 'ajax') { self::ajax($v, $var); } else { if (in_array($k, $arr)) { self::incFront($k, $var); } else { self::error('404'); } } } } } /** * Control Backend Handler Function. This will handle the controller which * file will be included at the Backend controller. * * @author Puguh Wijayanto <metalgenix@gmail.com> * * @since 0.0.1 */ public static function backend($vars = '') { if (!empty($_GET['page'])) { self::incBack($_GET['page']); } else { self::incBack('default'); } } /** * Control Error Handler Function. This will handle the error page. Default * is 404 not found. This handler include file which is called by specific * name at the Error directory. * * @param string $vars * * @author Puguh Wijayanto <metalgenix@gmail.com> * * @since 0.0.1 */ public static function error($vars = '', $val = '') { if (isset($vars) && $vars != '') { $file = GX_PATH.'/inc/lib/Control/Error/'.$vars.'.control.php'; if (file_exists($file)) { include $file; } } else { include GX_PATH.'/inc/lib/Control/Error/unknown.control.php'; } } /** * Control Install Handler Function. This will handle the Install page. * * @author Puguh Wijayanto <metalgenix@gmail.com> * * @since 0.0.1 */ public static function install() { include GX_PATH.'/inc/lib/Control/Install/default.control.php'; } public static function ajax($vars = '', $param = '') { if (isset($vars) && $vars != '') { $file = GX_PATH.'/inc/lib/Control/Ajax/'.$vars.'-ajax.control.php'; if (file_exists($file)) { include $file; } else { self::error('404'); } } } } /* End of file Control.class.php */ /* Location: ./inc/lib/Control.class.php */
mit
adamaoc/life-and-gears
header.php
1824
<!DOCTYPE html> <html <?php language_attributes(); ?> class="no-js"> <head> <meta charset="<?php bloginfo('charset'); ?>"> <title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?> - <?php bloginfo('description'); ?></title> <link href="//www.google-analytics.com" rel="dns-prefetch"> <link href="<?php echo get_template_directory_uri(); ?>/assets/img/icons/favicon.ico" rel="shortcut icon"> <link href="<?php echo get_template_directory_uri(); ?>/assets/img/icons/touch.png" rel="apple-touch-icon-precomposed"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="description" content="<?php bloginfo('description'); ?>"> <?php wp_head(); ?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style/css/style.css"> </head> <body <?php body_class(); ?>> <!-- Wrap all page content here --> <div id="wrap"> <!-- Fixed navbar --> <div class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/"><?php bloginfo('name'); ?></a> </div> <div class="collapse navbar-collapse"> <?php wp_nav_menu( array('theme_location' => 'header-menu', 'menu_class' => 'nav navbar-nav') ); ?> </div><!--/.nav-collapse --> </div> </div> <div class="container">
mit
cuckata23/wurfl-data
data/lifetab_e7316_ver1.php
414
<?php return array ( 'id' => 'lifetab_e7316_ver1', 'fallback' => 'generic_android_ver4_2', 'capabilities' => array ( 'is_tablet' => 'true', 'model_name' => 'Lifetab E7316', 'brand_name' => 'Medion', 'can_assign_phone_number' => 'false', 'physical_screen_height' => '154', 'physical_screen_width' => '90', 'resolution_width' => '600', 'resolution_height' => '1024', ), );
mit
TheGigabots/gigabots-dashboard
src/components/Designer.js
5849
import React from "react"; import PropTypes from "prop-types"; import 'codemirror/mode/javascript/javascript'; import 'codemirror/lib/codemirror.css'; import 'codemirror/theme/material.css'; import Blockly from 'node-blockly/browser'; import {reactLocalStorage} from 'reactjs-localstorage'; import toolboxXML from './../blocks/toolbox.xml'; export default class Designer extends React.Component { constructor() { super(); this.state = this.newState(); this.blocklyEditor = null; } newState() { return { code: "" } } componentWillMount() { this.loadCustomBlocks(); } componentDidMount() { fetch(toolboxXML) .then(response => response.text()) .then(toolboxText => { this.blocklyEditor = Blockly.inject(this.blocklyDiv, { toolbox: toolboxText, maxBlocks: Infinity, trashcan: true, grid: { spacing: 20, length: 1, colour: '#888', snap: true }, zoom: { controls: true, wheel: false, startScale: 1.1, maxScale: 3, minScale: 0.3, scaleSpeed: 1.2 } } ); this.loadXMLFromLocalStorage(false); this.blocklyEditor.addChangeListener(() => { let xml = Blockly.Xml.workspaceToDom(this.blocklyEditor); let xml_text = Blockly.Xml.domToText(xml); let js = Blockly.JavaScript.workspaceToCode(this.blocklyEditor); reactLocalStorage.set("editorXML", xml_text); this.props.codeChangeListener(js, xml_text); }) window.addEventListener('resize', () => this.resize(), false) }); } loadXMLFromLocalStorage(notify) { let loadedXML = reactLocalStorage.get("editorXML"); if (loadedXML) { Blockly.mainWorkspace.clear(); Blockly.Xml.domToWorkspace(Blockly.Xml.textToDom(loadedXML), this.blocklyEditor); let js = Blockly.JavaScript.workspaceToCode(this.blocklyEditor); this.props.codeChangeListener(js, loadedXML); } if (notify) { this.props.loadXMLFunc(); } } friendOptions() { if (this.props.gigabot) { const friendsList = this.props.gigabot.friendsAsList(); let list = friendsList.map(f => { return [f.shortCode, f.shortCode]; }) list.push(['bot', 'bot']) return list; } else { return [["bot", "bot"]]; } } validateFriendOptions(e) { //console.log(e); } /** * Don't try and require these blocks up top before blockly is properly initialized. */ loadCustomBlocks() { //Most block definitions move to customBlocks, direct export //from block editor. Any local definitions should load afterwards //and will override the editor produced blocks. require('./../blocks/customBlocks'); require('./../blocks/StartEventBlock'); require('./../blocks/RunEventBlock'); require('./../blocks/FriendInput').init(() => { return this.friendOptions(); }, (e) => { return this.validateFriendOptions(e); }) require('./../blocks/SayBlock'); require('./../blocks/BeepBlock'); //Sensors require('./../blocks/BatteryVoltageBlock'); require('./../blocks/TouchSensorBlock'); require('./../blocks/InfraredSensorBlock'); require('./../blocks/ColorSensorBlock'); require('./../blocks/ColorSensorValueBlock'); require('./../blocks/UltrasonicSensorBlock'); require('./../blocks/TimeInMillisBlock'); require('./../blocks/LogBlock'); require("./../blocks/WaitBlock"); require('./../blocks/EveryBlock'); require('./../blocks/LEDBlock'); require('./../blocks/RunMotorForTime'); require('./../blocks/RunMotorSpeed'); require('./../blocks/DriveSetupBlock'); require('./../blocks/MotorOutputBlock'); require('./../blocks/DriveControlBlock'); require('./../blocks/DriveControTimeBlock'); require('./../blocks/StopMotorBlock'); require('./../blocks/StopAllMotorBlock'); } resize() { Blockly.svgResize(this.blocklyEditor); this.forceUpdate() } render() { if (this.props.loadFromLocalStorage) { this.loadXMLFromLocalStorage(true); } let blocklyDivStyle = { height: 800, width: 1000, } if (this.blocklyDiv) { let calcWidth = this.blocklyDiv.parentNode.clientWidth; let calcHeight = this.blocklyDiv.parentNode.clientHeight; blocklyDivStyle.width = calcWidth - 20; blocklyDivStyle.height = calcHeight; } return ( <div id="blocklyContainer"> <div id="blocklyDiv" style={blocklyDivStyle} ref={(d) => { this.blocklyDiv = d }}></div> </div> ); } } Designer.propTypes = { loadFromLocalStorage: PropTypes.bool.isRequired, gigabot: PropTypes.object.isRequired, codeChangeListener: PropTypes.func.isRequired, loadXMLFunc: PropTypes.func.isRequired, };
mit
euangoddard/django-ab
src/ab/templatetags/ab.py
2132
from django.template.base import Library from django.template.base import Node from django.template.base import TemplateSyntaxError from django.template.base import Variable from ab import VARIANT_A from ab import VARIANT_B from ab.models import ABTest register = Library() @register.tag def run_ab_test(parser, token): """ Declare an AB test in the template: {% run_ab_test "Name of the test" %} <!-- markup for variant A goes here --> {% or %} <!-- markup for variant B goes here --> {% end_ab_test %} """ arguments = token.split_contents() tag_name = arguments.pop(0) if len(arguments) != 1: raise TemplateSyntaxError("") ab_test_name = arguments[0] variant_a_content = parser.parse(("or",)) parser.delete_first_token() end_tag_marker = "end_{}".format(tag_name.split("_", 1)[1]) variant_b_content = parser.parse((end_tag_marker,)) parser.delete_first_token() return _ABTestNode(ab_test_name, variant_a_content, variant_b_content) class _ABTestNode(Node): def __init__(self, ab_test_name, variant_a_content, variant_b_content): self.ab_test_name = Variable(ab_test_name) self.variant_a_content = variant_a_content self.variant_b_content = variant_b_content def render(self, context): ab_test_name = self.ab_test_name.resolve(context) ab_test = ABTest.objects.get_or_create(name=ab_test_name)[0] block_context = context.copy() block_context["ab_test"] = ab_test if self._is_variant_a_applicable(context["request"]): block_context["ab_test_variant"] = VARIANT_A content = self.variant_a_content.render(block_context) ab_test.times_a_presented += 1 else: block_context["ab_test_variant"] = VARIANT_B content = self.variant_b_content.render(block_context) ab_test.times_b_presented += 1 ab_test.save() return content @staticmethod def _is_variant_a_applicable(request): raise NotImplementedError("Determine whether A or B is applicable!")
mit
AlexeyEvlampiev/Nature
tests/XUnitTest.Nature/Chemkin/Thermo/ThermoCollection_Parse_Should.cs
315
namespace Nature.Chemkin.Thermo { using Xunit; public class ThermoCollection_Parse_Should { [Fact] public void Work() { var collection = ThermoCollection.Parse(ThermoCollectionsResource.thermo30); Assert.Equal(collection.Count, 53); } } }
mit
elect86/jogl-samples
jogl-samples/src/tests/gl_330/Gl_330_texture_integer_rgb10a2ui.java
7585
/* * 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 tests.gl_330; import com.jogamp.opengl.GL; import static com.jogamp.opengl.GL2ES3.*; import com.jogamp.opengl.GL3; import com.jogamp.opengl.GLContext; import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.util.GLBuffers; import com.jogamp.opengl.util.glsl.ShaderCode; import com.jogamp.opengl.util.glsl.ShaderProgram; import framework.BufferUtils; import glm.glm; import glm.mat._4.Mat4; import framework.Profile; import framework.Semantic; import framework.Test; import glm.vec._2.Vec2; import java.io.IOException; import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.util.logging.Level; import java.util.logging.Logger; import jgli.Gl; import jgli.Texture2d; /** * * @author GBarbieri */ public class Gl_330_texture_integer_rgb10a2ui extends Test { public static void main(String[] args) { Gl_330_texture_integer_rgb10a2ui gl_330_texture_integer_rgb10a2ui = new Gl_330_texture_integer_rgb10a2ui(); } public Gl_330_texture_integer_rgb10a2ui() { super("gl-330-texture-integer-rgb10a2ui", Profile.CORE, 3, 3); } private final String VERT_SHADER_SOURCE = "texture-integer"; private final String FRAG_SHADER_SOURCE = "texture-integer-10bit"; private final String SHADERS_ROOT = "src/data/gl_330"; private final String TEXTURE_DIFFUSE = "kueken7_rgb10a2u.dds"; // With DDS textures, v texture coordinate are reversed, from top to bottom private int vertexCount = 6; private int vertexSize = vertexCount * 2 * 2 * Float.BYTES; private float[] vertexData = { -1.0f, -1.0f,/**/ 0.0f, 1.0f, +1.0f, -1.0f,/**/ 1.0f, 1.0f, +1.0f, +1.0f,/**/ 1.0f, 0.0f, +1.0f, +1.0f,/**/ 1.0f, 0.0f, -1.0f, +1.0f,/**/ 0.0f, 0.0f, -1.0f, -1.0f,/**/ 0.0f, 1.0f}; private IntBuffer bufferName = GLBuffers.newDirectIntBuffer(1), textureName = GLBuffers.newDirectIntBuffer(1), vertexArrayName = GLBuffers.newDirectIntBuffer(1); private int programName, uniformMvp, uniformDiffuse; @Override protected boolean begin(GL gl) { GL3 gl3 = (GL3) gl; boolean validated = true; if (validated) { validated = initTexture(gl3); } if (validated) { validated = initProgram(gl3); } if (validated) { validated = initBuffer(gl3); } if (validated) { validated = initVertexArray(gl3); } return validated; } private boolean initProgram(GL3 gl3) { boolean validated = true; if (validated) { ShaderProgram shaderProgram = new ShaderProgram(); ShaderCode vertShaderCode = ShaderCode.create(gl3, GL_VERTEX_SHADER, this.getClass(), SHADERS_ROOT, null, VERT_SHADER_SOURCE, "vert", null, true); ShaderCode fragShaderCode = ShaderCode.create(gl3, GL_FRAGMENT_SHADER, this.getClass(), SHADERS_ROOT, null, FRAG_SHADER_SOURCE, "frag", null, true); shaderProgram.init(gl3); shaderProgram.add(vertShaderCode); shaderProgram.add(fragShaderCode); programName = shaderProgram.program(); shaderProgram.link(gl3, System.out); } // Get variables locations if (validated) { uniformMvp = gl3.glGetUniformLocation(programName, "MVP"); uniformDiffuse = gl3.glGetUniformLocation(programName, "Diffuse"); } return validated & checkError(gl3, "initProgram"); } private boolean initBuffer(GL3 gl3) { FloatBuffer vertexBuffer = GLBuffers.newDirectFloatBuffer(vertexData); gl3.glGenBuffers(1, bufferName); gl3.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(0)); gl3.glBufferData(GL_ARRAY_BUFFER, vertexSize, vertexBuffer, GL_STATIC_DRAW); gl3.glBindBuffer(GL_ARRAY_BUFFER, 0); BufferUtils.destroyDirectBuffer(vertexBuffer); return true; } private boolean initTexture(GL3 gl3) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); if (texture.empty()) { return false; } jgli.Gl.Format format = jgli.Gl.translate(texture.format()); gl3.glGenTextures(1, textureName); // Default unpack alignment of 4 is ok, we have 32 bit per pixel. gl3.glActiveTexture(GL_TEXTURE0); gl3.glBindTexture(GL_TEXTURE_2D, textureName.get(0)); gl3.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl3.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); gl3.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); gl3.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); gl3.glTexImage2D(GL_TEXTURE_2D, 0, format.internal.value, // Gl.InternalFormat.INTERNAL_RGB10A2U.value, texture.dimensions(0)[0], texture.dimensions(0)[1], 0, format.external.value, // Gl.ExternalFormat.EXTERNAL_RGBA_INTEGER.value, // format.type.value, GL_UNSIGNED_INT_10_10_10_2, texture.data(0)); } catch (IOException ex) { Logger.getLogger(Gl_330_texture_integer_rgb10a2ui.class.getName()).log(Level.SEVERE, null, ex); } return true; } private boolean initVertexArray(GL3 gl3) { gl3.glGenVertexArrays(1, vertexArrayName); gl3.glBindVertexArray(vertexArrayName.get(0)); { gl3.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(0)); gl3.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, 2 * Vec2.SIZE, 0); gl3.glVertexAttribPointer(Semantic.Attr.TEXCOORD, 2, GL_FLOAT, false, 2 * Vec2.SIZE, Vec2.SIZE); gl3.glBindBuffer(GL_ARRAY_BUFFER, 0); gl3.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl3.glEnableVertexAttribArray(Semantic.Attr.TEXCOORD); } gl3.glBindVertexArray(0); return true; } @Override protected boolean render(GL gl) { GL3 gl3 = (GL3) gl; Mat4 projection = glm.perspective_((float) Math.PI * 0.25f, 4.0f / 3.0f, 0.1f, 100.0f); Mat4 model = new Mat4(1.0f); Mat4 mvp = projection.mul(viewMat4()).mul(model); gl3.glViewport(0, 0, windowSize.x, windowSize.y); gl3.glClearBufferfv(GL_COLOR, 0, clearColor.put(0, 1).put(1, .5f).put(2, 0).put(3, 1)); gl3.glUseProgram(programName); gl3.glUniform1i(uniformDiffuse, 0); gl3.glUniformMatrix4fv(uniformMvp, 1, false, mvp.toFa_(), 0); gl3.glActiveTexture(GL_TEXTURE0); gl3.glBindTexture(GL_TEXTURE_2D, textureName.get(0)); gl3.glBindVertexArray(vertexArrayName.get(0)); gl3.glDrawArraysInstanced(GL_TRIANGLES, 0, vertexCount, 1); return true; } }
mit
cluckd/cluckd
src/qt/locale/bitcoin_es.ts
142544
<?xml version="1.0" ?><!DOCTYPE TS><TS language="es" version="2.1"> <context> <name>AboutDialog</name> <message> <source>About darkestdimecoin Core</source> <translation>Acerca de darkestdimecoin Core</translation> </message> <message> <source>&lt;b&gt;darkestdimecoin Core&lt;/b&gt; version</source> <translation>Versión de &lt;b&gt;darkestdimecoin Core&lt;b&gt;</translation> </message> <message> <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> Este es un software experimental. Distribuido bajo la licencia MIT/X11, vea el archivo adjunto COPYING o http://www.opensource.org/licenses/mit-license.php. Este producto incluye software desarrollado por OpenSSL Project para su uso en el OpenSSL Toolkit (http://www.openssl.org/) y software criptográfico escrito por Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.</translation> </message> <message> <source>Copyright</source> <translation>Copyright</translation> </message> <message> <source>The darkestdimecoin Core developers</source> <translation>Los desarrolladores de darkestdimecoin Core</translation> </message> <message> <source>(%1-bit)</source> <translation>(%1-bit)</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <source>Double-click to edit address or label</source> <translation>Haga doble clic para editar la etiqueta o dirección </translation> </message> <message> <source>Create a new address</source> <translation>Crear una nueva dirección</translation> </message> <message> <source>&amp;New</source> <translation>Nuevo</translation> </message> <message> <source>Copy the currently selected address to the system clipboard</source> <translation>Copiar la dirección seleccionada al portapapeles del sistema</translation> </message> <message> <source>&amp;Copy</source> <translation>&amp;Copiar</translation> </message> <message> <source>C&amp;lose</source> <translation>&amp;Cerrar</translation> </message> <message> <source>&amp;Copy Address</source> <translation>&amp;Copiar dirección</translation> </message> <message> <source>Delete the currently selected address from the list</source> <translation>Borrar de la lista la dirección seleccionada</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>Exportar a un archivo los datos de esta pestaña</translation> </message> <message> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <source>&amp;Delete</source> <translation>&amp;Eliminar</translation> </message> <message> <source>Choose the address to send coins to</source> <translation>Escoja la dirección a la que enviar darkestdimecoins</translation> </message> <message> <source>Choose the address to receive coins with</source> <translation>Escoja la dirección de la que recibir darkestdimecoins</translation> </message> <message> <source>C&amp;hoose</source> <translation>&amp;Escoger</translation> </message> <message> <source>Sending addresses</source> <translation>Direcciones de envío</translation> </message> <message> <source>Receiving addresses</source> <translation>Direcciones de recepción</translation> </message> <message> <source>These are your darkestdimecoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Estas son sus direcciones darkestdimecoin para enviar pagos. Compruebe siempre la cantidad y la dirección receptora antes de enviar darkestdimecoins.</translation> </message> <message> <source>These are your darkestdimecoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> <translation>Estas son sus direcciones de darkestdimecoin para recibir pagos. Se recomienda utilizar una nueva dirección de recepción para cada transacción.</translation> </message> <message> <source>Copy &amp;Label</source> <translation>Copiar &amp;etiqueta</translation> </message> <message> <source>&amp;Edit</source> <translation>&amp;Editar</translation> </message> <message> <source>Export Address List</source> <translation>Exportar la lista de direcciones </translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>Archivos de columnas separadas por coma (*.csv)</translation> </message> <message> <source>Exporting Failed</source> <translation>Error exportando</translation> </message> <message> <source>There was an error trying to save the address list to %1.</source> <translation>Ha habido un error al intentar guardar los datos del monedero en %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <source>Address</source> <translation>Dirección</translation> </message> <message> <source>(no label)</source> <translation>(sin etiqueta)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <source>Passphrase Dialog</source> <translation>Diálogo de contraseña</translation> </message> <message> <source>Enter passphrase</source> <translation>Introducir contraseña</translation> </message> <message> <source>New passphrase</source> <translation>Nueva contraseña</translation> </message> <message> <source>Repeat new passphrase</source> <translation>Repita la nueva contraseña</translation> </message> <message> <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>Introduzca la nueva contraseña del monedero.&lt;br/&gt;Por favor elija una con &lt;b&gt;10 o más caracteres aleatorios&lt;/b&gt;, u &lt;b&gt;ocho o más palabras&lt;/b&gt;.</translation> </message> <message> <source>Encrypt wallet</source> <translation>Cifrar el monedero</translation> </message> <message> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Esta operación requiere su contraseña para desbloquear el monedero.</translation> </message> <message> <source>Unlock wallet</source> <translation>Desbloquear monedero</translation> </message> <message> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Esta operación requiere su contraseña para descifrar el monedero.</translation> </message> <message> <source>Decrypt wallet</source> <translation>Descifrar el monedero</translation> </message> <message> <source>Change passphrase</source> <translation>Cambiar contraseña</translation> </message> <message> <source>Enter the old and new passphrase to the wallet.</source> <translation>Introduzca la contraseña anterior del monedero y la nueva. </translation> </message> <message> <source>Confirm wallet encryption</source> <translation>Confirmar cifrado del monedero</translation> </message> <message> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR darkestdimecoinS&lt;/b&gt;!</source> <translation>Atencion: ¡Si cifra su monedero y pierde la contraseña perderá &lt;b&gt;TODOS SUS darkestdimecoinS&lt;/b&gt;!&quot;</translation> </message> <message> <source>Are you sure you wish to encrypt your wallet?</source> <translation>¿Seguro que desea cifrar su monedero?</translation> </message> <message> <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>IMPORTANTE: Cualquier copia de seguridad que haya realizado previamente de su archivo de monedero debe reemplazarse con el nuevo archivo de monedero cifrado. Por razones de seguridad, las copias de seguridad previas del archivo de monedero no cifradas serán inservibles en cuanto comience a usar el nuevo monedero cifrado.</translation> </message> <message> <source>Warning: The Caps Lock key is on!</source> <translation>Aviso: ¡La tecla de bloqueo de mayúsculas está activada!</translation> </message> <message> <source>Wallet encrypted</source> <translation>Monedero cifrado</translation> </message> <message> <source>darkestdimecoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your darkestdimecoins from being stolen by malware infecting your computer.</source> <translation>darkestdimecoin se cerrará para finalizar el proceso de cifrado. Recuerde que el cifrado de su monedero no puede proteger totalmente sus darkestdimecoins de robo por malware que infecte su sistema.</translation> </message> <message> <source>Wallet encryption failed</source> <translation>Ha fallado el cifrado del monedero</translation> </message> <message> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Ha fallado el cifrado del monedero debido a un error interno. El monedero no ha sido cifrado.</translation> </message> <message> <source>The supplied passphrases do not match.</source> <translation>Las contraseñas no coinciden.</translation> </message> <message> <source>Wallet unlock failed</source> <translation>Ha fallado el desbloqueo del monedero</translation> </message> <message> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>La contraseña introducida para descifrar el monedero es incorrecta.</translation> </message> <message> <source>Wallet decryption failed</source> <translation>Ha fallado el descifrado del monedero</translation> </message> <message> <source>Wallet passphrase was successfully changed.</source> <translation>Se ha cambiado correctamente la contraseña del monedero.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <source>Sign &amp;message...</source> <translation>Firmar &amp;mensaje...</translation> </message> <message> <source>Synchronizing with network...</source> <translation>Sincronizando con la red…</translation> </message> <message> <source>&amp;Overview</source> <translation>&amp;Vista general</translation> </message> <message> <source>Node</source> <translation>Nodo</translation> </message> <message> <source>Show general overview of wallet</source> <translation>Mostrar vista general del monedero</translation> </message> <message> <source>&amp;Transactions</source> <translation>&amp;Transacciones</translation> </message> <message> <source>Browse transaction history</source> <translation>Examinar el historial de transacciones</translation> </message> <message> <source>E&amp;xit</source> <translation>&amp;Salir</translation> </message> <message> <source>Quit application</source> <translation>Salir de la aplicación</translation> </message> <message> <source>Show information about darkestdimecoin</source> <translation>Mostrar información acerca de darkestdimecoin</translation> </message> <message> <source>About &amp;Qt</source> <translation>Acerca de &amp;Qt</translation> </message> <message> <source>Show information about Qt</source> <translation>Mostrar información acerca de Qt</translation> </message> <message> <source>&amp;Options...</source> <translation>&amp;Opciones...</translation> </message> <message> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Cifrar monedero…</translation> </message> <message> <source>&amp;Backup Wallet...</source> <translation>&amp;Guardar copia del monedero...</translation> </message> <message> <source>&amp;Change Passphrase...</source> <translation>&amp;Cambiar la contraseña…</translation> </message> <message> <source>&amp;Sending addresses...</source> <translation>Direcciones de &amp;envío...</translation> </message> <message> <source>&amp;Receiving addresses...</source> <translation>Direcciones de &amp;recepción...</translation> </message> <message> <source>Open &amp;URI...</source> <translation>Abrir &amp;URI...</translation> </message> <message> <source>Importing blocks from disk...</source> <translation>Importando bloques de disco...</translation> </message> <message> <source>Reindexing blocks on disk...</source> <translation>Reindexando bloques en disco...</translation> </message> <message> <source>Send coins to a darkestdimecoin address</source> <translation>Enviar darkestdimecoins a una dirección darkestdimecoin</translation> </message> <message> <source>Modify configuration options for darkestdimecoin</source> <translation>Modificar las opciones de configuración de darkestdimecoin</translation> </message> <message> <source>Backup wallet to another location</source> <translation>Copia de seguridad del monedero en otra ubicación</translation> </message> <message> <source>Change the passphrase used for wallet encryption</source> <translation>Cambiar la contraseña utilizada para el cifrado del monedero</translation> </message> <message> <source>&amp;Debug window</source> <translation>Ventana de &amp;depuración</translation> </message> <message> <source>Open debugging and diagnostic console</source> <translation>Abrir la consola de depuración y diagnóstico</translation> </message> <message> <source>&amp;Verify message...</source> <translation>&amp;Verificar mensaje...</translation> </message> <message> <source>darkestdimecoin</source> <translation>darkestdimecoin</translation> </message> <message> <source>Wallet</source> <translation>Monedero</translation> </message> <message> <source>&amp;Send</source> <translation>&amp;Enviar</translation> </message> <message> <source>&amp;Receive</source> <translation>&amp;Recibir</translation> </message> <message> <source>&amp;Show / Hide</source> <translation>Mo&amp;strar/ocultar</translation> </message> <message> <source>Show or hide the main Window</source> <translation>Mostrar u ocultar la ventana principal</translation> </message> <message> <source>Encrypt the private keys that belong to your wallet</source> <translation>Cifrar las claves privadas de su monedero</translation> </message> <message> <source>Sign messages with your darkestdimecoin addresses to prove you own them</source> <translation>Firmar mensajes con sus direcciones darkestdimecoin para demostrar la propiedad</translation> </message> <message> <source>Verify messages to ensure they were signed with specified darkestdimecoin addresses</source> <translation>Verificar mensajes comprobando que están firmados con direcciones darkestdimecoin concretas</translation> </message> <message> <source>&amp;File</source> <translation>&amp;Archivo</translation> </message> <message> <source>&amp;Settings</source> <translation>&amp;Configuración</translation> </message> <message> <source>&amp;Help</source> <translation>A&amp;yuda</translation> </message> <message> <source>Tabs toolbar</source> <translation>Barra de pestañas</translation> </message> <message> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <source>darkestdimecoin Core</source> <translation>darkestdimecoin Core</translation> </message> <message> <source>Request payments (generates QR codes and darkestdimecoin: URIs)</source> <translation>Solicitar pagos (genera codigo QR y URL&apos;s de darkestdimecoin)</translation> </message> <message> <source>&amp;About darkestdimecoin Core</source> <translation>&amp;Acerca de darkestdimecoin Core</translation> </message> <message> <source>Show the list of used sending addresses and labels</source> <translation>Mostrar la lista de direcciones de envío y etiquetas</translation> </message> <message> <source>Show the list of used receiving addresses and labels</source> <translation>Muestra la lista de direcciones de recepción y etiquetas</translation> </message> <message> <source>Open a darkestdimecoin: URI or payment request</source> <translation>Abrir un darkestdimecoin: URI o petición de pago</translation> </message> <message> <source>&amp;Command-line options</source> <translation>&amp;Opciones de consola de comandos</translation> </message> <message> <source>Show the darkestdimecoin Core help message to get a list with possible darkestdimecoin command-line options</source> <translation>Muestra el mensaje de ayuda darkestdimecoin Core para obtener una lista con las posibles opciones de la consola de comandos de darkestdimecoin</translation> </message> <message> <source>darkestdimecoin client</source> <translation>Cliente darkestdimecoin</translation> </message> <message numerus="yes"> <source>%n active connection(s) to darkestdimecoin network</source> <translation><numerusform>%n conexión activa hacia la red darkestdimecoin</numerusform><numerusform>%n conexiones activas hacia la red darkestdimecoin</numerusform></translation> </message> <message> <source>No block source available...</source> <translation>Ninguna fuente de bloques disponible ...</translation> </message> <message> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>Se han procesado %1 de %2 bloques (estimados) del historial de transacciones.</translation> </message> <message> <source>Processed %1 blocks of transaction history.</source> <translation>Procesados %1 bloques del historial de transacciones.</translation> </message> <message numerus="yes"> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation> </message> <message numerus="yes"> <source>%n day(s)</source> <translation><numerusform>%n día</numerusform><numerusform>%n días</numerusform></translation> </message> <message numerus="yes"> <source>%n week(s)</source> <translation><numerusform>%n semana</numerusform><numerusform>%n semanas</numerusform></translation> </message> <message> <source>%1 and %2</source> <translation>%1 y %2</translation> </message> <message numerus="yes"> <source>%n year(s)</source> <translation><numerusform>%n año</numerusform><numerusform>%n años</numerusform></translation> </message> <message> <source>%1 behind</source> <translation>%1 por detrás</translation> </message> <message> <source>Last received block was generated %1 ago.</source> <translation>El último bloque recibido fue generado hace %1.</translation> </message> <message> <source>Transactions after this will not yet be visible.</source> <translation>Las transacciones posteriores aún no están visibles.</translation> </message> <message> <source>Error</source> <translation>Error</translation> </message> <message> <source>Warning</source> <translation>Aviso</translation> </message> <message> <source>Information</source> <translation>Información</translation> </message> <message> <source>Up to date</source> <translation>Actualizado</translation> </message> <message> <source>Catching up...</source> <translation>Actualizando...</translation> </message> <message> <source>Sent transaction</source> <translation>Transacción enviada</translation> </message> <message> <source>Incoming transaction</source> <translation>Transacción entrante</translation> </message> <message> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Fecha: %1 Cantidad: %2 Tipo: %3 Dirección: %4 </translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;desbloqueado&lt;/b&gt;</translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;bloqueado&lt;/b&gt;</translation> </message> <message> <source>A fatal error occurred. darkestdimecoin can no longer continue safely and will quit.</source> <translation>Ha ocurrido un error crítico. darkestdimecoin ya no puede continuar con seguridad y se cerrará.</translation> </message> </context> <context> <name>ClientModel</name> <message> <source>Network Alert</source> <translation>Alerta de red</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <source>Coin Control Address Selection</source> <translation>Selección de direcciones bajo Coin Control</translation> </message> <message> <source>Quantity:</source> <translation>Cantidad:</translation> </message> <message> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <source>Amount:</source> <translation>Cuantía:</translation> </message> <message> <source>Priority:</source> <translation>Prioridad:</translation> </message> <message> <source>Fee:</source> <translation>Tasa:</translation> </message> <message> <source>Low Output:</source> <translation>Envío pequeño:</translation> </message> <message> <source>After Fee:</source> <translation>Después de tasas:</translation> </message> <message> <source>Change:</source> <translation>Cambio:</translation> </message> <message> <source>(un)select all</source> <translation>(des)marcar todos</translation> </message> <message> <source>Tree mode</source> <translation>Modo árbol</translation> </message> <message> <source>List mode</source> <translation>Modo lista</translation> </message> <message> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <source>Address</source> <translation>Dirección</translation> </message> <message> <source>Date</source> <translation>Fecha</translation> </message> <message> <source>Confirmations</source> <translation>Confirmaciones</translation> </message> <message> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <source>Priority</source> <translation>Prioridad</translation> </message> <message> <source>Copy address</source> <translation>Copiar dirección</translation> </message> <message> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <source>Copy amount</source> <translation>Copiar cuantía</translation> </message> <message> <source>Copy transaction ID</source> <translation>Copiar identificador de transacción</translation> </message> <message> <source>Lock unspent</source> <translation>Bloquear lo no gastado</translation> </message> <message> <source>Unlock unspent</source> <translation>Desbloquear lo no gastado</translation> </message> <message> <source>Copy quantity</source> <translation>Copiar cantidad</translation> </message> <message> <source>Copy fee</source> <translation>Copiar donación</translation> </message> <message> <source>Copy after fee</source> <translation>Copiar después de aplicar donación</translation> </message> <message> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <source>Copy priority</source> <translation>Copiar prioridad</translation> </message> <message> <source>Copy low output</source> <translation>Copiar envío pequeño</translation> </message> <message> <source>Copy change</source> <translation>Copiar cambio</translation> </message> <message> <source>highest</source> <translation>lo más alto</translation> </message> <message> <source>higher</source> <translation>más alto</translation> </message> <message> <source>high</source> <translation>alto</translation> </message> <message> <source>medium-high</source> <translation>medio-alto</translation> </message> <message> <source>medium</source> <translation>medio</translation> </message> <message> <source>low-medium</source> <translation>bajo-medio</translation> </message> <message> <source>low</source> <translation>bajo</translation> </message> <message> <source>lower</source> <translation>más bajo</translation> </message> <message> <source>lowest</source> <translation>lo más bajo</translation> </message> <message> <source>(%1 locked)</source> <translation>(%1 bloqueado)</translation> </message> <message> <source>none</source> <translation>ninguna</translation> </message> <message> <source>Dust</source> <translation>Basura</translation> </message> <message> <source>yes</source> <translation>si</translation> </message> <message> <source>no</source> <translation>no</translation> </message> <message> <source>This label turns red, if the transaction size is greater than 1000 bytes.</source> <translation>Esta etiqueta se torna roja si el tamaño de la transación es mayor a 1000 bytes.</translation> </message> <message> <source>This means a fee of at least %1 per kB is required.</source> <translation>Esto implica que se requiere una tarifa de al menos %1 por kB</translation> </message> <message> <source>Can vary +/- 1 byte per input.</source> <translation>Puede variar +/- 1 byte por entrada.</translation> </message> <message> <source>Transactions with higher priority are more likely to get included into a block.</source> <translation>Las transacciones con alta prioridad son más propensas a ser incluidas dentro de un bloque.</translation> </message> <message> <source>This label turns red, if the priority is smaller than &quot;medium&quot;.</source> <translation>Esta etiqueta se muestra en rojo si la prioridad es menor que &quot;media&quot;.</translation> </message> <message> <source>This label turns red, if any recipient receives an amount smaller than %1.</source> <translation>Esta etiqueta se torna roja si cualquier destinatario recibe una cantidad menor a %1.</translation> </message> <message> <source>This means a fee of at least %1 is required.</source> <translation>Esto significa que se necesita una tarifa de al menos %1.</translation> </message> <message> <source>Amounts below 0.546 times the minimum relay fee are shown as dust.</source> <translation>Cantidades por debajo de 0.546 veces la tasa serán mostradas como basura</translation> </message> <message> <source>This label turns red, if the change is smaller than %1.</source> <translation>Esta etiqueta se vuelve roja si el cambio es menor que %1</translation> </message> <message> <source>(no label)</source> <translation>(sin etiqueta)</translation> </message> <message> <source>change from %1 (%2)</source> <translation>Enviar desde %1 (%2)</translation> </message> <message> <source>(change)</source> <translation>(cambio)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <source>Edit Address</source> <translation>Editar Dirección</translation> </message> <message> <source>&amp;Label</source> <translation>&amp;Etiqueta</translation> </message> <message> <source>The label associated with this address list entry</source> <translation>La etiqueta asociada con esta entrada de la lista de direcciones</translation> </message> <message> <source>The address associated with this address list entry. This can only be modified for sending addresses.</source> <translation>La dirección asociada con esta entrada de la lista de direcciones. Solo puede ser modificada para direcciones de envío.</translation> </message> <message> <source>&amp;Address</source> <translation>&amp;Dirección</translation> </message> <message> <source>New receiving address</source> <translation>Nueva dirección de recepción</translation> </message> <message> <source>New sending address</source> <translation>Nueva dirección de envío</translation> </message> <message> <source>Edit receiving address</source> <translation>Editar dirección de recepción</translation> </message> <message> <source>Edit sending address</source> <translation>Editar dirección de envío</translation> </message> <message> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>La dirección introducida &quot;%1&quot; ya está presente en la libreta de direcciones.</translation> </message> <message> <source>The entered address &quot;%1&quot; is not a valid darkestdimecoin address.</source> <translation>La dirección introducida &quot;%1&quot; no es una dirección darkestdimecoin válida.</translation> </message> <message> <source>Could not unlock wallet.</source> <translation>No se pudo desbloquear el monedero.</translation> </message> <message> <source>New key generation failed.</source> <translation>Ha fallado la generación de la nueva clave.</translation> </message> </context> <context> <name>FreespaceChecker</name> <message> <source>A new data directory will be created.</source> <translation>Se creará un nuevo directorio de datos.</translation> </message> <message> <source>name</source> <translation>nombre</translation> </message> <message> <source>Directory already exists. Add %1 if you intend to create a new directory here.</source> <translation>El directorio ya existe. Añada %1 si pretende crear aquí un directorio nuevo.</translation> </message> <message> <source>Path already exists, and is not a directory.</source> <translation>La ruta ya existe y no es un directorio.</translation> </message> <message> <source>Cannot create data directory here.</source> <translation>No se puede crear un directorio de datos aquí.</translation> </message> </context> <context> <name>HelpMessageDialog</name> <message> <source>darkestdimecoin Core - Command-line options</source> <translation>darkestdimecoin Core - Opciones de consola de comandos</translation> </message> <message> <source>darkestdimecoin Core</source> <translation>darkestdimecoin Core</translation> </message> <message> <source>version</source> <translation>versión</translation> </message> <message> <source>Usage:</source> <translation>Uso:</translation> </message> <message> <source>command-line options</source> <translation>opciones de la consola de comandos</translation> </message> <message> <source>UI options</source> <translation>Opciones GUI</translation> </message> <message> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Establecer el idioma, por ejemplo, &quot;es_ES&quot; (predeterminado: configuración regional del sistema)</translation> </message> <message> <source>Start minimized</source> <translation>Arrancar minimizado</translation> </message> <message> <source>Set SSL root certificates for payment request (default: -system-)</source> <translation>Establecer los certificados raíz SSL para solicitudes de pago (predeterminado: -system-)</translation> </message> <message> <source>Show splash screen on startup (default: 1)</source> <translation>Mostrar pantalla de bienvenida en el inicio (predeterminado: 1)</translation> </message> <message> <source>Choose data directory on startup (default: 0)</source> <translation>Elegir directorio de datos al iniciar (predeterminado: 0)</translation> </message> </context> <context> <name>Intro</name> <message> <source>Welcome</source> <translation>Bienvenido</translation> </message> <message> <source>Welcome to darkestdimecoin Core.</source> <translation>Bienvenido a darkestdimecoin Core</translation> </message> <message> <source>As this is the first time the program is launched, you can choose where darkestdimecoin Core will store its data.</source> <translation>Al ser la primera vez que se ejecuta el programa, puede elegir dónde almacenará sus datos darkestdimecoin Core.</translation> </message> <message> <source>darkestdimecoin Core will download and store a copy of the darkestdimecoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source> <translation>darkestdimecoin Core va a descargar y guardar una copia de la cadena de bloques de darkestdimecoin. Se almacenará al menos %1GB de datos en este directorio, que irá creciendo con el tiempo. El monedero se guardará también en este directorio.</translation> </message> <message> <source>Use the default data directory</source> <translation>Utilizar el directorio de datos predeterminado</translation> </message> <message> <source>Use a custom data directory:</source> <translation>Utilice un directorio de datos personalizado:</translation> </message> <message> <source>darkestdimecoin</source> <translation>darkestdimecoin</translation> </message> <message> <source>Error: Specified data directory &quot;%1&quot; can not be created.</source> <translation>Error: No puede crearse el directorio de datos especificado &quot;%1&quot;.</translation> </message> <message> <source>Error</source> <translation>Error</translation> </message> <message> <source>GB of free space available</source> <translation>GB de espacio libre disponible</translation> </message> <message> <source>(of %1GB needed)</source> <translation>(de los %1GB necesarios)</translation> </message> </context> <context> <name>OpenURIDialog</name> <message> <source>Open URI</source> <translation>Abrir URI...</translation> </message> <message> <source>Open payment request from URI or file</source> <translation>El pago requiere una URI o archivo</translation> </message> <message> <source>URI:</source> <translation>URI:</translation> </message> <message> <source>Select payment request file</source> <translation>Seleccione archivo de sulicitud de pago</translation> </message> <message> <source>Select payment request file to open</source> <translation>Abrir archivo de solicitud de pago</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <source>Options</source> <translation>Opciones</translation> </message> <message> <source>&amp;Main</source> <translation>&amp;Principal</translation> </message> <message> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>Tarifa de transacción opcional por kB que ayuda a asegurar que sus transacciones sean procesadas rápidamente. La mayoría de transacciones son de 1kB.</translation> </message> <message> <source>Pay transaction &amp;fee</source> <translation>Comisión de &amp;transacciones</translation> </message> <message> <source>Automatically start darkestdimecoin after logging in to the system.</source> <translation>Iniciar darkestdimecoin automáticamente al encender el sistema.</translation> </message> <message> <source>&amp;Start darkestdimecoin on system login</source> <translation>&amp;Iniciar darkestdimecoin al iniciar el sistema</translation> </message> <message> <source>Size of &amp;database cache</source> <translation>Tamaño de cache de la &amp;base de datos</translation> </message> <message> <source>MB</source> <translation>MB</translation> </message> <message> <source>Number of script &amp;verification threads</source> <translation>Número de procesos de &amp;verificación de scripts</translation> </message> <message> <source>Connect to the darkestdimecoin network through a SOCKS proxy.</source> <translation>Conectarse a la red darkestdimecoin a través de un proxy SOCKS.</translation> </message> <message> <source>&amp;Connect through SOCKS proxy (default proxy):</source> <translation>&amp;Conectarse a través de proxy SOCKS (proxy predeterminado):</translation> </message> <message> <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source> <translation>Dirección IP del proxy (p. ej. IPv4: 127.0.0.1 / IPv6: ::1)</translation> </message> <message> <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source> <translation>URLs de terceros (por ejemplo, un explorador de bloques) que aparecen en la pestaña de transacciones como items del menú contextual. El %s en la URL es reemplazado por el hash de la transacción. Se pueden separar múltiples URLs por una barra vertical |.</translation> </message> <message> <source>Third party transaction URLs</source> <translation>URLs de transacciones de terceros</translation> </message> <message> <source>Active command-line options that override above options:</source> <translation>Opciones activas de consola de comandos que tienen preferencia sobre las opciones antes mencionadas:</translation> </message> <message> <source>Reset all client options to default.</source> <translation>Restablecer todas las opciones del cliente a las predeterminadas.</translation> </message> <message> <source>&amp;Reset Options</source> <translation>&amp;Restablecer opciones</translation> </message> <message> <source>&amp;Network</source> <translation>&amp;Red</translation> </message> <message> <source>(0 = auto, &lt;0 = leave that many cores free)</source> <translation>(0 = automático, &lt;0 = dejar libres ese número de núcleos)</translation> </message> <message> <source>W&amp;allet</source> <translation>&amp;Monedero</translation> </message> <message> <source>Expert</source> <translation>Experto</translation> </message> <message> <source>Enable coin &amp;control features</source> <translation>Habilitar funcionalidad de &amp;coin control</translation> </message> <message> <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source> <translation>Si desactiva el gasto del cambio no confirmado, no se podrá usar el cambio de una transacción hasta que se alcance al menos una confirmación. Esto afecta también a cómo se calcula su saldo.</translation> </message> <message> <source>&amp;Spend unconfirmed change</source> <translation>&amp;Gastar cambio no confirmado</translation> </message> <message> <source>Automatically open the darkestdimecoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Abrir automáticamente el puerto del cliente darkestdimecoin en el router. Esta opción solo funciona si el router admite UPnP y está activado.</translation> </message> <message> <source>Map port using &amp;UPnP</source> <translation>Mapear el puerto usando &amp;UPnP</translation> </message> <message> <source>Proxy &amp;IP:</source> <translation>Dirección &amp;IP del proxy:</translation> </message> <message> <source>&amp;Port:</source> <translation>&amp;Puerto:</translation> </message> <message> <source>Port of the proxy (e.g. 9050)</source> <translation>Puerto del servidor proxy (ej. 9050)</translation> </message> <message> <source>SOCKS &amp;Version:</source> <translation>&amp;Versión SOCKS:</translation> </message> <message> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versión SOCKS del proxy (ej. 5)</translation> </message> <message> <source>&amp;Window</source> <translation>&amp;Ventana</translation> </message> <message> <source>Show only a tray icon after minimizing the window.</source> <translation>Minimizar la ventana a la bandeja de iconos del sistema.</translation> </message> <message> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimizar a la bandeja en vez de a la barra de tareas</translation> </message> <message> <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>Minimizar en lugar de salir de la aplicación al cerrar la ventana. Cuando esta opción está activa, la aplicación solo se puede cerrar seleccionando Salir desde el menú.</translation> </message> <message> <source>M&amp;inimize on close</source> <translation>M&amp;inimizar al cerrar</translation> </message> <message> <source>&amp;Display</source> <translation>&amp;Interfaz</translation> </message> <message> <source>User Interface &amp;language:</source> <translation>I&amp;dioma de la interfaz de usuario</translation> </message> <message> <source>The user interface language can be set here. This setting will take effect after restarting darkestdimecoin.</source> <translation>El idioma de la interfaz de usuario puede establecerse aquí. Este ajuste se aplicará cuando se reinicie darkestdimecoin.</translation> </message> <message> <source>&amp;Unit to show amounts in:</source> <translation>Mostrar las cantidades en la &amp;unidad:</translation> </message> <message> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Elegir la subdivisión predeterminada para mostrar cantidades en la interfaz y cuando se envían darkestdimecoins.</translation> </message> <message> <source>Whether to show darkestdimecoin addresses in the transaction list or not.</source> <translation>Mostrar o no las direcciones darkestdimecoin en la lista de transacciones.</translation> </message> <message> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Mostrar las direcciones en la lista de transacciones</translation> </message> <message> <source>Whether to show coin control features or not.</source> <translation>Mostrar o no funcionalidad de Coin Control</translation> </message> <message> <source>&amp;OK</source> <translation>&amp;Aceptar</translation> </message> <message> <source>&amp;Cancel</source> <translation>&amp;Cancelar</translation> </message> <message> <source>default</source> <translation>predeterminado</translation> </message> <message> <source>none</source> <translation>ninguna</translation> </message> <message> <source>Confirm options reset</source> <translation>Confirme el restablecimiento de las opciones</translation> </message> <message> <source>Client restart required to activate changes.</source> <translation>Se necesita reiniciar el cliente para activar los cambios.</translation> </message> <message> <source>Client will be shutdown, do you want to proceed?</source> <translation>El cliente se cerrará. ¿Desea continuar?</translation> </message> <message> <source>This change would require a client restart.</source> <translation>Este cambio exige el reinicio del cliente.</translation> </message> <message> <source>The supplied proxy address is invalid.</source> <translation>La dirección proxy indicada es inválida.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <source>Form</source> <translation>Desde</translation> </message> <message> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the darkestdimecoin network after a connection is established, but this process has not completed yet.</source> <translation>La información mostrada puede estar desactualizada. Su monedero se sincroniza automáticamente con la red darkestdimecoin después de que se haya establecido una conexión, pero este proceso aún no se ha completado.</translation> </message> <message> <source>Wallet</source> <translation>Monedero</translation> </message> <message> <source>Available:</source> <translation>Disponible:</translation> </message> <message> <source>Your current spendable balance</source> <translation>Su balance actual gastable</translation> </message> <message> <source>Pending:</source> <translation>Pendiente:</translation> </message> <message> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source> <translation>Total de transacciones que deben ser confirmadas, y que no cuentan con el balance gastable necesario</translation> </message> <message> <source>Immature:</source> <translation>No disponible:</translation> </message> <message> <source>Mined balance that has not yet matured</source> <translation>Saldo recién minado que aún no está disponible.</translation> </message> <message> <source>Total:</source> <translation>Total:</translation> </message> <message> <source>Your current total balance</source> <translation>Su balance actual total</translation> </message> <message> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Movimientos recientes&lt;/b&gt;</translation> </message> <message> <source>out of sync</source> <translation>desincronizado</translation> </message> </context> <context> <name>PaymentServer</name> <message> <source>URI handling</source> <translation>Gestión de URI</translation> </message> <message> <source>URI can not be parsed! This can be caused by an invalid darkestdimecoin address or malformed URI parameters.</source> <translation>¡No se puede interpretar la URI! Esto puede deberse a una dirección darkestdimecoin inválida o a parámetros de URI mal formados.</translation> </message> <message> <source>Requested payment amount of %1 is too small (considered dust).</source> <translation>La cantidad del pago solicitado (%1) es demasiado pequeña (considerada polvo).</translation> </message> <message> <source>Payment request error</source> <translation>Error en petición de pago</translation> </message> <message> <source>Cannot start darkestdimecoin: click-to-pay handler</source> <translation>No se pudo iniciar darkestdimecoin: manejador de pago-al-clic</translation> </message> <message> <source>Net manager warning</source> <translation>Advertencia del gestor de red</translation> </message> <message> <source>Your active proxy doesn&apos;t support SOCKS5, which is required for payment requests via proxy.</source> <translation>El proxy configurado no soporta el protocolo SOCKS5, el cual es requerido para pagos vía proxy.</translation> </message> <message> <source>Payment request fetch URL is invalid: %1</source> <translation>La URL de obtención de la solicitud de pago es inválida: %1</translation> </message> <message> <source>Payment request file handling</source> <translation>Procesado del archivo de solicitud de pago</translation> </message> <message> <source>Payment request file can not be read or processed! This can be caused by an invalid payment request file.</source> <translation>¡No se ha podido leer o procesar el archivo de solicitud de pago! Esto puede deberse a un archivo inválido de solicitud de pago.</translation> </message> <message> <source>Unverified payment requests to custom payment scripts are unsupported.</source> <translation>No están soportadas las peticiones inseguras a scripts de pago personalizados</translation> </message> <message> <source>Refund from %1</source> <translation>Devolución de %1</translation> </message> <message> <source>Error communicating with %1: %2</source> <translation>Error en la comunicación con %1: %2</translation> </message> <message> <source>Payment request can not be parsed or processed!</source> <translation>¡La solicitud de pago no puede leerse ni procesarse!</translation> </message> <message> <source>Bad response from server %1</source> <translation>Respuesta errónea del servidor %1</translation> </message> <message> <source>Payment acknowledged</source> <translation>Pago aceptado</translation> </message> <message> <source>Network request error</source> <translation>Error en petición de red</translation> </message> </context> <context> <name>QObject</name> <message> <source>darkestdimecoin</source> <translation>darkestdimecoin</translation> </message> <message> <source>Error: Specified data directory &quot;%1&quot; does not exist.</source> <translation>Error: El directorio de datos especificado &quot;%1&quot; no existe.</translation> </message> <message> <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source> <translation>Error: No se ha podido leer el archivo de configuración: %1. Debe utilizarse solamente la sintaxis clave=valor.</translation> </message> <message> <source>Error: Invalid combination of -regtest and -testnet.</source> <translation>Error: Combinación no válida de -regtest y -testnet.</translation> </message> <message> <source>darkestdimecoin Core didn&apos;t yet exit safely...</source> <translation>darkestdimecoin core no se ha cerrado de forma segura todavía...</translation> </message> <message> <source>Enter a darkestdimecoin address (e.g. QfgBvXopUwn3KtDnW4HHqX2L7KD37TigXS)</source> <translation>Introduzca una dirección darkestdimecoin (ej. QfgBvXopUwn3KtDnW4HHqX2L7KD37TigXS)</translation> </message> </context> <context> <name>QRImageWidget</name> <message> <source>&amp;Save Image...</source> <translation>Guardar Imagen...</translation> </message> <message> <source>&amp;Copy Image</source> <translation>Copiar imagen</translation> </message> <message> <source>Save QR Code</source> <translation>Guardar código QR</translation> </message> <message> <source>PNG Image (*.png)</source> <translation>Imágenes PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <source>Client name</source> <translation>Nombre del cliente</translation> </message> <message> <source>N/A</source> <translation>N/D</translation> </message> <message> <source>Client version</source> <translation>Versión del cliente</translation> </message> <message> <source>&amp;Information</source> <translation>&amp;Información</translation> </message> <message> <source>Debug window</source> <translation>Ventana de depuración</translation> </message> <message> <source>General</source> <translation>General</translation> </message> <message> <source>Using OpenSSL version</source> <translation>Utilizando la versión OpenSSL</translation> </message> <message> <source>Startup time</source> <translation>Hora de inicio</translation> </message> <message> <source>Network</source> <translation>Red</translation> </message> <message> <source>Name</source> <translation>Nombre</translation> </message> <message> <source>Number of connections</source> <translation>Número de conexiones</translation> </message> <message> <source>Block chain</source> <translation>Cadena de bloques</translation> </message> <message> <source>Current number of blocks</source> <translation>Número actual de bloques</translation> </message> <message> <source>Estimated total blocks</source> <translation>Bloques totales estimados</translation> </message> <message> <source>Last block time</source> <translation>Hora del último bloque</translation> </message> <message> <source>&amp;Open</source> <translation>&amp;Abrir</translation> </message> <message> <source>&amp;Console</source> <translation>&amp;Consola</translation> </message> <message> <source>&amp;Network Traffic</source> <translation>&amp;Tráfico de Red</translation> </message> <message> <source>&amp;Clear</source> <translation>&amp;Vaciar</translation> </message> <message> <source>Totals</source> <translation>Total:</translation> </message> <message> <source>In:</source> <translation>Entrante:</translation> </message> <message> <source>Out:</source> <translation>Saliente:</translation> </message> <message> <source>Build date</source> <translation>Fecha de compilación</translation> </message> <message> <source>Debug log file</source> <translation>Archivo de registro de depuración</translation> </message> <message> <source>Open the darkestdimecoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Abrir el archivo de registro de depuración en el directorio actual de datos. Esto puede llevar varios segundos para archivos de registro grandes.</translation> </message> <message> <source>Clear console</source> <translation>Borrar consola</translation> </message> <message> <source>Welcome to the darkestdimecoin RPC console.</source> <translation>Bienvenido a la consola RPC de darkestdimecoin</translation> </message> <message> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Use las flechas arriba y abajo para navegar por el historial y &lt;b&gt;Control+L&lt;/b&gt; para vaciar la pantalla.</translation> </message> <message> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Escriba &lt;b&gt;help&lt;/b&gt; para ver un resumen de los comandos disponibles.</translation> </message> <message> <source>%1 B</source> <translation>%1 B</translation> </message> <message> <source>%1 KB</source> <translation>%1 KB</translation> </message> <message> <source>%1 MB</source> <translation>%1 MB</translation> </message> <message> <source>%1 GB</source> <translation>%1 GB</translation> </message> <message> <source>%1 m</source> <translation>%1 m</translation> </message> <message> <source>%1 h</source> <translation>%1 h</translation> </message> <message> <source>%1 h %2 m</source> <translation>%1 h %2 m</translation> </message> </context> <context> <name>ReceiveCoinsDialog</name> <message> <source>&amp;Amount:</source> <translation>Cantidad</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;Etiqueta:</translation> </message> <message> <source>&amp;Message:</source> <translation>Mensaje:</translation> </message> <message> <source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source> <translation>Reutilizar una de las direcciones previamente usadas para recibir. Reutilizar direcciones tiene problemas de seguridad y privacidad. No lo uses a menos que antes regeneres una solicitud de pago.</translation> </message> <message> <source>R&amp;euse an existing receiving address (not recommended)</source> <translation>R&amp;eutilizar una dirección existente para recibir (no recomendado)</translation> </message> <message> <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the darkestdimecoin network.</source> <translation>Un mensaje opcional para adjuntar a la solicitud de pago, que se muestra cuando se abre la solicitud. Nota: El mensaje no se enviará con el pago por la red darkestdimecoin.</translation> </message> <message> <source>An optional label to associate with the new receiving address.</source> <translation>Etiqueta opcional para asociar con la nueva dirección de recepción.</translation> </message> <message> <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source> <translation>Utilice este formulario para solicitar pagos. Todos los campos son &lt;b&gt;opcionales&lt;/b&gt;.</translation> </message> <message> <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source> <translation>Para solicitar una cantidad opcional. Deje este vacío o cero para no solicitar una cantidad específica.</translation> </message> <message> <source>Clear all fields of the form.</source> <translation>Vaciar todos los campos del formulario.</translation> </message> <message> <source>Clear</source> <translation>Vaciar</translation> </message> <message> <source>Requested payments history</source> <translation>Historial de pagos solicitados</translation> </message> <message> <source>&amp;Request payment</source> <translation>&amp;Solicitar pago</translation> </message> <message> <source>Show the selected request (does the same as double clicking an entry)</source> <translation>Muestra la petición seleccionada (También doble clic)</translation> </message> <message> <source>Show</source> <translation>Mostrar</translation> </message> <message> <source>Remove the selected entries from the list</source> <translation>Borrar de la lista las direcciónes actualmente seleccionadas</translation> </message> <message> <source>Remove</source> <translation>Eliminar</translation> </message> <message> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <source>Copy message</source> <translation>Mensaje</translation> </message> <message> <source>Copy amount</source> <translation>Copiar cuantía</translation> </message> </context> <context> <name>ReceiveRequestDialog</name> <message> <source>QR Code</source> <translation>Código QR</translation> </message> <message> <source>Copy &amp;URI</source> <translation>Copiar &amp;URI</translation> </message> <message> <source>Copy &amp;Address</source> <translation>Copiar &amp;Dirección</translation> </message> <message> <source>&amp;Save Image...</source> <translation>Guardar Imagen...</translation> </message> <message> <source>Request payment to %1</source> <translation>Solicitar pago a %1</translation> </message> <message> <source>Payment information</source> <translation>Información de pago</translation> </message> <message> <source>URI</source> <translation>URI</translation> </message> <message> <source>Address</source> <translation>Dirección</translation> </message> <message> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <source>Message</source> <translation>Mensaje</translation> </message> <message> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>URI resultante demasiado larga. Intente reducir el texto de la etiqueta / mensaje.</translation> </message> <message> <source>Error encoding URI into QR Code.</source> <translation>Error al codificar la URI en el código QR.</translation> </message> </context> <context> <name>RecentRequestsTableModel</name> <message> <source>Date</source> <translation>Fecha</translation> </message> <message> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <source>Message</source> <translation>Mensaje</translation> </message> <message> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <source>(no label)</source> <translation>(sin etiqueta)</translation> </message> <message> <source>(no message)</source> <translation>(Ningun mensaje)</translation> </message> <message> <source>(no amount)</source> <translation>(sin cantidad)</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <source>Send Coins</source> <translation>Enviar darkestdimecoins</translation> </message> <message> <source>Coin Control Features</source> <translation>Características de Coin Control</translation> </message> <message> <source>Inputs...</source> <translation>Entradas...</translation> </message> <message> <source>automatically selected</source> <translation>Seleccionado automáticamente</translation> </message> <message> <source>Insufficient funds!</source> <translation>Fondos insuficientes!</translation> </message> <message> <source>Quantity:</source> <translation>Cantidad:</translation> </message> <message> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <source>Amount:</source> <translation>Cuantía:</translation> </message> <message> <source>Priority:</source> <translation>Prioridad:</translation> </message> <message> <source>Fee:</source> <translation>Tasa:</translation> </message> <message> <source>Low Output:</source> <translation>Envío pequeño:</translation> </message> <message> <source>After Fee:</source> <translation>Después de tasas:</translation> </message> <message> <source>Change:</source> <translation>Cambio:</translation> </message> <message> <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source> <translation>Si se marca esta opción pero la dirección de cambio está vacía o es inválida, el cambio se enviará a una nueva dirección recién generada.</translation> </message> <message> <source>Custom change address</source> <translation>Dirección propia</translation> </message> <message> <source>Send to multiple recipients at once</source> <translation>Enviar a múltiples destinatarios de una vez</translation> </message> <message> <source>Add &amp;Recipient</source> <translation>Añadir &amp;destinatario</translation> </message> <message> <source>Clear all fields of the form.</source> <translation>Vaciar todos los campos del formulario</translation> </message> <message> <source>Clear &amp;All</source> <translation>Vaciar &amp;todo</translation> </message> <message> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <source>Confirm the send action</source> <translation>Confirmar el envío</translation> </message> <message> <source>S&amp;end</source> <translation>&amp;Enviar</translation> </message> <message> <source>Confirm send coins</source> <translation>Confirmar el envío de darkestdimecoins</translation> </message> <message> <source>%1 to %2</source> <translation>%1 a %2</translation> </message> <message> <source>Copy quantity</source> <translation>Copiar cantidad</translation> </message> <message> <source>Copy amount</source> <translation>Copiar cuantía</translation> </message> <message> <source>Copy fee</source> <translation>Copiar donación</translation> </message> <message> <source>Copy after fee</source> <translation>Copiar después de aplicar donación</translation> </message> <message> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <source>Copy priority</source> <translation>Copiar prioridad</translation> </message> <message> <source>Copy low output</source> <translation>Copiar envío pequeño</translation> </message> <message> <source>Copy change</source> <translation>Copiar Cambio</translation> </message> <message> <source>Total Amount %1 (= %2)</source> <translation>Cuantía Total %1 (=%2)</translation> </message> <message> <source>or</source> <translation>o</translation> </message> <message> <source>The recipient address is not valid, please recheck.</source> <translation>La dirección de recepción no es válida, compruébela de nuevo.</translation> </message> <message> <source>The amount to pay must be larger than 0.</source> <translation>La cantidad por pagar tiene que ser mayor de 0.</translation> </message> <message> <source>The amount exceeds your balance.</source> <translation>La cantidad sobrepasa su saldo.</translation> </message> <message> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>El total sobrepasa su saldo cuando se incluye la tasa de envío de %1</translation> </message> <message> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Se ha encontrado una dirección duplicada. Solo se puede enviar a cada dirección una vez por operación de envío.</translation> </message> <message> <source>Transaction creation failed!</source> <translation>¡Ha fallado la creación de la transacción!</translation> </message> <message> <source>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>¡La transacción fue rechazada! Esto puede haber ocurrido si alguno de los darkestdimecoins de su monedero ya estaba gastado o si ha usado una copia de wallet.dat y los darkestdimecoins estaban gastados en la copia pero no se habían marcado como gastados aqui.</translation> </message> <message> <source>Warning: Invalid darkestdimecoin address</source> <translation>Alerta: Dirección de darkestdimecoin inválida</translation> </message> <message> <source>(no label)</source> <translation>(sin etiqueta)</translation> </message> <message> <source>Warning: Unknown change address</source> <translation>Alerta: Dirección de darkestdimecoin inválida</translation> </message> <message> <source>Are you sure you want to send?</source> <translation>¿Está seguro que desea enviar?</translation> </message> <message> <source>added as transaction fee</source> <translation>añadido como comisión de transacción</translation> </message> <message> <source>Payment request expired</source> <translation>Petición de pago expirada</translation> </message> <message> <source>Invalid payment address %1</source> <translation>Dirección de pago no válida %1</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <source>A&amp;mount:</source> <translation>Ca&amp;ntidad:</translation> </message> <message> <source>Pay &amp;To:</source> <translation>&amp;Pagar a:</translation> </message> <message> <source>The address to send the payment to (e.g. QfgBvXopUwn3KtDnW4HHqX2L7KD37TigXS)</source> <translation>La dirección a la que enviar el pago (p. ej. QfgBvXopUwn3KtDnW4HHqX2L7KD37TigXS)</translation> </message> <message> <source>Enter a label for this address to add it to your address book</source> <translation>Etiquete esta dirección para añadirla a la libreta</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;Etiqueta:</translation> </message> <message> <source>Choose previously used address</source> <translation>Escoger direcciones previamente usadas</translation> </message> <message> <source>This is a normal payment.</source> <translation>Esto es un pago ordinario.</translation> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Pegar dirección desde portapapeles</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Remove this entry</source> <translation>Eliminar esta transacción</translation> </message> <message> <source>Message:</source> <translation>Mensaje:</translation> </message> <message> <source>This is a verified payment request.</source> <translation>Esto es una petición de pago verificado.</translation> </message> <message> <source>Enter a label for this address to add it to the list of used addresses</source> <translation>Introduce una etiqueta para esta dirección para añadirla a la lista de direcciones utilizadas</translation> </message> <message> <source>A message that was attached to the darkestdimecoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the darkestdimecoin network.</source> <translation>Un mensaje que se adjuntó a la darkestdimecoin: URL que será almacenada con la transacción para su referencia. Nota: Este mensaje no se envía a través de la red darkestdimecoin.</translation> </message> <message> <source>This is an unverified payment request.</source> <translation>Esto es una petición de pago no verificado.</translation> </message> <message> <source>Pay To:</source> <translation>Paga a:</translation> </message> <message> <source>Memo:</source> <translation>Memo:</translation> </message> </context> <context> <name>ShutdownWindow</name> <message> <source>darkestdimecoin Core is shutting down...</source> <translation>darkestdimecoin Core se está cerrando...</translation> </message> <message> <source>Do not shut down the computer until this window disappears.</source> <translation>No apague el equipo hasta que desaparezca esta ventana.</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <source>Signatures - Sign / Verify a Message</source> <translation>Firmas - Firmar / verificar un mensaje</translation> </message> <message> <source>&amp;Sign Message</source> <translation>&amp;Firmar mensaje</translation> </message> <message> <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>Puede firmar mensajes con sus direcciones para demostrar que las posee. Tenga cuidado de no firmar cualquier cosa vaga, ya que los ataques de phishing pueden tratar de engañarle para suplantar su identidad. Firme solo declaraciones totalmente detalladas con las que usted esté de acuerdo.</translation> </message> <message> <source>The address to sign the message with (e.g. QfgBvXopUwn3KtDnW4HHqX2L7KD37TigXS)</source> <translation>La dirección con la que firmar el mensaje (ej. QfgBvXopUwn3KtDnW4HHqX2L7KD37TigXS)</translation> </message> <message> <source>Choose previously used address</source> <translation>Escoger dirección previamente usada</translation> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Pegar dirección desde portapapeles</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Enter the message you want to sign here</source> <translation>Introduzca el mensaje que desea firmar aquí</translation> </message> <message> <source>Signature</source> <translation>Firma</translation> </message> <message> <source>Copy the current signature to the system clipboard</source> <translation>Copiar la firma actual al portapapeles del sistema</translation> </message> <message> <source>Sign the message to prove you own this darkestdimecoin address</source> <translation>Firmar el mensaje para demostrar que se posee esta dirección darkestdimecoin</translation> </message> <message> <source>Sign &amp;Message</source> <translation>Firmar &amp;mensaje</translation> </message> <message> <source>Reset all sign message fields</source> <translation>Vaciar todos los campos de la firma de mensaje</translation> </message> <message> <source>Clear &amp;All</source> <translation>Vaciar &amp;todo</translation> </message> <message> <source>&amp;Verify Message</source> <translation>&amp;Verificar mensaje</translation> </message> <message> <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>Introduzca la dirección para la firma, el mensaje (asegurándose de copiar tal cual los saltos de línea, espacios, tabulaciones, etc.) y la firma a continuación para verificar el mensaje. Tenga cuidado de no asumir más información de lo que dice el propio mensaje firmado para evitar fraudes basados en ataques de tipo man-in-the-middle.</translation> </message> <message> <source>The address the message was signed with (e.g. QfgBvXopUwn3KtDnW4HHqX2L7KD37TigXS)</source> <translation>La dirección con la que se firmó el mensaje (ej. QfgBvXopUwn3KtDnW4HHqX2L7KD37TigXS)</translation> </message> <message> <source>Verify the message to ensure it was signed with the specified darkestdimecoin address</source> <translation>Verificar el mensaje para comprobar que fue firmado con la dirección darkestdimecoin indicada</translation> </message> <message> <source>Verify &amp;Message</source> <translation>Verificar &amp;mensaje</translation> </message> <message> <source>Reset all verify message fields</source> <translation>Vaciar todos los campos de la verificación de mensaje</translation> </message> <message> <source>Enter a darkestdimecoin address (e.g. QfgBvXopUwn3KtDnW4HHqX2L7KD37TigXS)</source> <translation>Introduzca una dirección darkestdimecoin (ej. QfgBvXopUwn3KtDnW4HHqX2L7KD37TigXS)</translation> </message> <message> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Haga clic en &quot;Firmar mensaje&quot; para generar la firma</translation> </message> <message> <source>The entered address is invalid.</source> <translation>La dirección introducida es inválida.</translation> </message> <message> <source>Please check the address and try again.</source> <translation>Verifique la dirección e inténtelo de nuevo.</translation> </message> <message> <source>The entered address does not refer to a key.</source> <translation>La dirección introducida no corresponde a una clave.</translation> </message> <message> <source>Wallet unlock was cancelled.</source> <translation>Se ha cancelado el desbloqueo del monedero. </translation> </message> <message> <source>Private key for the entered address is not available.</source> <translation>No se dispone de la clave privada para la dirección introducida.</translation> </message> <message> <source>Message signing failed.</source> <translation>Ha fallado la firma del mensaje.</translation> </message> <message> <source>Message signed.</source> <translation>Mensaje firmado.</translation> </message> <message> <source>The signature could not be decoded.</source> <translation>No se puede decodificar la firma.</translation> </message> <message> <source>Please check the signature and try again.</source> <translation>Compruebe la firma e inténtelo de nuevo.</translation> </message> <message> <source>The signature did not match the message digest.</source> <translation>La firma no coincide con el resumen del mensaje.</translation> </message> <message> <source>Message verification failed.</source> <translation>La verificación del mensaje ha fallado.</translation> </message> <message> <source>Message verified.</source> <translation>Mensaje verificado.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <source>darkestdimecoin Core</source> <translation>darkestdimecoin Core</translation> </message> <message> <source>The darkestdimecoin Core developers</source> <translation>Los desarrolladores de darkestdimecoin Core</translation> </message> <message> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TrafficGraphWidget</name> <message> <source>KB/s</source> <translation>KB/s</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <source>Open until %1</source> <translation>Abierto hasta %1</translation> </message> <message> <source>conflicted</source> <translation>en conflicto</translation> </message> <message> <source>%1/offline</source> <translation>%1/fuera de línea</translation> </message> <message> <source>%1/unconfirmed</source> <translation>%1/no confirmado</translation> </message> <message> <source>%1 confirmations</source> <translation>%1 confirmaciones</translation> </message> <message> <source>Status</source> <translation>Estado</translation> </message> <message numerus="yes"> <source>, broadcast through %n node(s)</source> <translation><numerusform>, transmitir a través de %n nodo</numerusform><numerusform>, transmitir a través de %n nodos</numerusform></translation> </message> <message> <source>Date</source> <translation>Fecha</translation> </message> <message> <source>Source</source> <translation>Fuente</translation> </message> <message> <source>Generated</source> <translation>Generado</translation> </message> <message> <source>From</source> <translation>De</translation> </message> <message> <source>To</source> <translation>Para</translation> </message> <message> <source>own address</source> <translation>dirección propia</translation> </message> <message> <source>label</source> <translation>etiqueta</translation> </message> <message> <source>Credit</source> <translation>Crédito</translation> </message> <message numerus="yes"> <source>matures in %n more block(s)</source> <translation><numerusform>disponible en %n bloque más</numerusform><numerusform>disponible en %n bloques más</numerusform></translation> </message> <message> <source>not accepted</source> <translation>no aceptada</translation> </message> <message> <source>Debit</source> <translation>Débito</translation> </message> <message> <source>Transaction fee</source> <translation>Comisión de transacción</translation> </message> <message> <source>Net amount</source> <translation>Cantidad neta</translation> </message> <message> <source>Message</source> <translation>Mensaje</translation> </message> <message> <source>Comment</source> <translation>Comentario</translation> </message> <message> <source>Transaction ID</source> <translation>Identificador de transacción</translation> </message> <message> <source>Merchant</source> <translation>Vendedor</translation> </message> <message> <source>Generated coins must mature %1 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>Los darkestdimecoins generados deben madurar %1 bloques antes de que puedan gastarse. Cuando generó este bloque, se transmitió a la red para que se añadiera a la cadena de bloques. Si no consigue entrar en la cadena, su estado cambiará a &quot;no aceptado&quot; y ya no se podrá gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque a pocos segundos del suyo.</translation> </message> <message> <source>Debug information</source> <translation>Información de depuración</translation> </message> <message> <source>Transaction</source> <translation>Transacción</translation> </message> <message> <source>Inputs</source> <translation>entradas</translation> </message> <message> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <source>true</source> <translation>verdadero</translation> </message> <message> <source>false</source> <translation>falso</translation> </message> <message> <source>, has not been successfully broadcast yet</source> <translation>, todavía no se ha sido difundido satisfactoriamente</translation> </message> <message numerus="yes"> <source>Open for %n more block(s)</source> <translation><numerusform>Abrir para %n bloque más</numerusform><numerusform>Abrir para %n bloques más</numerusform></translation> </message> <message> <source>unknown</source> <translation>desconocido</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <source>Transaction details</source> <translation>Detalles de transacción</translation> </message> <message> <source>This pane shows a detailed description of the transaction</source> <translation>Esta ventana muestra información detallada sobre la transacción</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <source>Date</source> <translation>Fecha</translation> </message> <message> <source>Type</source> <translation>Tipo</translation> </message> <message> <source>Address</source> <translation>Dirección</translation> </message> <message> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <source>Immature (%1 confirmations, will be available after %2)</source> <translation>No vencidos (%1 confirmaciones. Estarán disponibles al cabo de %2)</translation> </message> <message numerus="yes"> <source>Open for %n more block(s)</source> <translation><numerusform>Abrir para %n bloque más</numerusform><numerusform>Abrir para %n bloques más</numerusform></translation> </message> <message> <source>Open until %1</source> <translation>Abierto hasta %1</translation> </message> <message> <source>Confirmed (%1 confirmations)</source> <translation>Confirmado (%1 confirmaciones)</translation> </message> <message> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Este bloque no ha sido recibido por otros nodos y probablemente no sea aceptado!</translation> </message> <message> <source>Generated but not accepted</source> <translation>Generado pero no aceptado</translation> </message> <message> <source>Offline</source> <translation>Sin conexión</translation> </message> <message> <source>Unconfirmed</source> <translation>Sin confirmar</translation> </message> <message> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation>Confirmando (%1 de %2 confirmaciones recomendadas)</translation> </message> <message> <source>Conflicted</source> <translation>En conflicto</translation> </message> <message> <source>Received with</source> <translation>Recibido con</translation> </message> <message> <source>Received from</source> <translation>Recibidos de</translation> </message> <message> <source>Sent to</source> <translation>Enviado a</translation> </message> <message> <source>Payment to yourself</source> <translation>Pago propio</translation> </message> <message> <source>Mined</source> <translation>Minado</translation> </message> <message> <source>(n/a)</source> <translation>(nd)</translation> </message> <message> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Estado de transacción. Pasa el ratón sobre este campo para ver el número de confirmaciones.</translation> </message> <message> <source>Date and time that the transaction was received.</source> <translation>Fecha y hora en que se recibió la transacción.</translation> </message> <message> <source>Type of transaction.</source> <translation>Tipo de transacción.</translation> </message> <message> <source>Destination address of transaction.</source> <translation>Dirección de destino de la transacción.</translation> </message> <message> <source>Amount removed from or added to balance.</source> <translation>Cantidad retirada o añadida al saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <source>All</source> <translation>Todo</translation> </message> <message> <source>Today</source> <translation>Hoy</translation> </message> <message> <source>This week</source> <translation>Esta semana</translation> </message> <message> <source>This month</source> <translation>Este mes</translation> </message> <message> <source>Last month</source> <translation>Mes pasado</translation> </message> <message> <source>This year</source> <translation>Este año</translation> </message> <message> <source>Range...</source> <translation>Rango...</translation> </message> <message> <source>Received with</source> <translation>Recibido con</translation> </message> <message> <source>Sent to</source> <translation>Enviado a</translation> </message> <message> <source>To yourself</source> <translation>A usted mismo</translation> </message> <message> <source>Mined</source> <translation>Minado</translation> </message> <message> <source>Other</source> <translation>Otra</translation> </message> <message> <source>Enter address or label to search</source> <translation>Introduzca una dirección o etiqueta que buscar</translation> </message> <message> <source>Min amount</source> <translation>Cantidad mínima</translation> </message> <message> <source>Copy address</source> <translation>Copiar dirección</translation> </message> <message> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <source>Copy amount</source> <translation>Copiar cuantía</translation> </message> <message> <source>Copy transaction ID</source> <translation>Copiar identificador de transacción</translation> </message> <message> <source>Edit label</source> <translation>Editar etiqueta</translation> </message> <message> <source>Show transaction details</source> <translation>Mostrar detalles de la transacción</translation> </message> <message> <source>Export Transaction History</source> <translation>Exportar historial de transacciones</translation> </message> <message> <source>Exporting Failed</source> <translation>Error exportando</translation> </message> <message> <source>There was an error trying to save the transaction history to %1.</source> <translation>Ha habido un error al intentar guardar la transacción con %1.</translation> </message> <message> <source>Exporting Successful</source> <translation>Exportación finalizada</translation> </message> <message> <source>The transaction history was successfully saved to %1.</source> <translation>La transacción ha sido guardada en %1.</translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>Archivos de columnas separadas por coma (*.csv)</translation> </message> <message> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <source>Date</source> <translation>Fecha</translation> </message> <message> <source>Type</source> <translation>Tipo</translation> </message> <message> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <source>Address</source> <translation>Dirección</translation> </message> <message> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <source>ID</source> <translation>ID</translation> </message> <message> <source>Range:</source> <translation>Rango:</translation> </message> <message> <source>to</source> <translation>para</translation> </message> </context> <context> <name>WalletFrame</name> <message> <source>No wallet has been loaded.</source> <translation>No se ha cargado ningún monedero</translation> </message> </context> <context> <name>WalletModel</name> <message> <source>Send Coins</source> <translation>Enviar darkestdimecoins</translation> </message> </context> <context> <name>WalletView</name> <message> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>Exportar a un archivo los datos de esta pestaña</translation> </message> <message> <source>Backup Wallet</source> <translation>Copia de seguridad del monedero</translation> </message> <message> <source>Wallet Data (*.dat)</source> <translation>Datos de monedero (*.dat)</translation> </message> <message> <source>Backup Failed</source> <translation>Ha fallado el respaldo</translation> </message> <message> <source>There was an error trying to save the wallet data to %1.</source> <translation>Ha habido un error al intentar guardar los datos del monedero en %1.</translation> </message> <message> <source>The wallet data was successfully saved to %1.</source> <translation>Los datos del monedero se han guardado con éxito en %1.</translation> </message> <message> <source>Backup Successful</source> <translation>Se ha completado la copia de seguridad del monedero</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <source>Usage:</source> <translation>Uso:</translation> </message> <message> <source>List commands</source> <translation>Muestra comandos </translation> </message> <message> <source>Get help for a command</source> <translation>Recibir ayuda para un comando </translation> </message> <message> <source>Options:</source> <translation>Opciones: </translation> </message> <message> <source>Specify configuration file (default: darkestdimecoin.conf)</source> <translation>Especificar archivo de configuración (predeterminado: darkestdimecoin.conf) </translation> </message> <message> <source>Specify pid file (default: darkestdimecoind.pid)</source> <translation>Especificar archivo pid (predeterminado: darkestdimecoin.pid) </translation> </message> <message> <source>Specify data directory</source> <translation>Especificar directorio para los datos</translation> </message> <message> <source>Listen for connections on &lt;port&gt; (default: 8333 or testnet: 18333)</source> <translation>Escuchar conexiones en &lt;puerto&gt; (predeterminado: 8333 o testnet: 18333)</translation> </message> <message> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Mantener como máximo &lt;n&gt; conexiones a pares (predeterminado: 125)</translation> </message> <message> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Conectar a un nodo para obtener direcciones de pares y desconectar</translation> </message> <message> <source>Specify your own public address</source> <translation>Especifique su propia dirección pública</translation> </message> <message> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Umbral para la desconexión de pares con mal comportamiento (predeterminado: 100)</translation> </message> <message> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: 86400)</translation> </message> <message> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Ha ocurrido un error al configurar el puerto RPC %u para escucha en IPv4: %s</translation> </message> <message> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 8332 or testnet: 18332)</source> <translation>Escuchar conexiones JSON-RPC en &lt;puerto&gt; (predeterminado: 8332 o testnet:18332)</translation> </message> <message> <source>Accept command line and JSON-RPC commands</source> <translation>Aceptar comandos consola y JSON-RPC </translation> </message> <message> <source>darkestdimecoin Core RPC client version</source> <translation>Versión del cliente RPC de darkestdimecoin Core RPC</translation> </message> <message> <source>Run in the background as a daemon and accept commands</source> <translation>Ejecutar en segundo plano como daemon y aceptar comandos </translation> </message> <message> <source>Use the test network</source> <translation>Usar la red de pruebas </translation> </message> <message> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Aceptar conexiones desde el exterior (predeterminado: 1 si no -proxy o -connect)</translation> </message> <message> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=darkestdimecoinrpc 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;darkestdimecoin Alert&quot; admin@foo.com </source> <translation>%s, debe establecer un valor rpcpassword en el archivo de configuración: %s Se recomienda utilizar la siguiente contraseña aleatoria: rpcuser=darkestdimecoinrpc rpcpassword=%s (no es necesario recordar esta contraseña) El nombre de usuario y la contraseña DEBEN NO ser iguales. Si el archivo no existe, créelo con permisos de archivo de solo lectura. Se recomienda también establecer alertnotify para recibir notificaciones de problemas. Por ejemplo: alertnotify=echo %%s | mail -s &quot;darkestdimecoin Alert&quot; admin@foo.com </translation> </message> <message> <source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source> <translation>Cifrados aceptables (predeterminados: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</translation> </message> <message> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Ha ocurrido un error al configurar el puerto RPC %u para escuchar mediante IPv6. Recurriendo a IPv4: %s</translation> </message> <message> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Vincular a la dirección dada y escuchar siempre en ella. Utilice la notación [host]:port para IPv6</translation> </message> <message> <source>Continuously rate-limit free transactions to &lt;n&gt;*1000 bytes per minute (default:15)</source> <translation>Limitar continuamente las transacciones gratuitas a &lt;n&gt;*1000 bytes por minuto (predeterminado:15)</translation> </message> <message> <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>Iniciar modo de prueba de regresión, el cuál utiliza una cadena especial en la cual los bloques pueden ser resueltos instantáneamente. Se utiliza para herramientas de prueba de regresión y desarrollo de aplicaciones.</translation> </message> <message> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly.</source> <translation>Ingresar en el modo de prueba de regresión, que utiliza una cadena especial en la que los bloques se pueden resolver instantáneamente.</translation> </message> <message> <source>Error: Listening for incoming connections failed (listen returned error %d)</source> <translation>Error: Ha fallado la escucha de conexiones entrantes (listen ha devuelto el error %d)</translation> </message> <message> <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>¡Error: se ha rechazado la transacción! Esto puede ocurrir si ya se han gastado algunos de los darkestdimecoins del monedero, como ocurriría si hubiera hecho una copia de wallet.dat y se hubieran gastado darkestdimecoins a partir de la copia, con lo que no se habrían marcado aquí como gastados.</translation> </message> <message> <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>¡Error: Esta transacción requiere una comisión de al menos %s debido a su cantidad, complejidad, o al uso de fondos recién recibidos!</translation> </message> <message> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Ejecutar comando cuando una transacción del monedero cambia (%s en cmd se remplazará por TxID)</translation> </message> <message> <source>Fees smaller than this are considered zero fee (for transaction creation) (default:</source> <translation>Las comisiones inferiores se consideran comisión cero (a efectos de creación de transacciones) (predeterminado:</translation> </message> <message> <source>Flush database activity from memory pool to disk log every &lt;n&gt; megabytes (default: 100)</source> <translation>Volcar la actividad de la base de datos de memoria al registro en disco cada &lt;n&gt; megabytes (predeterminado: 100)</translation> </message> <message> <source>How thorough the block verification of -checkblocks is (0-4, default: 3)</source> <translation>Nivel de rigor en la verificación de bloques de -checkblocks (0-4; predeterminado: 3)</translation> </message> <message> <source>In this mode -genproclimit controls how many blocks are generated immediately.</source> <translation>En este modo -genproclimit controla cuántos bloques se generan de inmediato.</translation> </message> <message> <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source> <translation>Establecer el número de hilos (threads) de verificación de scripts (entre %u y %d, 0 = automático, &lt;0 = dejar libres ese número de núcleos; predeterminado: %d)</translation> </message> <message> <source>Set the processor limit for when generation is on (-1 = unlimited, default: -1)</source> <translation>Establecer el límite de procesadores cuando está activada la generación (-1 = sin límite; predeterminado: -1)</translation> </message> <message> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Esta es una versión de pre-prueba - utilícela bajo su propio riesgo. No la utilice para usos comerciales o de minería.</translation> </message> <message> <source>Unable to bind to %s on this computer. darkestdimecoin Core is probably already running.</source> <translation>No se ha podido acceder a %s en esta máquina. Probablemente ya se está ejecutando darkestdimecoin Core.</translation> </message> <message> <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)</source> <translation>Usar proxy SOCKS5 distinto para comunicarse vía Tor de forma anónima (Predeterminado: -proxy)</translation> </message> <message> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Aviso: ¡-paytxfee tiene un valor muy alto! Esta es la comisión que pagará si envía una transacción.</translation> </message> <message> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong darkestdimecoin will not work properly.</source> <translation>Precaución: Por favor, ¡revise que la fecha y hora de su ordenador son correctas! Si su reloj está mal, darkestdimecoin no funcionará correctamente.</translation> </message> <message> <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source> <translation>Atención: ¡Parece que la red no está totalmente de acuerdo! Algunos mineros están presentando inconvenientes.</translation> </message> <message> <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>Atención: ¡Parece que no estamos completamente de acuerdo con nuestros pares! Podría necesitar una actualización, u otros nodos podrían necesitarla.</translation> </message> <message> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Aviso: ¡Error al leer wallet.dat! Todas las claves se han leído correctamente, pero podrían faltar o ser incorrectos los datos de transacciones o las entradas de la libreta de direcciones.</translation> </message> <message> <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>Aviso: ¡Recuperados datos de wallet.dat corrupto! El wallet.dat original se ha guardado como wallet.{timestamp}.bak en %s; si hubiera errores en su saldo o transacciones, deberá restaurar una copia de seguridad.</translation> </message> <message> <source>(default: 1)</source> <translation>(predeterminado: 1)</translation> </message> <message> <source>(default: wallet.dat)</source> <translation>(predeterminado: wallet.dat)</translation> </message> <message> <source>&lt;category&gt; can be:</source> <translation>&lt;category&gt; puede ser:</translation> </message> <message> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Intento de recuperar claves privadas de un wallet.dat corrupto</translation> </message> <message> <source>darkestdimecoin Core Daemon</source> <translation>darkestdimecoin Core Daemon (proceso independiente)</translation> </message> <message> <source>Block creation options:</source> <translation>Opciones de creación de bloques:</translation> </message> <message> <source>Clear list of wallet transactions (diagnostic tool; implies -rescan)</source> <translation>Vaciar lista de transacciones del monedero (herramienta de diagnóstico; implica -rescan)</translation> </message> <message> <source>Connect only to the specified node(s)</source> <translation>Conectar sólo a los nodos (o nodo) especificados</translation> </message> <message> <source>Connect through SOCKS proxy</source> <translation>Conectar a través de un proxy SOCKS</translation> </message> <message> <source>Connect to JSON-RPC on &lt;port&gt; (default: 8332 or testnet: 18332)</source> <translation>Conectar a JSON-RPC en &lt;puerto&gt; (predeterminado: 8332 o testnet: 18332)</translation> </message> <message> <source>Connection options:</source> <translation>Opciones de conexión:</translation> </message> <message> <source>Corrupted block database detected</source> <translation>Corrupción de base de datos de bloques detectada.</translation> </message> <message> <source>Debugging/Testing options:</source> <translation>Opciones de depuración/pruebas:</translation> </message> <message> <source>Disable safemode, override a real safe mode event (default: 0)</source> <translation>Inhabilitar el modo seguro, no considerar un suceso real de modo seguro (predeterminado: 0)</translation> </message> <message> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Descubrir dirección IP propia (predeterminado: 1 al escuchar sin -externalip)</translation> </message> <message> <source>Do not load the wallet and disable wallet RPC calls</source> <translation>No cargar el monedero y desactivar las llamadas RPC del monedero</translation> </message> <message> <source>Do you want to rebuild the block database now?</source> <translation>¿Quieres reconstruir la base de datos de bloques ahora?</translation> </message> <message> <source>Error initializing block database</source> <translation>Error al inicializar la base de datos de bloques</translation> </message> <message> <source>Error initializing wallet database environment %s!</source> <translation>Error al inicializar el entorno de la base de datos del monedero %s</translation> </message> <message> <source>Error loading block database</source> <translation>Error cargando base de datos de bloques</translation> </message> <message> <source>Error opening block database</source> <translation>Error al abrir base de datos de bloques.</translation> </message> <message> <source>Error: Disk space is low!</source> <translation>Error: ¡Espacio en disco bajo!</translation> </message> <message> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Error: ¡El monedero está bloqueado; no se puede crear la transacción!</translation> </message> <message> <source>Error: system error: </source> <translation>Error: error de sistema: </translation> </message> <message> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Ha fallado la escucha en todos los puertos. Use -listen=0 si desea esto.</translation> </message> <message> <source>Failed to read block info</source> <translation>No se ha podido leer la información de bloque</translation> </message> <message> <source>Failed to read block</source> <translation>No se ha podido leer el bloque</translation> </message> <message> <source>Failed to sync block index</source> <translation>No se ha podido sincronizar el índice de bloques</translation> </message> <message> <source>Failed to write block index</source> <translation>No se ha podido escribir en el índice de bloques</translation> </message> <message> <source>Failed to write block info</source> <translation>No se ha podido escribir la información de bloques</translation> </message> <message> <source>Failed to write block</source> <translation>No se ha podido escribir el bloque</translation> </message> <message> <source>Failed to write file info</source> <translation>No se ha podido escribir la información de archivo</translation> </message> <message> <source>Failed to write to coin database</source> <translation>No se ha podido escribir en la base de datos de darkestdimecoins</translation> </message> <message> <source>Failed to write transaction index</source> <translation>No se ha podido escribir en el índice de transacciones</translation> </message> <message> <source>Failed to write undo data</source> <translation>No se han podido escribir los datos de deshacer</translation> </message> <message> <source>Fee per kB to add to transactions you send</source> <translation>Donación por KB añadida a las transacciones que envíe</translation> </message> <message> <source>Fees smaller than this are considered zero fee (for relaying) (default:</source> <translation>Las comisiones inferiores se consideran comisión cero (a efectos de propagación) (predeterminado:</translation> </message> <message> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Encontrar pares mediante búsqueda de DNS (predeterminado: 1 salvo con -connect)</translation> </message> <message> <source>Force safe mode (default: 0)</source> <translation>Forzar modo seguro (predeterminado: 0)</translation> </message> <message> <source>Generate coins (default: 0)</source> <translation>Generar darkestdimecoins (predeterminado: 0)</translation> </message> <message> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Cuántos bloques comprobar al iniciar (predeterminado: 288, 0 = todos)</translation> </message> <message> <source>If &lt;category&gt; is not supplied, output all debugging information.</source> <translation>Si no se proporciona &lt;category&gt;, mostrar toda la depuración</translation> </message> <message> <source>Importing...</source> <translation>Importando...</translation> </message> <message> <source>Incorrect or no genesis block found. Wrong datadir for network?</source> <translation>Incorrecto o bloque de génesis no encontrado. Datadir equivocada para la red?</translation> </message> <message> <source>Invalid -onion address: &apos;%s&apos;</source> <translation>Dirección -onion inválida: &apos;%s&apos;</translation> </message> <message> <source>Not enough file descriptors available.</source> <translation>No hay suficientes descriptores de archivo disponibles. </translation> </message> <message> <source>Prepend debug output with timestamp (default: 1)</source> <translation>Anteponer marca temporal a la información de depuración (predeterminado: 1)</translation> </message> <message> <source>RPC client options:</source> <translation>Opciones para cliente RPC:</translation> </message> <message> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Reconstruir el índice de la cadena de bloques a partir de los archivos blk000??.dat actuales</translation> </message> <message> <source>Select SOCKS version for -proxy (4 or 5, default: 5)</source> <translation>Seleccionar versión de SOCKS para -proxy (4 o 5, predeterminado: 5)</translation> </message> <message> <source>Set database cache size in megabytes (%d to %d, default: %d)</source> <translation>Asignar tamaño de cache en megabytes (entre %d y %d; predeterminado: %d)</translation> </message> <message> <source>Set maximum block size in bytes (default: %d)</source> <translation>Establecer tamaño máximo de bloque en bytes (predeterminado: %d)</translation> </message> <message> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Establecer el número de procesos para atender las llamadas RPC (predeterminado: 4)</translation> </message> <message> <source>Specify wallet file (within data directory)</source> <translation>Especificar archivo de monedero (dentro del directorio de datos)</translation> </message> <message> <source>Spend unconfirmed change when sending transactions (default: 1)</source> <translation>Gastar cambio no confirmado al enviar transacciones (predeterminado: 1)</translation> </message> <message> <source>This is intended for regression testing tools and app development.</source> <translation>Esto afecta a las herramientas de prueba de regresión y al desarrollo informático de la aplicación.</translation> </message> <message> <source>Usage (deprecated, use darkestdimecoin-cli):</source> <translation>Uso (desaconsejado, usar darkestdimecoin-cli)</translation> </message> <message> <source>Verifying blocks...</source> <translation>Verificando bloques...</translation> </message> <message> <source>Verifying wallet...</source> <translation>Verificando monedero...</translation> </message> <message> <source>Wait for RPC server to start</source> <translation>Espere a que se inicie el servidor RPC</translation> </message> <message> <source>Wallet %s resides outside data directory %s</source> <translation>El monedero %s se encuentra fuera del directorio de datos %s</translation> </message> <message> <source>Wallet options:</source> <translation>Opciones de monedero:</translation> </message> <message> <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> <translation>Aviso: Argumento -debugnet anticuado, utilice -debug=net</translation> </message> <message> <source>You need to rebuild the database using -reindex to change -txindex</source> <translation>Usted necesita reconstruir la base de datos utilizando -reindex para cambiar -txindex</translation> </message> <message> <source>Imports blocks from external blk000??.dat file</source> <translation>Importa los bloques desde un archivo blk000??.dat externo</translation> </message> <message> <source>Cannot obtain a lock on data directory %s. darkestdimecoin Core is probably already running.</source> <translation>No se ha podido bloquear el directorio de datos %s. Probablemente ya se está ejecutando darkestdimecoin Core.</translation> </message> <message> <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source> <translation>Ejecutar un comando cuando se reciba una alerta importante o cuando veamos un fork demasiado largo (%s en cmd se reemplazará por el mensaje)</translation> </message> <message> <source>Output debugging information (default: 0, supplying &lt;category&gt; is optional)</source> <translation>Mostrar información de depuración (predeterminado: 0, proporcionar &lt;category&gt; es opcional)</translation> </message> <message> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: %d)</source> <translation>Establecer tamaño máximo de las transacciones de alta prioridad/baja comisión en bytes (predeterminado: %d)</translation> </message> <message> <source>Information</source> <translation>Información</translation> </message> <message> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Cantidad inválida para -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Cantidad inválida para -mintxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <source>Limit size of signature cache to &lt;n&gt; entries (default: 50000)</source> <translation>Limitar tamaño de la cache de firmas a &lt;n&gt; entradas (predeterminado: 50000)</translation> </message> <message> <source>Log transaction priority and fee per kB when mining blocks (default: 0)</source> <translation>Registrar en el log la prioridad de transacciones y la comisión por kB al minar bloques (predeterminado: 0)</translation> </message> <message> <source>Maintain a full transaction index (default: 0)</source> <translation>Mantener índice de transacciones completo (predeterminado: 0)</translation> </message> <message> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Búfer de recepción máximo por conexión, &lt;n&gt;*1000 bytes (predeterminado: 5000)</translation> </message> <message> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Búfer de recepción máximo por conexión, , &lt;n&gt;*1000 bytes (predeterminado: 1000)</translation> </message> <message> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Aceptar solamente cadena de bloques que concuerde con los puntos de control internos (predeterminado: 1)</translation> </message> <message> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Conectarse solo a nodos de la red &lt;net&gt; (IPv4, IPv6 o Tor)</translation> </message> <message> <source>Print block on startup, if found in block index</source> <translation>Imprimir bloque al iniciar, si se encuentra en el índice de bloques</translation> </message> <message> <source>Print block tree on startup (default: 0)</source> <translation>Imprimir árbol de bloques al iniciar (predeterminado: 0)</translation> </message> <message> <source>RPC SSL options: (see the darkestdimecoin Wiki for SSL setup instructions)</source> <translation>Opciones SSL de RPC: (véase la wiki de darkestdimecoin para las instrucciones de instalación de SSL)</translation> </message> <message> <source>RPC server options:</source> <translation>Opciones de servidor RPC:</translation> </message> <message> <source>Randomly drop 1 of every &lt;n&gt; network messages</source> <translation>Ignorar 1 de cada &lt;n&gt; mensajes de red al azar</translation> </message> <message> <source>Randomly fuzz 1 of every &lt;n&gt; network messages</source> <translation>Introducir datos fuzz en 1 de cada &lt;n&gt; mensajes de red al azar</translation> </message> <message> <source>Run a thread to flush wallet periodically (default: 1)</source> <translation>Ejecutar un hilo (thread) para limpiar de la memoria el monedero periódicamente (predeterminado: 1)</translation> </message> <message> <source>SSL options: (see the darkestdimecoin Wiki for SSL setup instructions)</source> <translation>Opciones SSL: (ver la darkestdimecoin Wiki para instrucciones de configuración SSL)</translation> </message> <message> <source>Send command to darkestdimecoin Core</source> <translation>Enviar orden a darkestdimecoin Core</translation> </message> <message> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log</translation> </message> <message> <source>Set minimum block size in bytes (default: 0)</source> <translation>Establecer tamaño mínimo de bloque en bytes (predeterminado: 0)</translation> </message> <message> <source>Sets the DB_PRIVATE flag in the wallet db environment (default: 1)</source> <translation>Establece la opción DB_PRIVATE en el entorno de base de datos del monedero (predeterminado: 1)</translation> </message> <message> <source>Show all debugging options (usage: --help -help-debug)</source> <translation>Muestra todas las opciones de depuración (uso: --help -help-debug)</translation> </message> <message> <source>Show benchmark information (default: 0)</source> <translation>Mostrar información de benchmarking (predeterminado: 0)</translation> </message> <message> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug)</translation> </message> <message> <source>Signing transaction failed</source> <translation>Transacción falló</translation> </message> <message> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Especificar el tiempo máximo de conexión en milisegundos (predeterminado: 5000)</translation> </message> <message> <source>Start darkestdimecoin Core Daemon</source> <translation>Iniciar darkestdimecoin Core Daemon</translation> </message> <message> <source>System error: </source> <translation>Error de sistema: </translation> </message> <message> <source>Transaction amount too small</source> <translation>Cantidad de la transacción demasiado pequeña</translation> </message> <message> <source>Transaction amounts must be positive</source> <translation>Las cantidades en las transacciones deben ser positivas</translation> </message> <message> <source>Transaction too large</source> <translation>Transacción demasiado grande</translation> </message> <message> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Usar UPnP para asignar el puerto de escucha (predeterminado: 0)</translation> </message> <message> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Usar UPnP para asignar el puerto de escucha (predeterminado: 1 al escuchar)</translation> </message> <message> <source>Username for JSON-RPC connections</source> <translation>Nombre de usuario para las conexiones JSON-RPC </translation> </message> <message> <source>Warning</source> <translation>Aviso</translation> </message> <message> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Aviso: Esta versión es obsoleta, actualización necesaria!</translation> </message> <message> <source>Zapping all transactions from wallet...</source> <translation>Eliminando todas las transacciones del monedero...</translation> </message> <message> <source>on startup</source> <translation>al iniciar</translation> </message> <message> <source>version</source> <translation>versión</translation> </message> <message> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrupto. Ha fallado la recuperación.</translation> </message> <message> <source>Password for JSON-RPC connections</source> <translation>Contraseña para las conexiones JSON-RPC </translation> </message> <message> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Permitir conexiones JSON-RPC desde la dirección IP especificada </translation> </message> <message> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Enviar comando al nodo situado en &lt;ip&gt; (predeterminado: 127.0.0.1) </translation> </message> <message> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Ejecutar un comando cuando cambia el mejor bloque (%s en cmd se sustituye por el hash de bloque)</translation> </message> <message> <source>Upgrade wallet to latest format</source> <translation>Actualizar el monedero al último formato</translation> </message> <message> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Ajustar el número de claves en reserva &lt;n&gt; (predeterminado: 100) </translation> </message> <message> <source>Rescan the block chain for missing wallet transactions</source> <translation>Volver a examinar la cadena de bloques en busca de transacciones del monedero perdidas</translation> </message> <message> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Usar OpenSSL (https) para las conexiones JSON-RPC </translation> </message> <message> <source>Server certificate file (default: server.cert)</source> <translation>Certificado del servidor (predeterminado: server.cert) </translation> </message> <message> <source>Server private key (default: server.pem)</source> <translation>Clave privada del servidor (predeterminado: server.pem) </translation> </message> <message> <source>This help message</source> <translation>Este mensaje de ayuda </translation> </message> <message> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>No es posible conectar con %s en este sistema (bind ha dado el error %d, %s)</translation> </message> <message> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitir búsquedas DNS para -addnode, -seednode y -connect</translation> </message> <message> <source>Loading addresses...</source> <translation>Cargando direcciones...</translation> </message> <message> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Error al cargar wallet.dat: el monedero está dañado</translation> </message> <message> <source>Error loading wallet.dat: Wallet requires newer version of darkestdimecoin</source> <translation>Error al cargar wallet.dat: El monedero requiere una versión más reciente de darkestdimecoin</translation> </message> <message> <source>Wallet needed to be rewritten: restart darkestdimecoin to complete</source> <translation>El monedero ha necesitado ser reescrito. Reinicie darkestdimecoin para completar el proceso</translation> </message> <message> <source>Error loading wallet.dat</source> <translation>Error al cargar wallet.dat</translation> </message> <message> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Dirección -proxy inválida: &apos;%s&apos;</translation> </message> <message> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>La red especificada en -onlynet &apos;%s&apos; es desconocida</translation> </message> <message> <source>Unknown -socks proxy version requested: %i</source> <translation>Solicitada versión de proxy -socks desconocida: %i</translation> </message> <message> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>No se puede resolver la dirección de -bind: &apos;%s&apos;</translation> </message> <message> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>No se puede resolver la dirección de -externalip: &apos;%s&apos;</translation> </message> <message> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Cantidad inválida para -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <source>Invalid amount</source> <translation>Cuantía no válida</translation> </message> <message> <source>Insufficient funds</source> <translation>Fondos insuficientes</translation> </message> <message> <source>Loading block index...</source> <translation>Cargando el índice de bloques...</translation> </message> <message> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Añadir un nodo al que conectarse y tratar de mantener la conexión abierta</translation> </message> <message> <source>Loading wallet...</source> <translation>Cargando monedero...</translation> </message> <message> <source>Cannot downgrade wallet</source> <translation>No se puede rebajar el monedero</translation> </message> <message> <source>Cannot write default address</source> <translation>No se puede escribir la dirección predeterminada</translation> </message> <message> <source>Rescanning...</source> <translation>Reexplorando...</translation> </message> <message> <source>Done loading</source> <translation>Generado pero no aceptado</translation> </message> <message> <source>To use the %s option</source> <translation>Para utilizar la opción %s</translation> </message> <message> <source>Error</source> <translation>Error</translation> </message> <message> <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>Tiene que establecer rpcpassword=&lt;contraseña&gt; en el fichero de configuración: ⏎ %s ⏎ Si el archivo no existe, créelo con permiso de lectura solamente del propietario.</translation> </message> </context> </TS>
mit
wahajashfaq/keryana
application/views/admin/add_side_banners.php
9110
<?php include('admin_header.php'); ?> <body> <div id="wrapper"> <?php include('admin_navbar.php') ?> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> Side Banners </div> <!-- /.panel-heading --> <div class="panel-body"> <!-- Nav tabs --> <ul class="nav nav-tabs"> <li class="active"><a href="#profile" data-toggle="tab">Banner One</a> </li> <li><a href="#messages" data-toggle="tab">Banner Two</a> </li> </ul> <!-- Tab panes --> <div class="tab-content"> <div class="tab-pane fade in active" id="profile"> <div class="col-lg-12"> <div class="panel"> <!-- /.panel-heading --> <div class="panel-body"> <center> <form id="upload_form" enctype="multipart/form-data" method="post" action="<?php echo base_url('admin/resources/Sliders/banner_one') ?> "> <fieldset> <?php if($message = $this->session->flashdata('message')): ?> <div class="alert alert-success"> <strong>Added Successfuly!</strong> <?php echo $message;?> </div> <?php endif; ?> <?php if(isset($error)) echo "<div class='alert alert-danger'>$error</div>"; ?> <div class="form-group"> <div class="upload_form_cont"> <div> <div><label for="image_file">Please select image file</label></div> <div><input type="file" name="image_file" id="image_file1" onchange="fileSelected(1);" /></div> </div> <img id="preview1" class="img-thumbnail" src="<?php echo base_url('uploads/banners/banner_one.jpg') ?> " /> <div id="progress_info"> <div id="progress"></div> <div id="progress_percent">&nbsp;</div> <div class="clear_both"></div> <input type="text" name="url" class="form-control" placeholder="Banner URL"> <input type="submit" name="btn_submit" class="btn btn-success" value="Upload"> </div> </div> </fieldset> </form> </center> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> </div> <div class="tab-pane fade" id="messages"> <div class="col-lg-12"> <div class="panel"> <!-- /.panel-heading --> <div class="panel-body"> <center> <form id="upload_form" enctype="multipart/form-data" method="post" action="<?php echo base_url('admin/resources/Sliders/banner_two') ?> "> <fieldset> <?php if($message = $this->session->flashdata('message')): ?> <div class="alert alert-success"> <strong>Added Successfuly!</strong> <?php echo $message;?> </div> <?php endif; ?> <?php if(isset($error)) echo "<div class='alert alert-danger'>$error</div>"; ?> <div class="form-group"> <div class="upload_form_cont"> <div> <div><label for="image_file">Please select image file</label></div> <div><input type="file" name="image_file" id="image_file2" onchange="fileSelected(2);" /></div> </div> <img id="preview2" class="img-thumbnail" src="<?php echo base_url('uploads/banners/banner_two.jpg') ?> " /> <div id="progress_info"> <div id="progress"></div> <div id="progress_percent">&nbsp;</div> <div class="clear_both"></div> <input type="text" name="url" class="form-control" placeholder="Banner URL"> <input type="submit" name="btn_submit" class="btn btn-success" value="Upload"> </div> </div> </fieldset> </form> </center> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> </div> </div> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-6 --> </div> </div> <script type="text/javascript"> // File uploading // common variables var iBytesUploaded = 0; var iBytesTotal = 0; var iPreviousBytesLoaded = 0; var iMaxFilesize = 2048576; // 5MB var oTimer = 0; var sResultFileSize = ''; function secondsToTime(secs) { // we will use this function to convert seconds in normal time format var hr = Math.floor(secs / 3600); var min = Math.floor((secs - (hr * 3600))/60); var sec = Math.floor(secs - (hr * 3600) - (min * 60)); if (hr < 10) {hr = "0" + hr; } if (min < 10) {min = "0" + min;} if (sec < 10) {sec = "0" + sec;} if (hr) {hr = "00";} return hr + ':' + min + ':' + sec; }; function bytesToSize(bytes) { var sizes = ['Bytes', 'KB', 'MB']; if (bytes == 0) return 'n/a'; var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))); return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i]; }; function fileSelected(id) { $preview = ''; $image_file ='' if(id==1){ $preview = 'preview1'; $image_file = 'image_file1'; } else if(id==2){ $preview = 'preview2'; $image_file = 'image_file2'; } var oFile = document.getElementById($image_file).files[0]; // filter for image files var rFilter = /^(image\/bmp|image\/gif|image\/jpeg|image\/png|image\/tiff)$/i; if (! rFilter.test(oFile.type)) { document.getElementById('error').style.display = 'block'; var oImage = document.getElementById($preview); oImage.removeAttribute("src"); return; } // little test for filesize if (oFile.size > iMaxFilesize) { document.getElementById('warnsize').style.display = 'block'; var oImage = document.getElementById($preview ); oImage.removeAttribute("src"); return; } // get preview element var oImage = document.getElementById($preview ); // prepare HTML5 FileReader var oReader = new FileReader(); oReader.onload = function(e){ // e.target.result contains the DataURL which we will use as a source of the image oImage.src = e.target.result; oImage.onload = function () { // binding onload event // we are going to display some custom image information here /* sResultFileSize = bytesToSize(oFile.size); document.getElementById('fileinfo').style.display = 'block'; document.getElementById('filename').innerHTML = 'Name: ' + oFile.name; document.getElementById('filesize').innerHTML = 'Size: ' + sResultFileSize; document.getElementById('filetype').innerHTML = 'Type: ' + oFile.type; document.getElementById('filedim').innerHTML = 'Dimension: ' + oImage.naturalWidth + ' x ' + oImage.naturalHeight;*/ }; }; // read selected file as DataURL oReader.readAsDataURL(oFile); } function uploadError(e) { // upload error document.getElementById('error2').style.display = 'block'; clearInterval(oTimer); } function uploadAbort(e) { // upload abort document.getElementById('abort').style.display = 'block'; clearInterval(oTimer); } </script> </div> <!-- /#page-wrapper --> </div> <!-- /#wrapper --> <?php include('admin_footer.php'); ?>
mit
fvovan/CM
library/CM/Service/Manager.php
8498
<?php class CM_Service_Manager extends CM_Class_Abstract { /** @var array */ private $_serviceConfigList = array(); /** @var array */ private $_serviceInstanceList = array(); /** @var CM_Service_Manager */ protected static $instance; /** * @param string $serviceName * @return bool */ public function has($serviceName) { $hasConfig = array_key_exists($serviceName, $this->_serviceConfigList); $hasInstance = array_key_exists($serviceName, $this->_serviceInstanceList); return $hasConfig || $hasInstance; } /** * @param string $serviceName * @param string|null $assertInstanceOf * @throws CM_Exception_Invalid * @return mixed */ public function get($serviceName, $assertInstanceOf = null) { if (!array_key_exists($serviceName, $this->_serviceInstanceList)) { $this->_serviceInstanceList[$serviceName] = $this->_instantiateService($serviceName); } $service = $this->_serviceInstanceList[$serviceName]; if (null !== $assertInstanceOf && !is_a($service, $assertInstanceOf, true)) { throw new CM_Exception_Invalid('Service `' . $serviceName . '` is a `' . get_class($service) . '`, but not `' . $assertInstanceOf . '`.'); } return $service; } /** * @param string $serviceName * @param string $className * @param array|null $arguments * @param string|null $methodName * @param array|null $methodArguments * @throws CM_Exception_Invalid */ public function register($serviceName, $className, array $arguments = null, $methodName = null, array $methodArguments = null) { $config = array( 'class' => $className, 'arguments' => $arguments, ); if (null !== $methodName) { $config['method'] = array( 'name' => $methodName, 'arguments' => $methodArguments ); } $this->registerWithArray($serviceName, $config); } /** * @param string $serviceName * @param array $config * @throws CM_Exception_Invalid */ public function registerWithArray($serviceName, array $config) { if ($this->has($serviceName)) { throw new CM_Exception_Invalid('Service `' . $serviceName . '` already registered.'); } $class = (string) $config['class']; $arguments = array(); if (isset($config['arguments'])) { $arguments = (array) $config['arguments']; } $method = null; if (isset($config['method'])) { $methodName = (string) $config['method']['name']; $methodArguments = array(); if (isset($config['method']['arguments'])) { $methodArguments = (array) $config['method']['arguments']; } $method = array('name' => $methodName, 'arguments' => $methodArguments); } $this->_serviceConfigList[$serviceName] = array( 'class' => $class, 'arguments' => $arguments, 'method' => $method, ); } /** * @param string $serviceName * @param mixed $instance * @throws CM_Exception_Invalid */ public function registerInstance($serviceName, $instance) { if ($this->has($serviceName)) { throw new CM_Exception_Invalid('Service `' . $serviceName . '` already registered.'); } $serviceName = (string) $serviceName; if ($instance instanceof CM_Service_ManagerAwareInterface) { $instance->setServiceManager($this); } $this->_serviceInstanceList[$serviceName] = $instance; } public function resetServiceInstances() { $this->_serviceInstanceList = []; } /** * @param string $serviceName */ public function unregister($serviceName) { unset($this->_serviceConfigList[$serviceName]); unset($this->_serviceInstanceList[$serviceName]); } /** * Methods in format get[serviceName] returns a instance of a service with given name. * * @param string $name * @param mixed $parameters * @return mixed * @throws CM_Exception_Invalid */ public function __call($name, $parameters) { if (preg_match('/get(.+)/', $name, $matches)) { $serviceName = $matches[1]; return $this->get($serviceName); } throw new CM_Exception_Invalid('Cannot extract service name from `' . $name . '`.'); } /** * @return CM_Service_Databases */ public function getDatabases() { return $this->get('databases', 'CM_Service_Databases'); } /** * @param string|null $serviceName * @return CM_MongoDb_Client */ public function getMongoDb($serviceName = null) { if (null === $serviceName) { $serviceName = 'MongoDb'; } return $this->get($serviceName, 'CM_MongoDb_Client'); } /** * @return CM_Options * @throws CM_Exception_Invalid */ public function getOptions() { return $this->get('options', 'CM_Options'); } /** * @return CM_Service_Filesystems */ public function getFilesystems() { return $this->get('filesystems', 'CM_Service_Filesystems'); } /** * @return CM_Debug */ public function getDebug() { return $this->get('debug' ,'CM_Debug'); } /** * @return CM_Service_Trackings */ public function getTrackings() { return $this->get('trackings', 'CM_Service_Trackings'); } /** * @return CM_Service_UserContent */ public function getUserContent() { return $this->get('usercontent', 'CM_Service_UserContent'); } /** * @return CM_Memcache_Client */ public function getMemcache() { return $this->get('memcache', 'CM_Memcache_Client'); } /** * @return CM_Redis_Client */ public function getRedis() { return $this->get('redis', 'CM_Redis_Client'); } /** * @return CM_Elasticsearch_Cluster */ public function getElasticsearch() { return $this->get('elasticsearch', 'CM_Elasticsearch_Cluster'); } /** * @return CMService_Newrelic */ public function getNewrelic() { return $this->get('newrelic', 'CMService_Newrelic'); } /** * @param string $serviceName * @throws CM_Exception_Invalid * @return mixed */ protected function _instantiateService($serviceName) { if (!array_key_exists($serviceName, $this->_serviceConfigList)) { throw new CM_Exception_Invalid("Service {$serviceName} has no config."); } $config = $this->_serviceConfigList[$serviceName]; $reflection = new ReflectionClass($config['class']); $arguments = $config['arguments']; if ($constructor = $reflection->getConstructor()) { $arguments = $this->_matchNamedArgs($serviceName, $constructor, $arguments); } $instance = $reflection->newInstanceArgs($arguments); if (null !== $config['method']) { $method = $reflection->getMethod($config['method']['name']); $methodArguments = $this->_matchNamedArgs($serviceName, $method, $config['method']['arguments']); $instance = $method->invokeArgs($instance, $methodArguments); } if ($instance instanceof CM_Service_ManagerAwareInterface) { $instance->setServiceManager($this); } return $instance; } /** * @param string $serviceName * @param ReflectionMethod $method * @param array $arguments * @throws CM_Exception_Invalid * @return array */ protected function _matchNamedArgs($serviceName, ReflectionMethod $method, array $arguments) { $namedArgs = new CM_Util_NamedArgs(); try { return $namedArgs->matchNamedArgs($method, $arguments); } catch (CM_Exception_Invalid $e) { throw new CM_Exception_Invalid("Cannot match arguments for `{$serviceName}`: {$e->getMessage()}"); } } /** * @return CM_Service_Manager */ public static function getInstance() { if (null === self::$instance) { self::$instance = new self(); } return self::$instance; } }
mit
sealTLV/SmsAuthService
complete/src/main/java/com/digi/config/app/RandomKeyConfig.java
401
package com.digi.config.app; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; @Configuration @ConfigurationProperties(prefix = "app.random") @Data public class RandomKeyConfig { private Integer size; private Integer partitionSize; private String delimiter; private Boolean withLetters; }
mit
mhevery/angular
packages/common/locales/global/vai-Latn.js
1582
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // THIS CODE IS GENERATED - DO NOT MODIFY // See angular/tools/gulp-tasks/cldr/extract.js (function(global) { global.ng = global.ng || {}; global.ng.common = global.ng.common || {}; global.ng.common.locales = global.ng.common.locales || {}; const u = undefined; function plural(n) { return 5; } root.ng.common.locales['vai-latn'] = [ 'vai-Latn', [['AM', 'PM'], u, u], u, [ ['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], u, u ], u, [ ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'], [ 'luukao kemã', 'ɓandaɓu', 'vɔɔ', 'fulu', 'goo', '6', '7', 'kɔnde', 'saah', 'galo', 'kenpkato ɓololɔ', 'luukao lɔma' ], u ], u, [['BCE', 'CE'], u, u], 1, [6, 0], ['dd/MM/y', 'd MMM y', 'd MMMM y', 'EEEE, d MMMM y'], ['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'], ['{1} {0}', u, u, u], ['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'], ['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'], '$', 'Laibhiya Dala', {'JPY': ['JP¥', '¥'], 'LRD': ['$'], 'USD': ['US$', '$']}, plural, [] ]; })(typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global || typeof window !== 'undefined' && window);
mit
abricos/abricos-mod-payments
src/js/model.js
1122
var Component = new Brick.Component(); Component.requires = { mod: [ {name: 'sys', files: ['appModel.js']} ] }; Component.entryPoint = function(NS){ var Y = Brick.YUI, SYS = Brick.mod.sys; NS.Request = Y.Base.create('request', SYS.AppModel, [], { structureName: 'Request' }); NS.RequestList = Y.Base.create('requestList', SYS.AppModelList, [], { appItem: NS.Request }); NS.Order = Y.Base.create('order', SYS.AppModel, [], { structureName: 'Order' }); NS.Form = Y.Base.create('Form', SYS.AppModel, [], { structureName: 'Form', use: function(component, callback, context){ var module = this.get('engineModule'); Brick.use(module, component, callback, context); } }); NS.ConfigOwner = Y.Base.create('configOwner', SYS.AppModel, [], { structureName: 'ConfigOwner' }); NS.Config = Y.Base.create('config', SYS.AppModel, [], { structureName: 'Config' }); NS.Config = Y.Base.create('config', SYS.AppModel, [], { structureName: 'Config' }); };
mit
ASxa86/AGE
src/math/GLM.cpp
226
#include <azule/math/GLM.h> void glm::to_json(nlohmann::json& j, const glm::vec2& x) { j["x"] = x.x; j["y"] = x.y; } void glm::from_json(const nlohmann::json& j, glm::vec2& x) { j["x"].get_to(x.x); j["y"].get_to(x.y); }
mit
deadbok/ann-flappy-bird-pygame
genetic.py
968
''' @since: 14/08/2015 @author: oblivion ''' import pickle class FloatGenome(object): ''' Genome created of floats. ''' def __init__(self, genome, fitness, name="Joshua"): ''' Create a genome from an array. :param size: Size ''' self.genome = genome self.fitness = fitness self.name = name if len(self.name) > 200: self.name = self.name[-50:-1] def save(self, filename): ''' Save the genome to a file. ''' with open(filename, 'wb') as genome_file: pickle.dump(self, genome_file, -1) def load(self, filename): ''' Load a genome from a file. ''' temp = None with open(filename, "rb") as genome_file: temp = pickle.load(genome_file) if temp is not None: self.genome = temp.genome self.fitness = temp.fitness self.name = "lo"
mit
Kubinyete/phpgallery
templates/perfil.php
1619
<main> <article> <section> <div class="perfil-container <?php if ($itens["usr_usuario"]->estaOnline()): echo " perfil-container-online"; endif; ?>" style="background-image: url('<?= $itens["usr_usuario"]->getImagemFundoUrl(); ?>');"> <div class="overlay"> <?php if ($itens["usr_logado"] !== null && $itens["usr_logado"]->getNome() === $itens["usr_usuario"]->getNome()): ?> <a class="edit-btn" href="<?= $itens['href_editar_perfil']; ?>">Editar perfil</a> <?php endif; ?> <h1 class="usuario-nome"><?= $itens["usr_usuario"]->getNome(); ?></h1> </div> <div class="imagem-perfil-container"> <?php if ($itens["usr_usuario"]->getAdmin()): ?> <img class="admin-icon" draggable="false" src="<?= $itens["recursos"]; ?>admin-icon.png"> <?php endif; ?> <img class="imagem-perfil" src="<?= $itens["usr_usuario"]->getImagemUrl(); ?>" alt="A imagem de perfil do usuário" draggable="false"> <p class="status-perfil"><?= ($itens["usr_usuario"]->estaOnline()) ? "Online" : "Offline"; ?></p> </div> <div class="overlay"> <p class="descricao"><?= $itens["usr_usuario"]->getDescricao(true); ?></p> <p class="descricao"><?php echo ($itens["usr_usuario"]->getAdmin()) ? "Administrador" : "Usuário"; ?> - <?= $itens["usr_usuario"]->getRep(); ?> REP</p> </div> </div> </section> <section> <h1>Imagens enviadas</h1> <p>Estas são as ultimas imagens adicionadas por <?= $itens["usr_usuario"]->getNome(); ?></p> <?php ( file_exists($itens["proc_imagens_lista"]) ) ? : include $itens["proc_imagens_lista"]; ?> </section> </article> </main>
mit
jamf/AppConfigSpecCreator
assets/js/views/modal/errors.js
1343
//views/modal/errors define([ "jquery", "underscore", "backbone", "bootstrap", "helper/pubsub", "text!templates/modal/errors.html" ], function ($, _, Backbone, Bootstrap, PubSub, ErrorsModalTemplate) { return Backbone.View.extend({ template: _.template(ErrorsModalTemplate), initialize: function () { this.render(); $("#errorsModal").modal("show"); } , render: function () { this.$el.html(this.template({model: this.model})); this.$el.appendTo("#modalsDiv"); } , events: { "click #errorsDownload": "saveHandler", "click #errorsClose": "cancelHandler", } , saveHandler: function () { var filename = "specfile.xml"; var pom = document.createElement('a'); var bb = new Blob([this.model.xml], {type: 'text/plain'}); pom.setAttribute('href', window.URL.createObjectURL(bb)); pom.setAttribute('download', filename); pom.dataset.downloadurl = ['text/plain', pom.download, pom.href].join(':'); pom.draggable = true; pom.classList.add('dragout'); var event = new MouseEvent('click'); pom.dispatchEvent(event); this.dismissModal(); } , cancelHandler: function () { this.dismissModal(); } , dismissModal: function () { $("#errorsModal").modal('hide'); this.$el.on("hidden.bs.modal", function () { PubSub.trigger("deleteView", this); }); } }); });
mit
tzurbaev/laravel-forge-api
src/Recipes/Commands/RecipeCommand.php
478
<?php namespace Laravel\Forge\Recipes\Commands; use Laravel\Forge\Recipes\Recipe; use Laravel\Forge\Commands\ResourceCommand; abstract class RecipeCommand extends ResourceCommand { /** * Resource path. * * @return string */ public function resourcePath() { return 'recipes'; } /** * Resource class name. * * @return string */ public function resourceClass() { return Recipe::class; } }
mit
AndriusBil/material-ui
docs/src/pages/demos/stepper/TextMobileStepper.js
2081
/* eslint-disable flowtype/require-valid-file-annotation */ import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from 'material-ui/styles'; import MobileStepper from 'material-ui/MobileStepper'; import Paper from 'material-ui/Paper'; import Typography from 'material-ui/Typography'; import Button from 'material-ui/Button'; import KeyboardArrowLeft from 'material-ui-icons/KeyboardArrowLeft'; import KeyboardArrowRight from 'material-ui-icons/KeyboardArrowRight'; const styles = theme => ({ root: { maxWidth: 400, flexGrow: 1, }, header: { display: 'flex', alignItems: 'center', height: 50, paddingLeft: theme.spacing.unit * 4, marginBottom: 20, background: theme.palette.background.default, }, }); class TextMobileStepper extends React.Component { state = { activeStep: 0, }; handleNext = () => { this.setState({ activeStep: this.state.activeStep + 1, }); }; handleBack = () => { this.setState({ activeStep: this.state.activeStep - 1, }); }; render() { const classes = this.props.classes; return ( <div className={classes.root}> <Paper square elevation={0} className={classes.header}> <Typography>Step {this.state.activeStep + 1} of 6</Typography> </Paper> <MobileStepper type="text" steps={6} position="static" activeStep={this.state.activeStep} className={classes.mobileStepper} nextButton={ <Button dense onClick={this.handleNext} disabled={this.state.activeStep === 5}> Next <KeyboardArrowRight /> </Button> } backButton={ <Button dense onClick={this.handleBack} disabled={this.state.activeStep === 0}> <KeyboardArrowLeft /> Back </Button> } /> </div> ); } } TextMobileStepper.propTypes = { classes: PropTypes.object.isRequired, }; export default withStyles(styles)(TextMobileStepper);
mit
hoppjs/hopp
packages/hopp/src/utils/fn.js
566
/** * @file src/utils/fn.js * @license MIT * @copyright 2017 10244872 Canada Inc. */ /** * Makes async functions deterministic. */ export default fn => { const cache = Object.create(null) return process.env.RECACHE === 'true' ? fn : async function () { const last = arguments[arguments.length - 1] let val = cache for (let i = 0, a = arguments[0]; i < arguments.length - 1; i += 1, a = arguments[i]) { val = val[a] = val[a] || Object.create(null) } return val[last] = (val[last] || await fn.apply(this, [...arguments])) } }
mit
fengzhike/acm_engine
apps/login/webapi.js
287
/** * webapi.js 封装app所需的所有web请求 * 供app测试使用,app加入网站后webpai应该由网站通过config,提供给每个app */ import { fetch } from 'mk-utils' export default { user: { login: (option) => fetch.post('/v1/user/login', option) } }
mit
dfernandezm/tv-crawler-scala
src/main/scala/com/morenware/tvcrawler/HelloActor.scala
1734
package com.morenware.tvcrawler import akka.actor.{Actor, ActorSystem, Props} import net.ruippeixotog.scalascraper.browser.JsoupBrowser import net.ruippeixotog.scalascraper.dsl.DSL._ import net.ruippeixotog.scalascraper.dsl.DSL.Extract._ import net.ruippeixotog.scalascraper.dsl.DSL.Parse._ import net.ruippeixotog.scalascraper.model.{ElementQuery, Element} import org.jsoup.Connection case class BaseLink(link: String) class HelloActor extends Actor { def receive = { case "hello" => println("hello back at you") case _ => println("huh?") } } class PageLoader extends Actor { def receive = { case BaseLink(link) => { println("Received link " + link) val browser = JsoupBrowser() val doc = browser.get(link) // Extract the text inside the first h1 element val title: String = doc >> text("h1") println("Title " + title) // Extract the elements with class "item" //val items: List[Element] = doc >> elementList(".item") // From each item, extract the text of the h3 element inside //val itemTitles: List[String] = items.map(_ >> text("h3")) // From the meta element with "viewport" as its attribute name, extract the // text in the content attribute //val viewport: String = doc >> attr("content")("meta[name=viewport]") } } } //object Main extends App { // val system = ActorSystem("HelloSystem") // // default Actor constructor // val helloActor = system.actorOf(Props[HelloActor], name = "helloactor") // helloActor ! "hello" // helloActor ! "buenos dias" // // val pageLoader = system.actorOf(Props[PageLoader], name = "pageLoader") // // pageLoader ! BaseLink("http://www.divxtotal.com/series/") //}
mit
caktoy/penjadwalan_karyawan
application/views/index.php
10125
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta charset="utf-8" /> <title>Penjadwalan Teknisi - <?php echo $judul; ?></title> <meta name="description" content="overview &amp; stats" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <!-- bootstrap & fontawesome --> <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap.min.css" /> <link rel="stylesheet" href="<?php echo base_url(); ?>assets/font-awesome/4.2.0/css/font-awesome.min.css" /> <!-- page specific plugin styles --> <!-- text fonts --> <link rel="stylesheet" href="<?php echo base_url(); ?>assets/fonts/fonts.googleapis.com.css" /> <!-- ace styles --> <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" /> <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/fullcalendar.min.css" /> <!--[if lte IE 9]> <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/ace-part2.min.css" class="ace-main-stylesheet" /> <![endif]--> <!--[if lte IE 9]> <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/ace-ie.min.css" /> <![endif]--> <!-- inline styles related to this page --> <!-- ace settings handler --> <script src="<?php echo base_url(); ?>assets/js/ace-extra.min.js"></script> <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries --> <!--[if lte IE 8]> <script src="<?php echo base_url(); ?>assets/js/html5shiv.min.js"></script> <script src="<?php echo base_url(); ?>assets/js/respond.min.js"></script> <![endif]--> <!--[if !IE]> --> <script src="<?php echo base_url(); ?>assets/js/jquery.2.1.1.min.js"></script> <!-- <![endif]--> <!--[if IE]> <script src="<?php echo base_url(); ?>assets/js/jquery.1.11.1.min.js"></script> <![endif]--> <!--[if !IE]> --> <script type="text/javascript"> window.jQuery || document.write("<script src='<?php echo base_url(); ?>assets/js/jquery.min.js'>"+"<"+"/script>"); </script> <!-- <![endif]--> <!--[if IE]> <script type="text/javascript"> window.jQuery || document.write("<script src='<?php echo base_url(); ?>assets/js/jquery1x.min.js'>"+"<"+"/script>"); </script> <![endif]--> <script type="text/javascript"> if('ontouchstart' in document.documentElement) document.write("<script src='<?php echo base_url(); ?>assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>"); </script> </head> <body class="no-skin"> <div id="navbar" class="navbar navbar-default"> <script type="text/javascript"> try{ace.settings.check('navbar' , 'fixed')}catch(e){} </script> <div class="navbar-container" id="navbar-container"> <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar"> <span class="sr-only">Toggle sidebar</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <div class="navbar-header pull-left"> <a href="<?php echo base_url(); ?>" class="navbar-brand"> <small> <i class="fa fa-users"></i> Penjadwalan Teknisi </small> </a> </div> </div><!-- /.navbar-container --> </div> <div class="main-container" id="main-container"> <script type="text/javascript"> try{ace.settings.check('main-container' , 'fixed')}catch(e){} </script> <?php $this->load->view('sidebar'); ?> <div class="main-content"> <div class="main-content-inner"> <div class="breadcrumbs" id="breadcrumbs"> <script type="text/javascript"> try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){} </script> <ul class="breadcrumb"> <?php foreach ($menu as $item) { ?> <li class=""><?php echo $item; ?></li> <?php } ?> </ul><!-- /.breadcrumb --> </div> <div class="page-content"> <?php $this->load->view($konten); ?> </div><!-- /.page-content --> </div> </div><!-- /.main-content --> <div class="footer"> <div class="footer-inner"> <div class="footer-content"> <span class="bigger-120"> <span class="blue bolder">Penjadwalan Teknisi</span> &copy; 2016 </span> </div> </div> </div> <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i> </a> </div><!-- /.main-container --> <!-- basic scripts --> <script src="<?php echo base_url(); ?>assets/js/bootstrap.min.js"></script> <!-- page specific plugin scripts --> <!--[if lte IE 8]> <script src="<?php echo base_url(); ?>assets/js/excanvas.min.js"></script> <![endif]--> <script src="<?php echo base_url().'assets/js/jquery-ui.custom.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/jquery.ui.touch-punch.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/jquery.easypiechart.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/jquery.sparkline.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/jquery.flot.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/jquery.flot.pie.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/jquery.flot.resize.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/chosen.jquery.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/fuelux.spinner.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/bootstrap-datepicker.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/bootstrap-timepicker.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/moment.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/fullcalendar.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/daterangepicker.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/bootstrap-datetimepicker.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/bootstrap-colorpicker.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/jquery.knob.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/jquery.autosize.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/jquery.inputlimiter.1.3.1.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/jquery.maskedinput.min.js'; ?>"></script> <script src="<?php echo base_url().'assets/js/bootstrap-tag.min.js'; ?>"></script> <script src="<?php echo base_url(); ?>assets/js/jquery.dataTables.min.js"></script> <script src="<?php echo base_url(); ?>assets/js/jquery.dataTables.bootstrap.min.js"></script> <script src="<?php echo base_url(); ?>assets/js/dataTables.tableTools.min.js"></script> <script src="<?php echo base_url(); ?>assets/js/dataTables.colVis.min.js"></script> <script src="<?php echo base_url(); ?>assets/js/bootbox.min.js"></script> <!-- ace scripts --> <script src="<?php echo base_url(); ?>assets/js/ace-elements.min.js"></script> <script src="<?php echo base_url(); ?>assets/js/ace.min.js"></script> <!-- inline scripts related to this page --> <script type="text/javascript"> $(document).ready(function() { //initiate dataTables plugin var oTable1 = $('#dynamic-table') .wrap("<div class='dataTables_borderWrap' />") //if you are applying horizontal scrolling (sScrollX) .dataTable( { bAutoWidth: false, // "aoColumns": [ // { "bSortable": false }, // null, null,null, null, null, // { "bSortable": false } // ], // "aaSorting": [], //, "sScrollY": "350px", //"bPaginate": false, //"sScrollX": "100%", //"sScrollXInner": "120%", //"bScrollCollapse": true, //Note: if you are applying horizontal scrolling (sScrollX) on a ".table-bordered" //you may want to wrap the table inside a "div.dataTables_borderWrap" element //"iDisplayLength": 50, "language": { "lengthMenu": "Menampilkan _MENU_ data per halaman", "zeroRecords": "Maaf, tidak ada data yang ditampilkan.", "info": "Halaman _PAGE_ dari _PAGES_", "infoEmpty": "Tidak ada data yang tersedia", "search": "Cari:", "decimal": ",", "thousands": ".", "paginate": { "previous": "<", "next": ">", "first": "<<", "last": ">>" }, "infoFiltered": "(Penyaringan dari _MAX_ total data)" } }); // oTable1.fnAdjustColumnSizing(); // date-picker plugin $('.date-picker').datepicker({ autoclose: true, todayHighlight: true }) //show datepicker when clicking on the icon .next().on(ace.click_event, function(){ $(this).prev().focus(); }); }); </script> </body> </html>
mit
junxianyong/fluffy-parakeet
hello-world.php
143
<?php $this_array = ['I am test 1', 'This is test 2', 'That is test 3']; foreach($this_array as $fruit) { echo '<p>' . $fruit . '</p>'; }
mit
uditalias/swamp-dashboard
app/scripts/iostream/app.js
2715
'use strict'; $(function() { var $stream = $('.io-container pre'); var $filesList = $('.aside-content ul'); var $selectedFile = $('.selected-file'); var $themeSwitch = $('.theme-switch'); var THEME_COOKIE_NAME = 'iostreamtheme'; function _onStreamerData(data) { $stream.text($stream.text() + data); } function _onFileListItemClick(fileName, event) { $filesList.find('li').removeClass('selected'); $(this).addClass('selected'); $selectedFile.hide(); $selectedFile.find('span').text(fileName); $selectedFile.show(); _poll(fileName); } function _onFilesListResponse(data) { $filesList.find('li').off('click'); $filesList.empty(); data = data.data; var aTime, bTime; data = data.sort(function(a, b) { if(a.mtime && b.mtime) { aTime = new Date(a.mtime).getTime(); bTime = new Date(b.mtime).getTime(); if(aTime > bTime) { return -1; } else if (aTime < bTime) { return 1; } else { return 0; } } else { return 0; } }).map(function(stat) { return stat && stat.filename || ''; }); aTime = null; bTime = null; _.forEach(data, function(file) { var $item = $('<li />'); $item.text(file); $item.on('click', _onFileListItemClick.bind($item, file)); $item.appendTo($filesList); }); } function _clearScreen() { $stream.text(''); } function _poll(fileName) { _clearScreen(); streamerService.poll(fileName); } function _touchThemeSwitch(setCookie) { if($('html').hasClass('light')) { $themeSwitch.find('span').text('ON'); setCookie && $.cookie(THEME_COOKIE_NAME, 1, { expires: 365, path: '/' }); } else { $themeSwitch.find('span').text('OFF'); setCookie && $.cookie(THEME_COOKIE_NAME, 0, { expires: 365, path: '/' }); } } function _initialize() { _touchThemeSwitch(false); $themeSwitch.on('click', function() { $('html').toggleClass('light'); _touchThemeSwitch(true); }); var _theme = $.cookie(THEME_COOKIE_NAME); if(_theme && parseInt(_theme) == 1) { $themeSwitch.trigger('click'); } streamerService.initialize(window.serviceId, window.ioType, _onStreamerData); streamerService.getSTDFilesList(_onFilesListResponse); _poll(); } _initialize(); });
mit
vnglst/converter
partials/sharedhead.php
544
<meta charset="utf-8"> <link rel="stylesheet" href="css/app.css" /> <link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,900,400italic|Droid+Serif:400,700,400italic" media="screen" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" /> <!-- Disable livereload when in production --> <script> // document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':3005/livereload.js?snipver=1"></' + 'script>') </script>
mit
ringwraith/Marxcoin-master
src/checkpoints.cpp
6030
// Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <boost/assign/list_of.hpp> // for 'map_list_of()' #include <boost/foreach.hpp> #include "checkpoints.h" #include "main.h" #include "uint256.h" namespace Checkpoints { typedef std::map<int, uint256> MapCheckpoints; // How many times we expect transactions after the last checkpoint to // be slower. This number is a compromise, as it can't be accurate for // every system. When reindexing from a fast disk with a slow CPU, it // can be up to 20, while when downloading from a slow network with a // fast multicore CPU, it won't be much higher than 1. static const double fSigcheckVerificationFactor = 5.0; struct CCheckpointData { const MapCheckpoints *mapCheckpoints; int64 nTimeLastCheckpoint; int64 nTransactionsLastCheckpoint; double fTransactionsPerDay; }; // What makes a good checkpoint block? // + Is surrounded by blocks with reasonable timestamps // (no blocks before with a timestamp after, none after with // timestamp before) // + Contains no strange transactions static MapCheckpoints mapCheckpoints = boost::assign::map_list_of ( 0, hashGenesisBlock) /* ( 11111, uint256("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")) ( 33333, uint256("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6")) ( 74000, uint256("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")) (105000, uint256("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")) (134444, uint256("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe")) (168000, uint256("0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763")) (193000, uint256("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")) (210000, uint256("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")) (216116, uint256("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")) (225430, uint256("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")) (250000, uint256("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214"))*/ ; static const CCheckpointData data = { &mapCheckpoints, 1375533383, // * UNIX timestamp of last checkpoint block 21491097, // * total number of transactions between genesis and last checkpoint // (the tx=... number in the SetBestChain debug.log lines) 60000.0 // * estimated number of transactions per day after checkpoint }; static MapCheckpoints mapCheckpointsTestnet = boost::assign::map_list_of ( 546, uint256("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")) ; static const CCheckpointData dataTestnet = { &mapCheckpointsTestnet, 1338180505, 16341, 300 }; const CCheckpointData &Checkpoints() { if (fTestNet) return dataTestnet; else return data; } bool CheckBlock(int nHeight, const uint256& hash) { if (!GetBoolArg("-checkpoints", true)) return true; const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; MapCheckpoints::const_iterator i = checkpoints.find(nHeight); if (i == checkpoints.end()) return true; return hash == i->second; } // Guess how far we are in the verification process at the given block index double GuessVerificationProgress(CBlockIndex *pindex) { if (pindex==NULL) return 0.0; int64 nNow = time(NULL); double fWorkBefore = 0.0; // Amount of work done before pindex double fWorkAfter = 0.0; // Amount of work left after pindex (estimated) // Work is defined as: 1.0 per transaction before the last checkoint, and // fSigcheckVerificationFactor per transaction after. const CCheckpointData &data = Checkpoints(); if (pindex->nChainTx <= data.nTransactionsLastCheckpoint) { double nCheapBefore = pindex->nChainTx; double nCheapAfter = data.nTransactionsLastCheckpoint - pindex->nChainTx; double nExpensiveAfter = (nNow - data.nTimeLastCheckpoint)/86400.0*data.fTransactionsPerDay; fWorkBefore = nCheapBefore; fWorkAfter = nCheapAfter + nExpensiveAfter*fSigcheckVerificationFactor; } else { double nCheapBefore = data.nTransactionsLastCheckpoint; double nExpensiveBefore = pindex->nChainTx - data.nTransactionsLastCheckpoint; double nExpensiveAfter = (nNow - pindex->nTime)/86400.0*data.fTransactionsPerDay; fWorkBefore = nCheapBefore + nExpensiveBefore*fSigcheckVerificationFactor; fWorkAfter = nExpensiveAfter*fSigcheckVerificationFactor; } return fWorkBefore / (fWorkBefore + fWorkAfter); } int GetTotalBlocksEstimate() { if (!GetBoolArg("-checkpoints", true)) return 0; const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; return checkpoints.rbegin()->first; } CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex) { if (!GetBoolArg("-checkpoints", true)) return NULL; const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints) { const uint256& hash = i.second; std::map<uint256, CBlockIndex*>::const_iterator t = mapBlockIndex.find(hash); if (t != mapBlockIndex.end()) return t->second; } return NULL; } }
mit
pataquets/namecoin-core
test/functional/interface_bitcoin_cli.py
14116
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitcoin-cli""" from decimal import Decimal from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, assert_raises_process_error, assert_raises_rpc_error, get_auth_cookie, ) # The block reward of coinbaseoutput.nValue (50) BTC/block matures after # COINBASE_MATURITY (100) blocks. Therefore, after mining 101 blocks we expect # node 0 to have a balance of (BLOCKS - COINBASE_MATURITY) * 50 BTC/block. BLOCKS = 101 BALANCE = (BLOCKS - 100) * 50 JSON_PARSING_ERROR = 'error: Error parsing JSON: foo' BLOCKS_VALUE_OF_ZERO = 'error: the first argument (number of blocks to generate, default: 1) must be an integer value greater than zero' TOO_MANY_ARGS = 'error: too many arguments (maximum 2 for nblocks and maxtries)' WALLET_NOT_LOADED = 'Requested wallet does not exist or is not loaded' WALLET_NOT_SPECIFIED = 'Wallet file not specified' class TestBitcoinCli(BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 1 def skip_test_if_missing_module(self): self.skip_if_no_cli() def run_test(self): """Main test logic""" self.nodes[0].generate(BLOCKS) self.log.info("Compare responses from getblockchaininfo RPC and `bitcoin-cli getblockchaininfo`") cli_response = self.nodes[0].cli.getblockchaininfo() rpc_response = self.nodes[0].getblockchaininfo() assert_equal(cli_response, rpc_response) user, password = get_auth_cookie(self.nodes[0].datadir, self.chain) self.log.info("Test -stdinrpcpass option") assert_equal(BLOCKS, self.nodes[0].cli('-rpcuser={}'.format(user), '-stdinrpcpass', input=password).getblockcount()) assert_raises_process_error(1, 'Incorrect rpcuser or rpcpassword', self.nodes[0].cli('-rpcuser={}'.format(user), '-stdinrpcpass', input='foo').echo) self.log.info("Test -stdin and -stdinrpcpass") assert_equal(['foo', 'bar'], self.nodes[0].cli('-rpcuser={}'.format(user), '-stdin', '-stdinrpcpass', input=password + '\nfoo\nbar').echo()) assert_raises_process_error(1, 'Incorrect rpcuser or rpcpassword', self.nodes[0].cli('-rpcuser={}'.format(user), '-stdin', '-stdinrpcpass', input='foo').echo) self.log.info("Test connecting to a non-existing server") assert_raises_process_error(1, "Could not connect to the server", self.nodes[0].cli('-rpcport=1').echo) self.log.info("Test connecting with non-existing RPC cookie file") assert_raises_process_error(1, "Could not locate RPC credentials", self.nodes[0].cli('-rpccookiefile=does-not-exist', '-rpcpassword=').echo) self.log.info("Test -getinfo with arguments fails") assert_raises_process_error(1, "-getinfo takes no arguments", self.nodes[0].cli('-getinfo').help) self.log.info("Test -getinfo returns expected network and blockchain info") if self.is_wallet_compiled(): self.nodes[0].encryptwallet(password) cli_get_info = self.nodes[0].cli('-getinfo').send_cli() network_info = self.nodes[0].getnetworkinfo() blockchain_info = self.nodes[0].getblockchaininfo() assert_equal(cli_get_info['version'], network_info['version']) assert_equal(cli_get_info['blocks'], blockchain_info['blocks']) assert_equal(cli_get_info['headers'], blockchain_info['headers']) assert_equal(cli_get_info['timeoffset'], network_info['timeoffset']) assert_equal( cli_get_info['connections'], { 'in': network_info['connections_in'], 'out': network_info['connections_out'], 'total': network_info['connections'] } ) assert_equal(cli_get_info['proxy'], network_info['networks'][0]['proxy']) assert_equal(cli_get_info['difficulty'], blockchain_info['difficulty']) assert_equal(cli_get_info['chain'], blockchain_info['chain']) if self.is_wallet_compiled(): self.log.info("Test -getinfo and bitcoin-cli getwalletinfo return expected wallet info") assert_equal(cli_get_info['balance'], BALANCE) assert 'balances' not in cli_get_info.keys() wallet_info = self.nodes[0].getwalletinfo() assert_equal(cli_get_info['keypoolsize'], wallet_info['keypoolsize']) assert_equal(cli_get_info['unlocked_until'], wallet_info['unlocked_until']) assert_equal(cli_get_info['paytxfee'], wallet_info['paytxfee']) assert_equal(cli_get_info['relayfee'], network_info['relayfee']) assert_equal(self.nodes[0].cli.getwalletinfo(), wallet_info) # Setup to test -getinfo, -generate, and -rpcwallet= with multiple wallets. wallets = [self.default_wallet_name, 'Encrypted', 'secret'] amounts = [BALANCE + Decimal('9.99991'), Decimal(9), Decimal(31)] self.nodes[0].createwallet(wallet_name=wallets[1]) self.nodes[0].createwallet(wallet_name=wallets[2]) w1 = self.nodes[0].get_wallet_rpc(wallets[0]) w2 = self.nodes[0].get_wallet_rpc(wallets[1]) w3 = self.nodes[0].get_wallet_rpc(wallets[2]) rpcwallet2 = '-rpcwallet={}'.format(wallets[1]) rpcwallet3 = '-rpcwallet={}'.format(wallets[2]) w1.walletpassphrase(password, self.rpc_timeout) w2.encryptwallet(password) w1.sendtoaddress(w2.getnewaddress(), amounts[1]) w1.sendtoaddress(w3.getnewaddress(), amounts[2]) # Mine a block to confirm; adds a block reward (50 BTC) to the default wallet. self.nodes[0].generate(1) self.log.info("Test -getinfo with multiple wallets and -rpcwallet returns specified wallet balance") for i in range(len(wallets)): cli_get_info = self.nodes[0].cli('-getinfo', '-rpcwallet={}'.format(wallets[i])).send_cli() assert 'balances' not in cli_get_info.keys() assert_equal(cli_get_info['balance'], amounts[i]) self.log.info("Test -getinfo with multiple wallets and -rpcwallet=non-existing-wallet returns no balances") cli_get_info_keys = self.nodes[0].cli('-getinfo', '-rpcwallet=does-not-exist').send_cli().keys() assert 'balance' not in cli_get_info_keys assert 'balances' not in cli_get_info_keys self.log.info("Test -getinfo with multiple wallets returns all loaded wallet names and balances") assert_equal(set(self.nodes[0].listwallets()), set(wallets)) cli_get_info = self.nodes[0].cli('-getinfo').send_cli() assert 'balance' not in cli_get_info.keys() assert_equal(cli_get_info['balances'], {k: v for k, v in zip(wallets, amounts)}) # Unload the default wallet and re-verify. self.nodes[0].unloadwallet(wallets[0]) assert wallets[0] not in self.nodes[0].listwallets() cli_get_info = self.nodes[0].cli('-getinfo').send_cli() assert 'balance' not in cli_get_info.keys() assert_equal(cli_get_info['balances'], {k: v for k, v in zip(wallets[1:], amounts[1:])}) self.log.info("Test -getinfo after unloading all wallets except a non-default one returns its balance") self.nodes[0].unloadwallet(wallets[2]) assert_equal(self.nodes[0].listwallets(), [wallets[1]]) cli_get_info = self.nodes[0].cli('-getinfo').send_cli() assert 'balances' not in cli_get_info.keys() assert_equal(cli_get_info['balance'], amounts[1]) self.log.info("Test -getinfo with -rpcwallet=remaining-non-default-wallet returns only its balance") cli_get_info = self.nodes[0].cli('-getinfo', rpcwallet2).send_cli() assert 'balances' not in cli_get_info.keys() assert_equal(cli_get_info['balance'], amounts[1]) self.log.info("Test -getinfo with -rpcwallet=unloaded wallet returns no balances") cli_get_info = self.nodes[0].cli('-getinfo', rpcwallet3).send_cli() assert 'balance' not in cli_get_info_keys assert 'balances' not in cli_get_info_keys # Test bitcoin-cli -generate. n1 = 3 n2 = 4 w2.walletpassphrase(password, self.rpc_timeout) blocks = self.nodes[0].getblockcount() self.log.info('Test -generate with no args') generate = self.nodes[0].cli('-generate').send_cli() assert_equal(set(generate.keys()), {'address', 'blocks'}) assert_equal(len(generate["blocks"]), 1) assert_equal(self.nodes[0].getblockcount(), blocks + 1) self.log.info('Test -generate with bad args') assert_raises_process_error(1, JSON_PARSING_ERROR, self.nodes[0].cli('-generate', 'foo').echo) assert_raises_process_error(1, BLOCKS_VALUE_OF_ZERO, self.nodes[0].cli('-generate', 0).echo) assert_raises_process_error(1, TOO_MANY_ARGS, self.nodes[0].cli('-generate', 1, 2, 3).echo) self.log.info('Test -generate with nblocks') generate = self.nodes[0].cli('-generate', n1).send_cli() assert_equal(set(generate.keys()), {'address', 'blocks'}) assert_equal(len(generate["blocks"]), n1) assert_equal(self.nodes[0].getblockcount(), blocks + 1 + n1) self.log.info('Test -generate with nblocks and maxtries') generate = self.nodes[0].cli('-generate', n2, 1000000).send_cli() assert_equal(set(generate.keys()), {'address', 'blocks'}) assert_equal(len(generate["blocks"]), n2) assert_equal(self.nodes[0].getblockcount(), blocks + 1 + n1 + n2) self.log.info('Test -generate -rpcwallet in single-wallet mode') generate = self.nodes[0].cli(rpcwallet2, '-generate').send_cli() assert_equal(set(generate.keys()), {'address', 'blocks'}) assert_equal(len(generate["blocks"]), 1) assert_equal(self.nodes[0].getblockcount(), blocks + 2 + n1 + n2) self.log.info('Test -generate -rpcwallet=unloaded wallet raises RPC error') assert_raises_rpc_error(-18, WALLET_NOT_LOADED, self.nodes[0].cli(rpcwallet3, '-generate').echo) assert_raises_rpc_error(-18, WALLET_NOT_LOADED, self.nodes[0].cli(rpcwallet3, '-generate', 'foo').echo) assert_raises_rpc_error(-18, WALLET_NOT_LOADED, self.nodes[0].cli(rpcwallet3, '-generate', 0).echo) assert_raises_rpc_error(-18, WALLET_NOT_LOADED, self.nodes[0].cli(rpcwallet3, '-generate', 1, 2, 3).echo) # Test bitcoin-cli -generate with -rpcwallet in multiwallet mode. self.nodes[0].loadwallet(wallets[2]) n3 = 4 n4 = 10 blocks = self.nodes[0].getblockcount() self.log.info('Test -generate -rpcwallet with no args') generate = self.nodes[0].cli(rpcwallet2, '-generate').send_cli() assert_equal(set(generate.keys()), {'address', 'blocks'}) assert_equal(len(generate["blocks"]), 1) assert_equal(self.nodes[0].getblockcount(), blocks + 1) self.log.info('Test -generate -rpcwallet with bad args') assert_raises_process_error(1, JSON_PARSING_ERROR, self.nodes[0].cli(rpcwallet2, '-generate', 'foo').echo) assert_raises_process_error(1, BLOCKS_VALUE_OF_ZERO, self.nodes[0].cli(rpcwallet2, '-generate', 0).echo) assert_raises_process_error(1, TOO_MANY_ARGS, self.nodes[0].cli(rpcwallet2, '-generate', 1, 2, 3).echo) self.log.info('Test -generate -rpcwallet with nblocks') generate = self.nodes[0].cli(rpcwallet2, '-generate', n3).send_cli() assert_equal(set(generate.keys()), {'address', 'blocks'}) assert_equal(len(generate["blocks"]), n3) assert_equal(self.nodes[0].getblockcount(), blocks + 1 + n3) self.log.info('Test -generate -rpcwallet with nblocks and maxtries') generate = self.nodes[0].cli(rpcwallet2, '-generate', n4, 1000000).send_cli() assert_equal(set(generate.keys()), {'address', 'blocks'}) assert_equal(len(generate["blocks"]), n4) assert_equal(self.nodes[0].getblockcount(), blocks + 1 + n3 + n4) self.log.info('Test -generate without -rpcwallet in multiwallet mode raises RPC error') assert_raises_rpc_error(-19, WALLET_NOT_SPECIFIED, self.nodes[0].cli('-generate').echo) assert_raises_rpc_error(-19, WALLET_NOT_SPECIFIED, self.nodes[0].cli('-generate', 'foo').echo) assert_raises_rpc_error(-19, WALLET_NOT_SPECIFIED, self.nodes[0].cli('-generate', 0).echo) assert_raises_rpc_error(-19, WALLET_NOT_SPECIFIED, self.nodes[0].cli('-generate', 1, 2, 3).echo) else: self.log.info("*** Wallet not compiled; cli getwalletinfo and -getinfo wallet tests skipped") self.nodes[0].generate(25) # maintain block parity with the wallet_compiled conditional branch self.log.info("Test -version with node stopped") self.stop_node(0) cli_response = self.nodes[0].cli('-version').send_cli() assert "{} RPC client version".format(self.config['environment']['PACKAGE_NAME']) in cli_response self.log.info("Test -rpcwait option successfully waits for RPC connection") self.nodes[0].start() # start node without RPC connection self.nodes[0].wait_for_cookie_credentials() # ensure cookie file is available to avoid race condition blocks = self.nodes[0].cli('-rpcwait').send_cli('getblockcount') self.nodes[0].wait_for_rpc_connection() assert_equal(blocks, BLOCKS + 25) if __name__ == '__main__': TestBitcoinCli().main()
mit
jdonenine/disney-parks-calendar
dist/model/park.js
3251
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ParkEnum; (function (ParkEnum) { ParkEnum[ParkEnum["MAGIC_KINGDOM"] = 0] = "MAGIC_KINGDOM"; ParkEnum[ParkEnum["EPCOT_FUTURE_WORLD"] = 1] = "EPCOT_FUTURE_WORLD"; ParkEnum[ParkEnum["EPCOT_WORLD_SHOWCASE"] = 2] = "EPCOT_WORLD_SHOWCASE"; ParkEnum[ParkEnum["HOLLYWOOD_STUDIOS"] = 3] = "HOLLYWOOD_STUDIOS"; ParkEnum[ParkEnum["ANIMAL_KINGDOM"] = 4] = "ANIMAL_KINGDOM"; ParkEnum[ParkEnum["TYPHOON_LAGOON"] = 5] = "TYPHOON_LAGOON"; ParkEnum[ParkEnum["BLIZZARD_BEACH"] = 6] = "BLIZZARD_BEACH"; ParkEnum[ParkEnum["ESPN_WWS"] = 7] = "ESPN_WWS"; ParkEnum[ParkEnum["DISNEY_SPRINGS"] = 8] = "DISNEY_SPRINGS"; })(ParkEnum = exports.ParkEnum || (exports.ParkEnum = {})); var ParkDefinition = (function () { function ParkDefinition() { this.isThemePark = false; this.isWaterPark = false; } return ParkDefinition; }()); exports.ParkDefinition = ParkDefinition; var ParkDefintions = [ { id: ParkEnum.MAGIC_KINGDOM, name: 'Magic Kingdom', parkName: 'Magic Kingdom Park', isThemePark: true }, { id: ParkEnum.EPCOT_FUTURE_WORLD, name: 'Epcot - Future World', parkName: 'Epcot - Future World', isThemePark: true }, { id: ParkEnum.EPCOT_WORLD_SHOWCASE, name: 'Epcot - World Showcase', parkName: 'Epcot - World Showcase', isThemePark: true }, { id: ParkEnum.HOLLYWOOD_STUDIOS, name: 'Hollywood Studios', parkName: 'Disney\'s Hollywood Studios', isThemePark: true }, { id: ParkEnum.ANIMAL_KINGDOM, name: 'Animal Kingdom', parkName: 'Disney\'s Animal Kingdom Theme Park', isThemePark: true }, { id: ParkEnum.TYPHOON_LAGOON, name: 'Typhoon Lagoon', parkName: 'Disney\'s Typhoon Lagoon Water Park', isWaterPark: true }, { id: ParkEnum.BLIZZARD_BEACH, name: 'Blizzard Beach', parkName: 'Disney\'s Blizzard Beach Water Park', isWaterPark: true }, { id: ParkEnum.ESPN_WWS, name: 'ESPN Wide World of Sports', parkName: 'ESPN Wide World of Sports Complex' }, { id: ParkEnum.DISNEY_SPRINGS, name: 'Disney Springs', parkName: 'Disney Springs' } ]; var ParkEnumHelper = (function () { function ParkEnumHelper() { } ParkEnumHelper.getAllParkDefinitions = function () { return ParkDefintions; }; ParkEnumHelper.getParkDefinition = function (id) { var matches = ParkDefintions.filter(function (parkDefinition) { return parkDefinition.id === id; }); if (!matches || matches.length < 1) { return; } return matches[0]; }; ParkEnumHelper.getParkDefinitionByParkName = function (parkName) { var matches = ParkDefintions.filter(function (parkDefinition) { return parkDefinition.parkName === parkName; }); if (!matches || matches.length < 1) { return; } return matches[0]; }; return ParkEnumHelper; }()); exports.ParkEnumHelper = ParkEnumHelper; //# sourceMappingURL=park.js.map
mit
harishuideveloper/My-India-Redux
src/components/Filter/index.js
53
import Filter from './Filter' export default Filter
mit
TEAM4456/MechCadets2016
src/org/usfirst/frc/team4456/robot/autonomous/AutoSequence.java
361
package org.usfirst.frc.team4456.robot.autonomous; public interface AutoSequence { /** * This method should get called in the initial autonomous stage. * runs initial autonomous code */ public void runInit(); /** * This method should get called in the periodc autonomous stage. * runs periodic autonomous code */ public void runPeriodic(); }
mit
para-cms/para
app/models/para/library/file.rb
1502
module Para module Library class File < ActiveRecord::Base if defined?(ActiveStorage) has_one_attached :attachment # Return attachment.path or attachment.url depending on the storage # backend, allowing 'openuri' and 'roo' libraries to load easily the # file at the right path, on filesystem or othe storage systems, like S3. # def attachment_path return unless attachment.attached? attachment.service_url end alias_method :attachment_url, :attachment_path def attachment_ext ::File.extname(attachment.filename.to_s) if attachment.attached? end else has_attached_file :attachment validates :attachment, presence: true do_not_validate_attachment_file_type :attachment # Return attachment.path or attachment.url depending on the storage # backend, allowing 'openuri' and 'roo' libraries to load easily the # file at the right path, on filesystem or othe storage systems, like S3. # def attachment_path return unless attachment? case attachment.options[:storage] when :filesystem then attachment.path else attachment.url end end def attachment_url attachment.url if attachment? end def attachment_ext ::File.extname(attachment_file_name) if attachment.attached? end end end end end
mit
Malkovski/Telerik
High-QualityCode/Homework/High-QualityClasses/Abstraction/Abstraction/Rectangle.cs
1627
namespace Abstraction { using System; internal class Rectangle : Figure { public Rectangle() : base(0, 0) { } internal Rectangle(double width, double height) : base(width, height) { } internal double Width { get { return this.width; } set { if (value == null) { throw new ArgumentNullException("Width cannot be null!"); } if (value < 0) { throw new ArgumentOutOfRangeException("Width cannot be negative value!"); } this.width = value; } } internal double Height { get { return this.height; } set { if (value == null) { throw new ArgumentNullException("Height cannot be null!"); } if (value < 0) { throw new ArgumentOutOfRangeException("Height cannot be negative value!"); } this.height = value; } } internal double CalcPerimeter() { double perimeter = 2 * (this.Width + this.Height); return perimeter; } internal double CalcSurface() { double surface = this.Width * this.Height; return surface; } } }
mit
bndw/pick
safe/account.go
2282
package safe import ( "fmt" "sort" "time" ) type Account struct { Username string `json:"username"` Password string `json:"password"` CreatedOn int64 `json:"createdOn"` ModifiedOn int64 `json:"modifiedOn"` History accountHistory `json:"history,omitempty"` } func (acc *Account) Update(cb func(*Account)) { cb(acc) acc.ModifiedOn = time.Now().Unix() } func (acc *Account) SyncWith(otherAccount *Account, name string) (bool, error) { if acc.CreatedOn != otherAccount.CreatedOn { // Apparently not the same account // TODO(leon): Implement unique ID for an account return false, fmt.Errorf("Accounts '%s' differ in creation date, skipping", name) } if acc.ModifiedOn < otherAccount.ModifiedOn { // Other account is newer, update ourself // Defer backup creation defer func(acc Account) { acc.History = append(acc.History, acc) }(*acc) acc.Username = otherAccount.Username acc.Password = otherAccount.Password // Sync history acc.syncHistory(otherAccount.History) // Update ModifiedOn acc.ModifiedOn = otherAccount.ModifiedOn return true, nil } return false, nil } type accountHistory []Account func (a accountHistory) Len() int { return len(a) } func (a accountHistory) Less(i, j int) bool { return a[i].ModifiedOn < a[j].ModifiedOn } func (a accountHistory) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (acc *Account) syncHistory(otherHistory accountHistory) { for _, otherAccount := range otherHistory { found := false for _, localAccount := range acc.History { if localAccount.ModifiedOn == otherAccount.ModifiedOn { // We already have this account in our history found = true break } } if !found { acc.History = append(acc.History, otherAccount) } } // Sort our history to preserve order historySorted := make(accountHistory, 0, len(acc.History)) // nolint: megacheck for _, account := range acc.History { historySorted = append(historySorted, account) } sort.Sort(historySorted) acc.History = historySorted } func NewAccount(username, password string) *Account { ts := time.Now().Unix() return &Account{ Username: username, Password: password, CreatedOn: ts, ModifiedOn: ts, History: make(accountHistory, 0), } }
mit
z2s8/erettsegit
test_erettsegit.py
1186
import os import unittest from erettsegit import argparse, yearify, monthify, levelify from erettsegit import MessageType, message_for class TestErettsegit(unittest.TestCase): def test_yearify_raises_out_of_bounds_years(self): with self.assertRaises(argparse.ArgumentTypeError): yearify(2003) yearify(1999) yearify(2) yearify(2999) def test_yearify_pads_short_year(self): self.assertEqual(yearify(12), 2012) def test_monthify_handles_textual_dates(self): self.assertEqual(monthify('Feb'), 2) self.assertEqual(monthify('majus'), 5) self.assertEqual(monthify('ősz'), 10) def test_levelify_handles_multi_lang(self): self.assertEqual(levelify('mid-level'), 'k') self.assertEqual(levelify('advanced'), 'e') def test_messages_get_interpolated_with_extra(self): os.environ['ERETTSEGIT_LANG'] = 'EN' self.assertEqual(message_for(MessageType.e_input, MessageType.c_year), 'incorrect year') def test_messages_ignore_unnecessary_extra(self): self.assertNotIn('None', message_for(MessageType.i_quit, extra=None))
mit
kf6kjg/chattel
Source/Chattel/ChattelReader.cs
9043
// ChattelReader.cs // // Author: // Ricky Curtice <ricky@rwcproductions.com> // // Copyright (c) 2016 Richard Curtice // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using InWorldz.Data.Assets.Stratus; namespace Chattel { public sealed class ChattelReader { private static readonly Logging.ILog LOG = Logging.LogProvider.For<ChattelReader>(); public delegate void AssetHandler(StratusAsset asset); private readonly ChattelConfiguration _config; private readonly IChattelLocalStorage _localStorage; private readonly ConcurrentDictionary<Guid, Queue<AssetHandler>> _idsBeingFetched = new ConcurrentDictionary<Guid, Queue<AssetHandler>>(); /// <summary> /// Initializes a new instance of the <see cref="T:ChattelReader"/> class. /// If local storage is enabled, but no local storage instance was passed in, automatically sets up and uses the AssetStorageSimpleFolderTree for local storage. /// If purgeLocalStorage is set, purges all assets in the storage. /// </summary> /// <param name="config">Instance of the configuration class.</param> /// <param name="localStorage">Instance of the IChattelLocalStorage interface. If left null, then the default AssetStorageSimpleFolderTree will be instantiated.</param> /// <param name="purgeLocalStorage">Whether or not to attempt to purge local storage.</param> public ChattelReader(ChattelConfiguration config, IChattelLocalStorage localStorage, bool purgeLocalStorage) { _config = config ?? throw new ArgumentNullException(nameof(config)); if (_config.LocalStorageEnabled) { _localStorage = localStorage ?? new AssetStorageSimpleFolderTree(config); } if (purgeLocalStorage) { _localStorage?.PurgeAll(null); } } /// <summary> /// Initializes a new instance of the <see cref="T:ChattelReader"/> class. /// If local storage is enabled, but no local storage instance was passed in, automatically sets up and uses the AssetStorageSimpleFolderTree for local storage. /// </summary> /// <param name="config">Instance of the configuration class.</param> /// <param name="localStorage">Instance of the IChattelLocalStorage interface. If left null, then the default AssetStorageSimpleFolderTree will be instantiated.</param> public ChattelReader(ChattelConfiguration config, IChattelLocalStorage localStorage) : this(config, localStorage, false) { } /// <summary> /// Initializes a new instance of the <see cref="T:ChattelReader"/> class. /// Automatically sets up and uses the AssetStorageSimpleFolderTree. /// If purgeLocalStorage is set, purges all assets in the storage for local storage. /// </summary> /// <param name="config">Instance of the configuration class.</param> /// <param name="purgeLocalStorage">Whether or not to attempt to purge local storage.</param> public ChattelReader(ChattelConfiguration config, bool purgeLocalStorage) : this(config, config?.LocalStorageEnabled ?? false ? new AssetStorageSimpleFolderTree(config) : null, purgeLocalStorage) { } /// <summary> /// Initializes a new instance of the <see cref="T:ChattelReader"/> class. /// Automatically sets up and uses the AssetStorageSimpleFolderTree. /// </summary> /// <param name="config">Instance of the configuration class.</param> public ChattelReader(ChattelConfiguration config) : this(config, new AssetStorageSimpleFolderTree(config), false) { } /// <summary> /// Quick check for whether or not any upstream servers were configured. /// </summary> public bool HasUpstream => _config.SerialParallelAssetServers.Any(); /// <summary> /// Ruleset for local storage operations when used as a cache for remote servers. /// </summary> [Flags] public enum CacheRule : uint { Normal = 0, SkipRead = 1, SkipWrite = 2, } /// <summary> /// Gets the asset from the server. /// </summary> /// <returns>The asset.</returns> /// <param name="assetId">Asset identifier.</param> /// <param name="handler">Callback delegate to hand the asset to.</param> /// <param name="cacheRule">Bitfield controlling how local storage is to be handled when used as a cache for remote servers.</param> public void GetAssetAsync(Guid assetId, AssetHandler handler, CacheRule cacheRule) { // Ask for null, get null. if (assetId == Guid.Empty) { handler(null); } // TODO: see if https://github.com/Reactive-Extensions/Rx.NET would do a better job, but they have to finish releasing 4.0 first. // It might be beneficial to move the listener processsing to another thread, but then you potentially lose parallism across multiple asset IDs. StratusAsset result = null; while (true) { // Hit up the local storage first. If there's no upstream then ignore skipread. if (!(cacheRule.HasFlag(CacheRule.SkipRead) && _config.SerialParallelAssetServers.Any()) && (_localStorage?.TryGetAsset(assetId, out result) ?? false)) { handler(result); return; } var listeners = new Queue<AssetHandler>(); listeners.Enqueue(handler); // Add myself to the new listeners list first thing, assuming, probably wrongly, that the following test is true. If wrong, meh: this queue gets dropped like an old potato. if (_idsBeingFetched.TryAdd(assetId, listeners)) { // Got to go try the servers now. foreach (var parallelServers in _config.SerialParallelAssetServers) { if (parallelServers.Count() == 1) { // Optimization: no need to hit up the parallel stuff if there's only 1. result = parallelServers.First().RequestAssetSync(assetId); } else { result = parallelServers.AsParallel().Select(server => server.RequestAssetSync(assetId)).FirstOrDefault(a => a != null); } if (result != null) { if (!cacheRule.HasFlag(CacheRule.SkipWrite)) { _localStorage?.StoreAsset(result); } break; } } // Now to process the listeners. var exceptions = new ConcurrentQueue<Exception>(); lock (listeners) { // Prevent new listeners from being added. Parallel.ForEach(listeners, waiting_handler => { if (waiting_handler == null) { LOG.Log(Logging.LogLevel.Warn, () => $"Attempted to process a handler for assetId {assetId} that was null!"); return; } try { waiting_handler(result); } catch (Exception e) { exceptions.Enqueue(e); } }); _idsBeingFetched.TryRemove(assetId, out var trash); } if (exceptions.Count > 0) { LOG.Log(Logging.LogLevel.Error, () => $"Exceptions ({exceptions.Count}) were thrown by handler(s) listening for asset {assetId}", new AggregateException(exceptions)); } return; // We're done here. } // See if we can add ourselves to the listener list. if (_idsBeingFetched.TryGetValue(assetId, out listeners)) { // Skiplock: if the lock cannot be taken, move on to the retry because the list is already being emptied. var lockTaken = false; try { Monitor.TryEnter(listeners, ref lockTaken); if (lockTaken) { listeners.Enqueue(handler); return; } } finally { if (lockTaken) { Monitor.Exit(listeners); } } // lock was skipped, therefore that list is already being cleaned out. } // It's gone already, so let's try again as the asset should be in local storage or we should query the servers again. Thread.Sleep(50); } } /// <summary> /// Gets the asset from the server using CacheRule.Normal /// </summary> /// <returns>The asset.</returns> /// <param name="assetId">Asset identifier.</param> /// <param name="handler">Callback delegate to hand the asset to.</param> public void GetAssetAsync(Guid assetId, AssetHandler handler) { GetAssetAsync(assetId, handler, CacheRule.Normal); } } }
mit
myabc/refinerycms
public/javascripts/refinery/admin.js
34410
var shiftHeld = false; $(document).ready(function(){ init_interface(); init_flash_messages(); init_delete_confirmations(); init_sortable_menu(); init_submit_continue(); init_modal_dialogs(); init_tooltips(); }); init_interface = function() { if (parent && parent.document.location.href != document.location.href) { $('body#dialog_container.dialog').addClass('iframed'); } $('input:submit:not(.button)').addClass('button'); $('.button, #editor_switch a').corner('6px'); $('#editor_switch a').appendTo($('<span></span>').prependTo('#editor_switch').corner('6px')); $('#page_container, .wym_box').corner('5px bottom'); $('.wym_box').corner('5px tr'); $('.field > .wym_box').corner('5px tl'); $('.wym_iframe iframe').corner('2px'); $('.form-actions:not(".form-actions-dialog")').corner('5px'); $('#recent_activity li a, #recent_inquiries li a').each(function(i, a) { $(this).textTruncate({ width: $(this).width() , tooltip: false }); }); // make sure that users can tab to wymeditor fields and add an overlay while loading. $('textarea.wymeditor').each(function() { textarea = $(this); if ((instance = WYMeditor.INSTANCES[$((textarea.next('.wym_box').find('iframe').attr('id')||'').split('_')).last().get(0)]) != null) { if ((next = textarea.parent().next()) != null && next.length > 0) { next.find('input, textarea').keydown($.proxy(function(e) { shiftHeld = e.shiftKey; if (shiftHeld && e.keyCode == $.ui.keyCode.TAB) { this._iframe.contentWindow.focus(); e.preventDefault(); } }, instance)).keyup(function(e) { shiftHeld = false; }); } if ((prev = textarea.parent().prev()) != null && prev.length > 0) { prev.find('input, textarea').keydown($.proxy(function(e) { if (e.keyCode == $.ui.keyCode.TAB) { this._iframe.contentWindow.focus(); e.preventDefault(); } }, instance)); } } }); // focus first field in an admin form. $('form input[type=text]:first').focus(); // ensure that the menu isn't wider than the page_container or else it looks silly to round that corner. if (($menu = $('#menu')).length > 0) { $menu.jcarousel({ vertical: false , scroll: 1 , buttonNextHTML: "<img src='/images/refinery/carousel-right.png' alt='down' height='15' width='10' />" , buttonPrevHTML: "<img src='/images/refinery/carousel-left.png' alt='up' height='15' width='10' />" , listTag: $menu.get(0).tagName.toLowerCase() , itemTag: $menu.children(':first').get(0).tagName.toLowerCase() }); if ($menu.outerWidth() < $('#page_container').outerWidth()) { $("#page_container:not('.login #page_container')").corner('5px tr'); } else { $("#page_container:not('.login #page_container')").uncorner(); } } $('#current_locale li a').click(function(e) { $('#current_locale li a span').each(function(span){ $(this).css('display', $(this).css('display') == 'none' ? '' : 'none'); }); $('#other_locales').animate({opacity: 'toggle', height: 'toggle'}, 250); e.preventDefault(); }); } init_delete_confirmations = function() { $('a.confirm-delete').click(function(e) { if ((confirmation = $(this).attr('data-confirm')) == null || confirmation.length == 0) { if ((title = ($(this).attr('title') || $(this).attr('tooltip'))) == null || title.length == 0) { title = "Remove this forever"; } confirmation = "Are you sure you want to " + title[0].toLowerCase() + title.substring(1) + "?"; } if (confirm(confirmation)) { $("<form method='POST' action='" + $(this).attr('href') + "'></form>") .append("<input type='hidden' name='_method' value='delete' />") .append("<input type='hidden' name='authenticity_token' value='" + $('#admin_authenticity_token').val() + "'/>") .appendTo('body').submit(); } e.preventDefault(); }); } init_flash_messages = function(){ $('#flash').fadeIn(550); $('#flash_close').click(function(e) { $('#flash').fadeOut({duration: 330}); e.preventDefault(); }); $('#flash.flash_message').prependTo('#records'); } init_modal_dialogs = function(){ $('a[href*="dialog=true"]').not('#dialog_container a').each(function(i, anchor) { $(anchor).data({ 'dialog-width': parseInt($($(anchor).attr('href').match("width=([0-9]*)")).last().get(0))||928 , 'dialog-height': parseInt($($(anchor).attr('href').match("height=([0-9]*)")).last().get(0))||473 , 'dialog-title': ($(anchor).attr('title') || $(anchor).attr('name') || $(anchor).html() || null) }).attr('href', $(anchor).attr('href').replace(/(\&(amp\;)?)?dialog\=true/, '') .replace(/(\&(amp\;)?)?width\=\d+/, '') .replace(/(\&(amp\;)?)?height\=\d+/, '') .replace(/(\?&(amp\;)?)/, '?') .replace(/\?$/, '')) .click(function(e){ $anchor = $(this); iframe_src = (iframe_src = $anchor.attr('href')) + (iframe_src.indexOf('?') > -1 ? '&amp;' : '?') + 'app_dialog=true&amp;dialog=true'; iframe = $("<iframe id='dialog_iframe' src='" + iframe_src + "'></iframe>").corner('8px'); iframe.dialog({ title: $anchor.data('dialog-title') , modal: true , resizable: false , autoOpen: true , width: $anchor.data('dialog-width') , height: $anchor.data('dialog-height') , open: onOpenDialog , close: onCloseDialog }); if ($.browser.msie) { iframe.css({'margin':'-2px 2px 2px -2px'}); } $(document.body).addClass('hide-overflow'); e.preventDefault(); }); }); } init_sortable_menu = function(){ var $menu = $('#menu'); if($menu.length == 0){return} $menu.sortable({ axis: 'x', cursor: 'crosshair', update: function(){ var ser = $menu.sortable('serialize', {key: 'menu[]', expression: /plugin_([\w]*)$/}), token = escape($('#admin_authenticity_token').val()); $.get('/refinery/update_menu_positions?' + ser, {authenticity_token: token}); } }).tabs(); //Initial status disabled $menu.sortable('disable'); $menu.find('#menu_reorder').click(function(e){ e.preventDefault(); $('#menu_reorder, #menu_reorder_done').toggle(); $('#site_bar, #header >*:not(#header_content, #menu, script), #content').fadeTo(500, 0.65); $menu.find('.tab a').click(function(ev){ ev.preventDefault(); }); $menu.sortable('enable'); }); $menu.find('#menu_reorder_done').click(function(e){ e.preventDefault(); $('#menu_reorder, #menu_reorder_done').toggle(); $('#site_bar, #header >*:not(#header_content, #menu, script), #content').fadeTo(500, 1); $menu.find('.tab a').unbind('click'); $menu.sortable('disable'); }); $menu.find('> a').corner('top 5px'); } init_submit_continue = function(){ $('#submit_continue_button').click(submit_and_continue); $('form').change(function(e) { $(this).attr('data-changes-made', true); }); if ((continue_editing_button = $('#continue_editing')).length > 0 && continue_editing_button.attr('rel') != 'no-prompt') { $('#editor_switch a').click(function(e) { if ($('form[data-changes-made]').length > 0) { if (!confirm("Any changes you've made will be lost. Are you sure you want to continue without saving?")) { e.preventDefault(); } } }); } } submit_and_continue = function(e, redirect_to) { // ensure wymeditors are up to date. if ($(this).hasClass('wymupdate')) { $.each(WYMeditor.INSTANCES, function(index, wym) { wym.update(); }); } $('#continue_editing').val(true); $('#flash').fadeOut(250) $('.fieldWithErrors').removeClass('fieldWithErrors').addClass('field'); $('#flash_container .errorExplanation').remove(); $.post($('#continue_editing').get(0).form.action, $($('#continue_editing').get(0).form).serialize(), function(data) { if (($flash_container = $('#flash_container')).length > 0) { $flash_container.html(data); $('#flash').css('width', 'auto').fadeIn(550); $('.errorExplanation').not($('#flash_container .errorExplanation')).remove(); if ((error_fields = $('#fieldsWithErrors').val()) != null) { $.each(error_fields.split(','), function() { $("#" + this).wrap("<div class='fieldWithErrors' />"); }); } else if (redirect_to) { window.location = redirect_to; } $('.fieldWithErrors:first :input:first').focus(); $('#continue_editing').val(false); init_flash_messages(); } }); e.preventDefault(); } init_tooltips = function(args){ $($(args != null ? args : 'a[title], span[title], #image_grid img[title], *[tooltip]')).not('.no-tooltip').each(function(index, element) { // create tooltip on hover and destroy it on hoveroff. $(element).hover(function(e) { $(this).oneTime(350, 'tooltip', $.proxy(function() { $('.tooltip').remove(); tooltip = $("<div class='tooltip'><div><span></span></div></div>").corner('6px').appendTo('#tooltip_container'); tooltip.find("span").html($(this).attr('tooltip')).corner('6px'); nib = $("<img src='/images/refinery/tooltip-nib.png' class='tooltip-nib'/>").appendTo('#tooltip_container'); tooltip.css({ 'opacity': 0 , 'maxWidth': '300px' }); required_left_offset = $(this).offset().left - (tooltip.outerWidth() / 2) + ($(this).outerWidth() / 2); tooltip.css('left', (required_left_offset > 0 ? required_left_offset : 0)); var tooltip_offset = tooltip.offset(); var tooltip_outer_width = tooltip.outerWidth(); if (tooltip_offset && (tooltip_offset.left + tooltip_outer_width) > (window_width = $(window).width())) { tooltip.css('left', window_width - tooltip_outer_width); } tooltip.css({ 'top': $(this).offset().top - tooltip.outerHeight() - 2 }) nib.css({ 'opacity': 0 }); if (tooltip_offset = tooltip.offset()) { nib.css({ 'left': $(this).offset().left + ($(this).outerWidth() / 2) - 5 , 'top': tooltip_offset.top + tooltip.height() }); } try { tooltip.animate({ top: tooltip_offset.top - 10 , opacity: 1 }, 200, 'swing'); nib.animate({ top: nib.offset().top - 10 , opacity: 1 }, 200); } catch(e) { tooltip.show(); nib.show(); } }, $(this))); }, function(e) { $(this).stopTime('tooltip'); if ((tt_offset = (tooltip = $('.tooltip')).css('z-index', '-1').offset()) == null) { tt_offset = {'top':0,'left':0}; } tooltip.animate({ top: tt_offset.top - 20 , opacity: 0 }, 125, 'swing', function(){ $(this).remove(); }); if ((nib_offset = (nib = $('.tooltip-nib')).offset()) == null) { nib_offset = {'top':0,'left':0}; } nib.animate({ top: nib_offset.top - 20 , opacity: 0 }, 125, 'swing', function(){ $(this).remove(); }); }).click(function(e) { $(this).stopTime('tooltip'); }); if ($(element).attr('tooltip') == null) { $(element).attr('tooltip', $(element).attr('title')); } // wipe clean the title on any children too. $(element).add($(element).children('img')).attr('title', null); }); } var link_dialog = { init: function(test_url, test_email){ this.test_url = test_url; this.test_email = test_email; this.init_tabs(); this.init_resources_submit(); this.init_close(); this.page_tab(); this.web_tab(); this.email_tab(); }, init_tabs: function(){ var radios = $('#dialog_menu_left input:radio'); var selected = radios.parent().filter(".selected_radio").find('input:radio').first() || radios.first(); radios.click(function(){ link_dialog.switch_area($(this)); }); selected.attr('checked', 'true'); link_dialog.switch_area(selected); }, init_resources_submit: function(){ $('#existing_resource_area .form-actions-dialog #submit_button').click(function(e){ e.preventDefault(); if((resource_selected = $('#existing_resource_area_content ul li.linked a')).length > 0) { resourceUrl = parseURL(resource_selected.attr('href')); relevant_href = resourceUrl.pathname; if (resourceUrl.protocol == "" && resourceUrl.hostname == "system") { relevant_href = "/system" + relevant_href; } // Add any alternate resource stores that need a absolute URL in the regex below if(resourceUrl.hostname.match(/s3.amazonaws.com/)) { relevant_href = resourceUrl.protocol + '//' + resourceUrl.host + relevant_href; } if (typeof(resource_picker.callback) == "function") { resource_picker.callback({ id: resource_selected.attr('id').replace("resource_", "") , href: relevant_href , html: resource_selected.html() }); } } }); $('.form-actions-dialog #cancel_button').trigger('click'); }, init_close: function(){ $('.form-actions-dialog #cancel_button').click(close_dialog); if (parent && parent.document.location.href != document.location.href && parent.document.getElementById('wym_dialog_submit') != null) { $('#dialog_container .form-actions input#submit_button').click(function(e) { e.preventDefault(); $(parent.document.getElementById('wym_dialog_submit')).click(); }); $('#dialog_container .form-actions a.close_dialog').click(close_dialog); } }, switch_area: function(area){ $('#dialog_menu_left .selected_radio').removeClass('selected_radio'); $(area).parent().addClass('selected_radio'); $('#dialog_main .dialog_area').hide(); $('#' + $(area).val() + '_area').show(); }, //Same for resources tab page_tab: function(){ $('.link_list li').click(function(e){ e.preventDefault(); $('.link_list li.linked').removeClass('linked'); $(this).addClass('linked'); var link = $(this).children('a.page_link').get(0); var port = (window.location.port.length > 0 ? (":" + window.location.port) : ""); var url = link.href.replace(window.location.protocol + "//" + window.location.hostname + port, ""); link_dialog.update_parent(url, link.rel.replace(/\ ?<em>.+?<\/em>/, '')); }); }, web_tab: function(){ $('#web_address_text').change(function(){ var prefix = '#web_address_', icon = ''; $(prefix + 'test_loader').show(); $(prefix + 'test_result').hide(); $(prefix + 'test_result').removeClass('success_icon').removeClass('failure_icon'); $.getJSON(link_dialog.test_url, {url: this.value}, function(data){ if(data.result == 'success'){ icon = 'success_icon'; }else{ icon = 'failure_icon'; } $(prefix + 'test_result').addClass(icon).show(); $(prefix + 'test_loader').hide(); }); link_dialog.update_parent( $(prefix + 'text').val(), $(prefix + 'text').val(), ($(prefix + 'target_blank').checked ? "_blank" : "") ); }); $('#web_address_target_blank').click(function(){ parent.document.getElementById('wym_target').value = this.checked ? "_blank" : ""; }); }, email_tab: function() { $('#email_address_text, #email_default_subject_text, #email_default_body_text').change(function(e){ var default_subject = $('#email_default_subject_text').val(), default_body = $('#email_default_body_text').val(), mailto = "mailto:" + $('#email_address_text').val(), modifier = "?", icon = ''; $('#email_address_test_loader').show(); $('#email_address_test_result').hide(); $('#email_address_test_result').removeClass('success_icon').removeClass('failure_icon'); $.getJSON(link_dialog.test_email, {email: mailto}, function(data){ if(data.result == 'success'){ icon = 'success_icon'; }else{ icon = 'failure_icon'; } $('#email_address_test_result').addClass(icon).show(); $('#email_address_test_loader').hide(); }); if(default_subject.length > 0){ mailto += modifier + "subject=" + default_subject; modifier = "&"; } if(default_body.length > 0){ mailto += modifier + "body=" + default_body; modifier = "&"; } link_dialog.update_parent(mailto, mailto.replace('mailto:', '')); }); }, update_parent: function(url, title, target) { if (parent != null) { if ((wym_href = parent.document.getElementById('wym_href')) != null) { wym_href.value = url; } if ((wym_title = parent.document.getElementById('wym_title')) != null) { wym_title.value = title; } if ((wym_target = parent.document.getElementById('wym_target')) != null) { wym_target.value = target || ""; } } } } var page_options = { init: function(enable_parts, new_part_url, del_part_url){ // set the page tabs up, but ensure that all tabs are shown so that when wymeditor loads it has a proper height. // also disable page overflow so that scrollbars don't appear while the page is loading. $(document.body).addClass('hide-overflow'); page_options.tabs = $('#page-tabs'); page_options.tabs.tabs({tabTemplate: '<li><a href="#{href}">#{label}</a></li>'}) page_options.tabs.find(' > ul li a').corner('top 5px'); part_shown = $('#page-tabs .page_part.field').not('.ui-tabs-hide'); $('#page-tabs .page_part.field').removeClass('ui-tabs-hide'); this.enable_parts = enable_parts; this.new_part_url = new_part_url; this.del_part_url = del_part_url; this.show_options(); this.title_type(); // Hook into the loaded function. This will be called when WYMeditor has done its thing. WYMeditor.loaded = function(){ // hide the tabs that are supposed to be hidden and re-enable overflow. $(document.body).removeClass('hide-overflow'); $('#page-tabs .page_part.field').not(part_shown).addClass('ui-tabs-hide'); $('#page-tabs > ul li a').corner('top 5px'); } if(this.enable_parts){ this.page_part_dialog(); } }, show_options: function(){ $('#toggle_advanced_options').click(function(e){ e.preventDefault(); $('#more_options').animate({opacity: 'toggle', height: 'toggle'}, 250); $('html,body').animate({ scrollTop: $('#toggle_advanced_options').parent().offset().top }, 250); }); }, title_type: function(){ $("input[name=page\[custom_title_type\]]").change(function(){ $('#custom_title_text, #custom_title_image').hide(); $('#custom_title_' + this.value).show(); }); }, page_part_dialog: function(){ $('#new_page_part_dialog').dialog({ title: 'Create Content Section', modal: true, resizable: false, autoOpen: false, width: 600, height: 200 }); $('#add_page_part').click(function(e){ e.preventDefault(); $('#new_page_part_dialog').dialog('open'); }); $('#new_page_part_save').click(function(e){ e.preventDefault(); var part_title = $('#new_page_part_title').val(); if(part_title.length > 0){ var tab_title = part_title.toLowerCase().replace(" ", "_"); if ($('#part_' + tab_title).size() == 0) { $.get(page_options.new_part_url, { title: part_title , part_index: $('#new_page_part_index').val() , body: '' } , function(data, status){ $('#submit_continue_button').remove(); // Add a new tab for the new content section. $(data).appendTo('#page_part_editors'); page_options.tabs.tabs('add', '#page_part_new_' + $('#new_page_part_index').val(), part_title); page_options.tabs.tabs('select', $('#new_page_part_index').val()); // turn the new textarea into a wymeditor. $('#page_parts_attributes_' + $('#new_page_part_index').val() + "_body").wymeditor(wymeditor_boot_options); // hook into wymedtior to instruct it to select this new tab again once it has loaded. WYMeditor.loaded = function() { page_options.tabs.tabs('select', $('#new_page_part_index').val()); WYMeditor.loaded = function(){}; // kill it again. } // Wipe the title and increment the index counter by one. $('#new_page_part_index').val(parseInt($('#new_page_part_index').val()) + 1); $('#new_page_part_title').val(''); page_options.tabs.find('> ul li a').corner('top 5px'); $('#new_page_part_dialog').dialog('close'); } ); }else{ alert("A content section with that title already exists, please choose another."); } }else{ alert("You have not entered a title for the content section, please enter one."); } }); $('#new_page_part_cancel').click(function(e){ e.preventDefault(); $('#new_page_part_dialog').dialog('close'); $('#new_page_part_title').val(''); }); $('#delete_page_part').click(function(e){ e.preventDefault(); if(confirm("This will remove the content section '" + $('#page_parts .ui-tabs-selected a').html() + "' immediately even if you don't save this page, are you sure?")) { var tabId = page_options.tabs.tabs('option', 'selected'); $.ajax({ url: page_options.del_part_url + '/' + $('#page_parts_attributes_' + tabId + '_id').val(), type: 'DELETE' }); page_options.tabs.tabs('remove', tabId); $('#page_parts_attributes_' + tabId + '_id').remove(); $('#submit_continue_button').remove(); } }); } } var image_dialog = { callback: null , init: function(callback){ this.callback = callback; this.init_tabs(); this.init_select(); this.init_actions(); return this; } , init_tabs: function(){ var radios = $('#dialog_menu_left input:radio'); var selected = radios.parent().filter(".selected_radio").find('input:radio').first() || radios.first(); radios.click(function(){ link_dialog.switch_area($(this)); }); selected.attr('checked', 'true'); link_dialog.switch_area(selected); } , switch_area: function(radio){ $('#dialog_menu_left .selected_radio').removeClass('selected_radio'); $(radio).parent().addClass('selected_radio'); $('#dialog_main .dialog_area').hide(); $('#' + radio.value + '_area').show(); } , init_select: function(){ $('#existing_image_area_content ul li img').click(function(){ image_dialog.set_image(this); }); //Select any currently selected, just uploaded... if ((selected_img = $('#existing_image_area_content ul li.selected img')).length > 0) { image_dialog.set_image(selected_img.first()); } } , set_image: function(img){ if ($(img).length > 0) { $('#existing_image_area_content ul li.selected').removeClass('selected'); $(img).parent().addClass('selected'); var imageUrl = parseURL($(img).attr('src')); var imageThumbnailSize = $('#existing_image_size_area li.selected a').attr('rel'); if (!imageThumbnailSize) { imageThumbnailSize = ''; } else { imageThumbnailSize = '_' + imageThumbnailSize; } //alert(imageThumbnailSize); var relevant_src = imageUrl.pathname.replace('_dialog_thumb', imageThumbnailSize); if (imageUrl.protocol == "" && imageUrl.hostname == "system") { relevant_src = "/system" + relevant_src; } if(imageUrl.hostname.match(/s3.amazonaws.com/)){ relevant_src = imageUrl.protocol + '//' + imageUrl.host + relevant_src; } if (parent) { if ((wym_src = parent.document.getElementById('wym_src')) != null) { wym_src.value = relevant_src; } if ((wym_title = parent.document.getElementById('wym_title')) != null) { wym_title.value = $(img).attr('title'); } if ((wym_alt = parent.document.getElementById('wym_alt')) != null) { wym_alt.value = $(img).attr('alt'); } if ((wym_size = parent.document.getElementById('wym_size')) != null) { wym_size.value = imageThumbnailSize; } } } } , submit_image_choice: function(e) { e.preventDefault(); if((img_selected = $('#existing_image_area_content ul li.selected img').get(0)) && $.isFunction(this.callback)) { this.callback(img_selected); } close_dialog(e); } , init_actions: function(){ var _this = this; $('#existing_image_area .form-actions-dialog #submit_button').click($.proxy(_this.submit_image_choice, _this)); $('.form-actions-dialog #cancel_button').click($.proxy(close_dialog, _this)); $('#existing_image_size_area ul li a').click(function(e) { $('#existing_image_size_area ul li').removeClass('selected'); $(this).parent().addClass('selected'); $('#existing_image_size_area #wants_to_resize_image').attr('checked', 'checked'); image_dialog.set_image($('#existing_image_area_content ul li.selected img')); e.preventDefault(); }); $('#existing_image_size_area #wants_to_resize_image').change(function(){ if($(this).is(":checked")) { $('#existing_image_size_area ul li:first a').click(); } else { $('#existing_image_size_area ul li').removeClass('selected'); image_dialog.set_image($('#existing_image_area_content ul li.selected img')); } }); if (parent && parent.document.location.href != document.location.href && parent.document.getElementById('wym_dialog_submit') != null) { $('#existing_image_area .form-actions input#submit_button').click($.proxy(function(e) { e.preventDefault(); $(this.document.getElementById('wym_dialog_submit')).click(); }, parent)); $('#existing_image_area .form-actions a.close_dialog').click(close_dialog); } } } var list_reorder = { init: function() { $('#reorder_action').click(list_reorder.enable_reordering); $('#reorder_action_done').click(list_reorder.disable_reordering); } , enable_reordering: function(e) { if(e) { e.preventDefault(); } sortable_options = { 'tolerance': 'pointer' , 'placeholder': 'placeholder' , 'cursor': 'drag' , 'items': 'li' , 'axis': 'y' }; $(list_reorder.sortable_list).find('li').each(function(index, li) { if ($('ul', li).length) { return; } $("<ul></ul>").appendTo(li); }); if (list_reorder.tree && !$.browser.msie) { $(list_reorder.sortable_list).parent().nestedSortable($.extend(sortable_options, { 'maxDepth': 1 , 'placeholderElement': 'li' })); $(list_reorder.sortable_list).addClass('ui-sortable'); } else { $(list_reorder.sortable_list).sortable(sortable_options); } $('#site_bar, #header > *:not(script)').fadeTo(500, 0.3); $('#actions *:not("#reorder_action_done, #reorder_action")').not($('#reorder_action_done').parents('li, ul')).fadeTo(500, 0.55); $('#reorder_action').hide(); $('#reorder_action_done').show(); } , parse_branch: function(indexes, li) { branch = "&sortable_list"; $.each(indexes, function(i, index) { branch += "[" + index + "]"; }); branch += "[id]=" + $($(li).attr('id').split('_')).last().get(0); // parse any children branches too. $(li).find('> li[id], > ul li[id]').each(function(i, child) { current_indexes = $.merge($.merge([], indexes), [i]); branch += list_reorder.parse_branch(current_indexes, child); }); return branch; } , disable_reordering: function(e) { if(e) { e.preventDefault(); } if (list_reorder.update_url != null) { serialized = ""; list_reorder.sortable_list.find('> li[id]').each(function(index, li) { if (list_reorder.tree) { serialized += list_reorder.parse_branch([index], li); } else { serialized += "&sortable_list[]=" + $($(li).attr('id').split('_')).last().get(0); } }); serialized += "&tree=" + list_reorder.tree; serialized += "&authenticity_token=" + encodeURIComponent($('#reorder_authenticity_token').val()); serialized += "&continue_reordering=false"; $.post(list_reorder.update_url, serialized, function(data) { // handle the case where we get the whole list back including the <ul> or whatever. if (data.match(new RegExp("^"+ $(list_reorder.sortable_list).get(0).tagName.toLowerCase() + "\ id=\"|\'" + list_reorder.sortable_list + "\"|\'>")).length == 1) { // replace reorder authenticity token's value. $('#reorder_authenticity_token').val($($(data.split('reorder_authenticity_token')).last().get(0).split('value=\'')).last().get(0).split('\'')[0]); // replace actual list content. $(list_reorder.sortable_list).html($(data).html()); } else { $(list_reorder.sortable_list).html(data); } // if we get passed a script tag, re-enable reordering. matches = data.replace('"', "'") .match(/<script\ type='text\/javascript'>([^<]*)<\/script>/im); if (matches != null && matches.length > 1) { list_reorder.enable_reordering(); } else { list_reorder.restore_controls(e); } }); } else { list_reorder.restore_controls(e); } } , restore_controls: function(e) { if (list_reorder.tree && !$.browser.msie) { list_reorder.sortable_list.add(list_reorder.sortable_list.find('ul, li')).draggable('destroy'); } else { $(list_reorder.sortable_list).sortable('destroy'); } $(list_reorder.sortable_list).removeClass('reordering, ui-sortable'); $('#site_bar, #header > *:not(script)').fadeTo(250, 1); $('#actions *:not("#reorder_action_done, #reorder_action")').not($('#reorder_action_done').parents('li, ul')).fadeTo(250, 1, function() { $('#reorder_action_done').hide(); $('#reorder_action').show(); }); } } var image_picker = { options: { selected: '', thumbnail: 'dialog_thumb', field: '#image', image_display: '#current_picked_image', no_image_message: '#no_picked_image_selected', image_container: '#current_image_container', remove_image_button: '#remove_picked_image', image_toggler: null } , init: function(new_options){ this.options = $.extend(this.options, new_options); $(this.options.remove_image_button).click($.proxy(this.remove_image, this)); $(this.options.image_toggler).click($.proxy(this.toggle_image, this)); } , remove_image: function(e) { e.preventDefault(); $(this.options.image_display).removeClass('brown_border') .attr({'src': '', 'width': '', 'height': ''}) .css({'width': 'auto', 'height': 'auto'}) .hide(); $(this.options.field).val(''); $(this.options.no_image_message).show(); $(this.options.remove_image_button).hide(); $(this).hide(); } , toggle_image: function(e) { $(this.options.image_toggler).html(($(this.options.image_toggler).html() == 'Show' ? 'Hide' : 'Show')); $(this.options.image_container).toggle(); e.preventDefault(); } , changed: function(image) { $(this.options.field).val(image.id.replace("image_", "")); image.src = image.src.replace('_dialog_thumb', '_' + this.options.thumbnail).replace(/\?\d*/, ''); current_image = $(this.options.image_display); current_image.replaceWith($("<img src='"+image.src+"?"+Math.floor(Math.random() * 1000000000)+"' id='"+current_image.attr('id')+"' class='brown_border' />")); $(this.options.remove_image_button).show(); $(this.options.no_image_message).hide(); } } var resource_picker = { callback: null , init: function(callback) { this.callback = callback; } } close_dialog = function(e) { if (parent && parent.document.location.href != document.location.href && $.isFunction(parent.$)) { $(parent.document.body).removeClass('hide-overflow'); parent.$('.ui-dialog').dialog('close').remove(); } else { $(document.body).removeClass('hide-overflow'); $('.ui-dialog').dialog('close').remove(); } e.preventDefault(); } //parse a URL to form an object of properties parseURL = function(url) { //save the unmodified url to href property //so that the object we get back contains //all the same properties as the built-in location object var loc = { 'href' : url }; //split the URL by single-slashes to get the component parts var parts = url.replace('//', '/').split('/'); //store the protocol and host loc.protocol = parts[0]; loc.host = parts[1]; //extract any port number from the host //from which we derive the port and hostname parts[1] = parts[1].split(':'); loc.hostname = parts[1][0]; loc.port = parts[1].length > 1 ? parts[1][1] : ''; //splice and join the remainder to get the pathname parts.splice(0, 2); loc.pathname = '/' + parts.join('/'); //extract any hash and remove from the pathname loc.pathname = loc.pathname.split('#'); loc.hash = loc.pathname.length > 1 ? '#' + loc.pathname[1] : ''; loc.pathname = loc.pathname[0]; //extract any search query and remove from the pathname loc.pathname = loc.pathname.split('?'); loc.search = loc.pathname.length > 1 ? '?' + loc.pathname[1] : ''; loc.pathname = loc.pathname[0]; //return the final object return loc; }
mit
andersinno/cmsplugin-carousel-ai
cmsplugin_carousel_ai/migrations/0003_slide_description.py
482
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cmsplugin_carousel_ai', '0002_add_call_to_action_label_for_slides'), ] operations = [ migrations.AddField( model_name='slide', name='description', field=models.CharField(max_length=380, verbose_name='slide description', blank=True), ), ]
mit
devxkh/FrankE
Editor/VEX/PCL/Properties/AssemblyInfo.cs
1121
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über folgende // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die einer Assembly zugeordnet sind. [assembly: AssemblyTitle("PCL.XEditor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PCL.XEditor")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("de")] // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: // // Hauptversion // Nebenversion // Buildnummer // Revision // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // durch Einsatz von '*', wie in nachfolgendem Beispiel: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
meditativeape/wikiracer
impl/bfs.go
3694
package impl import ( "github.com/meditativeape/wikiracer/util" "runtime" "sync" ) var numCrawlersPerLevel int = runtime.NumCPU() * 10 func FindPath(startUrl string, endUrl string) (*[]string, *map[string]string) { articleToParent := make(map[string]string) emptyPath := make([]string, 0) // Make sure both startUrl and endUrl point to valid Wikipedia articles startArticle, err := GetArticleNameFromUrlString(startUrl) if err != nil || !IsReachable(startUrl) { util.Logger.Printf("Invalid StartURL: %s\n", startUrl) return &emptyPath, &articleToParent } endArticle, err := GetArticleNameFromUrlString(endUrl) if err != nil || !IsReachable(endUrl) { util.Logger.Printf("Invalid EndURL: %s\n", endUrl) return &emptyPath, &articleToParent } articleToParent[startArticle] = "root" if startUrl == endUrl { emptyPath = append(emptyPath, startUrl) return &emptyPath, &articleToParent } outputCh := make(chan ArticleWithParent) var wg sync.WaitGroup wg.Add(1) go crawlSingleArticleAndSync(startArticle, outputCh, &wg) go closeChannelOnWg(outputCh, &wg) level := 0 found := false for { // collect outputs from crawlers at the current level, and skip articles that are already visited toBeCrawled := make([]string, 0) for articleWithParent := range outputCh { nextArticle := articleWithParent.Article if articleToParent[nextArticle] == "" { articleToParent[nextArticle] = articleWithParent.ParentArticle if nextArticle == endArticle { found = true break } else { toBeCrawled = append(toBeCrawled, nextArticle) } } } if found { util.Logger.Printf( "Found a path while crawling level %d! Start: %s End: %s\n", level, startArticle, endArticle) break } else { util.Logger.Printf( "Collected %d outputs from crawlers for level %d. Start: %s End: %s\n", len(toBeCrawled), level, startArticle, endArticle) level++ } // start a fixed number of goroutines to crawl all articles at the next level inputCh := make(chan string) nextOutputCh := make(chan ArticleWithParent, 1000) var nextWg sync.WaitGroup nextWg.Add(numCrawlersPerLevel) for i := 0; i < numCrawlersPerLevel; i++ { go crawlMultipleArticlesAndSync(inputCh, nextOutputCh, &nextWg) } go closeChannelOnWg(nextOutputCh, &nextWg) util.Logger.Printf( "Started %d crawlers for level %d. Start: %s End: %s\n", numCrawlersPerLevel, level, startArticle, endArticle) // start a goroutine to feed URLs into input channel go feedArticlesIntoChannel(toBeCrawled, inputCh) outputCh = nextOutputCh } return getPath(&articleToParent, endArticle), &articleToParent } func feedArticlesIntoChannel(articles []string, ch chan string) { for _, article := range articles { ch <- article } close(ch) } func crawlSingleArticleAndSync(article string, outputCh chan ArticleWithParent, wg *sync.WaitGroup) { crawl(article, outputCh) (*wg).Done() } func crawlMultipleArticlesAndSync(inputCh chan string, outputCh chan ArticleWithParent, wg *sync.WaitGroup) { for article := range inputCh { crawl(article, outputCh) } (*wg).Done() } func closeChannelOnWg(ch chan ArticleWithParent, wg *sync.WaitGroup) { (*wg).Wait() close(ch) } func getPath(articleToParent *map[string]string, endArticle string) *[]string { reversedPath := make([]string, 0) currentArticle := endArticle for currentArticle != "root" { reversedPath = append(reversedPath, currentArticle) currentArticle = (*articleToParent)[currentArticle] } pathLen := len(reversedPath) path := make([]string, pathLen) for i := 0; i < pathLen; i++ { path[i] = GetUrlStringFromArticleName(reversedPath[pathLen-i-1]) } return &path }
mit
LaravelRUS/SleepingOwlAdmin
src/Traits/ElementTaggable.php
386
<?php namespace SleepingOwl\Admin\Traits; trait ElementTaggable { /** * @var bool */ protected $taggable = false; /** * @return bool */ public function isTaggable() { return $this->taggable; } /** * @return $this */ public function taggable() { $this->taggable = true; return $this; } }
mit
jenningsm42/vulpan
vulpan/LoadResourceTask.cpp
750
#include "include/Engine.h" #include "include/LoadResourceTask.h" #include "include/Logger.h" namespace vlp { LoadResourceTask::LoadResourceTask(std::string&& path) : m_path(std::move(path)) { } void LoadResourceTask::run(Engine& engine) { auto loader = engine.getResourceLoader(); auto data = loader.readFile(m_path); if (data.size() == 0) { // readFile will log the exact error logger.log("Unable to load resource '%s'", m_path.c_str()); return; } if (data.size() >= 128 && memcmp(data.data(), "DDS ", 4) == 0) { auto resource = loader.loadDDS(data); engine.getResourceCache().add<TextureResource>(m_path, resource); } else { logger.log("Resource '%s' is in an unsupported format", m_path.c_str()); } } }
mit
zhangqiang110/my4j
pms/src/main/java/com/swfarm/biz/magento/bo/magentoapi/ComplexFilterArray.java
1889
package com.swfarm.biz.magento.bo.magentoapi; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p> * Java class for complexFilterArray complex type. * * <p> * The following schema fragment specifies the expected content contained within * this class. * * <pre> * &lt;complexType name="complexFilterArray"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="complexObjectArray" type="{urn:Magento}complexFilter" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "complexFilterArray", propOrder = { "complexObjectArray" }) public class ComplexFilterArray { protected List<ComplexFilter> complexObjectArray; /** * Gets the value of the complexObjectArray property. * * <p> * This accessor method returns a reference to the live list, not a * snapshot. Therefore any modification you make to the returned list will * be present inside the JAXB object. This is why there is not a * <CODE>set</CODE> method for the complexObjectArray property. * * <p> * For example, to add a new item, do as follows: * * <pre> * getComplexObjectArray().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link ComplexFilter } * * */ public List<ComplexFilter> getComplexObjectArray() { if (complexObjectArray == null) { complexObjectArray = new ArrayList<ComplexFilter>(); } return this.complexObjectArray; } }
mit
pr-snas/mural-de-recados
config/initializers/inflections.rb
633
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format # (all these examples are active by default): # ActiveSupport::Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end # # These inflection rules are supported but not enabled by default: # ActiveSupport::Inflector.inflections do |inflect| # inflect.acronym 'RESTful' # end ActiveSupport::Inflector.inflections do |inflect| inflect.irregular 'categoria', 'categorias' end
mit
URMC/i2b2_redi
java/src/main/java/edu/rochester/urmc/i2b2/SQLQueryJob.java
18211
/** * Copyright 2015 , University of Rochester Medical Center * * * 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 png (phillip_ng@urmc.rochester.edu) * * Revisions: * * 2016/03/01 cculbertson1 * Added reschedule() functionality and accompanying members and logic in * refresh(). */ package edu.rochester.urmc.i2b2; import edu.rochester.urmc.util.HashMapFunctions; import edu.rochester.urmc.util.SQLUtilities; import java.sql.Connection; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Properties; import java.util.Random; import javax.mail.Message; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; /** * This class represents a line within the I2B2_JOBS table in the control database, and is a task set to run by the * URMC tools. This class contains many of the utility functions, such as error logging, general logging, thread awareness * of whether it needs to be run, etc. * * When jobs are started or are running, the status of checking whether something is cancelled, its status, are handled * via a cached system. The updates to statuses are stored in memory, awaiting some interval, so that the database is * not being hammered by tons of tiny requests updating everything. * * @author png */ public class SQLQueryJob extends Thread implements Comparable{ boolean isCancelled = false; boolean isRescheduled = false; public Connection cntldb = null; public Connection datadb = null; public HashMap project = null; public Properties settings = null; public Object project_code = null; public Object project_id = null; public String job_id = null; private String queuedState = null; int delay = 0; boolean isStarted = false; long lastChecked = System.currentTimeMillis(); boolean dirty = false; String queuedStatus = ""; int queuedProgress = 0; Logger logger = LogManager.getLogger(SQLQueryJob.class); /** * Initialize is always called by the Monitor thread in order to pass items normally in an class intialization * which can't be done in reflection. * * @param cntldb - this is the control database where the I2B2_JOBS and its logs live. * @param datadb - This is the data database which contains i2b2. * @param job - The specific line from the I2B2_JOBS table. * @param settings - The settings for this runtime * @return this class after being loaded with data. */ public SQLQueryJob initialize( Connection cntldb, Connection datadb, HashMap job, Properties settings ) { this.datadb = datadb; this.cntldb = cntldb; this.project = job; this.settings = settings; project_code = job.get("PROJECTCODE"); project_id = job.get("PROJECTID"); job_id = ""+job.get("JOB_ID"); delay = new Random().nextInt( 10000 ); logger = LogManager.getLogger(this.getClass()); return this; } public HashMap getJob(){ return project; } public String getID(){ return job_id; } /** * This is a default run method that starts and stops itself, no work is done. */ public void run(){ updateStatus("Running"); try{ Thread.sleep(delay); } catch (Exception ex ){} updateStatus("Complete"); } public String toString(){ return this.getClass().getName() + ": "+project+""; } public boolean isCancelled() { refresh(); return isCancelled || !isRunnable(); } /** * Refreshes the job status and checks if it has been rescheduled * * @author cculbertson1 (curtis_culbertson@urmc.rochester.edu) * * @return true if the job has been rescheduled, false otherwise */ public boolean isRescheduled() { refresh(); return isRescheduled && !isRunnable(); } /** * This method performs the synchronization between the local memory and the database. * * Updated by cculbertson1 (curtis_culbertson@urmc.rochester.edu) to include rescheduling logic */ public void refresh(){ //since this changes the operation, you really don't want the statuses to change in here while you're trying to //update and get them correct. synchronized( this ){ //placed check in here so we're not hammering the server for updates. System status update changes get //immediate change however. Check every 5 seconds or less for status changes. if( !dirty && ( System.currentTimeMillis() - lastChecked > 5000 || queuedStatus.toLowerCase().startsWith("complete") || queuedStatus.toLowerCase().startsWith("error") || queuedStatus.toLowerCase().startsWith("cancel") ) ){ //this is so we don't infinitely stack overflow when refresh is called from something in refresh(). dirty = true; logger.debug("Checking for updates " + new Date() + " : " + project.get("STATUS") + ": " +queuedStatus ); try{ if( !(queuedStatus.toUpperCase().startsWith("ERROR") || queuedStatus.toUpperCase().startsWith("QUEUE") || queuedStatus.toUpperCase().startsWith("RESCHEDULED")) ){ if( project.get("ACTUAL_START_TIME") == null ){ SQLUtilities.execSQL(cntldb,"UPDATE I2B2_JOBS SET ACTUAL_START_TIME=SYSDATE WHERE JOB_ID='"+job_id+"'"); } isStarted = true; isRescheduled = false; } if( "ERROR".equalsIgnoreCase(queuedStatus) || queuedStatus.toUpperCase().startsWith("COMPLETE") || "CANCELLED".equalsIgnoreCase(queuedStatus) || queuedStatus.toUpperCase().startsWith("RESCHEDULED") ){ if( project.get("ACTUAL_END_TIME") == null ){ SQLUtilities.execSQL(cntldb,"UPDATE I2B2_JOBS SET ACTUAL_END_TIME=SYSDATE WHERE JOB_ID='"+job_id+"'"); } } if( queuedStatus.toUpperCase().startsWith("COMPLETE") ){ queuedProgress = 100; project.put("PERCENT_COMPLETE","100"); } if(!isRunnable()){ logger.debug("Thread Marked as Not Runnable."); } //refresh your data! This is so if for some reason, the numbers are changed since we last ran it, we can reverse the project = SQLUtilities.getTableHashedArray(cntldb, "SELECT I2B2_JOBS.* , PROJECTS.CONTACTEMAIL, PROJECTS.PROJECTCODE " + "FROM I2B2_JOBS LEFT JOIN PROJECTS " + "ON ( PROJECTS.PROJECTID=I2B2_JOBS.PROJECTID ) " + "WHERE JOB_ID='"+job_id+"'" )[0]; logger.debug( "requested to " + queuedStatus + ":" + queuedProgress + " " + this); //since cancellation is very important to check, do that comparison first. isCancelled |= (""+project.get("STATUS")).toUpperCase().startsWith("CANCEL"); isRescheduled |= (""+project.get("STATUS")).toUpperCase().startsWith("RESCHEDULED"); if( isCancelled ){ log( "Cancelled called" ); } // Removed because this line gets called continuously while in the rescheduled state // if(isRescheduled) { // log("Rescheduled called"); // } //just check that you don't go backward in statuses if you cancel. if( !isCancelled || !isRescheduled || ((isCancelled || isRescheduled) && (queuedStatus.toUpperCase().startsWith("QUEUED") || queuedStatus.toUpperCase().startsWith("ERROR") || queuedStatus.toUpperCase().startsWith("CANCEL") || queuedStatus.toUpperCase().startsWith("RESCHEDULED")))) { if( !queuedStatus.equals( project.get("STATUS") ) ){ logger.info("Updated Status to " + queuedStatus); } SQLUtilities.execSQL(cntldb,"UPDATE I2B2_JOBS SET LAST_TOUCHED=SYSDATE, STATUS='"+queuedStatus+"' WHERE JOB_ID='"+job_id+"'"); } else { logger.error( "Current status is " + project.get("STATUS") + " tried to set " + queuedStatus ); } // Update percent complete if( queuedProgress > 0 ){ SQLUtilities.execSQL(cntldb,"UPDATE I2B2_JOBS SET LAST_TOUCHED=SYSDATE, PERCENT_COMPLETE='"+queuedProgress+"' WHERE JOB_ID='"+job_id+"'"); } // Update params if( queuedState != null ){ SQLUtilities.execSQL(cntldb,"UPDATE I2B2_JOBS SET LAST_TOUCHED=SYSDATE, PARAMS='"+ queuedState.replaceAll("'","''") +"' WHERE JOB_ID='"+job_id+"'"); } lastChecked = System.currentTimeMillis(); } catch ( Exception ex ){ logger.error("Uncaught Exception", ex); } finally { dirty = false; } } //if not dirty and either the time is within window or there's a status change. } //synchronized - you don't want to collide mid execution with a status change. } public boolean isStarted(){ return isStarted; } public void updateStatus(String msg){ updateStatus( msg, -1 ); } public void updateStatus(String msg, int currentpct ) { updateStatus( msg, currentpct, null ); } public void updateStatus(String msg, int currentpct, String savestate ) { synchronized( this ){ queuedStatus = msg.replaceAll("'", "''"); queuedProgress = currentpct; queuedState = savestate; } refresh(); } public void reschedule(String startTime, String endTime) throws Exception { reschedule(startTime, endTime, -1); } public void reschedule(String startTime, String endTime, int percentComplete) throws Exception { reschedule(startTime, endTime, percentComplete, null); } /** * Reschedule a thread for the specified startTime time, putting it into a * queued status. Any required parameters will be recorded. * * @author cculbertson1 (curtis_culbertson@urmc.rochester.edu) * * @param startTime the time that the thread should resume as a String * @param endTime the time that the thread should end as a String * @param percentComplete the current progress * @param params any parameters that should be used when resuming * @throws Exception */ public void reschedule(String startTime, String endTime, int percentComplete, String params) throws Exception { //Commenting these lines out so the job isn't actually rescheduled aside from status //SQLUtilities.execSQL(cntldb,"UPDATE I2B2_JOBS SET START_TIME=TO_DATE('" + startTime + "','yyyymmddhh24miss') WHERE JOB_ID='"+job_id+"'"); //SQLUtilities.execSQL(cntldb,"UPDATE I2B2_JOBS SET END_TIME=TO_DATE('" + endTime + "','yyyymmddhh24miss') WHERE JOB_ID='"+job_id+"'"); synchronized( this ){ isRescheduled = true; queuedStatus = "Rescheduled"; queuedProgress = percentComplete; queuedState = params; } refresh(); } /** * This returns whether or not this thread should be running,based on what time it is allowed to run in the schedule. * @return */ public boolean isRunnable(){ boolean ans = !isCancelled ; refresh(); Date requested_start = (Date) project.get("START_TIME"); if( requested_start != null ){ ans &= requested_start.before(new Date()); } Date requested_end = (Date) project.get("END_TIME"); if( requested_end != null ){ ans &= requested_end.after(new Date()); } return ans; } public void log( String data ){ logger.info( data ); refresh(); String insert = data.replaceAll("'", "''"); try{ //insert more than one line for exceptionally long output. while( insert.length() > 0 ){ String line = insert; if( insert.length() > 980 ){ line = insert.substring(0,980); insert = insert.substring(980); if( line.endsWith("'") && !line.endsWith("''") ){ line += "'"; insert = insert.substring(1); } line += "<continues/>"; } else { insert = ""; } //create table trials.i2b2_jobs_log ( JOB_ID number, DATEOF TIMESTAMP, DESCR VARCHAR2(1000)); SQLUtilities.execSQL(cntldb,"INSERT INTO i2b2_jobs_log( JOB_ID, DATEOF, DESCR ) VALUES ( '"+job_id+"', SYSTIMESTAMP, '"+ line +"') "); } }catch ( Exception ex ){ logger.error("Uncaught Exception", ex); } } public void logError( Exception ex ){ logger.error("Uncaught Exception", ex); String aggregate = "" + ex.getClass() + ": " + ex.getMessage() + "\n" ; for( Object line: ex.getStackTrace() ){ aggregate += "\t"+line + "\n"; } try{ updateStatus( "Error" ); SQLUtilities.execSQL(cntldb,"UPDATE i2b2_jobs SET ERROR_CLOB='"+ aggregate.replaceAll("'", "`") +"') WHERE JOB_ID='"+job_id+"' "); }catch (Exception ex1){ logger.error("Uncaught Exception", ex1); } log( aggregate ); } public static int getMaxInstances(){ return 5; } @Override public int compareTo(Object o) { int answer = -1; if( o != null && o instanceof SQLQueryJob ){ answer = job_id.compareTo(((SQLQueryJob) o).getID()); } return answer; } public String[] getNotificationTos(){ String answer = settings.getProperty("mail.default.sendto" ); if( project.get("LAST_UI_TOUCHED") != null && System.currentTimeMillis() - ((Date) project.get("LAST_UI_TOUCHED")).getTime() > 10000 ){ answer += "," + project.get("CONTACTEMAIL"); } return answer.split(","); } public String getNotificationFrom(){ return settings.getProperty("mail.default.sendfrom" ); } public Date getLastUITouch(){ return (Date) project.get("LAST_UI_TOUCHED"); } public String getStatus(){ return queuedStatus; } public String getNotificationSubject(){ return this.getClass().getSimpleName() + " for project " + this.project_code + ", is " + getStatus(); } public String generateHtmlReport() throws Exception { StringBuffer buf = new StringBuffer(); buf.append("<p>Hello,<br>"); buf.append("<br>You are seeing this message because it looks like you've left the i2b2 web user interface, we wanted to let you know what happened with your request."); buf.append("<br><br>The status of the request was <strong>" + getStatus() +"</strong>."); buf.append("<br><br>Your request was as follows:"); buf.append( HashMapFunctions.hashMapToTable(project)); buf.append("<br>The log of this process is below: <br><hr><ul>"); boolean continues = false; for( Object l : new SQLUtilities(cntldb, "SELECT DESCR, TO_CHAR(DATEOF,'HH24:MI:SS') AS TIMEOF FROM i2b2_jobs_log log WHERE JOB_ID = " + job_id + " ORDER BY DATEOF")){ HashMap line = (HashMap)l; String descr = ""+line.get("DESCR"); if( !continues ){ buf.append("<li>" + line.get("TIMEOF") + " - " ); } if(descr.contains("<continues/>")){ continues = true; } else { continues = false; } buf.append(descr.replaceAll("<continues/>", "")); if( !continues ){ buf.append("</li>"); } } buf.append("</ul>"); return buf.toString(); } private String htmlfix( String xml ){ return xml.replaceAll("&", "&amp;").replaceAll(">", "&gt;").replaceAll("<", "&lt;"); } }
mit
jburgui/proyecto2.0
src/proyecto/backendBundle/Entity/Fragmento.php
5010
<?php namespace proyecto\backendBundle\Entity; /** * Entidad Fragmento * @author Javier Burguillo Sánchez */ class Fragmento { /** * @var integer */ private $id; /** * @var string */ private $nombre; /** * @var boolean */ private $primeraLetra; /** * @var boolean */ private $ultimaLetra; /** * @var boolean */ private $dosEspaciosJuntos; /** * @var boolean */ private $tresLetrasJuntas; /** * @var integer */ private $ratioDadasEliminadas; /** * @var integer */ private $letrasDadas; /** * @var integer */ private $ratioVocalesConsonantes; /** * @var \proyecto\backendBundle\Entity\Adjetivo */ private $idAdjetivo; /** * Obtener id * * @return integer */ public function getId() { return $this->id; } /** * Establecer nombre * * @param string * @return Fragmento */ public function setNombre($nombre) { $this->nombre = $nombre; return $this; } /** * Obtener nombre * * @return string */ public function getNombre() { return $this->nombre; } /** * Establecer primeraLetra * * @param boolean * @return Fragmento */ public function setPrimeraLetra($primeraLetra) { $this->primeraLetra = $primeraLetra; return $this; } /** * Obtener primeraLetra * * @return boolean */ public function getPrimeraLetra() { return $this->primeraLetra; } /** * Establecer ultimaLetra * * @param boolean * @return Fragmento */ public function setUltimaLetra($ultimaLetra) { $this->ultimaLetra = $ultimaLetra; return $this; } /** * Obtener ultimaLetra * * @return boolean */ public function getUltimaLetra() { return $this->ultimaLetra; } /** * Establecer dosEspaciosJuntos * * @param boolean * @return Fragmento */ public function setDosEspaciosJuntos($dosEspaciosJuntos) { $this->dosEspaciosJuntos = $dosEspaciosJuntos; return $this; } /** * Obtener dosEspaciosJuntos * * @return boolean */ public function getDosEspaciosJuntos() { return $this->dosEspaciosJuntos; } /** * Establecer tresLetrasJuntas * * @param boolean * @return Fragmento */ public function setTresLetrasJuntas($tresLetrasJuntas) { $this->tresLetrasJuntas = $tresLetrasJuntas; return $this; } /** * Obtener tresLetrasJuntas * * @return boolean */ public function getTresLetrasJuntas() { return $this->tresLetrasJuntas; } /** * Establecer ratioDadasEliminadas * * @param integer * @return Fragmento */ public function setRatioDadasEliminadas($ratioDadasEliminadas) { $this->ratioDadasEliminadas = $ratioDadasEliminadas; return $this; } /** * Obtener ratioDadasEliminadas * * @return integer */ public function getRatioDadasEliminadas() { return $this->ratioDadasEliminadas; } /** * Establecer letrasDadas * * @param integer * @return Fragmento */ public function setLetrasDadas($letrasDadas) { $this->letrasDadas = $letrasDadas; return $this; } /** * Obtener letrasDadas * * @return integer */ public function getLetrasDadas() { return $this->letrasDadas; } /** * Establecer ratioVocalesConsonantes * * @param integer * @return Fragmento */ public function setRatioVocalesConsonantes($ratioVocalesConsonantes) { $this->ratioVocalesConsonantes = $ratioVocalesConsonantes; return $this; } /** * Obtener ratioVocalesConsonantes * * @return integer */ public function getRatioVocalesConsonantes() { return $this->ratioVocalesConsonantes; } /** * Establecer idAdjetivo * * @param \proyecto\backendBundle\Entity\Adjetivo * @return Fragmento */ public function setIdAdjetivo(\proyecto\backendBundle\Entity\Adjetivo $idAdjetivo = null) { $this->idAdjetivo = $idAdjetivo; return $this; } /** * Obtener idAdjetivo * * @return \proyecto\backendBundle\Entity\Adjetivo */ public function getIdAdjetivo() { return $this->idAdjetivo; } /** * Método mágico. Devuelve el campo irdentificador principal para que no sea el id * * @return string */ public function __toString (){ return $this->nombre; } }
mit
kimochka/hispalia-cms
application/logs/log-2015-01-02.php
87868
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?> DEBUG - 2015-01-02 21:14:59 --> Config Class Initialized DEBUG - 2015-01-02 21:14:59 --> Hooks Class Initialized DEBUG - 2015-01-02 21:14:59 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:14:59 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:14:59 --> URI Class Initialized DEBUG - 2015-01-02 21:14:59 --> Router Class Initialized DEBUG - 2015-01-02 21:14:59 --> No URI present. Default controller set. DEBUG - 2015-01-02 21:14:59 --> Output Class Initialized DEBUG - 2015-01-02 21:14:59 --> Security Class Initialized DEBUG - 2015-01-02 21:14:59 --> Input Class Initialized DEBUG - 2015-01-02 21:14:59 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:14:59 --> Language Class Initialized DEBUG - 2015-01-02 21:14:59 --> Loader Class Initialized DEBUG - 2015-01-02 21:14:59 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:14:59 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:14:59 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:14:59 --> Database Driver Class Initialized ERROR - 2015-01-02 21:15:00 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:15:01 --> Jquery Class Initialized DEBUG - 2015-01-02 21:15:01 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:15:01 --> Table Class Initialized DEBUG - 2015-01-02 21:15:01 --> Model Class Initialized DEBUG - 2015-01-02 21:15:01 --> Model Class Initialized DEBUG - 2015-01-02 21:15:01 --> Model Class Initialized DEBUG - 2015-01-02 21:15:01 --> Model Class Initialized DEBUG - 2015-01-02 21:15:01 --> Controller Class Initialized DEBUG - 2015-01-02 21:15:01 --> File loaded: application/views/index.php DEBUG - 2015-01-02 21:15:01 --> Final output sent to browser DEBUG - 2015-01-02 21:15:01 --> Total execution time: 1.9250 DEBUG - 2015-01-02 21:15:05 --> Config Class Initialized DEBUG - 2015-01-02 21:15:05 --> Hooks Class Initialized DEBUG - 2015-01-02 21:15:05 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:15:05 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:15:05 --> URI Class Initialized DEBUG - 2015-01-02 21:15:05 --> Router Class Initialized ERROR - 2015-01-02 21:15:05 --> 404 Page Not Found --> favicon.ico DEBUG - 2015-01-02 21:15:10 --> Config Class Initialized DEBUG - 2015-01-02 21:15:10 --> Hooks Class Initialized DEBUG - 2015-01-02 21:15:10 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:15:10 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:15:10 --> URI Class Initialized DEBUG - 2015-01-02 21:15:10 --> Router Class Initialized DEBUG - 2015-01-02 21:15:10 --> Output Class Initialized DEBUG - 2015-01-02 21:15:10 --> Security Class Initialized DEBUG - 2015-01-02 21:15:10 --> Input Class Initialized DEBUG - 2015-01-02 21:15:10 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:15:10 --> Language Class Initialized DEBUG - 2015-01-02 21:15:10 --> Loader Class Initialized DEBUG - 2015-01-02 21:15:10 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:15:10 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:15:10 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:15:10 --> Database Driver Class Initialized ERROR - 2015-01-02 21:15:10 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:15:10 --> Jquery Class Initialized DEBUG - 2015-01-02 21:15:10 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:15:10 --> Table Class Initialized DEBUG - 2015-01-02 21:15:10 --> Model Class Initialized DEBUG - 2015-01-02 21:15:10 --> Model Class Initialized DEBUG - 2015-01-02 21:15:10 --> Model Class Initialized DEBUG - 2015-01-02 21:15:10 --> Model Class Initialized DEBUG - 2015-01-02 21:15:10 --> Controller Class Initialized DEBUG - 2015-01-02 21:15:10 --> Model Class Initialized DEBUG - 2015-01-02 21:15:11 --> Pagination Class Initialized DEBUG - 2015-01-02 21:15:12 --> File loaded: application/views/general_views/general_table1.php DEBUG - 2015-01-02 21:15:12 --> Final output sent to browser DEBUG - 2015-01-02 21:15:12 --> Total execution time: 1.4406 DEBUG - 2015-01-02 21:15:17 --> Config Class Initialized DEBUG - 2015-01-02 21:15:17 --> Hooks Class Initialized DEBUG - 2015-01-02 21:15:17 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:15:17 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:15:17 --> URI Class Initialized DEBUG - 2015-01-02 21:15:17 --> Router Class Initialized DEBUG - 2015-01-02 21:15:17 --> Output Class Initialized DEBUG - 2015-01-02 21:15:17 --> Security Class Initialized DEBUG - 2015-01-02 21:15:17 --> Input Class Initialized DEBUG - 2015-01-02 21:15:17 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:15:17 --> Language Class Initialized DEBUG - 2015-01-02 21:15:17 --> Loader Class Initialized DEBUG - 2015-01-02 21:15:17 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:15:17 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:15:17 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:15:17 --> Database Driver Class Initialized ERROR - 2015-01-02 21:15:17 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:15:17 --> Jquery Class Initialized DEBUG - 2015-01-02 21:15:17 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:15:17 --> Table Class Initialized DEBUG - 2015-01-02 21:15:17 --> Model Class Initialized DEBUG - 2015-01-02 21:15:17 --> Model Class Initialized DEBUG - 2015-01-02 21:15:17 --> Model Class Initialized DEBUG - 2015-01-02 21:15:17 --> Model Class Initialized DEBUG - 2015-01-02 21:15:17 --> Controller Class Initialized DEBUG - 2015-01-02 21:15:17 --> Model Class Initialized ERROR - 2015-01-02 21:15:17 --> Severity: Notice --> Undefined variable: delegados /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/form_nuevo_cliente.php 333 DEBUG - 2015-01-02 21:15:17 --> File loaded: application/views/clientes/form_nuevo_cliente.php DEBUG - 2015-01-02 21:15:17 --> File loaded: application/views/clientes/nuevo.php DEBUG - 2015-01-02 21:15:17 --> Final output sent to browser DEBUG - 2015-01-02 21:15:17 --> Total execution time: 0.0886 DEBUG - 2015-01-02 21:15:17 --> Config Class Initialized DEBUG - 2015-01-02 21:15:17 --> Hooks Class Initialized DEBUG - 2015-01-02 21:15:17 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:15:17 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:15:17 --> URI Class Initialized DEBUG - 2015-01-02 21:15:17 --> Router Class Initialized DEBUG - 2015-01-02 21:15:17 --> Output Class Initialized DEBUG - 2015-01-02 21:15:17 --> Security Class Initialized DEBUG - 2015-01-02 21:15:17 --> Input Class Initialized DEBUG - 2015-01-02 21:15:17 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:15:17 --> Language Class Initialized DEBUG - 2015-01-02 21:15:17 --> Loader Class Initialized DEBUG - 2015-01-02 21:15:17 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:15:17 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:15:17 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:15:17 --> Database Driver Class Initialized ERROR - 2015-01-02 21:15:17 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:15:17 --> Jquery Class Initialized DEBUG - 2015-01-02 21:15:17 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:15:17 --> Table Class Initialized DEBUG - 2015-01-02 21:15:17 --> Model Class Initialized DEBUG - 2015-01-02 21:15:17 --> Model Class Initialized DEBUG - 2015-01-02 21:15:17 --> Model Class Initialized DEBUG - 2015-01-02 21:15:17 --> Model Class Initialized DEBUG - 2015-01-02 21:15:17 --> Controller Class Initialized DEBUG - 2015-01-02 21:15:17 --> Final output sent to browser DEBUG - 2015-01-02 21:15:17 --> Total execution time: 0.1229 DEBUG - 2015-01-02 21:15:17 --> Config Class Initialized DEBUG - 2015-01-02 21:15:17 --> Hooks Class Initialized DEBUG - 2015-01-02 21:15:17 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:15:17 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:15:17 --> URI Class Initialized DEBUG - 2015-01-02 21:15:17 --> Router Class Initialized DEBUG - 2015-01-02 21:15:17 --> Output Class Initialized DEBUG - 2015-01-02 21:15:17 --> Security Class Initialized DEBUG - 2015-01-02 21:15:17 --> Input Class Initialized DEBUG - 2015-01-02 21:15:17 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:15:17 --> Language Class Initialized DEBUG - 2015-01-02 21:15:18 --> Loader Class Initialized DEBUG - 2015-01-02 21:15:18 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:15:18 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:15:18 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:15:18 --> Database Driver Class Initialized ERROR - 2015-01-02 21:15:18 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:15:18 --> Jquery Class Initialized DEBUG - 2015-01-02 21:15:18 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:15:18 --> Table Class Initialized DEBUG - 2015-01-02 21:15:18 --> Model Class Initialized DEBUG - 2015-01-02 21:15:18 --> Model Class Initialized DEBUG - 2015-01-02 21:15:18 --> Model Class Initialized DEBUG - 2015-01-02 21:15:18 --> Model Class Initialized DEBUG - 2015-01-02 21:15:18 --> Controller Class Initialized DEBUG - 2015-01-02 21:15:18 --> Model Class Initialized ERROR - 2015-01-02 21:15:18 --> 404 Page Not Found --> clientes/favicon.ico DEBUG - 2015-01-02 21:15:50 --> Config Class Initialized DEBUG - 2015-01-02 21:15:50 --> Hooks Class Initialized DEBUG - 2015-01-02 21:15:50 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:15:50 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:15:50 --> URI Class Initialized DEBUG - 2015-01-02 21:15:50 --> Router Class Initialized DEBUG - 2015-01-02 21:15:50 --> Output Class Initialized DEBUG - 2015-01-02 21:15:50 --> Security Class Initialized DEBUG - 2015-01-02 21:15:50 --> Input Class Initialized DEBUG - 2015-01-02 21:15:50 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:15:50 --> Language Class Initialized DEBUG - 2015-01-02 21:15:50 --> Loader Class Initialized DEBUG - 2015-01-02 21:15:50 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:15:50 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:15:50 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:15:50 --> Database Driver Class Initialized ERROR - 2015-01-02 21:15:50 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:15:50 --> Jquery Class Initialized DEBUG - 2015-01-02 21:15:50 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:15:50 --> Table Class Initialized DEBUG - 2015-01-02 21:15:50 --> Model Class Initialized DEBUG - 2015-01-02 21:15:50 --> Model Class Initialized DEBUG - 2015-01-02 21:15:50 --> Model Class Initialized DEBUG - 2015-01-02 21:15:50 --> Model Class Initialized DEBUG - 2015-01-02 21:15:50 --> Controller Class Initialized DEBUG - 2015-01-02 21:15:50 --> XSS Filtering completed DEBUG - 2015-01-02 21:15:50 --> Final output sent to browser DEBUG - 2015-01-02 21:15:50 --> Total execution time: 0.2840 DEBUG - 2015-01-02 21:15:54 --> Config Class Initialized DEBUG - 2015-01-02 21:15:54 --> Hooks Class Initialized DEBUG - 2015-01-02 21:15:54 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:15:54 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:15:54 --> URI Class Initialized DEBUG - 2015-01-02 21:15:54 --> Router Class Initialized DEBUG - 2015-01-02 21:15:54 --> Output Class Initialized DEBUG - 2015-01-02 21:15:54 --> Security Class Initialized DEBUG - 2015-01-02 21:15:54 --> Input Class Initialized DEBUG - 2015-01-02 21:15:54 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:15:54 --> Language Class Initialized DEBUG - 2015-01-02 21:15:54 --> Loader Class Initialized DEBUG - 2015-01-02 21:15:54 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:15:54 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:15:54 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:15:54 --> Database Driver Class Initialized ERROR - 2015-01-02 21:15:54 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:15:54 --> Jquery Class Initialized DEBUG - 2015-01-02 21:15:54 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:15:54 --> Table Class Initialized DEBUG - 2015-01-02 21:15:54 --> Model Class Initialized DEBUG - 2015-01-02 21:15:54 --> Model Class Initialized DEBUG - 2015-01-02 21:15:54 --> Model Class Initialized DEBUG - 2015-01-02 21:15:54 --> Model Class Initialized DEBUG - 2015-01-02 21:15:54 --> Controller Class Initialized DEBUG - 2015-01-02 21:15:54 --> XSS Filtering completed DEBUG - 2015-01-02 21:15:54 --> Final output sent to browser DEBUG - 2015-01-02 21:15:54 --> Total execution time: 0.0302 DEBUG - 2015-01-02 21:15:59 --> Config Class Initialized DEBUG - 2015-01-02 21:15:59 --> Hooks Class Initialized DEBUG - 2015-01-02 21:15:59 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:15:59 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:15:59 --> URI Class Initialized DEBUG - 2015-01-02 21:15:59 --> Router Class Initialized DEBUG - 2015-01-02 21:15:59 --> Output Class Initialized DEBUG - 2015-01-02 21:15:59 --> Security Class Initialized DEBUG - 2015-01-02 21:15:59 --> Input Class Initialized DEBUG - 2015-01-02 21:15:59 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:15:59 --> Language Class Initialized DEBUG - 2015-01-02 21:15:59 --> Loader Class Initialized DEBUG - 2015-01-02 21:15:59 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:15:59 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:15:59 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:15:59 --> Database Driver Class Initialized ERROR - 2015-01-02 21:15:59 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:15:59 --> Jquery Class Initialized DEBUG - 2015-01-02 21:15:59 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:15:59 --> Table Class Initialized DEBUG - 2015-01-02 21:15:59 --> Model Class Initialized DEBUG - 2015-01-02 21:15:59 --> Model Class Initialized DEBUG - 2015-01-02 21:15:59 --> Model Class Initialized DEBUG - 2015-01-02 21:15:59 --> Model Class Initialized DEBUG - 2015-01-02 21:15:59 --> Controller Class Initialized DEBUG - 2015-01-02 21:15:59 --> XSS Filtering completed DEBUG - 2015-01-02 21:15:59 --> Final output sent to browser DEBUG - 2015-01-02 21:15:59 --> Total execution time: 0.0539 DEBUG - 2015-01-02 21:16:19 --> Config Class Initialized DEBUG - 2015-01-02 21:16:19 --> Hooks Class Initialized DEBUG - 2015-01-02 21:16:19 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:16:19 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:16:19 --> URI Class Initialized DEBUG - 2015-01-02 21:16:19 --> Router Class Initialized DEBUG - 2015-01-02 21:16:19 --> Output Class Initialized DEBUG - 2015-01-02 21:16:19 --> Security Class Initialized DEBUG - 2015-01-02 21:16:19 --> Input Class Initialized DEBUG - 2015-01-02 21:16:19 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:16:19 --> Language Class Initialized DEBUG - 2015-01-02 21:16:19 --> Loader Class Initialized DEBUG - 2015-01-02 21:16:19 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:16:19 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:16:19 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:16:19 --> Database Driver Class Initialized ERROR - 2015-01-02 21:16:19 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:16:19 --> Jquery Class Initialized DEBUG - 2015-01-02 21:16:19 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:16:19 --> Table Class Initialized DEBUG - 2015-01-02 21:16:19 --> Model Class Initialized DEBUG - 2015-01-02 21:16:19 --> Model Class Initialized DEBUG - 2015-01-02 21:16:19 --> Model Class Initialized DEBUG - 2015-01-02 21:16:19 --> Model Class Initialized DEBUG - 2015-01-02 21:16:19 --> Controller Class Initialized DEBUG - 2015-01-02 21:16:19 --> XSS Filtering completed DEBUG - 2015-01-02 21:16:19 --> Final output sent to browser DEBUG - 2015-01-02 21:16:19 --> Total execution time: 0.0336 DEBUG - 2015-01-02 21:16:28 --> Config Class Initialized DEBUG - 2015-01-02 21:16:28 --> Hooks Class Initialized DEBUG - 2015-01-02 21:16:28 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:16:28 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:16:28 --> URI Class Initialized DEBUG - 2015-01-02 21:16:28 --> Router Class Initialized DEBUG - 2015-01-02 21:16:28 --> Output Class Initialized DEBUG - 2015-01-02 21:16:28 --> Security Class Initialized DEBUG - 2015-01-02 21:16:28 --> Input Class Initialized DEBUG - 2015-01-02 21:16:28 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:16:28 --> Language Class Initialized DEBUG - 2015-01-02 21:16:28 --> Loader Class Initialized DEBUG - 2015-01-02 21:16:28 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:16:28 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:16:28 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:16:28 --> Database Driver Class Initialized ERROR - 2015-01-02 21:16:28 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:16:28 --> Jquery Class Initialized DEBUG - 2015-01-02 21:16:28 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:16:28 --> Table Class Initialized DEBUG - 2015-01-02 21:16:28 --> Model Class Initialized DEBUG - 2015-01-02 21:16:28 --> Model Class Initialized DEBUG - 2015-01-02 21:16:28 --> Model Class Initialized DEBUG - 2015-01-02 21:16:28 --> Model Class Initialized DEBUG - 2015-01-02 21:16:28 --> Controller Class Initialized DEBUG - 2015-01-02 21:16:28 --> XSS Filtering completed DEBUG - 2015-01-02 21:16:28 --> Final output sent to browser DEBUG - 2015-01-02 21:16:28 --> Total execution time: 0.0337 DEBUG - 2015-01-02 21:16:28 --> Config Class Initialized DEBUG - 2015-01-02 21:16:28 --> Hooks Class Initialized DEBUG - 2015-01-02 21:16:28 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:16:28 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:16:28 --> URI Class Initialized DEBUG - 2015-01-02 21:16:28 --> Router Class Initialized DEBUG - 2015-01-02 21:16:28 --> Output Class Initialized DEBUG - 2015-01-02 21:16:28 --> Security Class Initialized DEBUG - 2015-01-02 21:16:28 --> Input Class Initialized DEBUG - 2015-01-02 21:16:28 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:16:28 --> Language Class Initialized DEBUG - 2015-01-02 21:16:28 --> Loader Class Initialized DEBUG - 2015-01-02 21:16:28 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:16:28 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:16:28 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:16:28 --> Database Driver Class Initialized ERROR - 2015-01-02 21:16:28 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:16:28 --> Jquery Class Initialized DEBUG - 2015-01-02 21:16:28 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:16:28 --> Table Class Initialized DEBUG - 2015-01-02 21:16:28 --> Model Class Initialized DEBUG - 2015-01-02 21:16:28 --> Model Class Initialized DEBUG - 2015-01-02 21:16:28 --> Model Class Initialized DEBUG - 2015-01-02 21:16:28 --> Model Class Initialized DEBUG - 2015-01-02 21:16:28 --> Controller Class Initialized DEBUG - 2015-01-02 21:16:28 --> XSS Filtering completed DEBUG - 2015-01-02 21:16:28 --> Final output sent to browser DEBUG - 2015-01-02 21:16:28 --> Total execution time: 0.0320 DEBUG - 2015-01-02 21:16:31 --> Config Class Initialized DEBUG - 2015-01-02 21:16:31 --> Hooks Class Initialized DEBUG - 2015-01-02 21:16:31 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:16:31 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:16:31 --> URI Class Initialized DEBUG - 2015-01-02 21:16:31 --> Router Class Initialized DEBUG - 2015-01-02 21:16:31 --> Output Class Initialized DEBUG - 2015-01-02 21:16:31 --> Security Class Initialized DEBUG - 2015-01-02 21:16:31 --> Input Class Initialized DEBUG - 2015-01-02 21:16:31 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:16:31 --> Language Class Initialized DEBUG - 2015-01-02 21:16:31 --> Loader Class Initialized DEBUG - 2015-01-02 21:16:31 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:16:31 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:16:31 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:16:31 --> Database Driver Class Initialized ERROR - 2015-01-02 21:16:31 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:16:31 --> Jquery Class Initialized DEBUG - 2015-01-02 21:16:31 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:16:31 --> Table Class Initialized DEBUG - 2015-01-02 21:16:31 --> Model Class Initialized DEBUG - 2015-01-02 21:16:31 --> Model Class Initialized DEBUG - 2015-01-02 21:16:31 --> Model Class Initialized DEBUG - 2015-01-02 21:16:31 --> Model Class Initialized DEBUG - 2015-01-02 21:16:31 --> Controller Class Initialized DEBUG - 2015-01-02 21:16:31 --> XSS Filtering completed DEBUG - 2015-01-02 21:16:31 --> Final output sent to browser DEBUG - 2015-01-02 21:16:31 --> Total execution time: 0.0394 DEBUG - 2015-01-02 21:16:33 --> Config Class Initialized DEBUG - 2015-01-02 21:16:33 --> Hooks Class Initialized DEBUG - 2015-01-02 21:16:33 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:16:33 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:16:33 --> URI Class Initialized DEBUG - 2015-01-02 21:16:33 --> Router Class Initialized DEBUG - 2015-01-02 21:16:33 --> Output Class Initialized DEBUG - 2015-01-02 21:16:33 --> Security Class Initialized DEBUG - 2015-01-02 21:16:33 --> Input Class Initialized DEBUG - 2015-01-02 21:16:33 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:16:33 --> Language Class Initialized DEBUG - 2015-01-02 21:16:33 --> Loader Class Initialized DEBUG - 2015-01-02 21:16:33 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:16:33 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:16:33 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:16:33 --> Database Driver Class Initialized ERROR - 2015-01-02 21:16:33 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:16:33 --> Jquery Class Initialized DEBUG - 2015-01-02 21:16:33 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:16:33 --> Table Class Initialized DEBUG - 2015-01-02 21:16:33 --> Model Class Initialized DEBUG - 2015-01-02 21:16:33 --> Model Class Initialized DEBUG - 2015-01-02 21:16:33 --> Model Class Initialized DEBUG - 2015-01-02 21:16:33 --> Model Class Initialized DEBUG - 2015-01-02 21:16:33 --> Controller Class Initialized DEBUG - 2015-01-02 21:16:33 --> XSS Filtering completed DEBUG - 2015-01-02 21:16:33 --> Final output sent to browser DEBUG - 2015-01-02 21:16:33 --> Total execution time: 0.0304 DEBUG - 2015-01-02 21:16:35 --> Config Class Initialized DEBUG - 2015-01-02 21:16:35 --> Hooks Class Initialized DEBUG - 2015-01-02 21:16:35 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:16:35 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:16:35 --> URI Class Initialized DEBUG - 2015-01-02 21:16:35 --> Router Class Initialized DEBUG - 2015-01-02 21:16:35 --> Output Class Initialized DEBUG - 2015-01-02 21:16:35 --> Security Class Initialized DEBUG - 2015-01-02 21:16:35 --> Input Class Initialized DEBUG - 2015-01-02 21:16:35 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:16:35 --> Language Class Initialized DEBUG - 2015-01-02 21:16:35 --> Loader Class Initialized DEBUG - 2015-01-02 21:16:35 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:16:35 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:16:35 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:16:35 --> Database Driver Class Initialized ERROR - 2015-01-02 21:16:35 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:16:35 --> Jquery Class Initialized DEBUG - 2015-01-02 21:16:35 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:16:35 --> Table Class Initialized DEBUG - 2015-01-02 21:16:35 --> Model Class Initialized DEBUG - 2015-01-02 21:16:35 --> Model Class Initialized DEBUG - 2015-01-02 21:16:35 --> Model Class Initialized DEBUG - 2015-01-02 21:16:35 --> Model Class Initialized DEBUG - 2015-01-02 21:16:35 --> Controller Class Initialized DEBUG - 2015-01-02 21:16:35 --> XSS Filtering completed DEBUG - 2015-01-02 21:16:35 --> Final output sent to browser DEBUG - 2015-01-02 21:16:35 --> Total execution time: 0.0293 DEBUG - 2015-01-02 21:16:54 --> Config Class Initialized DEBUG - 2015-01-02 21:16:54 --> Hooks Class Initialized DEBUG - 2015-01-02 21:16:54 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:16:54 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:16:54 --> URI Class Initialized DEBUG - 2015-01-02 21:16:54 --> Router Class Initialized DEBUG - 2015-01-02 21:16:54 --> Output Class Initialized DEBUG - 2015-01-02 21:16:54 --> Security Class Initialized DEBUG - 2015-01-02 21:16:54 --> Input Class Initialized DEBUG - 2015-01-02 21:16:54 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:16:54 --> Language Class Initialized DEBUG - 2015-01-02 21:16:54 --> Loader Class Initialized DEBUG - 2015-01-02 21:16:54 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:16:54 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:16:54 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:16:54 --> Database Driver Class Initialized ERROR - 2015-01-02 21:16:54 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:16:54 --> Jquery Class Initialized DEBUG - 2015-01-02 21:16:54 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:16:54 --> Table Class Initialized DEBUG - 2015-01-02 21:16:54 --> Model Class Initialized DEBUG - 2015-01-02 21:16:54 --> Model Class Initialized DEBUG - 2015-01-02 21:16:54 --> Model Class Initialized DEBUG - 2015-01-02 21:16:54 --> Model Class Initialized DEBUG - 2015-01-02 21:16:54 --> Controller Class Initialized DEBUG - 2015-01-02 21:16:54 --> Model Class Initialized DEBUG - 2015-01-02 21:16:55 --> Final output sent to browser DEBUG - 2015-01-02 21:16:55 --> Total execution time: 0.2974 DEBUG - 2015-01-02 21:16:56 --> Config Class Initialized DEBUG - 2015-01-02 21:16:56 --> Hooks Class Initialized DEBUG - 2015-01-02 21:16:56 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:16:56 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:16:56 --> URI Class Initialized DEBUG - 2015-01-02 21:16:56 --> Router Class Initialized DEBUG - 2015-01-02 21:16:56 --> Output Class Initialized DEBUG - 2015-01-02 21:16:56 --> Security Class Initialized DEBUG - 2015-01-02 21:16:56 --> Input Class Initialized DEBUG - 2015-01-02 21:16:56 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:16:56 --> Language Class Initialized DEBUG - 2015-01-02 21:16:56 --> Loader Class Initialized DEBUG - 2015-01-02 21:16:56 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:16:56 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:16:56 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:16:56 --> Database Driver Class Initialized ERROR - 2015-01-02 21:16:56 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:16:56 --> Jquery Class Initialized DEBUG - 2015-01-02 21:16:56 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:16:56 --> Table Class Initialized DEBUG - 2015-01-02 21:16:56 --> Model Class Initialized DEBUG - 2015-01-02 21:16:56 --> Model Class Initialized DEBUG - 2015-01-02 21:16:56 --> Model Class Initialized DEBUG - 2015-01-02 21:16:56 --> Model Class Initialized DEBUG - 2015-01-02 21:16:56 --> Controller Class Initialized DEBUG - 2015-01-02 21:16:56 --> Model Class Initialized DEBUG - 2015-01-02 21:16:57 --> Config Class Initialized DEBUG - 2015-01-02 21:16:57 --> Hooks Class Initialized DEBUG - 2015-01-02 21:16:57 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:16:57 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:16:57 --> URI Class Initialized DEBUG - 2015-01-02 21:16:57 --> Router Class Initialized DEBUG - 2015-01-02 21:16:57 --> Output Class Initialized DEBUG - 2015-01-02 21:16:57 --> Security Class Initialized DEBUG - 2015-01-02 21:16:57 --> Input Class Initialized DEBUG - 2015-01-02 21:16:57 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:16:57 --> Language Class Initialized DEBUG - 2015-01-02 21:16:57 --> Loader Class Initialized DEBUG - 2015-01-02 21:16:57 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:16:57 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:16:57 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:16:57 --> Database Driver Class Initialized ERROR - 2015-01-02 21:16:57 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:16:57 --> Jquery Class Initialized DEBUG - 2015-01-02 21:16:57 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:16:57 --> Table Class Initialized DEBUG - 2015-01-02 21:16:57 --> Model Class Initialized DEBUG - 2015-01-02 21:16:57 --> Model Class Initialized DEBUG - 2015-01-02 21:16:57 --> Model Class Initialized DEBUG - 2015-01-02 21:16:57 --> Model Class Initialized DEBUG - 2015-01-02 21:16:57 --> Controller Class Initialized DEBUG - 2015-01-02 21:16:57 --> Model Class Initialized ERROR - 2015-01-02 21:16:57 --> Severity: Notice --> Undefined variable: cliente /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/modificar.php 3 DEBUG - 2015-01-02 21:36:18 --> Config Class Initialized DEBUG - 2015-01-02 21:36:18 --> Hooks Class Initialized DEBUG - 2015-01-02 21:36:18 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:36:18 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:36:18 --> URI Class Initialized DEBUG - 2015-01-02 21:36:18 --> Router Class Initialized DEBUG - 2015-01-02 21:36:18 --> Output Class Initialized DEBUG - 2015-01-02 21:36:18 --> Security Class Initialized DEBUG - 2015-01-02 21:36:18 --> Input Class Initialized DEBUG - 2015-01-02 21:36:18 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:36:18 --> Language Class Initialized DEBUG - 2015-01-02 21:36:18 --> Loader Class Initialized DEBUG - 2015-01-02 21:36:18 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:36:18 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:36:18 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:36:18 --> Database Driver Class Initialized ERROR - 2015-01-02 21:36:18 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:36:18 --> Jquery Class Initialized DEBUG - 2015-01-02 21:36:18 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:36:18 --> Table Class Initialized DEBUG - 2015-01-02 21:36:18 --> Model Class Initialized DEBUG - 2015-01-02 21:36:18 --> Model Class Initialized DEBUG - 2015-01-02 21:36:18 --> Model Class Initialized DEBUG - 2015-01-02 21:36:18 --> Model Class Initialized DEBUG - 2015-01-02 21:36:18 --> Controller Class Initialized DEBUG - 2015-01-02 21:36:18 --> Model Class Initialized ERROR - 2015-01-02 21:36:18 --> Severity: Notice --> Undefined variable: cliente /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/modificar.php 3 DEBUG - 2015-01-02 21:36:20 --> Config Class Initialized DEBUG - 2015-01-02 21:36:20 --> Hooks Class Initialized DEBUG - 2015-01-02 21:36:20 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:36:20 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:36:20 --> URI Class Initialized DEBUG - 2015-01-02 21:36:20 --> Router Class Initialized DEBUG - 2015-01-02 21:36:20 --> Output Class Initialized DEBUG - 2015-01-02 21:36:20 --> Security Class Initialized DEBUG - 2015-01-02 21:36:20 --> Input Class Initialized DEBUG - 2015-01-02 21:36:20 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:36:20 --> Language Class Initialized DEBUG - 2015-01-02 21:36:20 --> Loader Class Initialized DEBUG - 2015-01-02 21:36:20 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:36:20 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:36:20 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:36:20 --> Database Driver Class Initialized ERROR - 2015-01-02 21:36:20 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:36:20 --> Jquery Class Initialized DEBUG - 2015-01-02 21:36:20 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:36:20 --> Table Class Initialized DEBUG - 2015-01-02 21:36:20 --> Model Class Initialized DEBUG - 2015-01-02 21:36:20 --> Model Class Initialized DEBUG - 2015-01-02 21:36:20 --> Model Class Initialized DEBUG - 2015-01-02 21:36:20 --> Model Class Initialized DEBUG - 2015-01-02 21:36:20 --> Controller Class Initialized DEBUG - 2015-01-02 21:36:20 --> Model Class Initialized ERROR - 2015-01-02 21:36:20 --> Severity: Notice --> Undefined variable: cliente /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/modificar.php 3 DEBUG - 2015-01-02 21:36:26 --> Config Class Initialized DEBUG - 2015-01-02 21:36:26 --> Hooks Class Initialized DEBUG - 2015-01-02 21:36:26 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:36:26 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:36:26 --> URI Class Initialized DEBUG - 2015-01-02 21:36:26 --> Router Class Initialized DEBUG - 2015-01-02 21:36:26 --> Output Class Initialized DEBUG - 2015-01-02 21:36:26 --> Security Class Initialized DEBUG - 2015-01-02 21:36:26 --> Input Class Initialized DEBUG - 2015-01-02 21:36:26 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:36:26 --> Language Class Initialized DEBUG - 2015-01-02 21:36:26 --> Loader Class Initialized DEBUG - 2015-01-02 21:36:26 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:36:26 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:36:26 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:36:26 --> Database Driver Class Initialized ERROR - 2015-01-02 21:36:26 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:36:26 --> Jquery Class Initialized DEBUG - 2015-01-02 21:36:26 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:36:26 --> Table Class Initialized DEBUG - 2015-01-02 21:36:26 --> Model Class Initialized DEBUG - 2015-01-02 21:36:26 --> Model Class Initialized DEBUG - 2015-01-02 21:36:26 --> Model Class Initialized DEBUG - 2015-01-02 21:36:26 --> Model Class Initialized DEBUG - 2015-01-02 21:36:26 --> Controller Class Initialized DEBUG - 2015-01-02 21:36:26 --> Model Class Initialized ERROR - 2015-01-02 21:36:26 --> Severity: Notice --> Undefined variable: delegados /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/form_nuevo_cliente.php 333 DEBUG - 2015-01-02 21:36:26 --> File loaded: application/views/clientes/form_nuevo_cliente.php DEBUG - 2015-01-02 21:36:26 --> File loaded: application/views/clientes/nuevo.php DEBUG - 2015-01-02 21:36:26 --> Final output sent to browser DEBUG - 2015-01-02 21:36:26 --> Total execution time: 0.0665 DEBUG - 2015-01-02 21:36:26 --> Config Class Initialized DEBUG - 2015-01-02 21:36:26 --> Hooks Class Initialized DEBUG - 2015-01-02 21:36:26 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:36:26 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:36:26 --> URI Class Initialized DEBUG - 2015-01-02 21:36:26 --> Router Class Initialized DEBUG - 2015-01-02 21:36:26 --> Output Class Initialized DEBUG - 2015-01-02 21:36:26 --> Security Class Initialized DEBUG - 2015-01-02 21:36:26 --> Input Class Initialized DEBUG - 2015-01-02 21:36:26 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:36:27 --> Language Class Initialized DEBUG - 2015-01-02 21:36:27 --> Loader Class Initialized DEBUG - 2015-01-02 21:36:27 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:36:27 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:36:27 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:36:27 --> Database Driver Class Initialized ERROR - 2015-01-02 21:36:27 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:36:27 --> Jquery Class Initialized DEBUG - 2015-01-02 21:36:27 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:36:27 --> Table Class Initialized DEBUG - 2015-01-02 21:36:27 --> Model Class Initialized DEBUG - 2015-01-02 21:36:27 --> Model Class Initialized DEBUG - 2015-01-02 21:36:27 --> Model Class Initialized DEBUG - 2015-01-02 21:36:27 --> Model Class Initialized DEBUG - 2015-01-02 21:36:27 --> Controller Class Initialized DEBUG - 2015-01-02 21:36:27 --> Final output sent to browser DEBUG - 2015-01-02 21:36:27 --> Total execution time: 0.0500 DEBUG - 2015-01-02 21:36:31 --> Config Class Initialized DEBUG - 2015-01-02 21:36:31 --> Hooks Class Initialized DEBUG - 2015-01-02 21:36:31 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:36:31 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:36:31 --> URI Class Initialized DEBUG - 2015-01-02 21:36:31 --> Router Class Initialized DEBUG - 2015-01-02 21:36:31 --> Output Class Initialized DEBUG - 2015-01-02 21:36:31 --> Security Class Initialized DEBUG - 2015-01-02 21:36:31 --> Input Class Initialized DEBUG - 2015-01-02 21:36:31 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:36:31 --> Language Class Initialized DEBUG - 2015-01-02 21:36:31 --> Loader Class Initialized DEBUG - 2015-01-02 21:36:31 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:36:31 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:36:31 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:36:31 --> Database Driver Class Initialized ERROR - 2015-01-02 21:36:31 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:36:31 --> Jquery Class Initialized DEBUG - 2015-01-02 21:36:31 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:36:31 --> Table Class Initialized DEBUG - 2015-01-02 21:36:31 --> Model Class Initialized DEBUG - 2015-01-02 21:36:31 --> Model Class Initialized DEBUG - 2015-01-02 21:36:31 --> Model Class Initialized DEBUG - 2015-01-02 21:36:31 --> Model Class Initialized DEBUG - 2015-01-02 21:36:31 --> Controller Class Initialized DEBUG - 2015-01-02 21:36:31 --> XSS Filtering completed DEBUG - 2015-01-02 21:36:31 --> Final output sent to browser DEBUG - 2015-01-02 21:36:31 --> Total execution time: 0.0330 DEBUG - 2015-01-02 21:36:32 --> Config Class Initialized DEBUG - 2015-01-02 21:36:32 --> Hooks Class Initialized DEBUG - 2015-01-02 21:36:32 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:36:32 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:36:32 --> URI Class Initialized DEBUG - 2015-01-02 21:36:32 --> Router Class Initialized DEBUG - 2015-01-02 21:36:32 --> Output Class Initialized DEBUG - 2015-01-02 21:36:32 --> Security Class Initialized DEBUG - 2015-01-02 21:36:32 --> Input Class Initialized DEBUG - 2015-01-02 21:36:32 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:36:32 --> Language Class Initialized DEBUG - 2015-01-02 21:36:32 --> Loader Class Initialized DEBUG - 2015-01-02 21:36:32 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:36:32 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:36:32 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:36:32 --> Database Driver Class Initialized ERROR - 2015-01-02 21:36:32 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:36:32 --> Jquery Class Initialized DEBUG - 2015-01-02 21:36:32 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:36:32 --> Table Class Initialized DEBUG - 2015-01-02 21:36:32 --> Model Class Initialized DEBUG - 2015-01-02 21:36:32 --> Model Class Initialized DEBUG - 2015-01-02 21:36:32 --> Model Class Initialized DEBUG - 2015-01-02 21:36:32 --> Model Class Initialized DEBUG - 2015-01-02 21:36:32 --> Controller Class Initialized DEBUG - 2015-01-02 21:36:32 --> XSS Filtering completed DEBUG - 2015-01-02 21:36:32 --> Final output sent to browser DEBUG - 2015-01-02 21:36:32 --> Total execution time: 0.0287 DEBUG - 2015-01-02 21:36:34 --> Config Class Initialized DEBUG - 2015-01-02 21:36:34 --> Hooks Class Initialized DEBUG - 2015-01-02 21:36:34 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:36:34 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:36:34 --> URI Class Initialized DEBUG - 2015-01-02 21:36:34 --> Router Class Initialized DEBUG - 2015-01-02 21:36:34 --> Output Class Initialized DEBUG - 2015-01-02 21:36:34 --> Security Class Initialized DEBUG - 2015-01-02 21:36:34 --> Input Class Initialized DEBUG - 2015-01-02 21:36:34 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:36:34 --> Language Class Initialized DEBUG - 2015-01-02 21:36:34 --> Loader Class Initialized DEBUG - 2015-01-02 21:36:34 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:36:34 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:36:34 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:36:34 --> Database Driver Class Initialized ERROR - 2015-01-02 21:36:34 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:36:34 --> Jquery Class Initialized DEBUG - 2015-01-02 21:36:34 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:36:34 --> Table Class Initialized DEBUG - 2015-01-02 21:36:34 --> Model Class Initialized DEBUG - 2015-01-02 21:36:34 --> Model Class Initialized DEBUG - 2015-01-02 21:36:34 --> Model Class Initialized DEBUG - 2015-01-02 21:36:34 --> Model Class Initialized DEBUG - 2015-01-02 21:36:34 --> Controller Class Initialized DEBUG - 2015-01-02 21:36:34 --> XSS Filtering completed DEBUG - 2015-01-02 21:36:34 --> Final output sent to browser DEBUG - 2015-01-02 21:36:34 --> Total execution time: 0.0304 DEBUG - 2015-01-02 21:36:35 --> Config Class Initialized DEBUG - 2015-01-02 21:36:35 --> Hooks Class Initialized DEBUG - 2015-01-02 21:36:35 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:36:35 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:36:35 --> URI Class Initialized DEBUG - 2015-01-02 21:36:35 --> Router Class Initialized DEBUG - 2015-01-02 21:36:35 --> Output Class Initialized DEBUG - 2015-01-02 21:36:35 --> Security Class Initialized DEBUG - 2015-01-02 21:36:35 --> Input Class Initialized DEBUG - 2015-01-02 21:36:35 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:36:35 --> Language Class Initialized DEBUG - 2015-01-02 21:36:35 --> Loader Class Initialized DEBUG - 2015-01-02 21:36:35 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:36:35 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:36:35 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:36:35 --> Database Driver Class Initialized ERROR - 2015-01-02 21:36:35 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:36:35 --> Jquery Class Initialized DEBUG - 2015-01-02 21:36:35 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:36:35 --> Table Class Initialized DEBUG - 2015-01-02 21:36:35 --> Model Class Initialized DEBUG - 2015-01-02 21:36:35 --> Model Class Initialized DEBUG - 2015-01-02 21:36:35 --> Model Class Initialized DEBUG - 2015-01-02 21:36:35 --> Model Class Initialized DEBUG - 2015-01-02 21:36:35 --> Controller Class Initialized DEBUG - 2015-01-02 21:36:35 --> XSS Filtering completed DEBUG - 2015-01-02 21:36:35 --> Final output sent to browser DEBUG - 2015-01-02 21:36:35 --> Total execution time: 0.0294 DEBUG - 2015-01-02 21:36:36 --> Config Class Initialized DEBUG - 2015-01-02 21:36:36 --> Hooks Class Initialized DEBUG - 2015-01-02 21:36:36 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:36:36 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:36:36 --> URI Class Initialized DEBUG - 2015-01-02 21:36:36 --> Router Class Initialized DEBUG - 2015-01-02 21:36:36 --> Output Class Initialized DEBUG - 2015-01-02 21:36:36 --> Security Class Initialized DEBUG - 2015-01-02 21:36:36 --> Input Class Initialized DEBUG - 2015-01-02 21:36:36 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:36:36 --> Language Class Initialized DEBUG - 2015-01-02 21:36:36 --> Loader Class Initialized DEBUG - 2015-01-02 21:36:36 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:36:36 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:36:36 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:36:36 --> Database Driver Class Initialized ERROR - 2015-01-02 21:36:36 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:36:36 --> Jquery Class Initialized DEBUG - 2015-01-02 21:36:36 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:36:36 --> Table Class Initialized DEBUG - 2015-01-02 21:36:36 --> Model Class Initialized DEBUG - 2015-01-02 21:36:36 --> Model Class Initialized DEBUG - 2015-01-02 21:36:36 --> Model Class Initialized DEBUG - 2015-01-02 21:36:36 --> Model Class Initialized DEBUG - 2015-01-02 21:36:36 --> Controller Class Initialized DEBUG - 2015-01-02 21:36:36 --> XSS Filtering completed DEBUG - 2015-01-02 21:36:36 --> Final output sent to browser DEBUG - 2015-01-02 21:36:36 --> Total execution time: 0.0359 DEBUG - 2015-01-02 21:36:36 --> Config Class Initialized DEBUG - 2015-01-02 21:36:36 --> Hooks Class Initialized DEBUG - 2015-01-02 21:36:36 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:36:36 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:36:36 --> URI Class Initialized DEBUG - 2015-01-02 21:36:36 --> Router Class Initialized DEBUG - 2015-01-02 21:36:36 --> Output Class Initialized DEBUG - 2015-01-02 21:36:36 --> Security Class Initialized DEBUG - 2015-01-02 21:36:36 --> Input Class Initialized DEBUG - 2015-01-02 21:36:36 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:36:36 --> Language Class Initialized DEBUG - 2015-01-02 21:36:36 --> Loader Class Initialized DEBUG - 2015-01-02 21:36:36 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:36:36 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:36:36 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:36:36 --> Database Driver Class Initialized ERROR - 2015-01-02 21:36:36 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:36:36 --> Jquery Class Initialized DEBUG - 2015-01-02 21:36:36 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:36:36 --> Table Class Initialized DEBUG - 2015-01-02 21:36:36 --> Model Class Initialized DEBUG - 2015-01-02 21:36:36 --> Model Class Initialized DEBUG - 2015-01-02 21:36:36 --> Model Class Initialized DEBUG - 2015-01-02 21:36:36 --> Model Class Initialized DEBUG - 2015-01-02 21:36:36 --> Controller Class Initialized DEBUG - 2015-01-02 21:36:36 --> XSS Filtering completed DEBUG - 2015-01-02 21:36:36 --> Final output sent to browser DEBUG - 2015-01-02 21:36:36 --> Total execution time: 0.0301 DEBUG - 2015-01-02 21:37:13 --> Config Class Initialized DEBUG - 2015-01-02 21:37:13 --> Hooks Class Initialized DEBUG - 2015-01-02 21:37:13 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:37:13 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:37:14 --> URI Class Initialized DEBUG - 2015-01-02 21:37:14 --> Router Class Initialized DEBUG - 2015-01-02 21:37:14 --> Output Class Initialized DEBUG - 2015-01-02 21:37:14 --> Security Class Initialized DEBUG - 2015-01-02 21:37:14 --> Input Class Initialized DEBUG - 2015-01-02 21:37:14 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:37:14 --> Language Class Initialized DEBUG - 2015-01-02 21:37:14 --> Loader Class Initialized DEBUG - 2015-01-02 21:37:14 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:37:14 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:37:14 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:37:14 --> Database Driver Class Initialized ERROR - 2015-01-02 21:37:14 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:37:14 --> Jquery Class Initialized DEBUG - 2015-01-02 21:37:14 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:37:14 --> Table Class Initialized DEBUG - 2015-01-02 21:37:14 --> Model Class Initialized DEBUG - 2015-01-02 21:37:14 --> Model Class Initialized DEBUG - 2015-01-02 21:37:14 --> Model Class Initialized DEBUG - 2015-01-02 21:37:14 --> Model Class Initialized DEBUG - 2015-01-02 21:37:14 --> Controller Class Initialized DEBUG - 2015-01-02 21:37:14 --> Model Class Initialized DEBUG - 2015-01-02 21:37:14 --> Final output sent to browser DEBUG - 2015-01-02 21:37:14 --> Total execution time: 0.1382 DEBUG - 2015-01-02 21:39:45 --> Config Class Initialized DEBUG - 2015-01-02 21:39:45 --> Hooks Class Initialized DEBUG - 2015-01-02 21:39:45 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:39:45 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:39:45 --> URI Class Initialized DEBUG - 2015-01-02 21:39:45 --> Router Class Initialized DEBUG - 2015-01-02 21:39:45 --> Output Class Initialized DEBUG - 2015-01-02 21:39:45 --> Security Class Initialized DEBUG - 2015-01-02 21:39:45 --> Input Class Initialized DEBUG - 2015-01-02 21:39:45 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:39:45 --> Language Class Initialized DEBUG - 2015-01-02 21:39:45 --> Loader Class Initialized DEBUG - 2015-01-02 21:39:45 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:39:45 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:39:45 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:39:45 --> Database Driver Class Initialized ERROR - 2015-01-02 21:39:45 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:39:45 --> Jquery Class Initialized DEBUG - 2015-01-02 21:39:45 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:39:45 --> Table Class Initialized DEBUG - 2015-01-02 21:39:45 --> Model Class Initialized DEBUG - 2015-01-02 21:39:45 --> Model Class Initialized DEBUG - 2015-01-02 21:39:45 --> Model Class Initialized DEBUG - 2015-01-02 21:39:45 --> Model Class Initialized DEBUG - 2015-01-02 21:39:45 --> Controller Class Initialized DEBUG - 2015-01-02 21:39:45 --> Model Class Initialized DEBUG - 2015-01-02 21:39:45 --> Config Class Initialized DEBUG - 2015-01-02 21:39:45 --> Hooks Class Initialized DEBUG - 2015-01-02 21:39:45 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:39:45 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:39:45 --> URI Class Initialized DEBUG - 2015-01-02 21:39:45 --> Router Class Initialized DEBUG - 2015-01-02 21:39:45 --> Output Class Initialized DEBUG - 2015-01-02 21:39:45 --> Security Class Initialized DEBUG - 2015-01-02 21:39:45 --> Input Class Initialized DEBUG - 2015-01-02 21:39:45 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:39:45 --> Language Class Initialized DEBUG - 2015-01-02 21:39:45 --> Loader Class Initialized DEBUG - 2015-01-02 21:39:45 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:39:45 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:39:45 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:39:45 --> Database Driver Class Initialized ERROR - 2015-01-02 21:39:45 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:39:45 --> Jquery Class Initialized DEBUG - 2015-01-02 21:39:45 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:39:45 --> Table Class Initialized DEBUG - 2015-01-02 21:39:45 --> Model Class Initialized DEBUG - 2015-01-02 21:39:45 --> Model Class Initialized DEBUG - 2015-01-02 21:39:45 --> Model Class Initialized DEBUG - 2015-01-02 21:39:45 --> Model Class Initialized DEBUG - 2015-01-02 21:39:45 --> Controller Class Initialized DEBUG - 2015-01-02 21:39:45 --> Model Class Initialized ERROR - 2015-01-02 21:39:45 --> Severity: Notice --> Undefined variable: cliente /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/modificar.php 3 DEBUG - 2015-01-02 21:53:49 --> Config Class Initialized DEBUG - 2015-01-02 21:53:49 --> Hooks Class Initialized DEBUG - 2015-01-02 21:53:49 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:53:49 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:53:49 --> URI Class Initialized DEBUG - 2015-01-02 21:53:49 --> Router Class Initialized DEBUG - 2015-01-02 21:53:49 --> Output Class Initialized DEBUG - 2015-01-02 21:53:49 --> Security Class Initialized DEBUG - 2015-01-02 21:53:49 --> Input Class Initialized DEBUG - 2015-01-02 21:53:49 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:53:49 --> Language Class Initialized DEBUG - 2015-01-02 21:53:49 --> Loader Class Initialized DEBUG - 2015-01-02 21:53:49 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:53:49 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:53:49 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:53:49 --> Database Driver Class Initialized ERROR - 2015-01-02 21:53:49 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:53:49 --> Jquery Class Initialized DEBUG - 2015-01-02 21:53:49 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:53:49 --> Table Class Initialized DEBUG - 2015-01-02 21:53:49 --> Model Class Initialized DEBUG - 2015-01-02 21:53:49 --> Model Class Initialized DEBUG - 2015-01-02 21:53:49 --> Model Class Initialized DEBUG - 2015-01-02 21:53:49 --> Model Class Initialized DEBUG - 2015-01-02 21:53:49 --> Controller Class Initialized DEBUG - 2015-01-02 21:53:49 --> Model Class Initialized ERROR - 2015-01-02 21:53:49 --> Severity: Notice --> Undefined variable: cliente /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/modificar.php 3 DEBUG - 2015-01-02 21:53:52 --> Config Class Initialized DEBUG - 2015-01-02 21:53:52 --> Hooks Class Initialized DEBUG - 2015-01-02 21:53:52 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:53:52 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:53:52 --> URI Class Initialized DEBUG - 2015-01-02 21:53:52 --> Router Class Initialized DEBUG - 2015-01-02 21:53:52 --> Output Class Initialized DEBUG - 2015-01-02 21:53:52 --> Security Class Initialized DEBUG - 2015-01-02 21:53:52 --> Input Class Initialized DEBUG - 2015-01-02 21:53:52 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:53:52 --> Language Class Initialized DEBUG - 2015-01-02 21:53:52 --> Loader Class Initialized DEBUG - 2015-01-02 21:53:52 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:53:52 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:53:52 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:53:52 --> Database Driver Class Initialized ERROR - 2015-01-02 21:53:52 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:53:52 --> Jquery Class Initialized DEBUG - 2015-01-02 21:53:52 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:53:52 --> Table Class Initialized DEBUG - 2015-01-02 21:53:52 --> Model Class Initialized DEBUG - 2015-01-02 21:53:52 --> Model Class Initialized DEBUG - 2015-01-02 21:53:52 --> Model Class Initialized DEBUG - 2015-01-02 21:53:52 --> Model Class Initialized DEBUG - 2015-01-02 21:53:52 --> Controller Class Initialized DEBUG - 2015-01-02 21:53:52 --> Model Class Initialized ERROR - 2015-01-02 21:53:52 --> Severity: Notice --> Undefined variable: cliente /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/modificar.php 3 DEBUG - 2015-01-02 21:53:53 --> Config Class Initialized DEBUG - 2015-01-02 21:53:53 --> Hooks Class Initialized DEBUG - 2015-01-02 21:53:53 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:53:53 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:53:53 --> URI Class Initialized DEBUG - 2015-01-02 21:53:53 --> Router Class Initialized DEBUG - 2015-01-02 21:53:53 --> Output Class Initialized DEBUG - 2015-01-02 21:53:53 --> Security Class Initialized DEBUG - 2015-01-02 21:53:53 --> Input Class Initialized DEBUG - 2015-01-02 21:53:53 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:53:53 --> Language Class Initialized DEBUG - 2015-01-02 21:53:53 --> Loader Class Initialized DEBUG - 2015-01-02 21:53:53 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:53:53 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:53:53 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:53:53 --> Database Driver Class Initialized ERROR - 2015-01-02 21:53:53 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:53:53 --> Jquery Class Initialized DEBUG - 2015-01-02 21:53:53 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:53:53 --> Table Class Initialized DEBUG - 2015-01-02 21:53:53 --> Model Class Initialized DEBUG - 2015-01-02 21:53:53 --> Model Class Initialized DEBUG - 2015-01-02 21:53:53 --> Model Class Initialized DEBUG - 2015-01-02 21:53:53 --> Model Class Initialized DEBUG - 2015-01-02 21:53:53 --> Controller Class Initialized DEBUG - 2015-01-02 21:53:53 --> Model Class Initialized ERROR - 2015-01-02 21:53:53 --> Severity: Notice --> Undefined variable: cliente /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/modificar.php 3 DEBUG - 2015-01-02 21:53:57 --> Config Class Initialized DEBUG - 2015-01-02 21:53:57 --> Hooks Class Initialized DEBUG - 2015-01-02 21:53:57 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:53:57 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:53:57 --> URI Class Initialized DEBUG - 2015-01-02 21:53:57 --> Router Class Initialized DEBUG - 2015-01-02 21:53:57 --> No URI present. Default controller set. DEBUG - 2015-01-02 21:53:57 --> Output Class Initialized DEBUG - 2015-01-02 21:53:57 --> Security Class Initialized DEBUG - 2015-01-02 21:53:57 --> Input Class Initialized DEBUG - 2015-01-02 21:53:57 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:53:57 --> Language Class Initialized DEBUG - 2015-01-02 21:53:57 --> Loader Class Initialized DEBUG - 2015-01-02 21:53:57 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:53:57 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:53:57 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:53:57 --> Database Driver Class Initialized ERROR - 2015-01-02 21:53:57 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:53:57 --> Jquery Class Initialized DEBUG - 2015-01-02 21:53:57 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:53:57 --> Table Class Initialized DEBUG - 2015-01-02 21:53:57 --> Model Class Initialized DEBUG - 2015-01-02 21:53:57 --> Model Class Initialized DEBUG - 2015-01-02 21:53:57 --> Model Class Initialized DEBUG - 2015-01-02 21:53:57 --> Model Class Initialized DEBUG - 2015-01-02 21:53:57 --> Controller Class Initialized DEBUG - 2015-01-02 21:53:57 --> File loaded: application/views/index.php DEBUG - 2015-01-02 21:53:57 --> Final output sent to browser DEBUG - 2015-01-02 21:53:57 --> Total execution time: 0.1182 DEBUG - 2015-01-02 21:54:07 --> Config Class Initialized DEBUG - 2015-01-02 21:54:07 --> Hooks Class Initialized DEBUG - 2015-01-02 21:54:07 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:54:07 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:54:07 --> URI Class Initialized DEBUG - 2015-01-02 21:54:07 --> Router Class Initialized DEBUG - 2015-01-02 21:54:07 --> Output Class Initialized DEBUG - 2015-01-02 21:54:07 --> Security Class Initialized DEBUG - 2015-01-02 21:54:07 --> Input Class Initialized DEBUG - 2015-01-02 21:54:07 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:54:07 --> Language Class Initialized DEBUG - 2015-01-02 21:54:07 --> Loader Class Initialized DEBUG - 2015-01-02 21:54:07 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:54:07 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:54:07 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:54:07 --> Database Driver Class Initialized ERROR - 2015-01-02 21:54:07 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:54:07 --> Jquery Class Initialized DEBUG - 2015-01-02 21:54:07 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:54:07 --> Table Class Initialized DEBUG - 2015-01-02 21:54:07 --> Model Class Initialized DEBUG - 2015-01-02 21:54:07 --> Model Class Initialized DEBUG - 2015-01-02 21:54:07 --> Model Class Initialized DEBUG - 2015-01-02 21:54:07 --> Model Class Initialized DEBUG - 2015-01-02 21:54:07 --> Controller Class Initialized DEBUG - 2015-01-02 21:54:07 --> Model Class Initialized ERROR - 2015-01-02 21:54:07 --> Severity: Notice --> Undefined variable: delegados /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/form_nuevo_cliente.php 333 DEBUG - 2015-01-02 21:54:07 --> File loaded: application/views/clientes/form_nuevo_cliente.php DEBUG - 2015-01-02 21:54:07 --> File loaded: application/views/clientes/nuevo.php DEBUG - 2015-01-02 21:54:07 --> Final output sent to browser DEBUG - 2015-01-02 21:54:07 --> Total execution time: 0.0987 DEBUG - 2015-01-02 21:54:08 --> Config Class Initialized DEBUG - 2015-01-02 21:54:08 --> Hooks Class Initialized DEBUG - 2015-01-02 21:54:08 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:54:08 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:54:08 --> URI Class Initialized DEBUG - 2015-01-02 21:54:08 --> Router Class Initialized DEBUG - 2015-01-02 21:54:08 --> Output Class Initialized DEBUG - 2015-01-02 21:54:08 --> Security Class Initialized DEBUG - 2015-01-02 21:54:08 --> Input Class Initialized DEBUG - 2015-01-02 21:54:08 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:54:08 --> Language Class Initialized DEBUG - 2015-01-02 21:54:08 --> Loader Class Initialized DEBUG - 2015-01-02 21:54:08 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:54:08 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:54:08 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:54:08 --> Database Driver Class Initialized ERROR - 2015-01-02 21:54:08 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:54:08 --> Jquery Class Initialized DEBUG - 2015-01-02 21:54:08 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:54:08 --> Table Class Initialized DEBUG - 2015-01-02 21:54:08 --> Model Class Initialized DEBUG - 2015-01-02 21:54:08 --> Model Class Initialized DEBUG - 2015-01-02 21:54:08 --> Model Class Initialized DEBUG - 2015-01-02 21:54:08 --> Model Class Initialized DEBUG - 2015-01-02 21:54:08 --> Controller Class Initialized DEBUG - 2015-01-02 21:54:08 --> Final output sent to browser DEBUG - 2015-01-02 21:54:08 --> Total execution time: 0.0345 DEBUG - 2015-01-02 21:54:08 --> Config Class Initialized DEBUG - 2015-01-02 21:54:08 --> Hooks Class Initialized DEBUG - 2015-01-02 21:54:08 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:54:08 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:54:08 --> URI Class Initialized DEBUG - 2015-01-02 21:54:08 --> Router Class Initialized DEBUG - 2015-01-02 21:54:08 --> Output Class Initialized DEBUG - 2015-01-02 21:54:08 --> Security Class Initialized DEBUG - 2015-01-02 21:54:08 --> Input Class Initialized DEBUG - 2015-01-02 21:54:08 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:54:08 --> Language Class Initialized DEBUG - 2015-01-02 21:54:08 --> Loader Class Initialized DEBUG - 2015-01-02 21:54:08 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:54:08 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:54:08 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:54:08 --> Database Driver Class Initialized ERROR - 2015-01-02 21:54:08 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:54:08 --> Jquery Class Initialized DEBUG - 2015-01-02 21:54:08 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:54:08 --> Table Class Initialized DEBUG - 2015-01-02 21:54:08 --> Model Class Initialized DEBUG - 2015-01-02 21:54:08 --> Model Class Initialized DEBUG - 2015-01-02 21:54:08 --> Model Class Initialized DEBUG - 2015-01-02 21:54:08 --> Model Class Initialized DEBUG - 2015-01-02 21:54:08 --> Controller Class Initialized DEBUG - 2015-01-02 21:54:08 --> Model Class Initialized ERROR - 2015-01-02 21:54:08 --> Severity: Notice --> Undefined variable: delegados /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/form_nuevo_cliente.php 333 DEBUG - 2015-01-02 21:54:08 --> File loaded: application/views/clientes/form_nuevo_cliente.php DEBUG - 2015-01-02 21:54:08 --> File loaded: application/views/clientes/nuevo.php DEBUG - 2015-01-02 21:54:08 --> Final output sent to browser DEBUG - 2015-01-02 21:54:08 --> Total execution time: 0.0663 DEBUG - 2015-01-02 21:54:16 --> Config Class Initialized DEBUG - 2015-01-02 21:54:16 --> Hooks Class Initialized DEBUG - 2015-01-02 21:54:16 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:54:16 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:54:16 --> URI Class Initialized DEBUG - 2015-01-02 21:54:16 --> Router Class Initialized DEBUG - 2015-01-02 21:54:16 --> Output Class Initialized DEBUG - 2015-01-02 21:54:16 --> Security Class Initialized DEBUG - 2015-01-02 21:54:16 --> Input Class Initialized DEBUG - 2015-01-02 21:54:16 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:54:16 --> Language Class Initialized DEBUG - 2015-01-02 21:54:16 --> Loader Class Initialized DEBUG - 2015-01-02 21:54:16 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:54:16 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:54:16 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:54:16 --> Database Driver Class Initialized ERROR - 2015-01-02 21:54:16 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:54:16 --> Jquery Class Initialized DEBUG - 2015-01-02 21:54:16 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:54:16 --> Table Class Initialized DEBUG - 2015-01-02 21:54:16 --> Model Class Initialized DEBUG - 2015-01-02 21:54:16 --> Model Class Initialized DEBUG - 2015-01-02 21:54:16 --> Model Class Initialized DEBUG - 2015-01-02 21:54:16 --> Model Class Initialized DEBUG - 2015-01-02 21:54:16 --> Controller Class Initialized DEBUG - 2015-01-02 21:54:16 --> XSS Filtering completed DEBUG - 2015-01-02 21:54:16 --> Final output sent to browser DEBUG - 2015-01-02 21:54:16 --> Total execution time: 0.0294 DEBUG - 2015-01-02 21:54:19 --> Config Class Initialized DEBUG - 2015-01-02 21:54:19 --> Hooks Class Initialized DEBUG - 2015-01-02 21:54:19 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:54:19 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:54:19 --> URI Class Initialized DEBUG - 2015-01-02 21:54:19 --> Router Class Initialized DEBUG - 2015-01-02 21:54:19 --> Output Class Initialized DEBUG - 2015-01-02 21:54:19 --> Security Class Initialized DEBUG - 2015-01-02 21:54:19 --> Input Class Initialized DEBUG - 2015-01-02 21:54:19 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:54:19 --> Language Class Initialized DEBUG - 2015-01-02 21:54:19 --> Loader Class Initialized DEBUG - 2015-01-02 21:54:19 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:54:19 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:54:19 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:54:19 --> Database Driver Class Initialized ERROR - 2015-01-02 21:54:19 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:54:19 --> Jquery Class Initialized DEBUG - 2015-01-02 21:54:19 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:54:19 --> Table Class Initialized DEBUG - 2015-01-02 21:54:19 --> Model Class Initialized DEBUG - 2015-01-02 21:54:19 --> Model Class Initialized DEBUG - 2015-01-02 21:54:19 --> Model Class Initialized DEBUG - 2015-01-02 21:54:19 --> Model Class Initialized DEBUG - 2015-01-02 21:54:19 --> Controller Class Initialized DEBUG - 2015-01-02 21:54:19 --> XSS Filtering completed DEBUG - 2015-01-02 21:54:19 --> Final output sent to browser DEBUG - 2015-01-02 21:54:19 --> Total execution time: 0.0296 DEBUG - 2015-01-02 21:54:50 --> Config Class Initialized DEBUG - 2015-01-02 21:54:50 --> Hooks Class Initialized DEBUG - 2015-01-02 21:54:50 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:54:50 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:54:50 --> URI Class Initialized DEBUG - 2015-01-02 21:54:50 --> Router Class Initialized DEBUG - 2015-01-02 21:54:50 --> Output Class Initialized DEBUG - 2015-01-02 21:54:50 --> Security Class Initialized DEBUG - 2015-01-02 21:54:50 --> Input Class Initialized DEBUG - 2015-01-02 21:54:50 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:54:50 --> Language Class Initialized DEBUG - 2015-01-02 21:54:50 --> Loader Class Initialized DEBUG - 2015-01-02 21:54:50 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:54:50 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:54:50 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:54:50 --> Database Driver Class Initialized ERROR - 2015-01-02 21:54:50 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:54:50 --> Jquery Class Initialized DEBUG - 2015-01-02 21:54:50 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:54:50 --> Table Class Initialized DEBUG - 2015-01-02 21:54:50 --> Model Class Initialized DEBUG - 2015-01-02 21:54:50 --> Model Class Initialized DEBUG - 2015-01-02 21:54:50 --> Model Class Initialized DEBUG - 2015-01-02 21:54:50 --> Model Class Initialized DEBUG - 2015-01-02 21:54:50 --> Controller Class Initialized DEBUG - 2015-01-02 21:54:50 --> Model Class Initialized DEBUG - 2015-01-02 21:54:50 --> Final output sent to browser DEBUG - 2015-01-02 21:54:50 --> Total execution time: 0.1347 DEBUG - 2015-01-02 21:56:55 --> Config Class Initialized DEBUG - 2015-01-02 21:56:55 --> Hooks Class Initialized DEBUG - 2015-01-02 21:56:55 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:56:55 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:56:55 --> URI Class Initialized DEBUG - 2015-01-02 21:56:55 --> Router Class Initialized DEBUG - 2015-01-02 21:56:55 --> Output Class Initialized DEBUG - 2015-01-02 21:56:55 --> Security Class Initialized DEBUG - 2015-01-02 21:56:55 --> Input Class Initialized DEBUG - 2015-01-02 21:56:55 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:56:55 --> Language Class Initialized DEBUG - 2015-01-02 21:56:55 --> Loader Class Initialized DEBUG - 2015-01-02 21:56:55 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:56:55 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:56:55 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:56:55 --> Database Driver Class Initialized ERROR - 2015-01-02 21:56:55 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:56:55 --> Jquery Class Initialized DEBUG - 2015-01-02 21:56:55 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:56:55 --> Table Class Initialized DEBUG - 2015-01-02 21:56:55 --> Model Class Initialized DEBUG - 2015-01-02 21:56:55 --> Model Class Initialized DEBUG - 2015-01-02 21:56:55 --> Model Class Initialized DEBUG - 2015-01-02 21:56:55 --> Model Class Initialized DEBUG - 2015-01-02 21:56:55 --> Controller Class Initialized DEBUG - 2015-01-02 21:56:55 --> Model Class Initialized DEBUG - 2015-01-02 21:56:56 --> Config Class Initialized DEBUG - 2015-01-02 21:56:56 --> Hooks Class Initialized DEBUG - 2015-01-02 21:56:56 --> Utf8 Class Initialized DEBUG - 2015-01-02 21:56:56 --> UTF-8 Support Enabled DEBUG - 2015-01-02 21:56:56 --> URI Class Initialized DEBUG - 2015-01-02 21:56:56 --> Router Class Initialized DEBUG - 2015-01-02 21:56:56 --> Output Class Initialized DEBUG - 2015-01-02 21:56:56 --> Security Class Initialized DEBUG - 2015-01-02 21:56:56 --> Input Class Initialized DEBUG - 2015-01-02 21:56:56 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 21:56:56 --> Language Class Initialized DEBUG - 2015-01-02 21:56:56 --> Loader Class Initialized DEBUG - 2015-01-02 21:56:56 --> Helper loaded: url_helper DEBUG - 2015-01-02 21:56:56 --> Helper loaded: form_helper DEBUG - 2015-01-02 21:56:56 --> Helper loaded: utils_helper DEBUG - 2015-01-02 21:56:56 --> Database Driver Class Initialized ERROR - 2015-01-02 21:56:56 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 21:56:56 --> Jquery Class Initialized DEBUG - 2015-01-02 21:56:56 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 21:56:56 --> Table Class Initialized DEBUG - 2015-01-02 21:56:56 --> Model Class Initialized DEBUG - 2015-01-02 21:56:56 --> Model Class Initialized DEBUG - 2015-01-02 21:56:56 --> Model Class Initialized DEBUG - 2015-01-02 21:56:56 --> Model Class Initialized DEBUG - 2015-01-02 21:56:56 --> Controller Class Initialized DEBUG - 2015-01-02 21:56:56 --> Model Class Initialized ERROR - 2015-01-02 21:56:56 --> Severity: Notice --> Undefined variable: cliente /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/modificar.php 3 DEBUG - 2015-01-02 23:22:19 --> Config Class Initialized DEBUG - 2015-01-02 23:22:19 --> Hooks Class Initialized DEBUG - 2015-01-02 23:22:19 --> Utf8 Class Initialized DEBUG - 2015-01-02 23:22:19 --> UTF-8 Support Enabled DEBUG - 2015-01-02 23:22:19 --> URI Class Initialized DEBUG - 2015-01-02 23:22:19 --> Router Class Initialized DEBUG - 2015-01-02 23:22:19 --> Output Class Initialized DEBUG - 2015-01-02 23:22:19 --> Security Class Initialized DEBUG - 2015-01-02 23:22:19 --> Input Class Initialized DEBUG - 2015-01-02 23:22:19 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 23:22:19 --> Language Class Initialized DEBUG - 2015-01-02 23:22:19 --> Loader Class Initialized DEBUG - 2015-01-02 23:22:19 --> Helper loaded: url_helper DEBUG - 2015-01-02 23:22:19 --> Helper loaded: form_helper DEBUG - 2015-01-02 23:22:19 --> Helper loaded: utils_helper DEBUG - 2015-01-02 23:22:19 --> Database Driver Class Initialized ERROR - 2015-01-02 23:22:19 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 23:22:19 --> Jquery Class Initialized DEBUG - 2015-01-02 23:22:19 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 23:22:19 --> Table Class Initialized DEBUG - 2015-01-02 23:22:19 --> Model Class Initialized DEBUG - 2015-01-02 23:22:19 --> Model Class Initialized DEBUG - 2015-01-02 23:22:19 --> Model Class Initialized DEBUG - 2015-01-02 23:22:19 --> Model Class Initialized DEBUG - 2015-01-02 23:22:19 --> Controller Class Initialized DEBUG - 2015-01-02 23:22:19 --> Model Class Initialized ERROR - 2015-01-02 23:22:20 --> Severity: Notice --> Undefined variable: delegados /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/form_modify_cliente.php 333 DEBUG - 2015-01-02 23:22:20 --> File loaded: application/views/clientes/form_modify_cliente.php DEBUG - 2015-01-02 23:22:20 --> File loaded: application/views/clientes/modificar.php DEBUG - 2015-01-02 23:22:20 --> Final output sent to browser DEBUG - 2015-01-02 23:22:20 --> Total execution time: 0.0602 DEBUG - 2015-01-02 23:22:22 --> Config Class Initialized DEBUG - 2015-01-02 23:22:22 --> Hooks Class Initialized DEBUG - 2015-01-02 23:22:22 --> Utf8 Class Initialized DEBUG - 2015-01-02 23:22:22 --> UTF-8 Support Enabled DEBUG - 2015-01-02 23:22:22 --> URI Class Initialized DEBUG - 2015-01-02 23:22:22 --> Router Class Initialized DEBUG - 2015-01-02 23:22:22 --> Output Class Initialized DEBUG - 2015-01-02 23:22:22 --> Security Class Initialized DEBUG - 2015-01-02 23:22:22 --> Input Class Initialized DEBUG - 2015-01-02 23:22:22 --> Global POST and COOKIE data sanitized DEBUG - 2015-01-02 23:22:22 --> Language Class Initialized DEBUG - 2015-01-02 23:22:22 --> Loader Class Initialized DEBUG - 2015-01-02 23:22:22 --> Helper loaded: url_helper DEBUG - 2015-01-02 23:22:22 --> Helper loaded: form_helper DEBUG - 2015-01-02 23:22:22 --> Helper loaded: utils_helper DEBUG - 2015-01-02 23:22:22 --> Database Driver Class Initialized ERROR - 2015-01-02 23:22:22 --> Severity: 8192 --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/system/database/drivers/mysql/mysql_driver.php 91 DEBUG - 2015-01-02 23:22:22 --> Jquery Class Initialized DEBUG - 2015-01-02 23:22:22 --> Javascript Class Initialized and loaded. Driver used: jquery DEBUG - 2015-01-02 23:22:22 --> Table Class Initialized DEBUG - 2015-01-02 23:22:22 --> Model Class Initialized DEBUG - 2015-01-02 23:22:22 --> Model Class Initialized DEBUG - 2015-01-02 23:22:22 --> Model Class Initialized DEBUG - 2015-01-02 23:22:22 --> Model Class Initialized DEBUG - 2015-01-02 23:22:22 --> Controller Class Initialized DEBUG - 2015-01-02 23:22:22 --> Model Class Initialized ERROR - 2015-01-02 23:22:22 --> Severity: Notice --> Undefined variable: cliente /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/modificar.php 3 ERROR - 2015-01-02 23:22:22 --> Severity: Notice --> Undefined variable: delegados /Users/kimdrp/Documents/Hispalia/hispaliaProject/HispaliaAccountManager/workspace/HispaliaWeb/application/views/clientes/form_modify_cliente.php 333 DEBUG - 2015-01-02 23:22:22 --> File loaded: application/views/clientes/form_modify_cliente.php DEBUG - 2015-01-02 23:22:22 --> File loaded: application/views/clientes/modificar.php DEBUG - 2015-01-02 23:22:22 --> Final output sent to browser DEBUG - 2015-01-02 23:22:22 --> Total execution time: 0.0946
mit
sparkychildcharlie/FoxieBot
chat-plugins/bot.js
6866
'use strict'; exports.commands = { eval: function(target, room, user) { if (!user.isDev() || !target) return false; let battle; if (room && room.battle) { battle = room.battle; } try { let result = eval(target.trim()); this.send("<< " + JSON.stringify(result)); } catch (e) { this.send("<< " + e.name + ": " + e.message) } }, c: "custom", custom: function(target, room, user) { if (!user.isDev() || !target) return false; if (target.indexOf("[") === 0 && target.indexOf("]") > 1) { let targetRoomId = toId(target.split("[")[1].split("]")[0], true); if (!Rooms.rooms.has(targetRoomId)) return this.send("I am not in the room you specified."); this.room = Rooms.get(target.split("[")[1].split("]")[0]); target = target.split("]").slice(1).join("]").trim(); } if (!target) return false; this.send(target); }, reload: function(target, room, user) { if (!user.isDev()) return false; let success = Tools.reload(); this.send(success ? "Reloaded commands." : "Failed to reload commands."); }, rename: "login", login: function(target, room, user) { if (!user.isDev()) return false; if (!target) { log("monitor", "Manually logging in as " + Config.bot.name + " - pass: " + Config.bot.pass); this.send("Renaming to " + Config.bot.name); Parse.login(Config.bot.name, Config.bot.pass); return; } target = target.split(","); let nick = target[0]; let pass = target.length > 1 ? target.slice(1).join(",").trim() : null; log("monitor", "Manually logging in as " + nick + " - pass: " + pass); Parse.login(nick, pass); this.send("Attempting to rename to " + nick); }, memusage: 'memoryusage', memoryusage: function (target, room, user) { if (!user.isDev()) return false; this.can("say"); let memUsage = process.memoryUsage(); let results = [memUsage.rss, memUsage.heapUsed, memUsage.heapTotal]; let units = ["B", "KiB", "MiB", "GiB", "TiB"]; for (let i = 0; i < results.length; i++) { let unitIndex = Math.floor(Math.log2(results[i]) / 10); // 2^10 base log results[i] = "" + (results[i] / Math.pow(2, 10 * unitIndex)).toFixed(2) + " " + units[unitIndex]; } this.send("[Main process] RSS: " + results[0] + ", Heap: " + results[1] + " / " + results[2]); }, auth: "promote", promote: function(target, room, user) { if (!target) return this.parse("/botauth"); if (target.split(",").length !== 2 || !["deauth", "+", "%", "@", "~"].includes(target.split(",")[1].trim())) return false; if (!this.can("promote", target.split(",")[1].trim().replace("deauth", " "))) return false; let rankNames = { "deauth": "Regular", "+": "Voice", "%": "Driver", "@": "Moderator", "~": "Administrator", } if (target.split(",")[1].trim().replace("deauth", " ") === " ") { delete Db("ranks").object()[this.targetUser.userid || this.targetUser]; if(this.targetUser.userid) this.targetUser.botRank = " "; Db.save(); } else { typeof this.targetUser !== "string" ? this.targetUser.botPromote(target.split(",")[1].trim().replace("deauth", " ")) : Db("ranks").set(toId(this.targetUser), target.split(",")[1].trim().replace("deauth", " ")); } this.send((this.targetUser.name || this.targetUser) + " was appointed Bot " + rankNames[target.split(",")[1].trim()] + "."); }, botauth: function(target, room, user) { this.can("say"); let botAuth = Db("ranks").object(); let auth = {}; for (let u in botAuth) { if (!auth[botAuth[u]]) auth[botAuth[u]] = []; auth[botAuth[u]].push(u); } let rankNames = { "+": "+Voices", "%": "%Drivers", "@": "@Moderators", "~": "~Adminstrators", } let buffer = Object.keys(auth).sort((a, b) => { if (Config.ranks[a] > Config.ranks[b]) return -1; return 1; }).map(r => rankNames[r] + " (" + auth[r].length + ")\n" + auth[r].sort().join(", ")).join("\n\n"); Tools.uploadToHastebin(buffer, link => { this.send("Bot Auth: " + link); }); }, mute: function(target, room, user) { if (!target || !this.can("mute")) return false; if (Monitor.isBanned(this.targetUser.userid || this.targetUser) && ["lock", "ban"].includes(Monitor.isBanned(this.targetUser.userid || this.targetUser))) return this.send("The user is already locked/banned."); Monitor.mute(this.targetUser.userid || this.targetUser); this.send((this.targetUser.name || this.targetUser) + " was muted from using the bot for 7 minutes by " + user.name + "."); }, lock: function(target, room, user) { if (!target || !this.can("lock")) return false; if (Monitor.isBanned(this.targetUser.userid || this.targetUser) && Monitor.isBanned(this.targetUser.userid || this.targetUser) === "ban") return this.send("The user is already banned."); Monitor.lock(this.targetUser.userid || this.targetUser); this.send((this.targetUser.name || this.targetUser) + " was locked from using the bot by " + user.name + "."); }, ban: function(target, room, user) { if (!target || !this.can("ban")) return false; Monitor.ban(this.targetUser.userid || this.targetUser); this.send((this.targetUser.name || this.targetUser) + " was banned from using the bot by " + user.name + "."); }, unmute: function(target, room, user) { if (!target || !this.can("mute") || Monitor.isBanned(this.targetUser.userid || this.targetUser) !== "mute") return false; Monitor.release(this.targetUser.userid || this.targetUser); this.send((this.targetUser.name || this.targetUser) + " was unmuted by " + user.name + "."); }, unlock: function(target, room, user) { if (!target || !this.can("lock") || Monitor.isBanned(this.targetUser.userid || this.targetUser) !== "lock") return false; Monitor.release(this.targetUser.userid || this.targetUser); this.send((this.targetUser.name || this.targetUser) + " was unlocked by " + user.name + "."); }, unban: function(target, room, user) { if (!target || !this.can("ban") || Monitor.isBanned(this.targetUser.userid || this.targetUser) !== "ban") return false; Monitor.release(this.targetUser.userid || this.targetUser); this.send((this.targetUser.name || this.targetUser) + " was unbanned by " + user.name + "."); }, };
mit