code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
require 'spec_helper' # Testing constants may sound nonsensical, but we must be 100% sure that # their addresses (used by RIOT and TIA classes) match the mapping on Bus, # guaranteeing that chips will work regardless of the mirror used by games describe Ruby2600::Constants do it 'uses $00-$3F mirror in all TIA constants' do [ VSYNC, VBLANK, WSYNC, RSYNC, NUSIZ0, NUSIZ1, COLUP0, COLUP1, COLUPF, COLUBK, CTRLPF, REFP0, REFP1, PF0, PF1, PF2, RESP0, RESP1, RESM0, RESM1, RESBL, AUDC0, AUDC1, AUDF0, AUDF1, AUDV0, AUDV1, GRP0, GRP1, ENAM0, ENAM1, ENABL, HMP0, HMP1, HMM0, HMM1, HMBL, VDELP0, VDELP1, VDELBL, RESMP0, RESMP1, HMOVE, HMCLR, CXCLR, CXM0P, CXM1P, CXP0FB, CXP1FB, CXM0FB, CXM1FB, CXBLPF, CXPPMM, INPT0, INPT1, INPT2, INPT3, INPT4, INPT5 ].each { |reg| expect(reg).to be <= 0x3F } end it 'uses $0280-$029x mirror in al RIOT constants' do [ SWCHA, SWACNT, SWCHB, SWBCNT, INTIM, INSTAT, TIM1T, TIM8T, TIM64T, T1024T ].each do |reg| expect(reg).to be >= 0x280 expect(reg).to be <= 0x29F end end end
chesterbr/ruby2600
spec/lib/ruby2600/constants_spec.rb
Ruby
mit
1,095
<?php namespace Migrations; use Doctrine\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; /** * Auto-generated Migration: Please modify to your needs! */ class Version20171130122128 extends AbstractMigration { /** * @param Schema $schema */ public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs $this->abortIf( $this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.' ); $this->addSql( 'CREATE TABLE assignment_supplementary_exercise_file (assignment_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', supplementary_exercise_file_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', INDEX IDX_D6457EA6D19302F8 (assignment_id), INDEX IDX_D6457EA62D777971 (supplementary_exercise_file_id), PRIMARY KEY(assignment_id, supplementary_exercise_file_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB' ); $this->addSql( 'CREATE TABLE assignment_attachment_file (assignment_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', attachment_file_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', INDEX IDX_51F652B7D19302F8 (assignment_id), INDEX IDX_51F652B75B5E2CEA (attachment_file_id), PRIMARY KEY(assignment_id, attachment_file_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB' ); $this->addSql( 'ALTER TABLE assignment_supplementary_exercise_file ADD CONSTRAINT FK_D6457EA6D19302F8 FOREIGN KEY (assignment_id) REFERENCES assignment (id) ON DELETE CASCADE' ); $this->addSql( 'ALTER TABLE assignment_supplementary_exercise_file ADD CONSTRAINT FK_D6457EA62D777971 FOREIGN KEY (supplementary_exercise_file_id) REFERENCES uploaded_file (id) ON DELETE CASCADE' ); $this->addSql( 'ALTER TABLE assignment_attachment_file ADD CONSTRAINT FK_51F652B7D19302F8 FOREIGN KEY (assignment_id) REFERENCES assignment (id) ON DELETE CASCADE' ); $this->addSql( 'ALTER TABLE assignment_attachment_file ADD CONSTRAINT FK_51F652B75B5E2CEA FOREIGN KEY (attachment_file_id) REFERENCES uploaded_file (id) ON DELETE CASCADE' ); } public function postUp(Schema $schema): void { $this->connection->beginTransaction(); $assignments = $this->connection->executeQuery("SELECT * FROM assignment"); foreach ($assignments as $assignment) { $supplementaryFiles = $this->connection->executeQuery( "SELECT * FROM exercise_supplementary_exercise_file WHERE exercise_id = :id", ["id" => $assignment["exercise_id"]] ); $supplementaryFilesQuery = []; foreach ($supplementaryFiles as $file) { $supplementaryFilesQuery[] = "('{$assignment["id"]}', '{$file["supplementary_exercise_file_id"]}')"; } if (!empty($supplementaryFilesQuery)) { $this->connection->executeQuery( "INSERT INTO assignment_supplementary_exercise_file (assignment_id, supplementary_exercise_file_id) VALUES " . implode( ', ', $supplementaryFilesQuery ) ); } $attachmentFiles = $this->connection->executeQuery( "SELECT * FROM exercise_attachment_file WHERE exercise_id = :id", ["id" => $assignment["exercise_id"]] ); $attachmentFilesQuery = []; foreach ($attachmentFiles as $file) { $attachmentFilesQuery[] = "('{$assignment["id"]}', '{$file["attachment_file_id"]}')"; } if (!empty($attachmentFilesQuery)) { $this->connection->executeQuery( "INSERT INTO assignment_attachment_file (assignment_id, attachment_file_id) VALUES " . implode( ', ', $attachmentFilesQuery ) ); } } $this->connection->commit(); } /** * @param Schema $schema */ public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->abortIf( $this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.' ); $this->addSql('DROP TABLE assignment_supplementary_exercise_file'); $this->addSql('DROP TABLE assignment_attachment_file'); } }
ReCodEx/api
migrations/Version20171130122128.php
PHP
mit
4,711
//--------------------------------------------------------------------------- // // File: XamlStyleSerializer.cs // // Description: // Class that serializes and deserializes Styles. // // Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Collections; using System.Globalization; using System.IO; using System.Reflection; using System.Text; using System.Xml; using System.Security.Permissions; using MS.Utility; #if !PBTCOMPILER using System.Windows.Data; #endif #if PBTCOMPILER namespace MS.Internal.Markup #else namespace System.Windows.Markup #endif { /// <summary> /// Class that knows how to serialize and deserialize Style objects /// </summary> internal class XamlStyleSerializer : XamlSerializer { #if PBTCOMPILER #region Construction /// <summary> /// Constructor for XamlStyleSerializer /// </summary> public XamlStyleSerializer() : base() { } internal XamlStyleSerializer(ParserHooks parserHooks) : base() { _parserHooks = parserHooks; } private ParserHooks _parserHooks = null; #endregion Construction /// <summary> /// Convert from Xaml read by a token reader into baml being written /// out by a record writer. The context gives mapping information. /// </summary> internal override void ConvertXamlToBaml ( XamlReaderHelper tokenReader, ParserContext context, XamlNode xamlNode, BamlRecordWriter bamlWriter) { StyleXamlParser styleParser = new StyleXamlParser(tokenReader, context); styleParser.BamlRecordWriter = bamlWriter; styleParser.ParserHooks = _parserHooks; // Process the xamlNode that is passed in so that the <Style> element is written to baml styleParser.WriteElementStart((XamlElementStartNode)xamlNode); // Parse the entire Style section now, writing everything out directly to BAML. styleParser.Parse(); } #else /// <summary> /// If the Style represented by a group of baml records is stored in a dictionary, this /// method will extract the key used for this dictionary from the passed /// collection of baml records. For Style, this is the type of the first element record /// in the record collection, skipping over the Style element itself. /// </summary> //CASRemoval:[StrongNameIdentityPermission(SecurityAction.InheritanceDemand, PublicKey = Microsoft.Internal.BuildInfo.WCP_PUBLIC_KEY_STRING)] internal override object GetDictionaryKey(BamlRecord startRecord, ParserContext parserContext) { Type styleTargetType = Style.DefaultTargetType; bool styleTargetTypeSet = false; object targetType = null; int numberOfElements = 0; BamlRecord record = startRecord; short ownerTypeId = 0; while (record != null) { if (record.RecordType == BamlRecordType.ElementStart) { BamlElementStartRecord elementStart = record as BamlElementStartRecord; if (++numberOfElements == 1) { // save the type ID of the first element (i.e. <Style>) ownerTypeId = elementStart.TypeId; } else if (numberOfElements == 2) { styleTargetType = parserContext.MapTable.GetTypeFromId(elementStart.TypeId); styleTargetTypeSet = true; break; } } else if (record.RecordType == BamlRecordType.Property && numberOfElements == 1) { // look for the TargetType property on the <Style> element BamlPropertyRecord propertyRecord = record as BamlPropertyRecord; if (parserContext.MapTable.DoesAttributeMatch(propertyRecord.AttributeId, ownerTypeId, TargetTypePropertyName)) { targetType = parserContext.XamlTypeMapper.GetDictionaryKey(propertyRecord.Value, parserContext); } } else if (record.RecordType == BamlRecordType.PropertyComplexStart || record.RecordType == BamlRecordType.PropertyIListStart) { // We didn't find the second element before a complex property like // Style.Triggers, so return the default style target type: FrameworkElement. break; } record = record.Next; } if (targetType == null) { if (!styleTargetTypeSet) { ThrowException(SRID.StyleNoDictionaryKey, parserContext.LineNumber, parserContext.LinePosition); } return styleTargetType; } else return targetType; } // Helper to insert line and position numbers into message, if they are present void ThrowException( string id, int lineNumber, int linePosition) { string message = SR.Get(id); XamlParseException parseException; // Throw the appropriate execption. If we have line numbers, then we are // parsing a xaml file, so throw a xaml exception. Otherwise were are // parsing a baml file. if (lineNumber > 0) { message += " "; message += SR.Get(SRID.ParserLineAndOffset, lineNumber.ToString(CultureInfo.CurrentCulture), linePosition.ToString(CultureInfo.CurrentCulture)); parseException = new XamlParseException(message, lineNumber, linePosition); } else { parseException = new XamlParseException(message); } throw parseException; } #endif // !PBTCOMPILER #region Data // Constants used for emitting specific properties and attributes for a Style internal const string StyleTagName = "Style"; internal const string TargetTypePropertyName = "TargetType"; internal const string BasedOnPropertyName = "BasedOn"; internal const string VisualTriggersPropertyName = "Triggers"; internal const string ResourcesPropertyName = "Resources"; internal const string SettersPropertyName = "Setters"; internal const string VisualTriggersFullPropertyName = StyleTagName + "." + VisualTriggersPropertyName; internal const string SettersFullPropertyName = StyleTagName + "." + SettersPropertyName; internal const string ResourcesFullPropertyName = StyleTagName + "." + ResourcesPropertyName; internal const string PropertyTriggerPropertyName = "Property"; internal const string PropertyTriggerValuePropertyName = "Value"; internal const string PropertyTriggerSourceName = "SourceName"; internal const string PropertyTriggerEnterActions = "EnterActions"; internal const string PropertyTriggerExitActions = "ExitActions"; internal const string DataTriggerBindingPropertyName = "Binding"; internal const string EventTriggerEventName = "RoutedEvent"; internal const string EventTriggerSourceName = "SourceName"; internal const string EventTriggerActions = "Actions"; internal const string MultiPropertyTriggerConditionsPropertyName = "Conditions"; internal const string SetterTagName = "Setter"; internal const string SetterPropertyAttributeName = "Property"; internal const string SetterValueAttributeName = "Value"; internal const string SetterTargetAttributeName = "TargetName"; internal const string SetterEventAttributeName = "Event"; internal const string SetterHandlerAttributeName = "Handler"; #if HANDLEDEVENTSTOO internal const string SetterHandledEventsTooAttributeName = "HandledEventsToo"; #endif #endregion Data } }
mind0n/hive
Cache/Libs/net46/wpf/src/Framework/System/Windows/Markup/XamlStyleSerializer.cs
C#
mit
9,268
# grunt-mini-static-blog > The best Grunt plugin ever. ## Getting Started This plugin requires Grunt `~0.4.5` If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: ```shell npm install grunt-mini-static-blog --save-dev ``` Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: ```js grunt.loadNpmTasks('grunt-mini-static-blog'); ``` ## The "mini_static_blog" task ### Overview In your project's Gruntfile, add a section named `mini_static_blog` to the data object passed into `grunt.initConfig()`. ```js grunt.initConfig({ mini_static_blog: { options: { // Task-specific options go here. }, your_target: { // Target-specific file lists and/or options go here. }, }, }); ``` ### Options #### options.separator Type: `String` Default value: `', '` A string value that is used to do something with whatever. #### options.punctuation Type: `String` Default value: `'.'` A string value that is used to do something else with whatever else. ### Usage Examples #### Default Options In this example, the default options are used to do something with whatever. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result would be `Testing, 1 2 3.` ```js grunt.initConfig({ mini_static_blog: { options: {}, files: { 'dest/default_options': ['src/testing', 'src/123'], }, }, }); ``` #### Custom Options In this example, custom options are used to do something else with whatever else. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result in this case would be `Testing: 1 2 3 !!!` ```js grunt.initConfig({ mini_static_blog: { options: { separator: ': ', punctuation: ' !!!', }, files: { 'dest/default_options': ['src/testing', 'src/123'], }, }, }); ``` ## Contributing In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). ## Release History _(Nothing yet)_
cassidypignatello/grunt-mini-static-blog
README.md
Markdown
mit
2,470
using System.Collections; using UnityEngine; using UF.GameSave; using FlatBuffers; namespace UF.Managers { /// <summary> /// GameSave manager. /// </summary> public class GameSaveManager : MgrSingleton<GameSaveManager> { public Monster monster; public override void OnInit() { } public void Load() { string gamesaveFilePath = FileUtils.GetWritablePathForPathname(FileUtils.gamesave(11111)); byte[] bytes = FileUtils.GetBytesFromFile(gamesaveFilePath); if (bytes == null) { // Default value var builder = new FlatBufferBuilder(1); Monster.StartMonster(builder); var orc = Monster.EndMonster(builder); Monster.FinishMonsterBuffer(builder, orc); monster = Monster.GetRootAsMonster(builder.DataBuffer); } else { monster = Monster.GetRootAsMonster(new ByteBuffer(bytes)); } } public void Save() { byte[] bytes = monster.ByteBuffer.Data; FileUtils.WriteToFile(FileUtils.gamesave(11111), bytes); } } }
sric0880/unity-framework
Assets/Scripts/Managers/GameSaveManager.cs
C#
mit
986
import Ember from 'ember'; export default Ember.Route.extend({ model:function(params){ return this.store.find('item', params['item_id']); } });
Mode7James/ember-slick
tests/dummy/app/routes/items/item.js
JavaScript
mit
149
#!/usr/bin/python import os from django.conf import settings from django.db import models from models.models import * os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' # Your app code here
Salias/Django-ORM-Standalone-template
app.py
Python
mit
193
package dt
millken/mktty
dt/empty.go
GO
mit
10
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../../node_modules/mocha/mocha.css"> <title>Mocha Tests</title> </head> <body> <div id="mocha"></div> <script src="../../node_modules/mocha/mocha.js"></script> <script src="../../node_modules/expect.js/index.js"></script> <script> mocha.setup({ checkLeaks: true, ui: 'bdd' }); </script> <!-- Arabic --> <script src="locale/ar.es.js" type="module"></script> <!-- Azerbaijani --> <script src="locale/az.es.js" type="module"></script> <!-- Bengali --> <script src="locale/bn.es.js" type="module"></script> <!-- Burmese --> <script src="locale/my.es.js" type="module"></script> <!-- Chinese --> <script src="locale/zh-cn.es.js" type="module"></script> <!-- Chinese --> <script src="locale/zh-tw.es.js" type="module"></script> <!-- Czech --> <script src="locale/cs.es.js" type="module"></script> <!-- Danish --> <script src="locale/dk.es.js" type="module"></script> <!-- Dutch --> <script src="locale/nl.es.js" type="module"></script> <!-- French --> <script src="locale/fr.es.js" type="module"></script> <!-- German --> <script src="locale/de.es.js" type="module"></script> <!-- Greek --> <script src="locale/el.es.js" type="module"></script> <!-- Hindi --> <script src="locale/hi.es.js" type="module"></script> <!-- Hungarian --> <script src="locale/hu.es.js" type="module"></script> <!-- Indonesian --> <script src="locale/id.es.js" type="module"></script> <!-- Italian --> <script src="locale/it.es.js" type="module"></script> <!-- Japanese --> <script src="locale/ja.es.js" type="module"></script> <!-- Javanese --> <script src="locale/jv.es.js" type="module"></script> <!-- Kinyarwanda --> <script src="locale/rw.es.js" type="module"></script> <!-- Korean --> <script src="locale/ko.es.js" type="module"></script> <!-- Persian --> <script src="locale/fa.es.js" type="module"></script> <!-- Polish --> <script src="locale/pl.es.js" type="module"></script> <!-- Portuguese --> <script src="locale/pt.es.js" type="module"></script> <!-- Punjabi --> <script src="locale/pa-in.es.js" type="module"></script> <!-- Romanian --> <script src="locale/ro.es.js" type="module"></script> <!-- Russian --> <script src="locale/ru.es.js" type="module"></script> <!-- Serbian --> <script src="locale/sr.es.js" type="module"></script> <!-- Spanish --> <script src="locale/es.es.js" type="module"></script> <!-- Swedish --> <script src="locale/sv.es.js" type="module"></script> <!-- Thai --> <script src="locale/th.es.js" type="module"></script> <!-- Turkish --> <script src="locale/tr.es.js" type="module"></script> <!-- Ukrainian --> <script src="locale/uk.es.js" type="module"></script> <!-- Uzbek --> <script src="locale/uz.es.js" type="module"></script> <!-- Vietnamese --> <script src="locale/vi.es.js" type="module"></script> <script type="module"> mocha.run(); </script> </body> </html>
knowledgecode/date-and-time
test/esm/locale.html
HTML
mit
3,264
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_09) on Thu Jun 05 13:27:53 CEST 2014 --> <title>util</title> <meta name="date" content="2014-06-05"> <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> </head> <body> <h1 class="bar"><a href="../util/package-summary.html" target="classFrame">util</a></h1> <div class="indexContainer"> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="AlertHelper.html" title="class in util" target="classFrame">AlertHelper</a></li> <li><a href="BlockManager.html" title="class in util" target="classFrame">BlockManager</a></li> <li><a href="HashHelper.html" title="class in util" target="classFrame">HashHelper</a></li> <li><a href="JsonHelper.html" title="class in util" target="classFrame">JsonHelper</a></li> <li><a href="MessageAdapter.html" title="class in util" target="classFrame">MessageAdapter</a></li> <li><a href="MessageHelper.html" title="class in util" target="classFrame">MessageHelper</a></li> <li><a href="RadiusManager.html" title="class in util" target="classFrame">RadiusManager</a></li> <li><a href="StringValidator.html" title="class in util" target="classFrame">StringValidator</a></li> <li><a href="UsernameManager.html" title="class in util" target="classFrame">UsernameManager</a></li> </ul> </div> </body> </html>
antan/snack
Snack/javadoc/util/package-frame.html
HTML
mit
1,455
#!/bin/sh # CYBERWATCH SAS - 2017 # # Security fix for DSA-3224-1 # # Security announcement date: 2015-04-12 00:00:00 UTC # Script generation date: 2017-01-01 21:07:19 UTC # # Operating System: Debian 7 (Wheezy) # Architecture: armv7l # # Vulnerable packages fix on version: # - libx11:2:1.5.0-1+deb7u2 # # Last versions recommanded by security team: # - libx11:2:1.5.0-1+deb7u3 # # CVE List: # - CVE-2013-7439 # # More details: # - https://www.cyberwatch.fr/vulnerabilites # # Licence: Released under The MIT License (MIT), See LICENSE FILE sudo apt-get install --only-upgrade libx11=2:1.5.0-1+deb7u3 -y
Cyberwatch/cbw-security-fixes
Debian_7_(Wheezy)/armv7l/2015/DSA-3224-1.sh
Shell
mit
617
#!/bin/sh # CYBERWATCH SAS - 2016 # # Security fix for RHSA-2013:0658 # # Security announcement date: 2013-03-21 18:29:12 UTC # Script generation date: 2016-05-12 18:11:18 UTC # # Operating System: Red Hat 6 # Architecture: x86_64 # # Vulnerable packages fix on version: # - openstack-cinder.noarch:2012.2.3-4.el6ost # - openstack-cinder-doc.noarch:2012.2.3-4.el6ost # - python-cinder.noarch:2012.2.3-4.el6ost # # Last versions recommanded by security team: # - openstack-cinder.noarch:2014.1.4-1.1.el6ost # - openstack-cinder-doc.noarch:2014.1.4-1.1.el6ost # - python-cinder.noarch:2014.1.4-1.1.el6ost # # CVE List: # - CVE-2013-1664 # - CVE-2013-1665 # # More details: # - https://www.cyberwatch.fr/vulnerabilites # # Licence: Released under The MIT License (MIT), See LICENSE FILE sudo yum install openstack-cinder.noarch-2014.1.4 -y sudo yum install openstack-cinder-doc.noarch-2014.1.4 -y sudo yum install python-cinder.noarch-2014.1.4 -y
Cyberwatch/cbw-security-fixes
Red_Hat_6/x86_64/2013/RHSA-2013:0658.sh
Shell
mit
969
<?php $this->load->view('globales/head_step2.php'); $this->load->view('globales/mensajes'); //echo var_dump($marcado->hijos); $id = $app->id; ?> <style type="text/css"> /* #app-container{ padding: 3rem 0rem; }*/ form{ margin:0; } h1#app-name{ font-size: 22px; } #header-interno-navbar{ display: block; position: relative; box-sizing: border-box; } #header-interno-navbar div{ position: relative; display: inline-table; box-sizing: border-box; vertical-align: middle; } #brand-container{ left: 10px; } #imagen-paso{ display: inline-table; padding: 0em 2em; } #imagen-paso i, #imagen-paso h3{ display: inline-table; vertical-align: middle; color: white; } #RunTour2{ display: inline-table; width: 580px; margin: 10px auto; background: rgba(255,255,255,.4); padding: 1em; box-sizing: border-box; text-align: justify; border-radius: 5px; position: relative; vertical-align: middle; } #RunTour2 button{ border: 0px; background: rgb(190,1,119); color: #fff; padding: .3em .7em; box-sizing: border-box; border-radius: 3px; position: absolute; right: 15px; top: 45px;} .doble{ margin: 10px auto; position: relative outline: 1px solid red; position: table; width: 800px; } .btn-guardar-narracion{ width: 125px !important; margin: 0 auto; padding: 8px; background: green !important; } .btn-guardar-narracion:hover{ background: darkgreen !important; } #taComentario{ border-radius: 0px; border: 3px solid rgb(220,220,220); width: 90%; height: 150px; } .nav-tabs i{ cursor: pointer; } .nav-tabs i:hover{ color: gray; } #mainpop{ position: fixed; background: rgba(0,0,0,.7); width: 100%; height: 100%; top: 0px; left: 0px; z-index: 999999; transition: all 2s ease-in; } #PopUpOut{ background: #fff; width: 30%; box-sizing: border-box; height: 400px; padding: 3em; border-radius: 3px; box-shadow: 1px 1px 4px 1px rgba(100,100,100,.4); } .cerrar{ color: white; font-size: 1rem; /*background: rgb(60,179,113);*/ padding: 5px; margin: 0px 120px; } .cerrar:hover{ color: white; text-decoration: none; } .cerrar i{ vertical-align: middle !important; } #cbo_datos, #cbo_vozmini{ width: 90%; border-radius: 0px; margin: 15px auto; } .inicialdata:hover{ color: steelblue; vertical-align: middle; } </style> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <header id="header-steps"> <div id="header-content"> <div id="brand" class="header-element"> <?php // $logo = $this->specialapp->create_logo('logo_principal_mv.jpg'); ?> <!-- <a class="brand" href="<?php echo $logo->brand_url; ?>"> <img src="<?php echo $logo->brand_img ?>" alt="Mensajes de Voz"/> </a> --> <h1>Mensajes de Voz</h1> </div> <!-- Opciones de navegación --> <?php if($this->session->userdata('logged_in')): ?> <div id="username"> <span id="nombre-usuario"><?php echo ("<b>" . $username . "</b>"); ?></span> <i class="material-icons" id="ico-username">settings</i> </div> <div id="saldo"> <i class="material-icons" id="ico-saldo">monetization_on</i> <span id="valor-saldo"><?php echo number_format($credits,0,",",".");?></span> <span id="texto-saldo">créditos</span> </div> <?php endif; ?> </div><!-- /header-content --> </header> <?php if($this->session->userdata('logged_in')){ ?> <div class="newNav" id="newNav"> <ul> <li class="item-main-menu"><a href="<?php echo base_url('campaign'); ?>"><i class="material-icons">folder_open</i><span>Campañas</span></a></li> <li class="item-main-menu"><a href="<?php echo base_url('contacts/contact_manager'); ?>"><i class="material-icons">account_circle</i><span>Contactos</span></a></li> <?php if(!$this->permissions->get('deny_marketplace')):?> <li class="item-main-menu"><a href="<?php echo base_url('marketplace'); ?>"><i class="material-icons" id="material-module">view_module</i><span>Aplicaciones</span></a></li> <?php endif; ?> <li class="item-main-menu"><a href="<?php echo base_url('payment'); ?>"><i class="material-icons">monetization_on</i> <span>Recargar Saldo</span></a></li> <?php if($this->session->userdata("user_id")==KKATOO_USER):?> <li class="item-main-menu"><a href="<?php echo base_url('user/apps'); ?>"><i class="material-icons">check_circle</i> <span>Admin App</span></a></li> <li class="item-main-menu"><a href="<?php echo base_url('admin/recents/'); ?>"><i class="material-icons">check_circle</i> <span>Supe Apps</span></a></li> <li class="item-main-menu"><a target="_blank" href="<?php echo base_url("wizard/newapp/subs"); ?>"><i class="material-icons">check_circle</i> <span>App Sus</span></a></li> <li class="item-main-menu"><a target="_blank" href="<?php echo base_url("wizard/newapp/dif"); ?>"><i class="material-icons">check_circle</i> <span>App Dif</span></a></li> <?php endif; ?> <li><a href="<?php echo base_url("login/logout"); ?>"><i class="material-icons">power_settings_new</i> <span>Salir</span></a></li> <!-- <li class="color" data-color="yellow"><a href="#" style="width: 24px; height: 24px; border: 1px solid white; background: yellow;"></a></li> <li class="color" data-color="#681508"><a href="#" style="width: 24px; height: 24px; border: 1px solid white; background: #681508;"></a></li> --> <?php }else{ ?> <li><a href="<?php echo base_url("login/login"); ?>?rtrn=<?php echo str_replace("/".KKATOO_ROOT."/","",$_SERVER['REQUEST_URI']); ?>"><?php echo $this->lang->line('login'); ?></a></li> <li><a href="<?php echo base_url("login/register"); ?>"><?php echo $this->lang->line('register'); ?></a></li> <?php } ?> </ul> </div> <div class="doble"> <div id="imagen-paso"> <h3>Paso2</h3> </div> <div id="RunTour2"> <p>Aprende rápidamente cómo comenzar a configurar tu mensaje. Haz click en el botón Iniciar Tour para guiarte paso a paso</p> <button id="IniciarTour">Iniciar Tour</button> </div> </div> <!-- CONTAINER DE LA APLICACION --> <div id="app-container" class="container"> <!-- HEADER DE LA APLICACION --> <div class="row"> <div class="span12" id="app-header"> <div class="row"> <!-- COLUMA 1 Imagen, nombre y descripción de la aplicación --> <div class="span6" id="app-name-and-desc"> <div class="app-image"> <img width="60" id="app-logo" src="<?php print base_url("public/".$app->image); ?>" alt="" > </div> <h1 id="app-name"><?php echo $app->title; ?></h1> <!-- <div id="app-description"> <?php echo $app->description; ?> </div> --> </div> <!-- #app-name-and-desc --> <!-- COLUMA 2 Formulario de nombre de la campaña --> <div class="span6"> <div id="frm-campaign-name" style="text-transform: uppercase;"> <div class="control-group"> <label for="txt-campaign-name"> <?php echo "<span style='font-weight: 300; color: #656a71;'>#" .$id_campaign . "</span> ". $name_campaign; ?> </label> </div> </div> </div> <!-- .span6 --> </div> <!-- .row --> </div> <!-- #app-header --> </div> <!-- .row --> <!-- PESTAÑAS PASOS --> <div class="row" id="tabs"> <div class="span12"> <!-- PESTAÑAS --> <ul class="nav nav-tabs" id="steps-tabs"> <li><a href="<?php echo base_url('apps/'.$app->uri); ?>" ><?php echo $this->lang->line('step1'); ?></a></li> <li><a href="#message-config" id="segundo" data-toggle="tab"><?php echo $this->lang->line('step2'); ?></a></li> <li><a data-step="10" data-intro="Ve al siguiente paso para configurar la fecha y hora de tu campaña" href="<?php echo base_url('apps/'.$app->uri.'/3'); ?>"><?php echo $this->lang->line('step3'); ?></a></li> </ul> <!-- CONTENIDOS PESTAÑAS --> <div class="tab-content" id="tab-content"> <!-- PESTAÑA 1 *************************************************--> <div class="tab-pane active" id="message-config" > <?php if(!empty($intro)){ ?> <div class="preview-content" id="pre-cont-au" style="font-weight:400"> <strong>Mensaje de Introducción.</strong><br /> <audio id="player_intro" src="<?php echo $intro->path; ?>" type="audio/*" controls="controls" style="margin-top:10px;"></audio> </div> <?php } ?> <!-- MENSAJE CONFIGURADO (SI APLICA) --> <?php if($audiocampaign){ ?> <div class="preview-content" id="pre-cont-au"> <strong>Mensaje principal</strong><br /> <audio id="player2" src="<?php echo base_url('public/audios');if(!empty($audiocampaign)): echo '/'.$audiocampaign->path; endif;?>" type="audio/*" controls="controls" style="margin-top:10px;"></audio> </div> <?php } ?> <?php if(isset($textcampaign)){ if(isset($textcampaign->text_speech)){ echo '<div class="preview-content" id="pre-cont-text">'; echo 'El mensaje actualmente configurado para narrar es:<br><div class="texto"><strong>"' . $textcampaign->text_speech.'"</strong></div>'; echo '</div>'; } else { // echo '<div class="preview-content" id="pre-cont-text">'; // echo '<div class="texto"></div>'; // echo '</div>'; } } else { // echo '<div class="preview-content" id="pre-cont-text">'; // echo '<div class="texto"></div>'; // echo '</div>'; } ?> <?php if(!empty($cierre)){ ?> <div class="preview-content" id="pre-cont-au"> <strong>Mensaje de Cierre</strong><br /> <audio id="player_cierre" src="<?php echo $cierre->path; ?>" type="audio/*" controls="controls" style="margin-top:10px;"></audio> </div> <?php } ?> <!-- HEADER PESTANA 1--> <div class="row" id="messages-header"> <div class="span6"><h2><?php echo $this->lang->line('configmessage'); ?></h2></div> <div class="span5" id="messages-links"> <!-- <div id="messages-admin-ico"><a href="###ADMIN AUDIOS"></a></div> <div id="messages-simulation-ico"><a href="#HACER SIMULACIÓN"></a></div> --> </div> </div> <!-- .row --> <!-- SECCION DE GRABACION DE INTRO --> <?php if($app->intro==1): ?> <div id="intro-recording" style="display:;"> <h3>Grabar intro</h3> <p style="margin: 0 40px;">Puedes grabar un mensaje de un máximo de 10 segundos para invitar a tus contactos a que escuchen el mensaje pregrabado de la aplicación.</p> <div style="overflow:hidden;margin: 5px 40px;"> <?php $the_url_record = base_url('apps/save_intro'); $the_url_record = urlencode($the_url_record); ?> <object width="100%" height="250" type="application/x-shockwave-flash" data="<?php echo base_url('assets/swf') ?>/kkatoo-audio-recorder.swf?saveurl=<?php echo $the_url_record ?>&id_wapp=<?php echo $app->id ?>&cache=<?php echo time(); ?>&function=real_redirect"> <param name="movie" value="<?php echo base_url('assets/swf') ?>/kkatoo-audio-recorder.swf?saveurl=<?php echo $the_url_record ?>&id_wapp=<?php echo $app->id ?>&cache=<?php echo time(); ?>&function=real_redirect" /> <param name="flashvars" value="saveurl=<?php echo $the_url_record ?>&id_wapp=<?php echo $app->id ?>&function=real_redirect"> <param name="quality" value="high" /> <param name="wmode" value="" /> </object> </div> </div> <?php endif; ?> <div class="clearfix"></div> <!-- GRUPO DE TABS DE MENSAJE INICIAL --> <div id="msg-initial"> <h3>Mensaje a emitir en la llamada</h3> <?php if($this->permissions->get('request_special_audio')): ?> <!--PEDIR AUDIO--> <div class="request_audio"> <p><?php echo $this->lang->line('request_audio_text'); ?></p> <input type="button" id="request_audio" class="btn" name="request_audio" data-iduser="<?php echo $this->session->userdata('user_id') ?>" data-idapp="<?php echo $app->id ?>" value="<?php echo $this->lang->line('request_audio_button'); ?>" /> <div class="clearfix"></div> </div> <!--/PEDIR AUDIO--> <?php endif; ?> <!-- BIBLIOTECA DE CONTENIDOS --> <div id="biblioteca" class="a_section" style="padding: 0px 20px;"> <div class="row-fluid"> <!-- 1a COLUMNA --> <div class="<?php if($app->text_speech == 1 || $app->record_audio == 1 || $app->upload_audio == 1) echo 'span7' ?> left-column" id="content-library-list" data-step="6" data-intro="Cada audio o texto que generes se listará en este espacio y estará siempre activo para futuras campañas a menos que desees borrarlo."> <p class="subtitulo"> Biblioteca de Contenidos </p> <div class="clearfix"></div> <form name="admin_contents" id="admin_contents" method="post" action=""> <table class="table table-striped" > <thead> <tr> <!--<th><input type="checkbox" class="check-all" name="check-all"></th>--> <th>Nombre</th> <th class="center">Acción</th> </tr> </thead> <tbody class="topaginate topaginate_wiz"> <!-- ESTA PARTE ES LA QUE SE REPITE EN UN CICLO --> <?php if($app->use_audio == 1): ?> <?php if(!empty($library)): ?> <?php foreach($library as $content): ?> <?php if($content->content_tipo == "text"): ?> <?php $text = $content; ?> <tr class="content_resume content_resume_text_<?php echo $text->text_id; ?>"> <td class="center" style="display:none; visibility"> <input type="hidden" name="check_content" value="<?php echo $text->text_id; ?>_<?php echo $text->content_tipo ?>" class="chk-select"> </td> <td> <?php echo $text->text_name; ?> </td> <td class="center"> <a href="javascript:;" title="<?php echo $this->lang->line('add_content'); ?>" data-step="7" data-intro="Para seleccionar el mensaje que usarás en tu campaña haz click en este botón" class="telefono" data-content="<?php echo $text->text_id; ?>_<?php echo $text->content_tipo ?>"><i class="material-icons">dialpad</i></a><a href="javascript:;" title="Editar mensaje de audio" class="item-edit-ico" data-id="<?php echo $text->text_id; ?>" data-tipo="text"><i class="material-icons">mode_edit</i></a><a href="javascript:;" title="Reproducir audio" class="item-view-ico" data-id="<?php echo $text->text_id; ?>" data-tipo="text"><i class="material-icons">play_arrow</i></a><a href="#" class="item-delete-ico" title="Eliminar audio" data-id="<?php echo $text->text_id; ?>" data-tipo="text"><i class="material-icons">delete_forever</i></a> </td> </tr> <tr class="content_view content_view_text_<?php echo $text->text_id; ?>" style="display: none;"> <td colspan="3"> <h4><?php echo $this->lang->line('nombre'); ?></h4> <p class="name_field"><?php echo $text->text_name; ?></p> <h4><?php echo $this->lang->line('the_message'); ?></h4> <p class="message"><?php echo $text->text_text; ?></p> <h4><?php echo $this->lang->line('voicena'); ?></h4> <p class="voice" data-voice-id="<?php echo $text->text_voice_id ?>"><?php echo $text->voice_name; ?> - <?php echo $text->idioma; ?></p> </td> </tr> <?php elseif($content->content_tipo == "audio"): ?> <?php $audio = $content; ?> <tr class="content_resume content_resume_audio_<?php echo $audio->audio_id; ?>"> <td class="center" style="display:none; visibility"> <input type="hidden" name="check_content" value="<?php echo $audio->audio_id; ?>_<?php echo $audio->content_tipo ?>" class="chk-select"> </td> <td><?php echo $audio->audio_name; ?></td> <td class="center"> <a href="javascript:;" class="telefono" title="<?php echo $this->lang->line('add_content'); ?>" data-content="<?php echo $audio->audio_id; ?>_<?php echo $audio->content_tipo ?>"><i class="material-icons">dialpad</i></a><a title="Editar mensaje de audio" href="javascript:;" class="item-edit-ico" data-id="<?php echo $audio->audio_id; ?>" data-tipo="audio"><i class="material-icons">mode_edit</i></a><a title="Reproducir audio" href="javascript:;" class="item-view-ico" data-id="<?php echo $audio->audio_id; ?>" data-tipo="audio"><i class="material-icons">play_arrow</i></a><a href="javascript:;" class="item-delete-ico" title="Eliminar audio" data-id="<?php echo $audio->audio_id; ?>" data-tipo="audio"><i class="material-icons">delete_forever</i></a> </td> </tr> <tr class="content_view content_view_audio_<?php echo $audio->audio_id; ?>" style="display: none;"> <td colspan="3"> <h4><?php echo $this->lang->line('nombre'); ?></h4> <p class="name_field"><?php echo $audio->audio_name; ?></p> <audio id="player2" src="<?php echo base_url('public/audios') ?>/<?php echo $audio->path; ?>" type="audio/*" controls></audio> </td> </tr> <?php endif; ?> <?php endforeach; ?> <?php endif; ?> <?php endif; ?> </tbody> </table> <input type="hidden" name="check_content" value="" /> <input type="hidden" name="id_campaign" class="id_campaign" value="<?php echo $id_campaign; ?>" /> <input type="hidden" name="arbol" value="" class="uploadsmall-arbol"> </form> <div class="pagination_wiz pagination" style="text-align: center;"> <ul> <!--Pagination--> </ul> </div> </div><!-- span 7 #content-library-list --> <?php if($app->text_speech == 1 || $app->record_audio == 1 || $app->upload_audio == 1): ?> <!-- 2a COLUMNA --> <div class="span5 right-column" id="content-library-tabs"> <p class="subtitulo">Grabar nuevos contenidos</p> <div class="tabbable tabbable-bordered tabs-left"> <ul class="nav nav-tabs" style="position: relative !important;"> <?php if($app->text_speech==1): ?> <li class="active"><a href="#narrar" data-toggle="tab" id="tab-narrar" title="Configurar mensaje de audio" ><i class="material-icons">chat</i></a></li> <?php endif; ?> <?php if($app->upload_audio==1): ?> <li <?php if($app->text_speech==0) echo 'class="active"' ?>><a title="Subir audio" href="#subir" data-toggle="tab" id="tab-subir" ><img data-step="4" data-intro="Desde aquí puedes subir un audio que tengas ya grabado en tus archivos" src="<?php echo base_url('assets/img') ?>/ico-upload-audio-24.png" alt="Narrar"></a></li> <?php endif; ?> <?php if($app->record_audio==1): ?> <li <?php if($app->text_speech==0 && $app->upload_audio==0) echo 'class="active"' ?>><a title="Grabar audio" href="#grabar" data-toggle="tab" id="tab-grabar" ><img data-step="5" data-intro="Desde aquí puedes grabar un audio en línea" src="<?php echo base_url('assets/img') ?>/ico-rec-audio-24.png" alt="Narrar"></a></li> <?php endif; ?> <!-- <li><a href="#seleccionar" data-toggle="tab" id="tab-seleccionar" ><img src="../<?php echo base_url('assets/img') ?>/ico-choose-audio-24.png" alt="Narrar"></a></li> --> </ul> <div class="tab-content"> <!-- TAB NARRAR --> <?php if($app->text_speech==1): ?> <div class="tab-pane active" id="narrar"> <?php //OPEN TEXT SPEECH FORM $attributes = array('name' => 'form-text-speach', 'id' => 'form-text-speach'); echo form_open('wizard/ajax_save_text_speach', $attributes); ?> <p><?php echo $this->lang->line("messagena"); ?></p> <?php if($app->id =='327'){?> <style> #TarjetaFlotante{ background: white; width: 460px; height: height; color: #303030; box-sizing: border-box; padding: 1.3rem; position: fixed; bottom: 25px; left: 5px; text-align: left; box-shadow: rgba(0,0,0,.2) 1px 1px 1px 1px; border-top: 4px solid #8FD7EA; z-index: 999 !important; } #TarjetaFlotante h4{ font-weight: 300; font-size: 32px; color: silver; } #TarjetaFlotante hr{ border-bottom: 1px solid silver; border-top: 0px; border-right: 0px; border-left: 0px; padding: .5rem; height: 0px; width: 100%; margin: .5rem auto; } #CerrarTarjeta{ color: black; text-decoration: none; cursor: pointer; text-align: right; position: absolute; right: 30px; } #CerrarTarjeta:hover{ text-decoration: none; cursor: pointer; color: lightblue; } #BotonTarjeta{ width: auto; padding: 1rem; background: gold; color: white; text-transform: uppercase; position: fixed; bottom: 50px; left: 5px; text-decoration: none; cursor: pointer; color: black; } #BotonTarjeta:hover{ text-decoration: none; } </style> <div id="TarjetaFlotante"> <h4>Caracteres permitidos <a href="#" id="CerrarTarjeta"><i class="material-icons">clear</i></a></h4> <hr> <p>Para asegurar que todos los teléfonos celulares reciban correctamente los mensajes, los caracteres que actualmente soportamos son los siguientes: <p>Letras: a-z A-Z (sin tildes, ñ o Ñ)</p> <p>Números: 0-9</p> <p>Símbolos:$ “ % ! ? & / \ ( ) < > = @ # + * _ - : ; , .</p> </div> <a id="BotonTarjeta">Mostrar Notificación</a> <textarea placeholder="" id="taComentario" maxlength="160" name="txt_msg_to_speech" id="txt_narrar_small" onKeyDown="cuenta()" onKeyUp="cuenta()"></textarea> <p style="color:steelblue; font-size: 16px; font-weight: 300;">Límite de caracteres para SMS: <span id="contadorTaComentario" style="color:green; font-weight: 400; text-align: center;">0/160</span></p> <?php } ?> <?php if($app->id !='327'){?> <textarea id="taComentario" name="txt_msg_to_speech" id="txt_narrar_small" onKeyDown="cuenta()" onKeyUp="cuenta()"></textarea> <?php } ?> <br /> <!-- --> <p>Usar campos personalizados:<?php //echo $this->lang->line('datomessage'); ?></p> <select data-step="2" data-intro="Al configurar tu mensaje puedes personalizarlo, insertando los campos que aparecen en esta lista." id="cbo_datos" name="cbo-datos" class="input-block-level"> <option value="dato" disabled selected ><?php echo $this->lang->line('dato'); ?></option> <option value="name"><?php echo $this->lang->line('name'); ?></option> <?php if(!empty($dynamic)){ ?> <?php foreach($dynamic as $fiel){ ?> <option value="<?php echo $fiel->name_fields; ?>"><?php echo $fiel->name; ?></option> <?php } ?> <?php } ?> </select> <!-- <br /> --> <?php if($app->id !='327'){?> <p><?php echo $this->lang->line('voicena'); ?></p> <select data-step="3" data-intro="En caso de que tu campaña sea en llamada, elige la voz con la que quieres que el mensaje sea narrado. Puedes elegir entre masculino y femenino." id="cbo_vozmini" name="cbo-vozmini" class="input-block-level"> <option value="0" disabled selected><?php echo $this->lang->line('voice'); ?></option> <?php foreach($voice as $voi){ ?> <option value="<?php echo $voi->id; ?>"><?php echo str_replace("IVONA 2 ","",$voi->name).' '.$voi->idioma; ?></option> <?php } ?> </select> <a class="iframe voice_link" id="PopUp" href="javascript:;">Escuchar Voces DEMO</a> <div id="mainpop" style="display:none;"> <iframe id="PopUpOut" src="<?php echo base_url('apps/voice_view'); ?>" frameborder="0"></iframe><br> <a href="javascript:;" id="cerrar" class="cerrar">cerrar<i class="material-icons">clear</i></a> </div> <?php } ?> <input type="hidden" name="id_wapp" id="id_wapp" value="<?php echo set_value('id_wapp', $id); ?>" /> <input type="hidden" name="id_content_text" id="id_content_text" value="" /> <div style="text-align:center"> <input type="submit" value="Guardar Mensaje" class="btn btn-block btn-guardar-narracion" /> <input type="reset" style="display:none;" value="Limpiar formulario" class="btn btn-block btn-guardar-narracion" /> </div> <?php echo form_close(); ?> </div> <?php endif; ?> <!-- TAB SUBIR --> <?php if($app->upload_audio==1): ?> <div class="tab-pane<?php if($app->text_speech==0) echo 'active'; ?>" id="subir"> <div id="dropdiv-small"> <div class="initial-audio-upload"> <?php //OPEN TEXT SPEECH FORM $attributes = array('name' => 'form-audio', 'id' => 'form-audio'); echo form_open('wizard/upload_audio', $attributes); ?> <label><?php echo $this->lang->line('nombre') ?></label> <input name="audio_name" type="text" class="input-block-level input-medium dynamic_name" value=""> <a href="javascript:void(0);"> <label class="cabinet"> <input type="file" class="file" name="upload_audio" data-context="dropdiv-small" accept="audio/*" data-form-data='{"wapp":"<?php echo $app->id ?>", "user":"<?php echo $app->user_id ?>"}' /> </label> </a> <?php echo form_close(); ?> <div id="progress_bar_audio"> <div class="bar" style="width: 0%;"></div> </div> </div> <!-- <div class="fakeupload"> <img src="../<?php echo base_url('assets/img') ?>/ico-audio-generic-medium.png" /> <p><a href="javascript:void(0)"></a><?php echo $this->lang->line('remplaceaudio'); ?>:<span></span></p> <input type="submit" id="subir-audio" class="btn" value="SUBIR AUDIO" /> </div> --> <!-- <input type="file" name="Filedata" /> --> <span class="msg" id="msg-upload">Selecciona un archivo de audio mp3 para subir, no debe pesar más de 2Mbs.</span> </div> <!-- dropdiv-small --> <div id="upload-audio"> Debes ser propietario de los derechos de autor o tener permiso de usar el contenido que subas. <a href="#MAS INFORMACION">Más información</a> </div> </div> <?php endif; ?> <!-- TAB GRABAR --> <?php if($app->record_audio==1): ?> <?php $the_url_record = base_url('wizard/add_audio_record'); $the_url_record = urlencode($the_url_record); ?> <div class="tab-pane <?php if($app->text_speech==0 && $app->upload_audio==0) echo 'active'; ?>" id="grabar"> <object width="100%" height="100%" type="application/x-shockwave-flash" data="<?php echo base_url('assets/swf') ?>/kkatoo-audio-recorder_small.swf?saveurl=<?php echo $the_url_record ?>&id_wapp=<?php echo $app->id ?>"> <param name="movie" value="<?php echo base_url('assets/swf') ?>/kkatoo-audio-recorder_small.swf?saveurl=<?php echo $the_url_record ?>&id_wapp=<?php echo $app->id ?>" /> <param name="flashvars" value="saveurl=<?php echo $the_url_record ?>&id_wapp=<?php echo $app->id ?>"> <param name="quality" value="high" /> <param name="wmode" value="" /> </object> </div> <?php endif; ?> <!-- TAB SELECCIONAR <div class="tab-pane" id="seleccionar"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Et, sequi ullam nihil sapiente accusamus ipsum perspiciatis facere quae veritatis necessitatibus facilis ex odio eaque magni minus reiciendis porro dolorum temporibus!</p> </div>--> </div> </div> </div><!-- .span5 #content-library-tabs --> <?php endif; ?> <?php if($app->id !='327'){?> <?php if($app->aditional_options == 1): ?> <!--<div id="buttons"> <button class="btn" type="button" id="show-additional-options"><?php echo $this->lang->line('optionsadd'); ?></button> </div> --><!-- buttons --> <?php endif; ?> </div><!-- .row --> </div> <?php if($app->aditional_options==1): ?> <!-- OPCIONES ADICIONALES --> <div id="msg-additional-options"> <h3 style="text-align:left;"><?php echo $this->lang->line('options'); ?></h3> <div id="msg-additional-dialpad"> <h4><?php echo $this->lang->line('numberoption'); ?></h4> <div id="dialpad"> <button class="dial-button" type="button" data-num="1" data-step="8" data-intro="Si tu llamada tiene opciones de marcación, selecciona el número en el teclado...">1</button> <button class="dial-button" type="button" data-num="2">2</button> <button class="dial-button" type="button" data-num="3">3</button><br> <button class="dial-button" type="button" data-num="4">4</button> <button class="dial-button" type="button" data-num="5">5</button> <button class="dial-button" type="button" data-num="6">6</button><br> <button class="dial-button" type="button" data-num="7">7</button> <button class="dial-button" type="button" data-num="8">8</button> <button class="dial-button" type="button" data-num="9">9</button><br> <button class="dial-button" type="button" data-num="*">*</button> <button class="dial-button" type="button" data-num="0">0</button> <button class="dial-button" type="button" data-num="#">#</button> </div> </div> <!-- msg-additional-dialpad --> <div id="tree-options"> <ul id="browser" class="filetree"> <li data-step="9" data-intro="Haz click en la carpeta que se genera y selecciona el audio en tu biblioteca haciendo click en el ícono en forma de teléfono" class="inicial expandable"><span class="folder inicialdata" data-num="inicial">Inicial</span> <ul> <?php if(isset($marcado->hijos)){ foreach($marcado->hijos as $marc) { if(isset($marc->digito)) { echo '<li class="'.$marc->digito.'" data-num="'.$marc->digito.'"><span class="folder" data-num="'.$marc->digito.'">'.$marc->digito.'</span><ul class="'.$marc->digito.'">'; foreach($marc->hijos as $hja) { if(isset($hja->digito)) { echo '<li class="subnivel"><span class="folder" data-num="'.$hja->digito.'">'.$hja->digito.'</span></li>';; } } echo '</ul></li>'; } } } ?> </ul> </li> </li> </ul> </div> <div class="show-which-message"> <h4><?php echo $this->lang->line('selected_message'); ?></h4> <div class="selected-message"> <div class="selected_audio" style="display:none;"> <h5>Audio Name</h5> <audio src="<?php echo base_url('public/audios');if(!empty($audiocampaign)): echo '/'.$audiocampaign->path; endif;?>" type="audio/*" controls="controls"></audio> </div> <div class="selected_text" style="display:none;"> <h5><?php echo $this->lang->line('text_to_speech'); ?></h5> <p></p> </div> </div> <div class="text-center delete_selected" style="display:none;"> <a href="javascript:void(0);" class="btn" data-delete="" data-campaign="<?php echo $id_campaign; ?>">Eliminar Selecionado <strong>#</strong></a> </div> </div> </div> <!-- msg-additional-options --> <!-- FIN OPCIONES ADICIONALES --> <?php endif; ?> <?php } ?> <!-- SECCION DE GRABACION DE CIERRE --> <?php if($app->cierre==1): ?> <div id="intro-recording" style="display:; "> <h3>Grabar cierre</h3> <p style="margin: 0 40px;">Si lo deseas también puedes grabar un mensaje de 10 segundos para despedirte de tus contactos.</p> <div style="overflow:hidden;margin: 5px 40px;"> <?php $the_url_record = base_url('apps/save_close'); $the_url_record = urlencode($the_url_record); ?> <object width="100%" height="250" type="application/x-shockwave-flash" data="<?php echo base_url('assets/swf') ?>/kkatoo-audio-recorder.swf?saveurl=<?php echo $the_url_record ?>&id_wapp=<?php echo $app->id ?>&cache=<?php echo time(); ?>&function=real_redirect"> <param name="movie" value="<?php echo base_url('assets/swf') ?>/kkatoo-audio-recorder.swf?saveurl=<?php echo $the_url_record ?>&id_wapp=<?php echo $app->id ?>&cache=<?php echo time(); ?>&function=real_redirect" /> <param name="flashvars" value="saveurl=<?php echo $the_url_record ?>&id_wapp=<?php echo $app->id ?>&function=real_redirect"> <param name="quality" value="high" /> <param name="wmode" value="" /> </object> </div> </div> <?php endif; ?> <br /> <div id="btn-next-step" style="display:"> <a class="btn btn-large" href="<?php echo base_url('apps/'.$app->uri.'/3'); ?>"><?php echo $this->lang->line('next_step'); ?> <i class="icon-chevron-right"></i> </a> </div> </div> <!-- paso1 (#contacts-select) --> <!-- fin PESTAÑA 1 *************************************************--> </div> <!-- #tab-content --> </div> <!-- .span12 --> </div> <!-- .row --> </div> <!-- #app-container --> <!-- Modal para esperar --> <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 id="myModalLabel">Cargando Datos</h3> </div> <div class="modal-body"> <p>Por favor espere?</p> </div> <div class="modal-footer"> <!--<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>--> </div> </div> <!-- #Modal para esperar --> <!-- Modal para mensajes --> <div id="mensajes" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 id="mensajesLabel">Error</h3> </div> <div class="modal-body"> <p><div class="alert alert-error mensajesdeerror"> Error al enviar los datos </div></p> </div> <div class="modal-footer"> <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> </div> </div> <!-- #Modal para mensajes --> <!-- Le javascript --> <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> --> <script src="<?php echo base_url('assets/js/bootstrap.js')?>"></script> <script src="<?php echo base_url('assets/js/plugins.js')?>"></script> <script src="<?php echo base_url('assets/build/mediaelement-and-player.min.js')?>"></script> <script src="<?php echo base_url('assets/js/steps-ini.js')?>"></script> <script src="<?php echo base_url('assets/js/fancybox/jquery.fancybox-1.3.4.pack.js')?>"></script> <script src="<?php echo base_url('assets/js/si.files.js'); ?>"></script> <script src="<?php echo base_url('assets/js/wizard'); ?>/jquery.simplePagination.js"></script> <script src="<?php echo base_url('assets/js/charactercounter.js')?>"></script> <script type="text/javascript"> $(document).ready(function(){ $( '#RunTour2').on('click', function(){ javascript:introJs().start(); }); }); $("#PopUp").click(function(){ $('#mainpop').show(); }); $("#cerrar").click(function(){ $('#mainpop').hide(); }); // Agregado libreria de contenidos /** PAGINACIÓN PARA LA LIBRERÍA DE CONTENIDOS **/ var pagination_ul = $('.pagination_wiz ul'); var items = 'tbody.topaginate_wiz tr.content_resume'; var numItemsToShow = 5; var numItems = $(items).length; var numPages = Math.ceil(numItems/numItemsToShow); function redraw_pagination(){ $(items).hide(); $(items).slice(0, numItemsToShow).fadeIn(); redraw_one(); } function redraw_one(){ pagination_ul.pagination('destroy'); made_pagination(); } $(items).hide(); $(items).slice(0, numItemsToShow).fadeIn(); function show_elements(page){ var beginItem = (page -1) * numItemsToShow; $(items).hide(); $('tr.content_view').hide(); $(items).slice(beginItem, beginItem + numItemsToShow).fadeIn(); } function made_pagination(){ numItems = $(items).length; numPages = Math.ceil(numItems/numItemsToShow); pagination_ul.pagination({ items: numItems, itemsOnPage: numItemsToShow, onPageClick: function(pageNumber, event) { show_elements(pageNumber); } }); } made_pagination(); //VARIABLES GLOBALES QUE SERÁN UTILIZADAS EN EL JS var $line_nombre = '<?php echo $this->lang->line('nombre') ?>'; var $line_the_message = '<?php echo $this->lang->line('the_message') ?>'; var $line_voicena = '<?php echo $this->lang->line('voicena') ?>'; var $app_data_id = '<?php echo $app->id ?>'; var $sure_delete_library= '<?php echo $this->lang->line('sure_delete_library'); ?>'; var $name_not_empty = '<?php echo $this->lang->line('name_not_empty'); ?>'; </script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> <script src="<?php echo base_url('assets/fileupload'); ?>/jquery.iframe-transport.js"></script> <script src="<?php echo base_url('assets/fileupload'); ?>/jquery.fileupload.js"></script> <script src="<?php echo base_url('assets/js/wizard/libreria_radios.js') ?>"></script> <script type="text/javascript"> $(document).ready(function($){ $('#steps-tabs a:#segundo').tab('show'); $('#msg-initial-tabs a:first').tab('show'); $('#msg-individual-tabs a:first').tab('show'); $(".ifancybox").fancybox({ 'autoDimensions': false, //'centerOnScroll': true, //'width' : '40%', //'height' : '50%', 'autoScale' : false, 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'type' : 'iframe', 'scrolling': 'auto' }); paso2(); }); <?php if(isset($marcado->hijos)){ foreach($marcado->hijos as $marc) { if(isset($marc->digito)) { echo 'arr_diales["'.$marc->digito.'"] = new Array();'; foreach($marc->hijos as $hja) { if(isset($hja->digito)) { echo 'arr_diales["'.$marc->digito.'"]["'.$hja->digito.'"] = new Array();'; } } } } } ?> SI.Files.stylizeAll(); </script> <script type="text/javascript"> function real_redirect(url){ location.href=url; } // LOAD THE SWF OBJECT DYNAMICALY var createSwfObject = function() { var src= '<?php echo base_url('assets/swf/kkatoo-audio-recorder_small.swf') ?>?saveurl=<?php echo $the_url_record ?>&id_wapp=<?php echo $app->id ?>'; var attributes = {id: 'myid', 'class': 'myclass', width: '100%', height: '100%'}; var parameters = {wmode: '', flashvars:"saveurl=<?php echo $the_url_record ?>&id_wapp=<?php echo $app->id ?>"}; var i, html, div, obj, attr = attributes || {}, param = parameters || {}; attr.type = 'application/x-shockwave-flash'; if (window.ActiveXObject) { attr.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'; param.movie = src; } else { attr.data = src; } html = '<object'; for (i in attr) { html += ' ' + i + '="' + attr[i] + '"'; } html += '>'; for (i in param) { html += '<param name="' + i + '" value="' + param[i] + '" />'; } html += '</object>'; div = document.createElement('div'); div.innerHTML = html; obj = div.firstChild; div.removeChild(obj); return obj; }; </script> <script type="text/javascript"> $(document).ready(function(){ $( "#BotonTarjeta" ).click(function() { $( "#BotonTarjeta" ).slideUp( "slow" ); $( "#TarjetaFlotante" ).slideDown( "slow" ); }).slideUp("slow"); $( "#CerrarTarjeta" ).click(function() { $( "#TarjetaFlotante" ).slideUp( "slow" ); $( "#BotonTarjeta" ).slideDown( "slow" ); }); // $( ".color" ).click(function() { // $('body').addClass($(this).attr("data-myclass")).removeClass("color_2"); // }); }); </script> </body> </html>
cmorenokkatoo/kkatooapp
application/views/step2.php
PHP
mit
53,681
// Load up the dependencies var Hapi = require('hapi'); // Our server framework var RoutesLib = require('./routes'); // Our routes // Create the server var server = new Hapi.createServer(process.env.HOST || '0.0.0.0', process.env.PORT || 9001, {cors: true, debug: {request:['error']}}); // Set up the route(s) server.route([ { method: 'GET', path: '/', handler: RoutesLib.grabSomeHeadlines } ]); // Start listening! server.start(function() { console.log('Server started and running at ' + server.info.uri); });
yoitsro/headliner
index.js
JavaScript
mit
515
MIT License Copyright (c) 2017 Mehul Ahuja 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.
HashCode55/goPacCap
LICENSE.md
Markdown
mit
1,068
// // Example 6-4. Log-polar transform example // logPolar.cpp : Defines the entry point for the console applicatio // // // input to second cvLogPolar does not need "CV_WARP_FILL_OUTLIERS": "M, CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS+CV_WARP_INVERSE_MAP );" --> "M, CV_INTER_LINEAR+CV_WARP_INVERSE_MAP );" // // // ./ch6_ex6_4 image m // Where m is the scale factor, which should be set so that the // features of interest dominate the available image area. // /* *************** License:************************** Oct. 3, 2008 Right to use this code in any way you want without warrenty, support or any guarentee of it working. BOOK: It would be nice if you cited it: Learning OpenCV: Computer Vision with the OpenCV Library by Gary Bradski and Adrian Kaehler Published by O'Reilly Media, October 3, 2008 AVAILABLE AT: http://www.amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134 Or: http://oreilly.com/catalog/9780596516130/ ISBN-10: 0596516134 or: ISBN-13: 978-0596516130 OTHER OPENCV SITES: * The source code is on sourceforge at: http://sourceforge.net/projects/opencvlibrary/ * The OpenCV wiki page (As of Oct 1, 2008 this is down for changing over servers, but should come back): http://opencvlibrary.sourceforge.net/ * An active user group is at: http://tech.groups.yahoo.com/group/OpenCV/ * The minutes of weekly OpenCV development meetings are at: http://pr.willowgarage.com/wiki/OpenCV ************************************************** */ #include <cv.h> #include <highgui.h> int main(int argc, char** argv) { IplImage* src; double M; if( argc == 3 && ((src=cvLoadImage(argv[1],1)) != 0 )) { M = atof(argv[2]); IplImage* dst = cvCreateImage( cvGetSize(src), 8, 3 ); IplImage* src2 = cvCreateImage( cvGetSize(src), 8, 3 ); cvLogPolar( src, dst, cvPoint2D32f(src->width/2,src->height/2), M, CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS ); cvLogPolar( dst, src2, cvPoint2D32f(src->width/2,src->height/2), M, CV_INTER_LINEAR+CV_WARP_INVERSE_MAP ); cvNamedWindow( "log-polar", 1 ); cvShowImage( "log-polar", dst ); cvNamedWindow( "inverse log-polar", 1 ); cvShowImage( "inverse log-polar", src2 ); cvWaitKey(); } return 0; }
gdijaejung/Learning-OpenCV
example/ch6_ex6_4.cpp
C++
mit
2,384
<?php namespace G4\Session\Exception; use Exception; use G4\Session\ErrorCodes; class MissingDomainNameException extends Exception { const MESSAGE = 'Missing Domain Name'; public function __construct() { parent::__construct(self::MESSAGE, ErrorCodes::MISSING_DOMAIN_NAME_EXCEPTION); } }
g4code/session
src/Exception/MissingDomainNameException.php
PHP
mit
316
import javax.mail.internet.InternetAddress; public class Person { private String name; private final int id; private final InternetAddress email; private String password; // THIS WILL CHANGE public Person(String newName, int newId, InternetAddress newEmail, String newPassword) { this.name = newName; this.id = newId; this.email = newEmail; this.password = newPassword; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public int getId() { return id; } public InternetAddress getEmail() { return email; } @Override public String toString() { return "Person [name=" + name + ", id=" + id + ", email=" + email + ", password=" + password + "]"; } }
omor1/CSE360-Project
JavaMD2/src/Person.java
Java
mit
876
require 'rubygems' require 'dream_cheeky' DreamCheeky::BigRedButton.run do push do print "alarm\n" `osascript -e "set Volume 5"` `say Ali ALERT!` `osascript -e "set Volume 0"` end end
andypiper/brb
ali.rb
Ruby
mit
205
package io.paymenthighway.model.response; import com.fasterxml.jackson.annotation.JsonProperty; import io.paymenthighway.model.Splitting; import java.util.UUID; /** * AfterPay Transaction status POJO */ public class AfterPayTransactionStatus { UUID id; String type; Long amount; @JsonProperty("current_amount") Long currentAmount; String currency; String timestamp; String modified; @JsonProperty("status") Status status; @JsonProperty("reverts") AfterPayRevert[] reverts; Customer customer; String order; @JsonProperty("committed") private Boolean committed; @JsonProperty("committed_amount") private String committedAmount; @JsonProperty("afterpay_payment_type") private String afterPayPaymentType; @JsonProperty("afterpay_checkout_id") private String afterPayCheckoutId; @JsonProperty("afterpay_reservation_id") private String afterPayReservationId; @JsonProperty("afterpay_customer_number") private String afterPayCustomerNumber; @JsonProperty("afterpay_capture_number") private String afterPayCaptureNumber; @JsonProperty("afterpay_outcome") private String afterPayOutcome; @JsonProperty("reference_number") private String referenceNumber; @JsonProperty("splitting") private Splitting splitting; public UUID getId() { return id; } public String getType() { return type; } public Long getAmount() { return amount; } public Long getCurrentAmount() { return currentAmount; } public String getCurrency() { return currency; } public String getTimestamp() { return timestamp; } public String getModified() { return modified; } public Status getStatus() { return status; } public AfterPayRevert[] getReverts() { return reverts; } public Customer getCustomer() { return customer; } public String getOrder() { return order; } public Boolean getCommitted() { return committed; } public String getCommittedAmount() { return committedAmount; } public String getAfterPayPaymentType() { return afterPayPaymentType; } public String getAfterPayCheckoutId() { return afterPayCheckoutId; } public String getAfterPayReservationId() { return afterPayReservationId; } public String getAfterPayCustomerNumber() { return afterPayCustomerNumber; } public String getAfterPayCaptureNumber() { return afterPayCaptureNumber; } public String getAfterPayOutcome() { return afterPayOutcome; } public String getReferenceNumber() { return referenceNumber; } /** * @return Splitting information if the transaction was splitted into sub-merchant and commission parts. */ public Splitting getSplitting() { return splitting; } }
solinor/paymenthighway-java-lib
src/main/java/io/paymenthighway/model/response/AfterPayTransactionStatus.java
Java
mit
2,768
--- layout: post title: Containers Are The New Components comments: true --- A few weeks ago I was trying to summarize my initial experience with containers to a friend. We know each other from the <a href="http://en.wikipedia.org/wiki/BEA_Systems">BEA Systems</a> times, back in the late 90s, and we have a similar background on middleware and distributed systems. Using that common experience, I thought that a good analogy would be to compare containers with EJBs, with a new twist on the term "container". <i>"In a way"</i>, I told my friend, <i>"the EJB container has become the new component and the container of those components is docker and the ecosystem of packaging and runtime management tools".</i> The analogy immediatly resonated with him, and we both draw similarities in the different evolutions of distributed systems: Tuxedo transactions, CORBA objects, Java EJBs, SOA services and now Docker containers. One could be tempted to say that history repeats itself and these concepts were already invented some time ago. I prefer to think about it as an iterative process with incremental improvements on each iteration. One of the stregths of this new micro-services architecture is the simplicity of the contract between the service (the container) and the container of the service (the host). Virtually any piece of software (linux software anyway), can be a component of the architecture, regardless of the programming language or the internal implementation. Compare this flexibility to the EJB specification. The EJB manifest becomes the Dockerfile, where the service author can package an arbitrary collection of disparate software. This flexibility can turn into its own <i>Achilles' heel</i>. The previous iterations were governed by steering committees and standards boards. That is not necessarily a good thing but stability used to promote adoption. It seems like the opposite case now. There is a myriad of solutions for managing the services. Still, potential users might just be waiting on the sidelines until a clear winner emerges.
pacogomez/pacogomez.github.io
_posts/2014-09-19-containers-are-the-new-components.md
Markdown
mit
2,073
"use strict"; var Condition = (function () { function Condition() { var data; if (data) { this.id = data.id ? data.id : -1; this.expression = data.expression; } else { this.id = -1; } } Condition.prototype.setData = function (data) { this.expression = data.expression; }; return Condition; }()); exports.Condition = Condition; //# sourceMappingURL=condition.js.map
corbinpage/flowwolf-ui
app/components/decision/condition/condition.js
JavaScript
mit
468
#!/bin/bash shopt -s nullglob ENVIRONMENTS=( hosts/* ) ENVIRONMENTS=( "${ENVIRONMENTS[@]##*/}" ) show_usage() { echo "Usage: deploy <environment> <site name> [options] <environment> is the environment to deploy to ("staging", "production", etc) <site name> is the Craft site to deploy (name defined in "craft_sites") [options] is any number of parameters that will be passed to ansible-playbook Available environments: `( IFS=$'\n'; echo "${ENVIRONMENTS[*]}" )` Examples: deploy staging example.com deploy production example.com deploy staging example.com -vv -T 60 " } [[ $# -lt 2 ]] && { show_usage; exit 127; } for arg do [[ $arg = -h ]] && { show_usage; exit 0; } done ENV="$1"; shift SITE="$1"; shift EXTRA_PARAMS=$@ DEPLOY_CMD="ansible-playbook deploy.yml -e env=$ENV -e site=$SITE $EXTRA_PARAMS" HOSTS_FILE="hosts/$ENV" if [[ ! -e $HOSTS_FILE ]]; then echo "Error: $ENV is not a valid environment ($HOSTS_FILE does not exist)." echo echo "Available environments:" ( IFS=$'\n'; echo "${ENVIRONMENTS[*]}" ) exit 1 fi $DEPLOY_CMD
newtonne/trellis
bin/deploy.sh
Shell
mit
1,064
/* ** my_put_nbr.c for my_put_nbr in /u/all/schmer_x/rendu/piscine/Jour_10/do-op ** ** Made by xavier schmerber ** Login <[email protected]> ** ** Started on Mon Oct 18 22:01:05 2010 xavier schmerber ** Last update Thu May 12 12:35:39 2011 xavier schmerber */ #include "../headers/rt.h" void my_put_nbr(int nb) { int puissance; if (nb < 0) { my_putchar('-'); nb = nb * -1; } puissance = 1; while ((nb / puissance) > 9) puissance = puissance * 10; while (puissance > 1) { my_putchar(nb / puissance + '0'); nb = nb % puissance; puissance = puissance / 10; } my_putchar(nb % 10 + '0'); }
Geod24/Raytracer
basics/my_put_nbr.c
C
mit
657
<?php if (isset($_GET['filter'], $_GET['delimiter'], $_GET['names'], $_GET['ages']) && !empty($_GET['delimiter']) && !empty($_GET['names']) && !empty($_GET['ages']) ) { $delimiter = $_GET['delimiter']; $formNames = $_GET['names']; $formAges = $_GET['ages']; if (!strpos($formNames, $delimiter) !== false && !strpos($formAges, $delimiter) !== false ) { $errorMessage = "No delimiters found mate.."; } else { $names = explode($delimiter, $formNames); $ages = array_map('intval', explode($delimiter, $formAges)); if (count($names) == count($ages)) { $students = array_combine($names, $ages); } else { $errorMessage = "There should be an age for each name and vise versa, Kev.."; } } } include '8.1. Render Students Info-View.php';
i-den/SoftwareUniversity
Software University/04) PHP Web Development Basics/03) PHP BASICS SYNTAX/08. Render Students Info.php
PHP
mit
851
<?php namespace Kohabi\USPS\Model; final class Ounces extends AbstractWeight { private $ounces; public function __construct($ounces) { $this->ounces = $ounces; } public function toOunces() { return $this->ounces; } public function toPounds() { return $this->ounces / 16; } public function scaleBy($factor) { return new Ounces($this->ounces * $factor); } }
kohabi/usps-php
src/Model/Ounces.php
PHP
mit
446
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using WebApplication.Models.BudgetViewModels; namespace WebApplication.Models { interface IBudget { List<TV> Summary(); } }
AndreyStelmakh/Bud
WebApplication/Models/IBudget.cs
C#
mit
245
package plugins.webbridge.gui; import javafx.fxml.FXML; import javafx.scene.control.CheckBox; import javafx.scene.control.TextField; import logbook.internal.Config; import logbook.internal.ThreadManager; import logbook.internal.gui.WindowController; import plugins.webbridge.bean.WebBridgeConfig; public class WebBridgeConfigController extends WindowController { /** * 中継サーバーへのデータ送信を有効にする */ @FXML private CheckBox bridgeEnabled; /** * ホスト */ @FXML private TextField bridgeHost; /** * ポート番号 */ @FXML private TextField bridgePort; /** * 初期化 */ @SuppressWarnings("unused") @FXML void initialize() { WebBridgeConfig config = WebBridgeConfig.get(); bridgeEnabled.setSelected(config.isBridgeEnabled()); bridgeHost.setText(config.getBridgeHost()); bridgePort.setText(String.valueOf(config.getBridgePort())); } /** * キャンセル */ @FXML void cancel() { getWindow().close(); } /** * 設定の反映 */ @FXML void ok() { WebBridgeConfig config = WebBridgeConfig.get(); config.setBridgeEnabled(bridgeEnabled.isSelected()); config.setBridgeHost(bridgeHost.getText()); config.setBridgePort(Integer.parseInt(bridgePort.getText())); ThreadManager.getExecutorService() .execute(Config.getDefault()::store); getWindow().close(); } }
rsky/logbook-kai-plugins
webbridge/src/main/java/plugins/webbridge/gui/WebBridgeConfigController.java
Java
mit
1,544
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation; /** * Response represents an HTTP response. * * @author Fabien Potencier <[email protected]> * * @api */ class Response { /** * @var \Symfony\Component\HttpFoundation\ResponseHeaderBag */ public $headers; /** * @var string */ protected $content; /** * @var string */ protected $version; /** * @var integer */ protected $statusCode; /** * @var string */ protected $statusText; /** * @var string */ protected $charset; /** * Status codes translation table. * * The list of codes is complete according to the * {@link http://www.iana.org/assignments/http-status-codes/ Hypertext Transfer Protocol (HTTP) Status Code Registry} * (last updated 2012-02-13). * * Unless otherwise noted, the status code is defined in RFC2616. * * @var array */ public static $statusTexts = array( 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', // RFC2518 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', // RFC4918 208 => 'Already Reported', // RFC5842 226 => 'IM Used', // RFC3229 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Reserved', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect', // RFC-reschke-http-status-308-07 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 418 => 'I\'m a teapot', // RFC2324 422 => 'Unprocessable Entity', // RFC4918 423 => 'Locked', // RFC4918 424 => 'Failed Dependency', // RFC4918 425 => 'Reserved for WebDAV advanced collections expired proposal', // RFC2817 426 => 'Upgrade Required', // RFC2817 428 => 'Precondition Required', // RFC6585 429 => 'Too Many Requests', // RFC6585 431 => 'Request Header Fields Too Large', // RFC6585 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported', 506 => 'Variant Also Negotiates (Experimental)', // RFC2295 507 => 'Insufficient Storage', // RFC4918 508 => 'Loop Detected', // RFC5842 510 => 'Not Extended', // RFC2774 511 => 'Network Authentication Required', // RFC6585 ); /** * Constructor. * * @param string $content The response content * @param integer $status The response status code * @param array $headers An array of response headers * * @api */ public function __construct($content = '', $status = 200, $headers = array()) { $this->headers = new ResponseHeaderBag($headers); $this->setContent($content); $this->setStatusCode($status); $this->setProtocolVersion('1.0'); if (!$this->headers->has('Date')) { $this->setDate(new \DateTime(null, new \DateTimeZone('UTC'))); } } /** * Factory method for chainability * * Example: * * return Response::create($body, 200) * ->setSharedMaxAge(300); * * @param string $content The response content * @param integer $status The response status code * @param array $headers An array of response headers * * @return Response */ public static function create($content = '', $status = 200, $headers = array()) { return new static($content, $status, $headers); } /** * Returns the Response as an HTTP string. * * The string representation of the Response is the same as the * one that will be sent to the client only if the prepare() method * has been called before. * * @return string The Response as an HTTP string * * @see prepare() */ public function __toString() { return sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n". $this->headers."\r\n". $this->getContent(); } /** * Clones the current Response instance. */ public function __clone() { $this->headers = clone $this->headers; } /** * Prepares the Response before it is sent to the client. * * This method tweaks the Response to ensure that it is * compliant with RFC 2616. Most of the changes are based on * the Request that is "associated" with this Response. * * @param Request $request A Request instance * * @return Response The current response. */ public function prepare(Request $request) { $headers = $this->headers; if ($this->isInformational() || in_array($this->statusCode, array(204, 304))) { $this->setContent(null); } // Content-type based on the Request if (!$headers->has('Content-Type')) { $format = $request->getRequestFormat(); if (null !== $format && $mimeType = $request->getMimeType($format)) { $headers->set('Content-Type', $mimeType); } } // Fix Content-Type $charset = $this->charset ?: 'UTF-8'; if (!$headers->has('Content-Type')) { $headers->set('Content-Type', 'text/html; charset='.$charset); } elseif (0 === strpos($headers->get('Content-Type'), 'text/') && false === strpos($headers->get('Content-Type'), 'charset')) { // add the charset $headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset); } // Fix Content-Length if ($headers->has('Transfer-Encoding')) { $headers->remove('Content-Length'); } if ($request->isMethod('HEAD')) { // cf. RFC2616 14.13 $length = $headers->get('Content-Length'); $this->setContent(null); if ($length) { $headers->set('Content-Length', $length); } } // Fix protocol if ('HTTP/1.0' != $request->server->get('SERVER_PROTOCOL')) { $this->setProtocolVersion('1.1'); } // Check if we need to send extra expire info headers if ('1.0' == $this->getProtocolVersion() && 'no-cache' == $this->headers->get('Cache-Control')) { $this->headers->set('pragma', 'no-cache'); $this->headers->set('expires', -1); } return $this; } /** * Sends HTTP headers. * * @return Response */ public function sendHeaders() { // headers have already been sent by the developer if (headers_sent()) { return $this; } // status header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)); // headers foreach ($this->headers->allPreserveCase() as $name => $values) { foreach ($values as $value) { header($name.': '.$value, false); } } // cookies foreach ($this->headers->getCookies() as $cookie) { setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly()); } return $this; } /** * Sends content for the current web response. * * @return Response */ public function sendContent() { echo $this->content; return $this; } /** * Sends HTTP headers and content. * * @return Response * * @api */ public function send() { $this->sendHeaders(); $this->sendContent(); if (function_exists('fastcgi_finish_request')) { fastcgi_finish_request(); } elseif ('cli' !== PHP_SAPI) { // ob_get_level() never returns 0 on some Windows configurations, so if // the level is the same two times in a row, the loop should be stopped. $previous = null; $obStatus = ob_get_status(1); while (($level = ob_get_level()) > 0 && $level !== $previous) { $previous = $level; if ($obStatus[$level - 1] && isset($obStatus[$level - 1]['del']) && $obStatus[$level - 1]['del']) { ob_end_flush(); } } flush(); } return $this; } /** * Sets the response content. * * Valid types are strings, numbers, and objects that implement a __toString() method. * * @param mixed $content * * @return Response * * @api */ public function setContent($content) { if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable(array($content, '__toString'))) { throw new \UnexpectedValueException('The Response content must be a string or object implementing __toString(), "'.gettype($content).'" given.'); } $this->content = (string) $content; return $this; } /** * Gets the current response content. * * @return string Content * * @api */ public function getContent() { return $this->content; } /** * Sets the HTTP protocol version (1.0 or 1.1). * * @param string $version The HTTP protocol version * * @return Response * * @api */ public function setProtocolVersion($version) { $this->version = $version; return $this; } /** * Gets the HTTP protocol version. * * @return string The HTTP protocol version * * @api */ public function getProtocolVersion() { return $this->version; } /** * Sets the response status code. * * @param integer $code HTTP status code * @param mixed $text HTTP status text * * If the status text is null it will be automatically populated for the known * status codes and left empty otherwise. * * @return Response * * @throws \InvalidArgumentException When the HTTP status code is not valid * * @api */ public function setStatusCode($code, $text = null) { $this->statusCode = $code = (int) $code; if ($this->isInvalid()) { throw new \InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $code)); } if (null === $text) { $this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] : ''; return $this; } if (false === $text) { $this->statusText = ''; return $this; } $this->statusText = $text; return $this; } /** * Retrieves the status code for the current web response. * * @return string Status code * * @api */ public function getStatusCode() { return $this->statusCode; } /** * Sets the response charset. * * @param string $charset Character set * * @return Response * * @api */ public function setCharset($charset) { $this->charset = $charset; return $this; } /** * Retrieves the response charset. * * @return string Character set * * @api */ public function getCharset() { return $this->charset; } /** * Returns true if the response is worth caching under any circumstance. * * Responses marked "private" with an explicit Cache-Control directive are * considered uncacheable. * * Responses with neither a freshness lifetime (Expires, max-age) nor cache * validator (Last-Modified, ETag) are considered uncacheable. * * @return Boolean true if the response is worth caching, false otherwise * * @api */ public function isCacheable() { if (!in_array($this->statusCode, array(200, 203, 300, 301, 302, 404, 410))) { return false; } if ($this->headers->hasCacheControlDirective('no-store') || $this->headers->getCacheControlDirective('private')) { return false; } return $this->isValidateable() || $this->isFresh(); } /** * Returns true if the response is "fresh". * * Fresh responses may be served from cache without any interaction with the * origin. A response is considered fresh when it includes a Cache-Control/max-age * indicator or Expiration header and the calculated age is less than the freshness lifetime. * * @return Boolean true if the response is fresh, false otherwise * * @api */ public function isFresh() { return $this->getTtl() > 0; } /** * Returns true if the response includes headers that can be used to validate * the response with the origin server using a conditional GET request. * * @return Boolean true if the response is validateable, false otherwise * * @api */ public function isValidateable() { return $this->headers->has('Last-Modified') || $this->headers->has('ETag'); } /** * Marks the response as "private". * * It makes the response ineligible for serving other clients. * * @return Response * * @api */ public function setPrivate() { $this->headers->removeCacheControlDirective('public'); $this->headers->addCacheControlDirective('private'); return $this; } /** * Marks the response as "public". * * It makes the response eligible for serving other clients. * * @return Response * * @api */ public function setPublic() { $this->headers->addCacheControlDirective('public'); $this->headers->removeCacheControlDirective('private'); return $this; } /** * Returns true if the response must be revalidated by caches. * * This method indicates that the response must not be served stale by a * cache in any circumstance without first revalidating with the origin. * When present, the TTL of the response should not be overridden to be * greater than the value provided by the origin. * * @return Boolean true if the response must be revalidated by a cache, false otherwise * * @api */ public function mustRevalidate() { return $this->headers->hasCacheControlDirective('must-revalidate') || $this->headers->has('proxy-revalidate'); } /** * Returns the Date header as a DateTime instance. * * @return \DateTime A \DateTime instance * * @throws \RuntimeException When the header is not parseable * * @api */ public function getDate() { return $this->headers->getDate('Date', new \DateTime()); } /** * Sets the Date header. * * @param \DateTime $date A \DateTime instance * * @return Response * * @api */ public function setDate(\DateTime $date) { $date->setTimezone(new \DateTimeZone('UTC')); $this->headers->set('Date', $date->format('D, d M Y H:i:s').' GMT'); return $this; } /** * Returns the age of the response. * * @return integer The age of the response in seconds */ public function getAge() { if ($age = $this->headers->get('Age')) { return $age; } return max(time() - $this->getDate()->format('U'), 0); } /** * Marks the response stale by setting the Age header to be equal to the maximum age of the response. * * @return Response * * @api */ public function expire() { if ($this->isFresh()) { $this->headers->set('Age', $this->getMaxAge()); } return $this; } /** * Returns the value of the Expires header as a DateTime instance. * * @return \DateTime A DateTime instance * * @api */ public function getExpires() { return $this->headers->getDate('Expires'); } /** * Sets the Expires HTTP header with a DateTime instance. * * If passed a null value, it removes the header. * * @param \DateTime $date A \DateTime instance * * @return Response * * @api */ public function setExpires(\DateTime $date = null) { if (null === $date) { $this->headers->remove('Expires'); } else { $date = clone $date; $date->setTimezone(new \DateTimeZone('UTC')); $this->headers->set('Expires', $date->format('D, d M Y H:i:s').' GMT'); } return $this; } /** * Sets the number of seconds after the time specified in the response's Date * header when the the response should no longer be considered fresh. * * First, it checks for a s-maxage directive, then a max-age directive, and then it falls * back on an expires header. It returns null when no maximum age can be established. * * @return integer|null Number of seconds * * @api */ public function getMaxAge() { if ($age = $this->headers->getCacheControlDirective('s-maxage')) { return $age; } if ($age = $this->headers->getCacheControlDirective('max-age')) { return $age; } if (null !== $this->getExpires()) { return $this->getExpires()->format('U') - $this->getDate()->format('U'); } return null; } /** * Sets the number of seconds after which the response should no longer be considered fresh. * * This methods sets the Cache-Control max-age directive. * * @param integer $value Number of seconds * * @return Response * * @api */ public function setMaxAge($value) { $this->headers->addCacheControlDirective('max-age', $value); return $this; } /** * Sets the number of seconds after which the response should no longer be considered fresh by shared caches. * * This methods sets the Cache-Control s-maxage directive. * * @param integer $value Number of seconds * * @return Response * * @api */ public function setSharedMaxAge($value) { $this->setPublic(); $this->headers->addCacheControlDirective('s-maxage', $value); return $this; } /** * Returns the response's time-to-live in seconds. * * It returns null when no freshness information is present in the response. * * When the responses TTL is <= 0, the response may not be served from cache without first * revalidating with the origin. * * @return integer|null The TTL in seconds * * @api */ public function getTtl() { if ($maxAge = $this->getMaxAge()) { return $maxAge - $this->getAge(); } return null; } /** * Sets the response's time-to-live for shared caches. * * This method adjusts the Cache-Control/s-maxage directive. * * @param integer $seconds Number of seconds * * @return Response * * @api */ public function setTtl($seconds) { $this->setSharedMaxAge($this->getAge() + $seconds); return $this; } /** * Sets the response's time-to-live for private/client caches. * * This method adjusts the Cache-Control/max-age directive. * * @param integer $seconds Number of seconds * * @return Response * * @api */ public function setClientTtl($seconds) { $this->setMaxAge($this->getAge() + $seconds); return $this; } /** * Returns the Last-Modified HTTP header as a DateTime instance. * * @return \DateTime A DateTime instance * * @api */ public function getLastModified() { return $this->headers->getDate('Last-Modified'); } /** * Sets the Last-Modified HTTP header with a DateTime instance. * * If passed a null value, it removes the header. * * @param \DateTime $date A \DateTime instance * * @return Response * * @api */ public function setLastModified(\DateTime $date = null) { if (null === $date) { $this->headers->remove('Last-Modified'); } else { $date = clone $date; $date->setTimezone(new \DateTimeZone('UTC')); $this->headers->set('Last-Modified', $date->format('D, d M Y H:i:s').' GMT'); } return $this; } /** * Returns the literal value of the ETag HTTP header. * * @return string The ETag HTTP header * * @api */ public function getEtag() { return $this->headers->get('ETag'); } /** * Sets the ETag value. * * @param string $etag The ETag unique identifier * @param Boolean $weak Whether you want a weak ETag or not * * @return Response * * @api */ public function setEtag($etag = null, $weak = false) { if (null === $etag) { $this->headers->remove('Etag'); } else { if (0 !== strpos($etag, '"')) { $etag = '"'.$etag.'"'; } $this->headers->set('ETag', (true === $weak ? 'W/' : '').$etag); } return $this; } /** * Sets the response's cache headers (validation and/or expiration). * * Available options are: etag, last_modified, max_age, s_maxage, private, and public. * * @param array $options An array of cache options * * @return Response * * @api */ public function setCache(array $options) { if ($diff = array_diff(array_keys($options), array('etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public'))) { throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', array_values($diff)))); } if (isset($options['etag'])) { $this->setEtag($options['etag']); } if (isset($options['last_modified'])) { $this->setLastModified($options['last_modified']); } if (isset($options['max_age'])) { $this->setMaxAge($options['max_age']); } if (isset($options['s_maxage'])) { $this->setSharedMaxAge($options['s_maxage']); } if (isset($options['public'])) { if ($options['public']) { $this->setPublic(); } else { $this->setPrivate(); } } if (isset($options['private'])) { if ($options['private']) { $this->setPrivate(); } else { $this->setPublic(); } } return $this; } /** * Modifies the response so that it conforms to the rules defined for a 304 status code. * * This sets the status, removes the body, and discards any headers * that MUST NOT be included in 304 responses. * * @return Response * * @see http://tools.ietf.org/html/rfc2616#section-10.3.5 * * @api */ public function setNotModified() { $this->setStatusCode(304); $this->setContent(null); // remove headers that MUST NOT be included with 304 Not Modified responses foreach (array('Allow', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-MD5', 'Content-Type', 'Last-Modified') as $header) { $this->headers->remove($header); } return $this; } /** * Returns true if the response includes a Vary header. * * @return Boolean true if the response includes a Vary header, false otherwise * * @api */ public function hasVary() { return (Boolean) $this->headers->get('Vary'); } /** * Returns an array of header names given in the Vary header. * * @return array An array of Vary names * * @api */ public function getVary() { if (!$vary = $this->headers->get('Vary')) { return array(); } return is_array($vary) ? $vary : preg_split('/[\s,]+/', $vary); } /** * Sets the Vary header. * * @param string|array $headers * @param Boolean $replace Whether to replace the actual value of not (true by default) * * @return Response * * @api */ public function setVary($headers, $replace = true) { $this->headers->set('Vary', $headers, $replace); return $this; } /** * Determines if the Response validators (ETag, Last-Modified) match * a conditional value specified in the Request. * * If the Response is not modified, it sets the status code to 304 and * removes the actual content by calling the setNotModified() method. * * @param Request $request A Request instance * * @return Boolean true if the Response validators match the Request, false otherwise * * @api */ public function isNotModified(Request $request) { if (!$request->isMethodSafe()) { return false; } $lastModified = $request->headers->get('If-Modified-Since'); $notModified = false; if ($etags = $request->getEtags()) { $notModified = (in_array($this->getEtag(), $etags) || in_array('*', $etags)) && (!$lastModified || $this->headers->get('Last-Modified') == $lastModified); } elseif ($lastModified) { $notModified = $lastModified == $this->headers->get('Last-Modified'); } if ($notModified) { $this->setNotModified(); } return $notModified; } // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html /** * Is response invalid? * * @return Boolean * * @api */ public function isInvalid() { return $this->statusCode < 100 || $this->statusCode >= 600; } /** * Is response informative? * * @return Boolean * * @api */ public function isInformational() { return $this->statusCode >= 100 && $this->statusCode < 200; } /** * Is response successful? * * @return Boolean * * @api */ public function isSuccessful() { return $this->statusCode >= 200 && $this->statusCode < 300; } /** * Is the response a redirect? * * @return Boolean * * @api */ public function isRedirection() { return $this->statusCode >= 300 && $this->statusCode < 400; } /** * Is there a client error? * * @return Boolean * * @api */ public function isClientError() { return $this->statusCode >= 400 && $this->statusCode < 500; } /** * Was there a server side error? * * @return Boolean * * @api */ public function isServerError() { return $this->statusCode >= 500 && $this->statusCode < 600; } /** * Is the response OK? * * @return Boolean * * @api */ public function isOk() { return 200 === $this->statusCode; } /** * Is the response forbidden? * * @return Boolean * * @api */ public function isForbidden() { return 403 === $this->statusCode; } /** * Is the response a not found error? * * @return Boolean * * @api */ public function isNotFound() { return 404 === $this->statusCode; } /** * Is the response a redirect of some form? * * @param string $location * * @return Boolean * * @api */ public function isRedirect($location = null) { return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->headers->get('Location')); } /** * Is the response empty? * * @return Boolean * * @api */ public function isEmpty() { return in_array($this->statusCode, array(201, 204, 304)); } }
Shipow/symfony
src/Symfony/Component/HttpFoundation/Response.php
PHP
mit
30,493
package edu.hypower.gatech.phidget; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.lang.reflect.*; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.phidgets.InterfaceKitPhidget; import com.phidgets.PhidgetException; import edu.hypower.gatech.phidget.comm.SensorNodeClient; import edu.hypower.gatech.phidget.sensor.*; /** * This class implements the startup process for a phidget-sensornode: 1) * configuration file interpretation, 2) sensor data collection configuration, * 3) network setup (and discovery), 4) transmission (and receiving) of data. * * @author pjmartin * */ public class PhidgetSensorNode { // Maps sensors to their associated data value - blocking queue will have one element // to allow event driven network clients. private final ConcurrentHashMap<String, BlockingQueue<Float>> rawDataMap = new ConcurrentHashMap<String, BlockingQueue<Float>>(); // Maps sensors to their associated runnable task. private final HashMap<String, Runnable> sensorUpdateRunners = new HashMap<String, Runnable>(); private final HashMap<String, Runnable> sensorClientRunners = new HashMap<String, Runnable>(); private String nodeIpAddr; private boolean isReady = false; private final int TIMEOUT = 5000; // 5s wait time public PhidgetSensorNode(String pathToConfig) { try { // Read in properties file, which is JSON ObjectMapper mapper = new ObjectMapper(); JsonNode rootNode = mapper.readTree(new File("sensornode.json")); nodeIpAddr = rootNode.get("ip-address").asText(); System.out.println("Sensor node IP Address: " + nodeIpAddr); String serverIpAddr = rootNode.get("server-ip-addr").asText(); Integer serverPort = rootNode.get("server-port").asInt(); System.out.println("Data Collection server IP Address: " + serverIpAddr + ", port " + serverPort); System.out.println("Attaching the Interface Kit Phidget..."); try { // Phidget initialization InterfaceKitPhidget ikit = new InterfaceKitPhidget(); ikit.openAny(); ikit.waitForAttachment(TIMEOUT); System.out.println("complete."); ikit.setRatiometric(true); ScheduledExecutorService schedExec = Executors .newScheduledThreadPool(Runtime.getRuntime().availableProcessors()); ExecutorService exec = Executors.newCachedThreadPool(); Iterator<Entry<String, JsonNode>> iter = rootNode.get("sensors").fields(); while (iter.hasNext()) { Map.Entry<String, JsonNode> entry = (Map.Entry<String, JsonNode>) iter.next(); Integer location = entry.getValue().get("location").asInt(); Integer updatePeriod = entry.getValue().get("update-period").asInt(); String sensorStr = entry.getKey(); String sensorKey = sensorStr + "." + location; String sensorName = Character.toUpperCase(sensorStr.charAt(0)) + sensorStr.substring(1, sensorStr.length()); try { Class<?> sensor = Class .forName("edu.hypower.gatech.phidget.sensor." + sensorName + "SensorReader"); Constructor<?> cons = sensor.getConstructor(Integer.class, String.class, InterfaceKitPhidget.class, ArrayBlockingQueue.class); System.out.println(sensorKey + ", updating every " + updatePeriod + "ms"); rawDataMap.putIfAbsent(sensorKey, new ArrayBlockingQueue<Float>(1)); sensorUpdateRunners.put(sensorKey, (SensorReader) cons.newInstance(location, sensorKey, ikit, (ArrayBlockingQueue<Float>) rawDataMap.get(sensorKey))); SensorNodeClient client = new SensorNodeClient((ArrayBlockingQueue<Float>) rawDataMap.get(sensorKey), nodeIpAddr, sensorKey, serverIpAddr, serverPort); sensorClientRunners.put(sensorKey, client); schedExec.scheduleAtFixedRate(sensorUpdateRunners.get(sensorKey), 0, updatePeriod, TimeUnit.MILLISECONDS); exec.submit(sensorClientRunners.get(sensorKey)); isReady = true; } catch (ClassNotFoundException cnfe){ System.err.println("ERROR: " + sensorName + " not implemented."); } catch (NoSuchMethodException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } catch (PhidgetException e) { System.err.println("Error: Timeout ( " + TIMEOUT + "ms) reached. No phidget Interface Kit detected."); } } catch (JsonProcessingException e) { System.err.println("JSON ERROR: " + e.getMessage()); System.exit(-1); } catch (IOException e) { System.err.println("ERROR: " + e.getMessage()); System.exit(-1); } } public final ArrayList<String> getSensorNames(){ final ArrayList<String> sensors = new ArrayList<String>(); for(String s : rawDataMap.keySet()){ sensors.add(s); } return sensors; } public boolean isReady() { return isReady; } public static void main(String[] args) { final PhidgetSensorNode node = new PhidgetSensorNode(""); if(node.isReady()){ while (true) { try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // System.out.println("Node running: " + node.getSensorNames()); } } } }
hypower-org/phidget-sensornode
src/edu/hypower/gatech/phidget/PhidgetSensorNode.java
Java
mit
6,170
RootDB ====== [![Build Status](https://travis-ci.org/braydonf/rootdb.svg?branch=master)](https://travis-ci.org/braydonf/rootdb) ## Objective Store key/value pair data to disk that can be distributed and cryptographically verified for byte-for-byte integrity. A root hash that represents the entire data set should be efficiently calculated without needing to serialize and read large amounts of data that can take several minutes. It should also be possible to prove that a portion of the database exists in a whole with comparison to the database's root hash. The performance of both insertion and deletion of keys is critical. The library should be portable into other projects and scripting languages and written in C/C++. ## Build **Note:** Current development and testing is with Ubuntu 15.10. Build requirements: ```bash apt-get install build-essential libtool autotools-dev automake ``` Library requirements: ```bash apt-get install liblmdb-dev libssl-dev ``` ```bash ./autogen.sh ./configure make ``` To run tests: ```bash ./test/tests ``` ## Related - Ethereum Merkle Patricia Tree - https://github.com/ethereum/wiki/wiki/Patricia-Tree - https://easythereentropy.wordpress.com/2014/06/04/understanding-the-ethereum-trie/ - https://github.com/ethereumjs/merkle-patricia-tree - Bitcoin Merkle Tree - https://en.bitcoin.it/wiki/Protocol_documentation#Merkle_Trees - https://en.wikipedia.org/wiki/Merkle_tree - Tendermint Merkle-ized Data Structures - https://github.com/tendermint/go-merkle - Node Merkle Tree - https://github.com/keybase/node-merkle-tree
braydonf/rootdb
README.md
Markdown
mit
1,589
<?php defined('BASEPATH') OR exit('No direct script access allowed'); /* |-------------------------------------------------------------------------- | Display Debug backtrace |-------------------------------------------------------------------------- | | If set to TRUE, a backtrace will be displayed along with php errors. If | error_reporting is disabled, the backtrace will not display, regardless | of this setting | */ defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE); /* |-------------------------------------------------------------------------- | File and Directory Modes |-------------------------------------------------------------------------- | | These prefs are used when checking and setting modes when working | with the file system. The defaults are fine on servers with proper | security, but you may wish (or even need) to change the values in | certain environments (Apache running a separate process for each | user, PHP under CGI with Apache suEXEC, etc.). Octal values should | always be used to set the mode correctly. | */ defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644); defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666); defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755); defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755); /* |-------------------------------------------------------------------------- | File Stream Modes |-------------------------------------------------------------------------- | | These modes are used when working with fopen()/popen() | */ defined('FOPEN_READ') OR define('FOPEN_READ', 'rb'); defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b'); defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care defined('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab'); defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b'); defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb'); defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); /* |-------------------------------------------------------------------------- | Exit Status Codes |-------------------------------------------------------------------------- | | Used to indicate the conditions under which the script is exit()ing. | While there is no universal standard for error codes, there are some | broad conventions. Three such conventions are mentioned below, for | those who wish to make use of them. The CodeIgniter defaults were | chosen for the least overlap with these conventions, while still | leaving room for others to be defined in future versions and user | applications. | | The three main conventions used for determining exit status codes | are as follows: | | Standard C/C++ Library (stdlibc): | http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html | (This link also contains other GNU-specific conventions) | BSD sysexits.h: | http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits | Bash scripting: | http://tldp.org/LDP/abs/html/exitcodes.html | */ defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code // Custom Constants defined('IP_ADDR') OR define('IP_ADDR', isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']);
mnavarrocarter/markdownblog
app/config/constants.php
PHP
mit
4,500
import { Arity5, Curry5 } from '../types' import { curry2 } from './curry2' import { curry3 } from './curry3' import { curry4 } from './curry4' export function curry5<A, B, C, D, E, F>(fn: Arity5<A, B, C, D, E, F>): Curry5<A, B, C, D, E, F> export function curry5(fn: Arity5<any, any, any, any, any, any>): Curry5<any, any, any, any, any, any> export function curry5<A, B, C, D, E, F>(fn: Arity5<A, B, C, D, E, F>): Curry5<A, B, C, D, E, F> { function curried(a: A, b: B, c: C, d: D, e: E): any { switch (arguments.length) { case 1: return curry4<B, C, D, E, F>((b: B, c: C, d: D, e: E) => fn(a, b, c, d, e)) case 2: return curry3<C, D, E, F>((c: C, d: D, e: E) => fn(a, b, c, d, e)) case 3: return curry2<D, E, F>((d: D, e: E) => fn(a, b, c, d, e)) case 4: return (e: E) => fn(a, b, c, d, e) default: return fn(a, b, c, d, e) } } return curried as Curry5<A, B, C, D, E, F> }
TylorS167/167
src/function/curry/curry5.ts
TypeScript
mit
914
class Booking < ActiveRecord::Base EMAIL_FORMAT = %r(\A\S+@\S+\z) enum state: %w( pending accepted rejected cancelled ) around_update :state_changed belongs_to :restaurant validates :state, inclusion: { in: states.keys } validates :restaurant_id, presence: true validates :number_of_persons, presence: true validates :phone_number, presence: true validates :starts_at, presence: true validates :email, format: { with: EMAIL_FORMAT }, allow_nil: true def state_changed state_changed = state_changed? yield if state_changed date = starts_at.strftime("%Y-%m-%d") time = starts_at.strftime("%H:%M") message = I18n.t(state, date: date, time: time, restaurant_name: self.restaurant.name, scope: %i(bookings status_changed_messages)) booking = BookingNotification.new booking.message = message booking.sms(phone_number) booking.send_mail(email) end end end
plug-hackathon/chefstable-backend
app/models/booking.rb
Ruby
mit
937
/* * Convert_hapcut2.cpp * * Created on: Mar 14, 2018 * Author: sedlazec */ #include "Convert_hapcut2.h" map<std::string, int> parse_hapcut(std::string hapcut2, std::string target_chr, int & phaseblock_id) { std::string buffer; std::ifstream myfile; map<std::string, int> hapcut; myfile.open(hapcut2.c_str(), std::ifstream::in); if (!myfile.good()) { std::cout << "Hapcut2 Parser: could not open file: " << hapcut2.c_str() << std::endl; exit(0); } getline(myfile, buffer); while (!myfile.eof()) { if (buffer[0] != 'B' && buffer[0] != '*') { //avoid headers! int count = 0; std::string chr = ""; int pos = -1; bool first_gt = true; bool second_gt = true; //not needed but good to check! for (size_t i = 0; i < buffer.size(); i++) { if (count == 1 && buffer[i - 1] == '\t') { first_gt = (bool) (buffer[i] != '0'); } if (count == 2 && buffer[i - 1] == '\t') { second_gt = (bool) (buffer[i] != '0'); } if (count == 3 && buffer[i] != '\t') { chr += buffer[i]; } if (count == 4 && buffer[i - 1] == '\t') { pos = atoi(&buffer[i]); break; } if (buffer[i] == '\t') { count++; } } if (strcmp(chr.c_str(), target_chr.c_str()) == 0) { if ((first_gt && !second_gt) || (!first_gt && second_gt)) { std::stringstream ss; ss << chr; ss << "_"; ss << pos; if (hapcut.find(ss.str()) == hapcut.end()) { hapcut[ss.str()] = phaseblock_id; if (!first_gt) { //negative ID for none hapcut[ss.str()] = hapcut[ss.str()] * -1; } } else { cerr << "A position was found twice: " << ss.str() << endl; } } } } else if(buffer[0] != 'B') { phaseblock_id++; } getline(myfile, buffer); } myfile.close(); return hapcut; } void process_hapcut(std::string orig_snp, std::string hapcut2, std::string output) { //parse VCF file. just if we dected a 0/1 we check the hapcut results. std::string buffer; std::ifstream myfile; myfile.open(orig_snp.c_str(), std::ifstream::in); if (!myfile.good()) { std::cout << "SNP Parser: could not open file: " << orig_snp.c_str() << std::endl; exit(0); } FILE * file = fopen(output.c_str(), "w"); map<std::string, int> hapcut_res; std::string old_chr; getline(myfile, buffer); int phaseblock = 1; //int num = 0; while (!myfile.eof()) { if (buffer[0] == '#') { if (buffer[1] == 'C') { fprintf(file, "%s", "##FORMAT=<ID=PS,Number=1,Type=Integer,Description=\"Phase set identifier\">\n"); } fprintf(file, "%s", buffer.c_str()); fprintf(file, "%c", '\n'); } else { // num++; std::size_t found = buffer.find_last_of('\t'); //check found + 1 if '1' && if found+3 !='0' -> if ((buffer[found + 1] == '0' && buffer[found + 3] == '1') || (buffer[found + 1] == '1' && buffer[found + 3] == '0')) { //search pos and replace 3 chars. int count = 0; std::string chr = ""; int pos = 0; for (size_t i = 0; i < buffer.size(); i++) { if (count == 0 && buffer[i] != '\t') { chr += buffer[i]; } if (count == 1 && buffer[i - 1] == '\t') { pos = atoi(&buffer[i]); break; } if (buffer[i] == '\t') { count++; } } if (strcmp(chr.c_str(), old_chr.c_str()) != 0) { //load new chr set: cout << "Parsing hapcut2 output for " << chr; hapcut_res = parse_hapcut(hapcut2, chr, phaseblock); cout << " SNPs parsed " << hapcut_res.size() << endl; old_chr = chr; } if (!chr.empty()) { std::stringstream ss; ss << chr; ss << "_"; ss << pos; if (hapcut_res.find(ss.str()) != hapcut_res.end()) { buffer.insert(found, ":PS"); found += 3; // cout << "MATCH: " << ss.str() << endl; if (hapcut_res[ss.str()] > 0) { buffer[found + 1] = '1'; buffer[found + 2] = '|'; buffer[found + 3] = '0'; } else { buffer[found + 1] = '0'; buffer[found + 2] = '|'; buffer[found + 3] = '1'; } std::stringstream id; id << ":"; id << abs(hapcut_res[ss.str()]); buffer.append(id.str()); } } } fprintf(file, "%s", buffer.c_str()); fprintf(file, "%c", '\n'); } getline(myfile, buffer); } myfile.close(); fclose(file); }
fritzsedlazeck/SURVIVOR
src/convert/Convert_hapcut2.cpp
C++
mit
4,293
<!DOCTYPE html> <html> <head> <title>Send Mail Results</title> </head> <body> <?php // Set path for the PHPMailer files. These must have been previously // unzipped and placed into the stated directory. Be sure to match // up the directories in your installation (i.e. you do not have to have // your files in the same directory that I have here, as long as you can // locate them). To download / install the necessary files, see: // https://github.com/Synchro/PHPMailer // On MAC the path is similar: $mailpath = 'C:\xampp\PHPMailer'; // Also note that Windows installations have different path names - be sure // to follow the syntax correctly. // Also, on my Windows version, to get this to work I had to do the following: // Edit file 'php.ini' (you need to find where that is) // Locate the line: extension=php_openssl.dll // If there is a semicolon (;) at the beginning of the line, delete it // Save the file // Start / restart Apache // Add the new path items to the previous PHP path $path = get_include_path(); set_include_path($path . PATH_SEPARATOR . $mailpath); require 'PHPMailerAutoload.php'; // PHPMailer is a class -- we will discuss classes and PHP object-oriented // programming soon. However, you should be able to copy / use this // technique without fully understanding PHP OOP. $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "tls"; // sets tls authentication $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server; or your email service $mail->Port = 587; // set the SMTP port for GMAIL server; or your email server port $mail->Username = "[email protected]"; // email username $mail->Password = "UVACSROCKS"; // email password //$mail->Username = "[email protected]"; // email username //$mail->Password = "UVACSROCKS"; // email password $sender = strip_tags($_POST["sender"]); $receiver = strip_tags($_POST["receiver"]); $subj = strip_tags($_POST["subject"]); $msg = strip_tags($_POST["msg"]); // Put information into the message $mail->addAddress($receiver); $mail->SetFrom($sender); $mail->Subject = "$subj"; $mail->Body = "$msg"; // echo 'Everything ok so far' . var_dump($mail); if(!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent'; } ?> </body> </html>
b-nguyen/cs3240-f15-team06-test
phpmailer/sendmail.php
PHP
mit
2,521
import { useRef, useEffect } from "react"; export interface FocusRefOption { visible?: boolean; async?: boolean; } export interface FocusFnOption extends FocusRefOption { target: HTMLElement | null; } // trigger focus programmatically export function focus(option: FocusFnOption) { const { visible, target, async = false } = option; if (!target || !visible) { return; } // use case for async: // wait till target become display:block; // since this function could be invoked before updating DOM style if (async) { Promise.resolve().then(() => target.focus()); } else { target.focus(); } } // return Ref export function useFocusRef<T extends HTMLElement>( option: FocusRefOption ): React.RefObject<T> { const { visible, async } = option; const ref = useRef<T>(null); useEffect(() => { focus({ target: ref.current, visible, async }); }, [visible, ref, async]); return ref; }
clair-design/clair
packages/react/src/utils/lib/hooks/lib/useFocusRef.ts
TypeScript
mit
951
require 'rails/generators' require 'rails/generators/base' class RailsEventsGenerator < Rails::Generators::Base desc "This generator creates files at app/assets/javascripts/#{Rails.application.class.parent_name.underscore}.js.coffee and app/assets/javascripts/views/_#{Rails.application.class.parent_name.underscore}_view.js.coffee" def create_project_file project_name_camel = Rails.application.class.parent_name.camelize project_name_snake = Rails.application.class.parent_name.underscore create_file "app/assets/javascripts/#{project_name_snake}.js", <<-FILE window.#{project_name_camel} = { Views: {}, Ui: { Close: function() { _.each(#{project_name_camel}.Ui, function(element) { if(element.close) element.close(); }) } }, setView: function() { if(!!#{project_name_camel}.view && #{project_name_camel}.view.close) #{project_name_camel}.view.close(); viewName = $('body').data('view-render'); if(!_.isFunction(#{project_name_camel}.Views[viewName])) return; #{project_name_camel}.view = new #{project_name_camel}.Views[viewName](); } } // reinitialize app due to turbolinks $(document).on('pageload', function() { #{project_name_camel}.setView() }) // initial Document Load $(document).ready(function() { #{project_name_camel}.setView() }) FILE end def create_project_view_file project_name_camel = Rails.application.class.parent_name.camelize project_name_snake = Rails.application.class.parent_name.underscore create_file "app/assets/javascripts/views/_#{project_name_snake}_view.js", <<-FILE // To bind events you need to create an events object // KEY = event and selector : VALUE = method // events : // { // 'eventName selector' : 'method', // 'eventName selector' : 'method', // } #{project_name_camel}.View = (function() { var delegateEventSplitter; function View(options) { this.close = _.bind(this.close, this); options || (options = {}); this.viewName = this.__proto__.constructor.name; if (this.render) this.render(options); this.delegateEvents(); } delegateEventSplitter = /^(\S+)\s*(.*)$/; View.prototype.delegateEvents = function(events) { // Copied/modified from Backbone.View.delegateEvents // http://backbonejs.org/docs/backbone.html#section-138 var delegateEventSplitter = /^(\\S+)\\s*(.*)$/ events || (events = _.result(this, 'events')); if (!events) return this; for (var key in events) { var method = events[key]; if (!_.isFunction(method)) method = this[method]; if (!method) continue; var match = key.match(delegateEventSplitter); $('body').on(match[1], match[2], _.bind(method, this)); } return this; }; View.prototype.close = function() { $('body').off('.' + this.viewName); $(window).off('.' + this.viewName); $(document).off('.' + this.viewName); $('body').off('.#{project_name_camel}Events'); $(window).off('.#{project_name_camel}Events'); $(document).off('.#{project_name_camel}Events'); if (this.postClose) return this.postClose(); }; View.extend = function(protoProps, staticProps) { // Copied from Backbone Helpers // http://backbonejs.org/docs/backbone.html#section-245 var parent = this; var child; // The constructor function for the new subclass is either defined by you // (the "constructor" property in your `extend` definition), or defaulted // by us to simply call the parent constructor. if (protoProps && _.has(protoProps, 'constructor')) { child = protoProps.constructor; } else { child = function(){ return parent.apply(this, arguments); }; } // Add static properties to the constructor function, if supplied. _.extend(child, parent, staticProps); // Set the prototype chain to inherit from `parent`, without calling // `parent`'s constructor function and add the prototype properties. child.prototype = _.create(parent.prototype, protoProps); child.prototype.constructor = child; // Set a convenience property in case the parent's prototype is needed // later. child.__super__ = parent.prototype; return child; }; return View; })(); FILE end def add_underscore_to_tree inject_into_file "app/assets/javascripts/application.js", after: "//= require jquery_ujs\n" do "//= require underscore\n" end end def add_project_to_tree project_name = Rails.application.class.parent_name.underscore inject_into_file "app/assets/javascripts/application.js", before: "\n//= require_tree ." do "\n//= require #{project_name}" end end def add_views_folder_to_tree project_name = Rails.application.class.parent_name.underscore inject_into_file "app/assets/javascripts/application.js", after: "//= require #{project_name}\n" do "//= require_tree ./views\n" end end def link_javascript_files_to_views inject_into_file "app/views/layouts/application.html.erb", after: "<body" do " data-view-render= <%= \"\#{@js_view.present? ? @js_view : controller_name.camelize+action_name.camelize}\" %>" end end end
Dbz/rails_events
lib/generators/rails_events_generator.rb
Ruby
mit
5,428
$(document).ready(function () { $('select').material_select(); $('#mutation_switch').change(function () { var mut = document.getElementById('mutation_switch').checked; if (mut == true) { $('#freq').removeAttr('disabled'); } else if (mut == false) { $('#freq').attr('disabled', true); } }); $('#submit-button').click(function () { var sequence = $('#seq-id').val(); var type = $('select').val(); var mutate = document.getElementById('mutation_switch').checked; var frequency = $('input[name="freq"]').val(); if (sequence == ""){ Materialize.toast('Insert sequence first!', 2000); } if (type == "RNA") { var before = new Date().getTime(); var trans = translateRNA(sequence, mutate, frequency); var after = new Date().getTime(); var duration = after - before; $('#seq-id1').val(trans); $('#time').text(duration + ' miliseconds'); } else if (type == "Protein") { var before = new Date().getTime(); var protein = translatePROT(sequence, mutate, frequency); var letters = protein[0]; var chain = protein[1]; var three_letter = protein[2]; $('#seq-id1').val(letters); $('#seq-id1').trigger('autoresize'); $('#seq-id2').val(chain); $('#seq-id2').trigger('autoresize'); $('#seq-id3').val(three_letter); $('#seq-id3').trigger('autoresize'); //////////////////////////// // PROPERTIES // //////////////////////////// updateProperties(letters); var after = new Date().getTime(); var duration = after - before; $('#time').text(duration + ' miliseconds'); } else { Materialize.toast('Select a translation type!', 2000); } }); // $('#save-button').click(function() { // var translation_text = "RNA sequence: " + $('#seq-id').val(); // var blob = new Blob([translation_text+'/nTest'], {type: "text/plain;charset=utf-8"}); // saveAs(blob, "Translation.txt"); // }); // function getSequence() { // return document.forms["conversor"][1].value; // // var form = document.forms["conversor"]; // var seq = form[1].value; // return seq; // } function translateRNA(sequence, mutate, frequency) { var translation = { 'A': 'U', 'T': 'A', 'C': 'G', 'G': 'C' }; var seq = sequence.toUpperCase().replace(/\s/g, ''); var i; var trans = ""; $('#seq-id').val(seq); for (var i = 0; i < seq.length; i++) { var char = seq.substring(i, i + 1); if (translation[char] === undefined) { alert("Unrecognized base at position " + i + " : " + char); console.log("Unrecognized base at position " + i + " : " + char); } else { trans += translation[char]; } } if (mutate == true && frequency && 0 != frequency) { return mutateChain(trans, frequency); } else { return trans; } } function mutateChain(sequence, frequency) { var chars = ["A", "U", "C", "G"]; var freq_per = 100 / frequency; var freq = (Math.floor(Math.random() * freq_per)); // The freq var will be the number of characters we skip before add a mutation, so the higer the freq_per and freq values, the lower the chance of mutation. for (var i = 0; i < sequence.length; i = i + (Math.floor(Math.random() * freq)) + 1) { var char = chars[Math.floor((Math.random() * chars.length))]; sequence = sequence.replaceAt(i, char); } return sequence; } String.prototype.replaceAt = function (index, replacement) { return this.substr(0, index) + replacement + this.substr(index + replacement.length); }; function translatePROT(sequence, mutate, frequency) { var protein = ""; var chain = ""; var three_letter = ""; var i; var sequence = sequence.toUpperCase().replace(/\s/g, ''); $('#seq-id').val(sequence); if (mutate == true && frequency && 0 != frequency) { var chars = ["A", "T", "C", "G"]; var freq_per = 100 / frequency; var freq = (Math.floor(Math.random() * freq_per)); for (var i = 0; i < sequence.length; i = i + (Math.floor(Math.random() * freq)) + 1) { var char = chars[Math.floor((Math.random() * chars.length))]; sequence = sequence.replaceAt(i, char); } } for (var i = 0; i < (sequence.length - 2); i = i + 3) { var codon = sequence.substring(i, i + 3); if (/GC./i.test(codon)) { protein += 'A'; chain += 'Alanine' + '-|-'; three_letter += "Ala-" } //Alanine else if (/TG[TC]/i.test(codon)) { protein += 'C'; chain += 'Cysteine' + '-|-'; three_letter += "Cys-" } // Cysteine else if (/GA[TC]/i.test(codon)) { protein += 'D'; chain += 'Aspartic_Acid' + '-|-'; three_letter += "Asx-" } // Aspartic Acid else if (/GA[AG]/i.test(codon)) { protein += 'E'; chain += 'Glutamic_Acid' + '-|-'; three_letter += "Glx-" } // Glutamic Acid else if (/TT[TC]/i.test(codon)) { protein += 'F'; chain += 'Phenylalanine' + '-|-'; three_letter += "Phe-" } // Phenylalanine else if (/GG./i.test(codon)) { protein += 'G'; chain += 'Glycine' + '-|-'; three_letter += "Gly-" } // Glycine else if (/CA[TC]/i.test(codon)) { protein += 'H'; chain += 'Histidine' + '-|-'; three_letter += "His-" } // Histidine else if (/AT[TCA]/i.test(codon)) { protein += 'I'; chain += 'Isoleucine' + '-|-'; three_letter += "Ile-" } // Isoleucine else if (/AA[AG]/i.test(codon)) { protein += 'K'; chain += 'Lysine' + '-|-'; three_letter += "Lys-" } // Lysine else if (/TT[AG]|CT./i.test(codon)) { protein += 'L'; chain += 'Leucine' + '-|-'; three_letter += "Leu-" } // Leucine else if (/ATG/i.test(codon)) { protein += 'M'; chain += 'Methionine' + '-|-'; three_letter += "Met-" } // Methionine else if (/AA[TC]/i.test(codon)) { protein += 'N'; chain += 'Asparagine' + '-|-'; three_letter += "Asn-" } // Asparagine else if (/CC./i.test(codon)) { protein += 'P'; chain += 'Proline' + '-|-'; three_letter += "Pro-" } // Proline else if (/CA[AG]/i.test(codon)) { protein += 'Q'; chain += 'Glutamine' + '-|-'; three_letter += "Gln-" } // Glutamine else if (/CG.|AG[AG]/i.test(codon)) { protein += 'R'; chain += 'Arginine' + '-|-'; three_letter += "Arg-" } // Arginine else if (/TC.|AG[TC]/i.test(codon)) { protein += 'S'; chain += 'Serine' + '-|-'; three_letter += "Ser-" } // Serine else if (/AC./i.test(codon)) { protein += 'T'; chain += 'Threonine' + '-|-'; three_letter += "Thr-" } // Threonine else if (/GT./i.test(codon)) { protein += 'V'; chain += 'Valine' + '-|-'; three_letter += "Val-" } // Valine else if (/TGG/i.test(codon)) { protein += 'W'; chain += 'Tryptophan' + '-|-'; three_letter += "Trp-" } // Tryptophan else if (/TA[TC]/i.test(codon)) { protein += 'Y'; chain += 'Tyrosine' + '-|-'; three_letter += "Tyr-" } // Tyrosine else if (/TA[AG]|TGA/i.test(codon)) { protein += '_'; chain += 'STOP' + '-|-'; three_letter += "STOP-" } // Stop else { alert("Unrecognized codon starting at position " + i + " : " + codon); } } return [protein, chain, three_letter]; } //////////////////////////////////////////////// // PROPERTIES // //////////////////////////////////////////////// /* Count each type of amino acid in the sequence. Determine the mass, isoelectric point, net charge, hydrophobicity, and extinction coefficient All functions here are based or refactored from Thomas Freeman algorythms. Most of them remain unchanged */ /* Global variables*/ var seq = ""; var ec1; var ec2; var pI; var hydrophobicity; var mass; var charge; var rescounts = new Array(); var aminos = { 'A': { '3letter': 'Ala', 'sc_mass': 15.0234, 'pk1': 2.35, 'pk2': 9.87, 'sc_hphob': 0.5 }, 'R': { '3letter': 'Arg', 'sc_mass': 100.0873, 'pk1': 1.82, 'pk2': 8.99, 'pk3': 12.48, 'sc_hphob': 1.81 }, 'N': { '3letter': 'Asn', 'sc_mass': 58.0292, 'pk1': 2.14, 'pk2': 8.72, 'sc_hphob': 0.85 }, 'D': { '3letter': 'Asp', 'sc_mass': 59.0132, 'pk1': 1.99, 'pk2': 9.9, 'pk3': 3.9, 'sc_hphob': 3.64 }, 'C': { '3letter': 'Cys', 'sc_mass': 46.9955, 'pk1': 1.92, 'pk2': 10.7, 'pk3': 8.3, 'sc_hphob': -0.02, 'extco': 125 }, 'Q': { '3letter': 'Gln', 'sc_mass': 72.0448, 'pk1': 2.17, 'pk2': 9.13, 'sc_hphob': 0.77 }, 'E': { '3letter': 'Glu', 'sc_mass': 73.0288, 'pk1': 2.1, 'pk2': 9.47, 'pk3': 4.07, 'sc_hphob': 3.63 }, 'G': { '3letter': 'Gly', 'sc_mass': 1.0078, 'pk1': 2.35, 'pk2': 9.78, 'sc_hphob': 1.15 }, 'H': { '3letter': 'His', 'sc_mass': 81.0452, 'pk1': 1.8, 'pk2': 9.33, 'pk3': 6.04, 'sc_hphob': 2.33 }, 'I': { '3letter': 'Ile', 'sc_mass': 57.0702, 'pk1': 2.32, 'pk2': 9.76, 'sc_hphob': -1.12 }, 'L': { '3letter': 'Leu', 'sc_mass': 57.0702, 'pk1': 2.33, 'pk2': 9.74, 'sc_hphob': -1.25 }, 'K': { '3letter': 'Lys', 'sc_mass': 72.0811, 'pk1': 2.16, 'pk2': 9.06, 'pk3': 10.54, 'sc_hphob': 2.8 }, 'M': { '3letter': 'Met', 'sc_mass': 75.0267, 'pk1': 2.13, 'pk2': 9.28, 'sc_hphob': -0.67 }, 'F': { '3letter': 'Phe', 'sc_mass': 91.0546, 'pk1': 2.2, 'pk2': 9.31, 'sc_hphob': -1.71 }, 'P': { '3letter': 'Pro', 'sc_mass': 41.039, 'pk1': 1.95, 'pk2': 10.64, 'sc_hphob': 0.14 }, 'S': { '3letter': 'Ser', 'sc_mass': 31.0183, 'pk1': 2.19, 'pk2': 9.21, 'sc_hphob': 0.46 }, 'T': { '3letter': 'Thr', 'sc_mass': 45.0339, 'pk1': 2.09, 'pk2': 9.1, 'sc_hphob': 0.25 }, 'W': { '3letter': 'Trp', 'sc_mass': 130.0655, 'pk1': 2.46, 'pk2': 9.41, 'sc_hphob': -2.09, 'extco': 5500 }, 'Y': { '3letter': 'Tyr', 'sc_mass': 107.0495, 'pk1': 2.2, 'pk2': 9.21, 'pk3': 10.07, 'sc_hphob': -0.71, 'extco': 1490 }, 'V': { '3letter': 'Val', 'sc_mass': 43.0546, 'pk1': 2.39, 'pk2': 9.74, 'sc_hphob': -0.46 } }; $('#submit-button').click(function () { updateProperties(); }); /* Count each type of amino acid in the sequence and store in rescounts */ function count_aminos(sequence) { var aminos_list = ['A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M', 'F', 'P', 'S', 'T', 'W', 'Y', 'V']; for (var i = 0; i < aminos_list.length; i++) { rescounts[aminos_list[i]] = CharCount(sequence, aminos_list[i]) } } function CharCount(theString, theChar) { var result = 0; for (var i = 0; i < theString.length; i++) { if (theString.charAt(i) == theChar) { result++; } } return result; } function calcmass(counts) { alphamass = 56.0136; h2o_mass = 18.0105; mass = alphamass * seq.length + h2o_mass; for (key in counts) { mass += counts[key] * aminos[key]['sc_mass']; } mass = mass.toFixed(4); } function calcec(counts) { ec2 = counts['W'] * aminos['W']['extco'] + counts['Y'] * aminos['Y']['extco']; ec1 = ec2 + cystine_count(counts['C']) * aminos['C']['extco']; ec1 = ec1 + " M<sup>-1</sup> * cm<sup>-1</sup>"; ec2 = ec2 + " M<sup>-1</sup> * cm<sup>-1</sup>"; } function cystine_count(cysteines) { return (cysteines - (cysteines % 2)) / 2; } function calcpi(counts, sequence) { first_res = sequence[0]; last_res = sequence[sequence.length - 1]; acids = { 'C-term': { 'count': 1, 'pk': aminos[first_res]['pk1'] }, 'D': { 'count': counts['D'], 'pk': aminos['D']['pk3'] }, 'E': { 'count': counts['E'], 'pk': aminos['E']['pk3'] }, 'C': { 'count': counts['C'], 'pk': aminos['C']['pk3'] }, 'Y': { 'count': counts['Y'], 'pk': aminos['Y']['pk3'] } }; bases = { 'N-term': { 'count': 1, 'pk': aminos[last_res]['pk2'] }, 'K': { 'count': counts['K'], 'pk': aminos['K']['pk3'] }, 'R': { 'count': counts['R'], 'pk': aminos['R']['pk3'] }, 'H': { 'count': counts['H'], 'pk': aminos['H']['pk3'] } }; for (var pH = 0; pH < 13.99; pH += 0.01) { var c = net_charge(acids, bases, pH); if (c <= 0) break; } pI = pH.toFixed(2); charge = Math.round(net_charge(acids, bases, 7)); charge = add_signum(charge); } function net_charge(a, b, pH) { var c = 0; for (key in a) { if (a[key]['count'] > 0) { c += -a[key]['count'] / (1 + Math.pow(10, (a[key]['pk'] - pH))); } } for (key in b) { if (b[key]['count'] > 0) { c += b[key]['count'] / (1 + Math.pow(10, (pH - b[key]['pk']))); } } c = c.toFixed(3); return c; } function calchphob(counts) { hydrophobicity = 7.9; for (key in counts) { hydrophobicity += counts[key] * aminos[key]['sc_hphob']; } hydrophobicity = hydrophobicity.toFixed(2); hydrophobicity = add_signum(hydrophobicity); hydrophobicity = hydrophobicity + " Kcal * mol <sup>-1</sup>"; } function add_signum(x) { if (x > 0) { return ("+" + x); } else { return x; } } function updateProperties(seq) { count_aminos(seq); console.log("Counting aminoacids: Done"); calcmass(rescounts); console.log("Calculating mass: Done"); calcpi(rescounts, seq); console.log("Calculating isoelectric point: Done"); calcec(rescounts); console.log("Calculating extinction coefficients: Done"); calchphob(rescounts); console.log("Calculating hidrophobicity: Done"); document.getElementById('length').innerHTML = seq.length; document.getElementById('mass').innerHTML = mass + " amu"; document.getElementById('pI').innerHTML = pI; document.getElementById('charge').innerHTML = charge; document.getElementById('hydrophobicity').innerHTML = hydrophobicity; document.getElementById('extinction1').innerHTML = ec1; document.getElementById('extinction2').innerHTML = ec2; } });
rbnfr/DNA-web
scripts/translate.js
JavaScript
mit
18,254
# travis-logs [![Build Status](https://travis-ci.org/juliangruber/travis-logs.svg?branch=master)](https://travis-ci.org/juliangruber/travis-logs) Stream all available travis logs of the current repository's current commit to the terminal, until all jobs are finished! ![screenshot](screenshots/1.png) ![screenshot](screenshots/2.png) ## Usage ```bash $ cd ~/dev/level/leveldown $ travis-logs $ # or $ travis-logs ~/dev/level/leveldown ``` ## Installation ```bash $ npm install -g travis-logs ``` ## JS API ```js const logs = require('travis-logs') logs('.') .on('job', stream => { stream.pipe(process.stdout, { end: false }) }) .on('pass', () => { process.exit(0) }) .on('fail', () => { process.exit(1) }) ``` For more events, check out [bin.js](https://github.com/juliangruber/travis-logs/blob/master/bin.js). ## Related projects - __[travis-watch](https://github.com/juliangruber/travis-watch)__ &mdash; Stream live Travis test results of the current commit to your terminal! - __[appveyor-watch](https://github.com/juliangruber/appveyor-watch)__ &mdash; Stream live AppVeyor test results of the current commit to your terminal! - __[ci-watch](https://github.com/juliangruber/ci-watch)__ &mdash; Travis-Watch and AppVeyor-Watch combined! - __[travis-log-stream](https://github.com/juliangruber/travis-log-stream)__ &mdash; Read streaming travis logs, no matter if live or historic. ## License MIT
juliangruber/travis-logs
README.md
Markdown
mit
1,443
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>T3931500594</title> <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,600"> <link rel="stylesheet" href="/style.css"> <link rel="stylesheet" href="/custom.css"> <link rel="alternate" type="application/rss+xml" title="Des Paroz" href="https://desparoz.me/feed.xml" /> <link rel="alternate" type="application/json" title="Des Paroz" href="https://desparoz.me/feed.json" /> <link rel="EditURI" type="application/rsd+xml" href="/rsd.xml" /> <link rel="me" href="https://micro.blog/desparoz" /> <link rel="me" href="https://twitter.com/desparoz" /> <link rel="me" href="https://github.com/desparoz" /> <link rel="authorization_endpoint" href="https://indieauth.com/auth" /> <link rel="token_endpoint" href="https://tokens.indieauth.com/token" /> <link rel="micropub" href="https://micro.blog/micropub" /> <link rel="webmention" href="https://micro.blog/webmention" /> <link rel="subscribe" href="https://micro.blog/users/follow" /> </head> <body> <div class="container"> <header class="masthead"> <h1 class="masthead-title--small"> <a href="/">Des Paroz</a> </h1> </header> <div class="content post h-entry"> <div class="post-date"> <time class="dt-published" datetime="2009-09-12 03:00:00 +0300">12 Sep 2009</time> </div> <div class="e-content"> <p>Underwater Photography magazine issue 50 available for download <a href="http://post.ly/4jnh">post.ly/4jnh</a></p> </div> </div> </div> </body> </html>
desparoz/desparoz.github.io
_site/2009/09/12/t3931500594.html
HTML
mit
1,661
// // navVC.h // MadMax+ // // Created by ruany on 2016/12/2. // Copyright © 2016年 ruany. All rights reserved. // #import <UIKit/UIKit.h> @interface navVC : UINavigationController @end
paradisery/MadMax
MadMax+/navVC.h
C
mit
198
#!/bin/bash cd "$(dirname "$0")" if [ ! -d ./bin ]; then mkdir -p ./bin fi # Ensure we fail immediately if any command fails. set -e pushd ./bin > /dev/null cmake -DCMAKE_BUILD_TYPE=Debug -DCPM_SHOW_HIERARCHY=TRUE .. make # We only test the build on Travis. There aren't any tests that we run # yet. echo "Running test (viewer)" ./glview_test popd
iauns/cpm-qt-test-glview
tests/run-tests.sh
Shell
mit
366
# OS Viewer [![Gitter](https://img.shields.io/gitter/room/openspending/chat.svg)](https://gitter.im/openspending/chat) [![Issues](https://img.shields.io/badge/issue-tracker-orange.svg)](https://github.com/openspending/openspending/issues) [![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](http://docs.openspending.org/en/latest/developers/viewer/) An app to view data packages loaded to OpenSpending. Provides access to raw data, access to an API for the data, and a suite of views to visualise the data. ## Quick start Clone the repo, install dependencies from npm, and run the server. See the [docs](http://docs.openspending.org/en/latest/developers/viewer/) for more information.
borysyuk/fiscal-data-package-viewer
README.md
Markdown
mit
698
validate-name =============
fakegermano/validate-name
README.md
Markdown
mit
28
@font-face { font-family: 'AraHamah1964R-Regular'; src: url('AraHamah1964R-Regular.eot?') format('eot'), url('AraHamah1964R-Regular.otf') format('opentype'), url('AraHamah1964R-Regular.woff') format('woff'), url('AraHamah1964R-Regular.ttf') format('truetype'), url('AraHamah1964R-Regular.svg#AraHamah1964R-Regular') format('svg'); }
Husamuddin/calender
css/fonts/webpack/AraHamah1964R-Regular/styles.css
CSS
mit
364
# Principal Component Analysis Code : from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud from pylab import * import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import rospy #import hrl_lib.mayavi2_util as mu import hrl_lib.viz as hv import hrl_lib.util as ut import hrl_lib.matplotlib_util as mpu import pickle from mvpa.clfs.knn import kNN from mvpa.datasets import Dataset from mvpa.clfs.transerror import TransferError from mvpa.misc.data_generators import normalFeatureDataset from mvpa.algorithms.cvtranserror import CrossValidatedTransferError from mvpa.datasets.splitters import NFoldSplitter import sys sys.path.insert(0, '/home/tapo/svn/robot1_data/usr/tapo/data_code/BMED_8813_HAP/Data') from data_method_I import Fmat_original def pca(X): #get dimensions num_data,dim = X.shape #center data mean_X = X.mean(axis=1) M = (X-mean_X) # subtract the mean (along columns) Mcov = cov(M) ###### Sanity Check ###### i=0 n=0 while i < 123: j=0 while j < 90: if X[i,j] != X[i,j]: print X[i,j] print i,j n=n+1 j = j+1 i=i+1 print n ########################## print 'PCA - COV-Method used' val,vec = linalg.eig(Mcov) #return the projection matrix, the variance and the mean return vec,val,mean_X, M, Mcov if __name__ == '__main__': Fmat = Fmat_original # Checking the Data-Matrix m_tot, n_tot = np.shape(Fmat) print 'Total_Matrix_Shape:',m_tot,n_tot eigvec_total, eigval_total, mean_data_total, B, C = pca(Fmat) #print eigvec_total #print eigval_total #print mean_data_total m_eigval_total, n_eigval_total = np.shape(np.matrix(eigval_total)) m_eigvec_total, n_eigvec_total = np.shape(eigvec_total) m_mean_data_total, n_mean_data_total = np.shape(np.matrix(mean_data_total)) print 'Eigenvalue Shape:',m_eigval_total, n_eigval_total print 'Eigenvector Shape:',m_eigvec_total, n_eigvec_total print 'Mean-Data Shape:',m_mean_data_total, n_mean_data_total #Recall that the cumulative sum of the eigenvalues shows the level of variance accounted by each of the corresponding eigenvectors. On the x axis there is the number of eigenvalues used. perc_total = cumsum(eigval_total)/sum(eigval_total) # Reduced Eigen-Vector Matrix according to highest Eigenvalues..(Considering First 20 based on above figure) W = eigvec_total[:,0:2] m_W, n_W = np.shape(W) print 'Reduced Dimension Eigenvector Shape:',m_W, n_W #Projected Data: Y = (W.T)*B m_Y, n_Y = np.shape(Y.T) print 'Transposed Projected Data Shape:', m_Y, n_Y #Using PYMVPA PCA_data = np.array(Y.T) PCA_label_1 = ['Edge-1']*30 + ['Surface']*30 + ['Edge-2']*30 PCA_chunk_1 = ['Can-Edge-1']*5 + ['Book-Edge-1']*5 + ['Brown-Cardboard-Box-Edge-1']*5 + ['Cinder-Block-Edge-1']*5 + ['Tin-Box-Edge-1']*5 + ['White-Cardboard-Box-Edge-1']*5 + ['Can-Surface']*5 + ['Book-Surface']*5 + ['Brown-Cardboard-Box-Surface']*5 + ['Cinder-Block-Surface']*5 + ['Tin-Box-Surface']*5 + ['White-Cardboard-Box-Surface']*5 + ['Can-Edge-2']*5 + ['Book-Edge-2']*5 + ['Brown-Cardboard-Box-Edge-2']*5 + ['Cinder-Block-Edge-2']*5 + ['Tin-Box-Edge-2']*5 + ['White-Cardboard-Box-Edge-2']*5 clf = kNN(k=10) terr = TransferError(clf) ds1 = Dataset(samples=PCA_data,labels=PCA_label_1,chunks=PCA_chunk_1) print ds1.samples.shape cvterr = CrossValidatedTransferError(terr,NFoldSplitter(cvtype=1),enable_states=['confusion']) error = cvterr(ds1) print error print cvterr.confusion.asstring(description=False) figure(1) cvterr.confusion.plot(numbers='True') # Variances figure(2) title('Variances of PCs') stem(range(len(perc_total)),perc_total,'--b') axis([-0.3,30.3,0,1.2]) grid('True') show()
tapomayukh/projects_in_python
sandbox_tapo/src/skin_related/BMED_8813_HAP/Scaling/results/cross_validate_categories_BMED_8813_HAP_scaled_method_I.py
Python
mit
4,026
--- layout: post title: "PyTorch Basics Part 1 (in Chinese)" author: Guanlin Li tag: party --- `2017.11.25 glli` > 引子. > > 一些经典的神经网络架构(前馈神经网、循环神经网、卷积神经网),或者根据使用者经验设计出的新的神经网络架构,我们将这些架构视为基本的计算模块,通过这些基本计算模块的组合、配搭,可以针对具体的机器学习任务(分类、回归、结构预测)设计出神经网络模型,通过训练数据得到一组使学习目标(函数)最优的模型参数,这样一个过程,叫做实用深度学习。如果读者希望总是使用深度学习的技术,上述的这一过程便会不断重复出现在读者的研究与实验活动中。 > > 由于神经网络的学习,即参数的估计、学习目标的优化的过程,最常使用的是梯度下降(gradient descent)。梯度下降算法需要计算每一时刻,给定数据$$\{ x^i, y^i \}$$后,神经网络模型的误差函数的梯度,并沿着梯度的方向更新网络的参数:$$\theta_{t+1} = \theta_t - \eta \cdot \nabla \mathcal{L(\theta ; \{ x^i, y^i \})}$$。而如何计算神经网络参数的梯度,存在着名为“反向传播”的梯度计算算法,就如“给定函数,能通过求导法则去求出各变量的偏导数”一样,倘若我们能做到:给定神经网络模型由输入到输出,再到目标函数的这一计算流程,且能根据求导法则,计算出每个神经网络参数的偏导数(梯度)的话,这样的梯度计算与参数更新过程,就都能自动由软件替我们完成,我们所要做的,仅仅是指定神经网络的计算流程即可。将上述方案实现的软件,我们称之为深度学习框架(deep learning framework),这里要介绍的[PyTorch](http://pytorch.org/)便属于其中一个十分优秀的框架。 #### 1. 自动微分 自动微分(Automatic Differentiation)又叫算法微分(Algorithmic Differentiation),由来已久,目的是通过算法与软件自动化,简化人工通过求导法则计算复杂函数偏导数的代价;具体讲,自动微分能对给定的函数求一阶甚至高阶的偏导数,原理是:复合函数求导的基本法则,即链式法则。 复合函数求导,如:$$y=g \cdot f \cdot h(x)$$,对$$x$$求导,可以拆解为每个复合运算求导后再连乘的形式: $$\partial{y}/\partial{x} = \partial{g}/\partial{f} \cdot \partial{f}/\partial{h} \cdot \partial{h}/\partial{x}$$ 自动微分需要通过软件自动化的是: 1. 对一个函数,如何表示为一些简单运算的复合(往往以有向无环图的数据结构表示),并记录需要对哪些变量进行偏导的计算 2. 对每个简单运算,给定了输入输出,如何求偏导 3. 如何根据链式法则,将每一部分的偏导数衔接起来,对于需要求偏导的变量,得到完整的链式求导的结果 自动微分的软件在求偏导时,往往分为:前向模式(Forward mode)、反向模式(Backward mode)。我们同样以上述对于$$x$$求偏导为例,并且假设一些计算过程的中间量如下: - $$a = h(x)$$ - $$b = f(a)$$ - $$y = g(b)$$ 前向模式按照如下顺序去计算$$\partial{y}/\partial{x}$$,可以发现上一次的计算结果可以直接代入下一次的计算中: - $$\partial{a}/\partial{x}$$ - $$\partial{b}/\partial{x} = \partial{b}/\partial{a} \cdot \partial{a}/\partial{x}$$ - $$\partial{y}/\partial(x) = \partial{y}/\partial(b) \cdot \partial{b}/\partial{x}$$ 后向模式则相反,按照如下顺序去计算$$\partial{y}/\partial{x}$$,同样可以看出,上一次的计算结果被代入了下一次的计算中: - $$\partial{y}/\partial{b}$$ - $$\partial{y}/\partial{a} = \partial{y}/\partial{b} \cdot \partial{b}/\partial{a}$$ - $$\partial{y}/\partial{x} = \partial{y}/\partial{a} \cdot \partial{a}/\partial{x}$$ > 思考. > > 写到这里,希望读者能够结合上一次茶会最后关于自动求导的内容,思考一下,这一个自动求导的程序应该如何去写:1. 大概需要哪些数据结构去存储哪些量(有向无环图?有向无环图的每一个节点需要有哪些变量去存储哪些数据);2. 前向模式和反向模式应该如何实现(有向图的拓扑序遍历?) 关于自动微分,上面的讲述十分粗糙,由于上次的茶会在最后部分大概阐述过,所以这里仅仅从概念与核心内容上进行了简单的强调,并没有举具体的例子。倘若读者对自动微分感兴趣,可以参见下面一些资料: - [Automatic Differentiation in Machine Learning: a Survey](https://arxiv.org/pdf/1502.05767.pdf): 自动微分的一篇综述性文章; - [Automatic Differentiation: or mathematically finding derivatives](http://www.columbia.edu/~ahd2125/post/2015/12/5/):这是一篇博客性质的文章,通过例子写得十分清楚,并还恰当的启发了读着如何应用程序设计语言去实现,作者提到了[Introduction to AD](https://alexey.radul.name/ideas/2013/introduction-to-automatic-differentiation/),这篇博客,同样可以去看看。 - [Automatic differentiation and Backpropagation](https://www.suchin.co/2017/03/18/Automatic-Differentiation-and-Backpropagation/):这篇博客结合了神经网络的自动求导,例子丰富,在文章最后给出了一个简单的前向网络用Python写出的一个自动求导的小程序,挺值得阅读的。 #### 2. 深度学习框架的基本组成 > 目的. > > 这一小节笔记的作用于目的在于,让读者对深度学习框架的架构有基本的了解,使得读者在接触新框架或阅读新框架代码时能够利用自己熟悉的框架的知识,进行迁移,并更快的掌握新框架。 所有现代深度学习框架所共有的两个特性是: - **提供GPU并行计算的接口**:这里需要思考的问题是,为什么需要将神经网络的计算派发至GPU进行计算,传统的运算单元CPU的劣势在哪儿? - **提供计算图构建与自动微分功能**:这一点想必读者已经耳熟能详了。 在华盛顿大学的深度学习系统课程中,另一个比较流行的深度学习框架[mxnet](https://mxnet.incubator.apache.org/)的作者之一陈天奇给出了一个“典型深度学习系统栈”的示意图: ![dlsys_arch](D:\wOrKsPaCe_old\Reading List\17\Tutorials\自然语言处理-晚茶会\imgs\pytorch\dlsys_arch.png) 从上图可以看出,一个框架的设计存在着许多需要考虑的问题: - 上层的User API的设计往往可以参考现有的一些框架,theano与torch是两个相对较早的框架,它们有着各自优秀的特性,theano的**静态计算图与计算图优化**的设计思想启发了tensorflow与mxnet。后二者的核心:计算图构建与自动微分功能,均是基于静态图的。 - 静态图的优势在于,由于构建计算图时,须使用框架中自定义的流程控制逻辑(流程控制逻辑主要指:条件判断、循环)而非程序设计语言原生的控制逻辑(if、for、while等),所以更方便设计者设计对计算图进行程序分析,进而能够对计算图进行优化(例如:中间数据节点的创建、合并等); - 静态图的弊端在于:倘若模型的设计会考虑数据本身带有的内在结构(最好的例子是递归神经网中根据每个句子的句法树进行前向计算),即每一条数据的计算图可能都有差异,这样便无法事先统一构建出一个计算图,静态图遇到这类问题的解决方案是,对每一个样例都要进行分析,并构建一个静态图,由于每次构图都会进行图的优化,会一定程度降低训练时的计算效率,另外,静态图框架中自定义的流程控制逻辑不易理解与使用的弊端,也造成了许多刚接触深度学习的用户的一大困扰; - 静态图的另一个弊端便是不方便用户使用程序设计语言原生的`print`进行调试:在theano中,**构图**即是将theano中的张量类型变量,不断进行theano内建的基本计算操作进行变换,从而得到目标变量的过程,最终会通过theano的函数算子进行编译得到一个函数,例如下面所示的sigmoid函数$$s = \frac{1}{1 + \exp(-X \cdot w)}$$的计算图的构建,其中$$X$$是数据矩阵,即X的每一行代表一个样例$$x \in \mathbb{R}^d$$。 ```python import theano import theano.tensor as T X = T.dmatrix('X') # 创建一个double类型的数据矩阵,名为'X' w = T.dmatrix('w') # 创建一个double类型的参数矩阵,名为'w' y = T.dot(x, w) # X dot w,y可以看作是计算图的中间结果,因为我们可以直接写为 s = 1 / (1 + T.exp(-T.dot(X, w))) s = 1 / (1 + T.exp(-y)) # sigmoid函数,运算'/','+','T.exp','-'均是逐元素运算(element-wise op) logistic_func = theano.function([X, w], s) # 调用theano的function函数,对计算图进行优化分析,并得到一个可供调用的函数'logistic_func',该函数的输入是'X'即一个double类型的矩阵,以及一个参数向量'w',输出是's'即一个与'X'矩阵行数相同的向量s s_real = logistic_func( [[1.0, 1.0], [-1.0, -1.0]] ) # 得到的函数可以进行调用,输入为numpy类型或者python原生的list类型的变量 print(s_real) ``` 倘若,我们希望或许计算过程的中间结果`y`,由于对计算图创建可调用函数时,`y`并非作为输出,所以我们无法访问得到`y`的值;只有显式的将`y`作为计算图的输出并构建可调用函数时,我们才能得到`y`的值,即: ```python logistic_func = theano.function([X, w], out=[s, y]) s_real, y_real = logistic_func( [[1.0, 1.0], [-1.0, -1.0]], # X_real 真实数据 [[0.0, 0.0]] # w_real 真实的参数矩阵 ) print(s_real) print(y_real) ``` 在theano和tensorflow中,通过其各自**自定义的op**得到的计算图,需要通过一个**容器**进行编译或运行,转换为可以接收**真实数据**进而进行计算得到**真实输出**的对象。在theano中需要通过`theano.function`进行显式的声明输入、输出,并得到一个函数对象,该函数对象即可以接收**与输入一致**的真实数据进行计算了;而在tensorflow中,需要通过调用`session.run()`进行真实数据的运算,如下面的相同功能的tensorflow代码: ```python import tensorflow as tf x_dim = 2 X = tf.placeholder(tf.float32, [None, x_dim]) # 创建一个数据的占位符placeholder,需要制定其形状 w = tf.Variable(tf.zeros([x_dim, 1])) # 创建一个参数矩阵,由于属于模型参数,所以通过tf.Variable创建为变量类型 y = -tf.matmul(X, w) # [None, 1] s = 1 / (1 + tf.exp(y)) # [None, 1]的矩阵 with tf.Session() as sess: tf.global_variables_initializer().run() # 执行所有计算图中Variable类型对象的初始化,这里即初始化参数向量'w' X_real = [[1.0, 1.0], [-1.0, -1.0]] s_real = sess.run(s, feed_dict={X: X_real}) # 计算's',当给定输入是X_real时 print(s_real) ``` 从上面的例子可以发现,在调用`sess.run(s, feed_dict={X: X_real})`时,类似于theano中创建函数,并给函数输入真实数据的过程,所以`sess.run()`函数不仅对计算图进行了优化,也同样执行了一次真实的计算。 - PyTorch和[Chainer](https://chainer.org/)的核心设计思想是基于动态图构建计算流程,用户可使用**程序设计语言原生的流程控制逻辑**进行计算图的构建,这部分的介绍在第4节中详细阐述。 - 在PyTorch中,用户所使用的API主要以Python包和模块的形式存在,经常使用的**包**包括: ![api](D:\wOrKsPaCe_old\Reading List\17\Tutorials\自然语言处理-晚茶会\imgs\pytorch\api.png) - `torch`:`torch`包,是一个张量运算的包,定义了各种基本运算、矩阵操作等; - `torch.Tensor`:`torch.Tensor`包,更准确的说是PyTorch所定义的一个类,作为数学概念中张量(tensor)的一个容器,提供了多种不同类型的张量的初始化方法以及计算,类似于matlab与numpy中的核心数据结构多维矩阵(multidimensional matrix); - `torch.nn`:神经网络模块,**基本神经网络的架构**的实现,例如:实现了基本的前馈神经网(线性层+非线性激活),循环神经网,卷积神经网(卷积层、池化层)等的接口;以及常用的**损失函数**的实现; ![nn_module](D:\wOrKsPaCe_old\Reading List\17\Tutorials\自然语言处理-晚茶会\imgs\pytorch\nn_module.png) - `torch.optim`:最优化算法的实现,将基于梯度的最优化算法:随机梯度下降`torch.optim.SGD`,以及其几种变体`torch.optim.Adadelta`,`torch.optim.Adagrad`,`torch.optim.Adam`,`torch.optim.RMSprop`等;同时,实现了一个著名的拟牛顿算法`torch.optim.LBFGS`。 - `torch.autograd`:自动求导模块,其中最重要的一个类是`Variable`,在使用时通过`from torch.autograd import Variable`加载到Python解释器中;该类可以通过封装`torch.Tensor`类型的变量,进行计算图的构建:即被`Variable`封装后的张量变量在进行前向计算时,`torch.autograd`模块会**跟踪**每一次基本计算Op(Operation,操作、基本计算),并动态构建计算图。 - 当然,上面所陈述的均为深度学习框架中用户接口层次的使用与设计,这里希望读者思考的是:**一个基于神经网络的学习/训练问题,其程序实现的流程大致是什么样的?**想明白了这个问题,就能对上述模块为什么要这么划分有更深入的理解。 - 顺着陈天奇的架构图往下走,就是系统级别的组件:包括计算图的优化与执行、以及运行时并行调度的功能。这部分是十分核心的,因为所有的OP最终都会被**链接**到基于GPU或者CPU开发的矩阵运算库的API中,并根据计算图的拓扑序进行前向或者反向计算,这部分计算发生在GPU的显存或CPU的缓存与内存中。由于GPU的计算核心数目远大于CPU,能通过并行存取、计算多个显存单元中的数据,所以特别适合矩阵运算与数据的批处理(batch learning),只要一批数据中的每一条数据的计算流程是一致的,就能够利用GPU进行批处理,计算效率会远高于CPU。 - GPU计算最常用的API是大名鼎鼎的英伟达公司(NVIDIA)设计开发的[CUDA](https://zh.wikipedia.org/wiki/CUDA)。更为准确的说,CUDA是一套英伟达设计的通用并行计算或通用GPU计算([GPGPU](https://zh.wikipedia.org/wiki/%E5%9B%BE%E5%BD%A2%E5%A4%84%E7%90%86%E5%99%A8%E9%80%9A%E7%94%A8%E8%AE%A1%E7%AE%97))架构,包括了用户接口与针对GPU硬件设配的编译器;深度学习主要使用CUDA提供的用户接口,将矩阵的基本运算(矩阵加法、乘法等)转换为CUDA中的相应计算,即可使用GPU的并行计算能力了。所以,几乎所有的依赖GPU的深度学习框架,都会在CUDA上进行封装,抽象出与上层用户API一致的OP接口以供上层Python包调用。另一方面,为了进行调度,框架设计者还会利用CUDA提供的并行计算组件管理GPU的内存,更适应于神经网络的计算特性。 > 注记. > > 关于深度学习框架如何与CUDA以及cuDNN进行交互与衔接的内容,已经超出笔者的知识范围,但了解这部分内容是十分有价值的:GPU给了我们新一代数据处理范式,对GPU或并行异构编程(如OpenCL)的了解,就如同对分布式计算(如基于MapReduce)的了解一样同样重要。 > > 在GPU程序设计中最终要的一环是对矩阵运算的优化,特别是矩阵乘法的优化,BLAS是一个线性代数基本运算标准,能够加速矩阵运算(与硬件计算资源CPU、GPU无关),[OpenBLAS](https://www.leiphone.com/news/201704/Puevv3ZWxn0heoEv.html)是中国学者张先轶主要维护的线性代数基本运算库,主要针对CPU开发;而英伟达也有着其对BLAS的GPU实现,称为[cuBLAS](http://docs.nvidia.com/cuda/cublas/index.html),该API直接在CUDA之上实现,能访问GPU的计算资源。 > > NVIDIA对于神经网络同样做了优化,在CUDA的基础上写了一个名为cuDNN的神经网络接口,其中高效实现了CNN与RNN > > 关于并行编程,Udacity上有一门课程,或许值得看一下——[并行编程入门](https://cn.udacity.com/course/intro-to-parallel-programming--cs344)。 - PyTorch中我们如何将模型加载到GPU上进行计算呢?我们可以直接通过`.`运算符调用`cuda()`方法即可,在`torch.Tensor`包中的所有张量类,均实现了该方法,所以可以直接通过`t.cuda()`将张量`t`加载到GPU上。那么这里出现的一个疑问是,倘若实验的主机上有多个GPU,上述`t.cuda()`执行后,会将CPU中的张量`t`加载到哪一个GPU上呢?PyTorch中,对GPU基础管理模块叫`torch.cuda`,我们可以通过下面的程序来查看是否能访问GPU硬件设配,以及设置当前使用的GPU设备;当然我们还可以通过调用`t_cpu = t.cpu()`将`t`的GPU数据拷贝回CPU上的`t_cpu`变量中,但GPU上面的数据仍然存在: ```python import torch import torch.cuda as cuda t = torch.Tensor() # cpu上,内存中 gpu_id = 0 if cuda.is_available(): cuda.set_device(gpu_id) t.cuda() # t在零号GPU上有了副本 t_cpu = t.cpu() # ``` 关于`cuda`类使用的语义,具体请参照API技术文档中关于[CUDA](http://pytorch.org/docs/0.2.0/) [Semantics](http://pytorch.org/docs/master/)这两部分,分别对应于版本号v0.2.0与v0.4.0a0(当前在master branch上的版本)。 > 注意. > > 请读者重视CUDA Semantics这部分,这部分充分体现了深度学习框架是如何进行有效的内存管理与如何进行多GPU调度等功能。PyTorch中的cuda模块使用python编写,参见[这里](https://github.com/pytorch/pytorch/tree/master/torch/cuda),通过调用`torch._C`类(该类位于[这里](https://github.com/pytorch/pytorch/tree/master/torch/csrc))封装的cuda上下文管理接口进行GPU设备的管理。感兴趣的读者可以详细了解一下,并借此掌握一些GPU并行计算与CUDA编程的知识。 > 尾语. > > 通过上面的阐述,希望读者能够从框架整体设计与应用功能的角度上对PyTorch以及其他深度学习框架有一定的了解,逐渐习得这种模块化的认识,对于理解与使用新的框架(不局限于深度学习)是十分有好处的。 #### 3. PyTorch的基本数据结构——张量 张量是科学计算中数据的容器,在数据科学和数据时代中,张量是用于描述、分析数据的技术手段,[张量](http://www.offconvex.org/2015/12/17/tensor-decompositions/)[方法](https://simons.berkeley.edu/sites/default/files/docs/2930/slidesanandkumar.pdf)在机器学习中是兼具理论与实用性的优秀学习工具。在深度学习中,数据往往具有较高的维度,使用向量或者矩阵表示,举例子讲,做线性回归时,每一个输入样例是一个d维向量$$\mathbb{x} \in \mathbb{R}^d$$;而当一有L个词的句子的每个词表示为一个d维词向量时,这个句子就可以通过L个$$\mathbb{x}_i \in \mathbb{R}^d$$表示,例如可以组织成一个矩阵的形式: $$X=[\mathbb{x_1, \mathbb{x}_2}, \dots, \mathbb{x}_L]_{d \times L}$$ 回顾机器学习的有监督问题,无论是对于分类、回归还是结构预测,大多数情形下,都需要通过模型去建模一个输入到输出的映射这样的问题,在深度学习中,我们希望通过设计一个神经网络去实现这样的映射关系。要编程实现这样一个神经网络的学习问题,即我们要通过反向传播算法,去对给定的数据,计算神经网络在当前参数下的损失函数,并反向传播求得梯度,进而去更新网络的参数。 这一过程中,所有的数值都需要通过张量进行存储与管理,这些数值有: - 模型的参数矩阵或向量 - 训练数据的数据矩阵或向量 在没有能实现自动微分的神经网络框架之前,人们通常采用matlab或者python的numpy包中的张量类进行上述数值的存储与运算。PyTorch的作者声称PyTorch用C++与Cython实现了类似于Numpy的张量类型、以及大部分的基本运算(Op,operation),我们下面来认识一下PyTorch的张量类型`torch.Tensor`。 ![tensortype](D:\wOrKsPaCe_old\Reading List\17\Tutorials\自然语言处理-晚茶会\imgs\pytorch\tensortype.png) 从上表看出,torch实现了7种类型的张量,分别有CPU版本和GPU版本,当创建一个CPU张量对象后,可以通过执行其`.cuda`方法将该张量加载到指定的GPU设备上。上述类型中,使用最多的是`torch.FloatTensor`和`torch.LongTensor`,两个类: ```python import torch t_float_nodim = torch.FloatTensor() # 创建一个没有维度的张量 print(t_float_nodim.size()) print(type(t_float_nodim.size())) # out () # torch.Size 对象 torch.Size t_float_vec = torch.FloatTensor(6) # 创建一个只有1维的张量——向量该维度上有6个元素 print(t_float_vec) # out 1.00000e-05 * -5.7287 0.0000 0.0000 0.0000 0.0000 0.0000 [torch.FloatTensor of size 6] print(t_float_vec.size()) # out (6L,) # torch.Size 对象 ``` 使用这两个类最多的原因在于: - 32-bit单精度浮点数的运算基本满足了机器学习算法中模型参数的精度,精度越低,显存占用越小,计算效率是越高的,所以有一些**片上固件式神经网络**采用的是16-bit甚至8-bit的浮点数;由于大部分GPU制造厂商生产的GPU对单精度浮点数运算有较好的支持,所以研究/开发人员在编写深度学习程序时,更常使用的数据类型是32-bit浮点数; - 自然语言处理的研究/开发人员更多使用`torch.LongTensor`,是因为自然语言处理中,会有**词表**,词表中每个词汇对应一个embedding向量(可作为模型参数);在一些开放域的NLP任务中,词表可能会达到百万量级,我们需要为此表中的每一个词分配一个ID号,即可通过`torch.LongTensor`进行存储。 #### 4. 神经网络的自动微分——`Variable`类、`autograd`模块 神经网络框架最大优势之一便是替我们自动计算神经网络参数的梯度。由于一个神经网络模型描述了从输入到输出的映射,该映射可以拆解为一个个基本计算的复合(类似于1中所述的函数的复合),所以,可以根据自动微分的原理与技术去实现神经网络的自动微分。 更广义的讲,所有深度学习框架均是一个自动微分的工具,均提供了大部分复合函数的自动求导机制。上句中“大部分”一词的意思在于:深度学习框架会尽可能地覆盖常用的基本运算,例如:初等运算中的加减乘除、指数对数、三角函数等运算。利用这些基本运算,使用户在使用时,可以构造出丰富的复合函数,以满足用户对计算流程的复杂需求。这些基本运算往往叫做“操作”或“算子”(Op, operation)。 前文曾提到过,`Variable`类封装的张量变量在进行前向计算时,会自动跟踪每一个基本计算,即`Variable`类至少含有的数据结构为下图所示,分别为`Variable`类型的成员变量:a). `Variable.data`, b). `Variable.grad`, c). `Variable.grad_fn`。 ![Variable_class](D:\wOrKsPaCe_old\Reading List\17\Tutorials\自然语言处理-晚茶会\imgs\pytorch\Variable_class.png) ```python import torch t = torch.FloatTensor(4, 4).fill_(1) # 创建一个全1的4x4的FloatTensor print(t) # out 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [torch.FloatTensor of size 4x4] from torch.autograd import Variable t_var = Variable(t) print(t_var) # out Variable containing: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [torch.FloatTensor of size 4x4] print(t_var.data) # out => 与t一致 print(t_var.data is t) # out => True 即t_var.data与t引用相同,指向同一块内存/显存区域 print(t_var.grad_fn) # print(type(t_var.grad_fn)) # out None print(t_var.grad) # print(type(t_var.grad)) # out None ``` 下面我们通过一个一维的例子,实现函数:$$y = a^2+ b \cdot \exp(c)$$,并计算$$y$$对每一个自变量$$a, b, c$$的导数: ```python import torch from torch.autograd import Variable a = Variable(torch.FloatTensor([1]).fill_(1)) b = Variable(torch.FloatTensor([1]).fill_(1)) c = Variable(torch.FloatTensor([1]).fill_(1)) a_square = a * a bc_ret = b * torch.exp(c) y = a_square + bc_ret y.backward() # 通过调用Variable对象y的backward()方法,可以反向传播计算偏导数;但是该条语句会报错 # error RuntimeError: there are no graph nodes that require computing gradients ``` 该条错误告诉我们,通过`Variable`跟踪构建的计算图中没有任何一个节点需要对其进行求导,也就是说我们可以通过`Variable`的构造属性`requires_grad`设置创建的`Variable`是否需要在计算图中对其进行求梯度;显然我们这里的三个变量`a, b, c`均需要对其进行求导,所以上面代码应该改为: ```python import torch from torch.autograd import Variable a = Variable(torch.FloatTensor([1]).fill_(1), requires_grad=True) b = Variable(torch.FloatTensor([1]).fill_(1), requires_grad=True) c = Variable(torch.FloatTensor([1]).fill_(1), requires_grad=True) a_square = a * a bc_ret = b * torch.exp(c) y = a_square + bc_ret y.backward() print(a.grad) # out Variable containing: 2 [torch.FloatTensor of size 1] print(b.grad) # out Variable containing: 2.7183 [torch.FloatTensor of size 1] print(c.grad) # out Variable containing: 2.7183 [torch.FloatTensor of size 1] print(y.grad) # 由于y是输出,所以其梯度为0 # out None ```
Epsilon-Lee/epsilon-lee.github.io
_posts/party/2017-11-26-PyTorch-Basics.md
Markdown
mit
26,301
#!/usr/bin/python # -*- coding: utf-8 -*- ''' @author: Tengwei Yuan 1. Get all links of summary pages - from start search page result 2. From each summary page get all links of detail product pages 3. From each detail product page get basic information and the number of review pages 4. From each review page get review information 5. Save all extracted information into file ''' import csv import re import string import time from urllib import urlopen import requests from bs4 import BeautifulSoup from lxml import html def clean_input(input): input = re.sub('\n+', " ", input) input = re.sub('\[[0-9]*\]', "", input) input = re.sub(' +', " ", input) input = bytes(input, "UTF-8") input = input.decode("ascii", "ignore") cleanInput = [] input = input.split(' ') for item in input: item = item.strip(string.punctuation) if len(item) > 1 or (item.lower() == 'a' or item.lower() == 'i'): cleanInput.append(item) return cleanInput def clean(item): clean_item = ' '.join(' '.join(item).split()) # ' '.join(item).lstrip(' ').lstrip('\n').rstrip(' ').rstrip('\n') return clean_item ### get all needed urls from current search page and also url to next page def get_urls_re(start_url): time.sleep(1) html = urlopen(start_url) base_url = 'http://place.qyer.com' bsObj = BeautifulSoup(html, 'lxml') # get needed urls from current page for a in bsObj.findAll('a', href=True): if re.findall('poi', a['href']): print("Found the URL:", a['href']) # get next page url for link in bsObj.findAll("a", attrs={'class': 'ui_page_item ui_page_next'}): if 'href' in link.attrs: next_page_link = base_url + link.attrs['href'] print(next_page_link) get_urls_re(next_page_link) return # 1 next_page_urls = set() def get_next_page_urls(start_url): cont = requests.get(start_url).content tree = html.fromstring(cont) base_url = 'http://place.qyer.com' next_page_url_xpath = '//*[@title="下一页"]/@href' next_page_url = tree.xpath(next_page_url_xpath) if next_page_url: next_page_url = base_url + ''.join(next_page_url) print(next_page_url) next_page_urls.add(next_page_url) get_next_page_urls(next_page_url) # 2 page_urls = set() def get_url_xpath(start_url): time.sleep(1) page_url_xpath = '//*[@id="poiLists"]/li[*]/div/h3/a/@href' cont = requests.get(start_url).content tree = html.fromstring(cont) for input in tree.xpath(page_url_xpath): page_url = clean_input(input)[0] page_urls.add(page_url) print(page_url) # 3 get all needed items in current page items_list = [] def get_items(page_url): page = requests.get(page_url).content tree = html.fromstring(page) title_xpath = '//*[@class="poiDet-largeTit"]/h1[@class="en"]/a/text()' body_xpath = '//*[@class="poiDet-detail"]/text()' rank_title_xpath = '//div[@class="infos"]/div[1]/ul/li[@class="rank"]/text()' rank_info_xpath = '//div[@class="infos"]/div[1]/ul/li[@class="rank"]/span/text()' tips_xpath = '//*[@class="poiDet-tips"]/li[*]/div[@class="content"]/p/text()' review_stars_xpath = '//span[@class="summery"]//text()' review_counts_xpath = '//span[@class="summery"]/b/text()' title = tree.xpath(title_xpath) body = tree.xpath(body_xpath) rank_title = tree.xpath(rank_title_xpath) rank_info = tree.xpath(rank_info_xpath) tips = tree.xpath(tips_xpath) review_stars = tree.xpath(review_stars_xpath) review_counts = tree.xpath(review_counts_xpath) print(review_stars) print(review_counts) title = clean(title) body = clean(body) rank_title = clean(rank_title) rank_info = clean(rank_info) tips = clean(tips) row = [title, rank_title + ': ' + rank_info, body, tips] print(row) return row # 4 reviews = [] def get_review_items_from_page_url(page_url, initial_page_flag, page): # if the page has been retrieved, use it instead of requesting it again if not initial_page_flag: page = requests.get(page_url).content xml_tree = html.fromstring(page) print(xml_tree) # review_star_xpath = '//div[@class="hiddenComment"]/div/span/text()' review_text_xpath = '//div[@class="hiddenComment"]/div/text()|//div[@class="hiddenComment"]/div/span/text()' # review_star = xml_tree.xpath(review_star_xpath) review_text = xml_tree.xpath(review_text_xpath) print(review_text) reviews.append([review_text]) def get_review_items_from_page_source( page_source): # if the page has been retrieved, use it instead of requesting it again xml_tree = html.fromstring(page_source) # save_html(page) review_star_xpath = '//div[@class="hiddenComment"]/div/span/text()' review_text_xpath = '//div[@class="hiddenComment"]/div/text()' review_star = xml_tree.xpath(review_star_xpath) review_text = xml_tree.xpath(review_text_xpath) print([review_star, review_text]) reviews.append([review_star, review_text]) def get_review_by_post(review_url, review_params): response = requests.post(review_url, data=review_params) content = response.text content = bytes(content, "UTF-8") content = content.decode("unicode-escape") print(content) from selenium import webdriver def get_review_items_selenium(page_url): browser = webdriver.Chrome(executable_path='/usr/local/bin/chromedriver') try: browser.get(page_url) time.sleep(10) print(browser.find_element_by_class_name("ui_page_next").text) browser.execute_script("window.scrollTo(0, document.body.scrollHeight);") time.sleep(3) browser.find_element_by_xpath('//div[@class="qui-popup-closeIcon"]').click() time.sleep(3) browser.find_element_by_class_name("ui_page_next").click() time.sleep(10) finally: browser.close() def save_csv(list_data): with open('reviews_qyer.csv', "a") as csv_file: writer = csv.writer(csv_file, delimiter=';', quotechar='"', quoting=csv.QUOTE_ALL) writer.writerow(list_data) csv_file.close() def save_bytes(page): f = open('test.html', 'wb') f.write(page) f.close() def main(start_url): next_page_urls.add(start_url) get_next_page_urls(start_url) print('all next page urls') print(next_page_urls) for next_page_url in next_page_urls: get_url_xpath(next_page_url) page_urls.add(start_url) for page_url in page_urls: get_items(page_url) print(reviews) if __name__ == '__main__': start_url = 'http://place.qyer.com/vancouver/food/?page=68' start_url = 'http://place.qyer.com/poi/V2EJalFiBz9TZg/' ##温哥华渔人码头 30 reviews 3 review pages get_items(start_url)
yuantw/DataCollecting
spider/SpiderQYer.py
Python
mit
6,919
<?php namespace App\Controllers; use CodeIgniter\RESTful\ResourceController; class Photos extends ResourceController { protected $modelName = 'App\Models\Photos'; protected $format = 'json'; public function index() { return $this->respond($this->model->findAll()); } // ... }
kenjis/CodeIgniter4
user_guide_src/source/incoming/restful/007.php
PHP
mit
316
![alt tag](http://i.imgur.com/middQ05.png) A file browser control for C# #Appearance ![alt tag](http://i.imgur.com/VJJudhB.png) #Usage ```csharp private void Form1_Load(object sender, EventArgs e) { folderBrowser2.ListDirectory(Environment.GetFolderPath(Environment.SpecialFolder.Desktop)); folderBrowser2.treeView1.AfterSelect += (object sE, TreeViewEventArgs eA) => { if (((FolderFileNode)folderBrowser2.treeView1.SelectedNode).isFile) { MessageBox.Show(((FolderFileNode)folderBrowser2.treeView1.SelectedNode).Path); } }; } ```
gregyjames/FileBrowser
README.md
Markdown
mit
578
<header id="toolbar" class="paper-layout-header mdl-layout__header mdl-layout__header--waterfall"> <!-- Top row, always visible --> <div class="mdl-layout__header-row"> <!-- Title --> <span class="mdl-layout-title">{{ site.title }}</span> <div class="mdl-layout-spacer"></div> <div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable mdl-textfield--floating-label mdl-textfield--align-right"> <label class="mdl-button mdl-js-button mdl-button--icon" for="search-input"> <i class="material-icons">search</i> </label> <div class="mdl-textfield__expandable-holder"> <input class="mdl-textfield__input" type="text" name="sample" id="search-input" /> </div> </div> <ul id="search-results"> <li class="mdl-menu__item" disabled>Search results</li> </ul> </div> <!-- Bottom row, not visible on scroll --> <div class="mdl-layout__header-row"> <div class="paper-avatar"> <img src="https://www.gravatar.com/avatar/{{ site.email_md5 }}?size=75"/> </div> <div class="mdl-layout-spacer"></div> <!-- Navigation --> <nav class="mdl-navigation"> <a class="mdl-navigation__link" href="{{ site.url }}{{ "/" }}">Home</a> {% for page in site.pages %} {% if page.title %} <a class="mdl-navigation__link" href="{{ page.url | replace_first: '/', '' | prepend: "/" | prepend: site.url }}">{{ page.title }}</a> {% endif %} {% endfor %} </nav> </div> </header> <div class="paper-drawer mdl-layout__drawer mdl-color--{{site.drawer.header_color}}"> <header class="paper-drawer-header"> <img class="avatar" src="https://www.gravatar.com/avatar/{{ site.email_md5 }}"/> <span class="paper-drawer-title">{{ site.title }}</span> </header> <nav class="paper-navigation mdl-navigation mdl-color--{{site.drawer.navigation_color}} mdl-color-text--{{site.drawer.text_color}}"> <a class="mdl-navigation__link" href="{{ site.url }}{{ "/" }}"> <i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">home</i> Home </a> {% for page in site.pages %} {% if page.title %} <a class="mdl-navigation__link" href="{{ page.url | replace_first: '/', '' | prepend: "/" | prepend: site.url }}"> {% if page.icon %} <i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">{{ page.icon }}</i> {% endif %} {{ page.title }} </a> {% endif %} {% endfor %} <div class="mdl-layout-spacer"></div> <a class="mdl-navigation__link" href="https://github.com/dbtek/paper"> <i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">help_outline</i> On Jekyll with Paper Theme </a> </nav> </div>
cwilko/cwilko.github.io
_includes/header.html
HTML
mit
2,833
MACHINE= $(shell uname -s) ifeq ($(MACHINE),Darwin) GFLAGS= -lsdl2 -lsdl2_image else GFLAGS= -lSDL2 -lSDL2_image endif CC= g++ CFLAGS = -std=c++11 -Wall -ggdb LD= g++ LDFLAGS= -L. -ggdb AR= ar ARFLAGS= rcs piece1= pawn piece2= knight piece3= bishop piece4= rook piece5= king piece6= queen board= board main= main game= game comp= AI piece= piece TARGETS= chess CMD= runchess.out all: $(TARGETS) cmd: $(CMD) chess: LTexture.o chessboard.o chesslib.a @echo "Linking $@..." @$(LD) $(LDFLAGS) $(GFLAGS) -o $@ $^ LTexture.o: LTexture.cpp LTexture.h @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< chessboard.o: chessboard.cpp @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< chesslib.a: $(piece1).o $(piece2).o $(piece3).o $(piece4).o $(piece5).o $(piece6).o $(game).o $(piece).o $(board).o $(comp).o @echo "Linking $@..." @$(AR) $(ARFLAGS) $@ $^ runchess.out: $(piece1).o $(piece2).o $(piece3).o $(piece4).o $(piece5).o $(piece6).o $(main).o $(game).o $(piece).o $(board).o $(comp).o @echo "Linking $@..." @$(LD) $(LDFLAGS) -o $@ $^ $(main).o: $(main).cpp @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< $(game).o: $(game).cpp $(game).h @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< $(board).o: $(board).cpp $(board).h @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< $(comp).o: $(comp).cpp $(comp).h @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< $(piece1).o: $(piece1).cpp $(piece1).h @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< $(piece2).o: $(piece2).cpp $(piece2).h @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< $(piece3).o: $(piece3).cpp $(piece3).h @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< $(piece4).o: $(piece4).cpp $(piece4).h @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< $(piece5).o: $(piece5).cpp $(piece5).h @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< $(piece6).o: $(piece6).cpp $(piece6).h @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< $(piece).o: $(piece).cpp $(piece).h @echo "Compiling $@..." @$(CC) $(CFLAGS) -c -o $@ $< clean: @echo "Cleaning..." @rm *.a @rm *.o @rm $(TARGETS) cleancmd: @echo "Cleaning CMD Program..." @rm *.o @rm runchess.out
mylekiller/ConesOfDunshire
Makefile
Makefile
mit
2,205
module.exports = (app) => { // Enable CORS app.use(function(req, res, next) { res.header("Access-Control-Allow-Origin", "*") res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept") next() }) }
junthehacker/LightningChat
middlewares/cors.js
JavaScript
mit
254
/** * Created by ds on 18/12/15. */ /* * This is a modified version of multilayerlayout3d * https://github.com/DennisSchwartz/multilayerlayout3d * * This is a multilayer layout for ngraph.three (https://github.com/anvaka/ngraph.three). * It is adapted from ngraph.forcelayout3d (https://github.com/anvaka/ngraph.forcelayout3d). * * Copyright (c) 2015, Dennis Schwartz * Licensed under the MIT license. */ 'use strict'; /** * Module Dependencies */ //module.exports = createLayout; //module.exports.simulator = require('ngraph.physics.simulator'); var eventify = require('ngraph.events'); var Defaults = require('./defaults'); var R = require('ramda'); var Options = { interLayerDistance: 100 }; /* * Public Methods */ function createIndependentMultilayerLayout(network, state) { if (!network) { throw new Error('Graph structure cannot be undefined'); } // Update Options file according to input //if (options) { // for (var key in options) { // if (options.hasOwnProperty(key)) { // Options[key] = options[key]; // console.log(key + ': ' + Options[key]); // } // } //} var V = network.nodes; var edges = network.edges; var nodes = network.nodelayers; var layers = network.layers; var elements = network.elements; console.log("setting ILD to:" + state.interLayerDistance); Options.interLayerDistance = state.interLayerDistance; console.log("Result: " + Options.interLayerDistance); /** * Create one simulator for each layer */ var createSimulator = require('ngraph.physics.simulator'); var physicsSimulators = []; for (var i=0;i<layers.length;i++) { physicsSimulators[i] = createSimulator(state.physicsSettings || Defaults.physicsSettings); } var interLayerDistance = state.interLayerDistance; var nodeBodies = typeof Object.create === 'function' ? Object.create(null) : {}; var springs = {}; /** * For each layer, create bodies from nodes add the bodies to the corresponding simulator */ initLayers(); listenToEvents(); var api = { /** * Do one step of iterative layout calculation * Return true is the current layout is stable */ step: function() { var stable = []; for (var i=0;i<physicsSimulators.length; i++) { stable.push(physicsSimulators[i].step()); } // Check if all simulators are stable //console.log(stable); for (i=0;i<stable.length;i++) { if (!stable[i]) { return false } } return true; }, /** * This will return the current position for each node * @param node * @returns {Vector3d} */ getNodePosition: function (node) { var nodeId = node.data['id']; var layer = getLayer(nodeId); var body = getInitializedBody(nodeId); //console.log("bOdy before pos.z: " + body.pos); body.pos.z = layer * interLayerDistance; return body.pos; }, /** * Sets position of a node to a given coordinates * @param {string} nodeId node identifier * @param {number} x position of a node * @param {number} y position of a node * @param {number=} z position of node (only if applicable to body) */ setNodePosition: function (nodeId) { var body = getInitializedBody(nodeId); body.setPosition.apply(body, Array.prototype.slice.call(arguments, 1)); }, /** * @returns {Object} Link position by link id * @returns {Object.from} {x, y} coordinates of link start * @returns {Object.to} {x, y} coordinates of link end */ getLinkPosition: function (linkId) { var spring = springs[linkId]; if (spring) { return { from: spring.from.pos, to: spring.to.pos }; } }, /** * @returns {Object} area required to fit in the graph. Object contains * `x1`, `y1` - top left coordinates * `x2`, `y2` - bottom right coordinates */ getGraphRect: function () { var boxes = []; for (var i=0;i<physicsSimulators.length; i++) { boxes.push(physicsSimulators[i].getBBox()); } var maxX1 = Math.max.apply(Math,boxes.map(function(o){return o.x1;})); var maxY1 = Math.max.apply(Math,boxes.map(function(o){return o.y1;})); var maxX2 = Math.max.apply(Math,boxes.map(function(o){return o.x2;})); var maxY2 = Math.max.apply(Math,boxes.map(function(o){return o.y2;})); return {x1: maxX1, y1: maxY1, x2: maxX2, y2: maxY2, z1: 0, z2: graph.get('layers').length * interLayerDistance + 15}; }, getGraphWidth: function () { var boxes = []; var box; var max = 0; var t; for (var i=0;i<physicsSimulators.length; i++) { box = physicsSimulators[i].getBBox(); t = Math.max(Math.abs(box.x1 - box.x2), Math.abs(box.y1 - box.y2)); if (t > max) max = t; } return max; }, /* * Requests layout algorithm to pin/unpin node to its current position * Pinned nodes should not be affected by layout algorithm and always * remain at their position */ pinNode: function (node, isPinned) { var body = getInitializedBody(node.id); body.isPinned = !!isPinned; }, /** * Checks whether given graph's node is currently pinned */ isNodePinned: function (node) { return getInitializedBody(node.id).isPinned; }, /** * Request to release all resources */ dispose: function() { //graph.off('changed', onGraphChanged); for (var i=0;i<physicsSimulators.length; i++) { physicsSimulators[i].off('stable', onStableChanged); } }, /** * Sets the inter layer distance */ setInterLayerDistance: function (dist) { interLayerDistance = dist; }, /** * Gets physical body for a given node id. If node is not found undefined * value is returned. */ getBody: getBody, getSettings: function () { return state.physicsSettings || Defaults.physicsSettings; }, /** * Gets spring for a given edge. * * @param {string} linkId link identifer. If two arguments are passed then * this argument is treated as formNodeId * @param {string=} toId when defined this parameter denotes head of the link * and first argument is trated as tail of the link (fromId) */ getSpring: getSpring, /** * [Read only] Gets current physics simulator */ simulator: {}, /** * Update physics settings */ updatePhysics: updatePhysics, makeStable: function () { onStableChanged(true); }, nodeUIBuilder: Defaults.nodeUIBuilder, linkUIBuilder: Defaults.linkUIBuilder, nodeRenderer: Defaults.nodeRenderer }; eventify(api); return api; function listenToEvents() { //network.on('changed', onGraphChanged); for (var i=0;i<physicsSimulators.length;i++) { physicsSimulators[i].on('stable', onStableChanged); } //physicsSimulators[0].on('stable', onStableChanged); } function onStableChanged(isStable) { console.log('Stable has changed!'); api.fire('stable', isStable); } function onGraphChanged(changes) { for (var i = 0; i < changes.length; ++i) { var change = changes[i]; if (change.changeType === 'add') { if (change.node) { initBody(change.node.id); } if (change.link) { initLink(change.link); } } else if (change.changeType === 'remove') { if (change.node) { releaseNode(change.node); } if (change.link) { releaseLink(change.link); } } } } function getSpring(fromId, toId) { var linkId; if (toId === undefined) { if (typeof fromId !== 'object') { // assume fromId as a linkId: linkId = fromId; } else { // assume fromId to be a link object: linkId = fromId.id; } } else { // toId is defined, should grab link: console.log(fromId, toId); var link = graph.get('edges').get(fromId + '-' + toId); if (!link) return; linkId = link.id; } console.log("Hello I'm here as well!"); return springs[linkId]; } function getLayer(nodeId) { var node = elements['nl' + nodeId]; var layerIDs = R.map(function (i) { return i.data['id'] }, layers); return layerIDs.indexOf('l' + node.data['layer']); // Return the index of the layer of node } function initLayers() { nodes.forEach(function (node) { var layer = getLayer(node.data.id); initBody(node.data.id, layer); }); edges.forEach(initLink); } function initBody(nodeId, layer) { var body = nodeBodies[nodeId]; if (!body) { var node = elements['nl' + nodeId]; if (!node) { throw new Error('initBody() was called with unknown node id'); } } var pos = node.position; if (!pos) { var neighbors = getNeighborBodies(node); pos = physicsSimulators[layer].getBestNewBodyPosition(neighbors); } body = physicsSimulators[layer].addBodyAt(pos); nodeBodies['nl' + nodeId] = body; updateBodyMass('nl' + nodeId); // // //if (isNodeOriginallyPinned(node)) { // body.isPinned = true; //} //TODO: Does this work?? } function getBody(nodeId) { return nodeBodies[nodeId]; } function releaseNode(node) { var nodeId = node.id; var body = nodeBodies[nodeId]; if (body) { nodeBodies[nodeId] = null; delete nodeBodies[nodeId]; physicsSimulator.removeBody(body); //TODO: update for multilayer layout } } function initLink(link) { updateBodyMass(link.data['source']); updateBodyMass(link.data['target']); // Only add springs for intra-layer links var fromLayer = elements[link.data['source']].data['layer']; var toLayer = elements[link.data['target']].data['layer']; var layerIndex = getLayer(link.data['source'].substring(2)); if ( toLayer === fromLayer ) { var fromBody = nodeBodies[link.data['source']], toBody = nodeBodies[link.data['target']], spring = physicsSimulators[layerIndex].addSpring(fromBody, toBody); noop(link, spring); springs[link.id] = spring; } } function releaseLink(link) { var spring = springs[link.get('id')]; if (spring) { var from = graph.get('nodes').get(link.fromId), to = graph.get('nodes').get(link.toId); if (from) updateBodyMass(from.get('id')); if (to) updateBodyMass(to.get('id')); delete springs[link.get('id')]; physicsSimulator.removeSpring(spring); } } /** * Checks whether graph node has in its settings pinned attribute, * which means layout algorithm cannot move it. Node can be preconfigured * as pinned, if it has "isPinned" attribute, or when node.data has it. * * @param {Object} node a graph node to check * @return {Boolean} true if node should be treated as pinned; false otherwise. */ //function isNodeOriginallyPinned(node) { // return (node && (node.isPinned || (node.data && node.data.isPinned))); //} // function getInitializedBody(nodeId) { var body = nodeBodies['nl' + nodeId]; if (!body) { initBody(nodeId); body = nodeBodies[nodeId]; } return body; } function getNeighborBodies(node, layer) { // set maxNeighbors to min of 2 or number of intra-layer(!) links var neighbors = []; if (!node.links) { return neighbors; } var sameLayerLinks = getSameLayerLinks(node,layer); var maxNeighbors = Math.min(sameLayerLinks.length, 2); for (var i=0;i<maxNeighbors; i++) { var link = sameLayerLinks[i]; var otherBody = link.get('source') !== node.get('id') ? nodeBodies[link.get('source')] : nodeBodies[link.get('target')]; if (otherBody && otherBody.pos) { neighbors.push(otherBody); } } return neighbors; } function getSameLayerLinks(node, layer) { var res = []; var n1, n2; for (var i=0;i<node.links.length;i++) { n1 = graph.get('nodes').get(node.links[i].get('target')); n2 = graph.getNode(node.links[i].get('source')); if (checkLinkLayer(n1, n2, layer) ) { res[i] = node.links[i]; } } return res; } function checkLinkLayer(node1, node2, layer) { return node1.get('layer').get('id') == layer && node2.get('layer').get('id') == layer; } function updateBodyMass(nodeId) { //console.log(nodeId.substring(2)); var body = nodeBodies[nodeId]; body.mass = nodeMass(nodeId); } /** * Calculates mass of a body, which corresponds to node with given id. * * @param {String|Number} nodeId identifier of a node, for which body mass needs to be calculated * @returns {Number} recommended mass of the body; */ function nodeMass(nodeId) { var id = 'nl' + nodeId; var mass = 0; for (var i=0; i < edges.length; i++) { var to = edges[i].data['target']; var from = edges[i].data['source']; if (to === id || from === id) mass++; } if (mass === 0) return 1; return 1 + mass / 4.0; } function getSettings() { return Defaults.physicsSettings; } function updatePhysics(settings) { for (key in settings) { if (settings.hasOwnProperty(key)) { for (var i = 0; i < physicsSimulators.length; i++) { if (physicsSimulators[i][key]) { physicsSimulators[i][key](settings[key]); } } } } for (i = 0; i < physicsSimulators.length; i++) { physicsSimulators[i].fire('stable', false); physicsSimulators[i].step(); } } } /** * Private Methods */ function noop() { } var _ = require('lodash'); function createConnectedMultilayerLayout(network, state) { var createSimulator = require('ngraph.physics.simulator'); var physicsSimulator = createSimulator(state.physicsSettings); var bodies = typeof Object.create === 'function' ? Object.create(null) : {}; var springs = {}; var positions = {}; var V = network.nodes; var edges = network.edges; var nodes = network.nodelayers; var elements = network.elements; console.log("setting ILD to:" + state.interLayerDistance); Options.interLayerDistance = state.interLayerDistance; console.log("Result: " + Options.interLayerDistance); // Aggregate network var aggEdges = []; for ( var i=0; i < V.length; i++ ) { initBody(V[i]); } //V.each(function (v) { // // Give simulated nodes to physics simulator // initBody(v); //}); ////V.each(function (v) { //for ( i=0; i < V.length; i++) { // // Get all edges from current v // var current = edges.byV(v.get('id'), network); // // create edges if not existing yet // current.each(function (e) { // var from = network.get('nodes').get(e.get('source')).get('node').get('id'); // var to = network.get('nodes').get(e.get('target')).get('node').get('id'); // var edge = { // id: from + '-' + to, // from: from, // to: to // }; // if (!_.includes(_.pluck(aggEdges, 'id'), edge.id) && to !== from) { // aggEdges.push(edge); // initLink(edge); // } // }) //} // Get all edges from v // create edges for aggregated network //var getGrp = function (grp, network) { // return Object.keys(network).filter(function (el) { // return network[el].group === grp; // }) //}; //console.log(elements); // //for ( i=0; i < V.length; i++ ) { // // Get all edges from this V that are not part of the aggregate elements yet // var currentEdges = R.filter(function (e) { // // Is it in the agg elements yet? // var inAgg = !R.contains(e.id, R.pluck('id', aggEdges)); // //console.log("Test: " + JSON.stringify(elements['n' + elements[e.data.source].data['node']].data['id']) + ", " + JSON.stringify(V[i].data['id'])); // var nodeInSource = elements['n' + elements[e.data.source].data['node']].data['id']; // var nodeInTarget = elements['n' + elements[e.data.target].data['node']].data['id']; // return nodeInSource === V[i].data['id'] && inAgg && nodeInSource !== nodeInTarget; // }, edges); // for ( var j=0; j < currentEdges.length; j++ ) { // var edge = currentEdges[j]; // var from = elements['n' + elements[edge.data.source].data['node']].data['id']; // var to = elements['n' + elements[edge.data.target].data['node']].data['id']; // var newEdge = { // id: from + '-' + to, // from: from, // to: to // }; // aggEdges.push(newEdge); // initLink(newEdge); // } //} // Iterate edges // Create new edge from nodes (V) if it does not exist var agg2 = {}; edges.forEach(function (edge) { var sourceNodeLayer = elements[edge.data['source']]; var targetNodeLayer = elements[edge.data['target']]; var sourceNode = elements['n' + sourceNodeLayer.data['node']].data['id']; var targetNode = elements['n' + targetNodeLayer.data['node']].data['id']; var aggEdgeID = sourceNode + '-' + targetNode; var newEdge = { id: sourceNode + '-' + targetNode, from: sourceNode, to: targetNode }; if ( !agg2.hasOwnProperty(aggEdgeID) ) { agg2[aggEdgeID] = edge; initLink(newEdge); } }); // Go through node-layers and add positions //network.get('nodes').each(function (n) { // var id = n.get('node').get('id'); // var pos = bodies[id].pos; // var z = network.get('layers').indexOf(n.get('layer')) * interLayerDistance; // positions[id] = { pos: pos, z: z }; //}); for ( i=0; i < nodes.length; i++ ) { var id = 'n' + nodes[i].data['node']; var pos = bodies[id].pos; var layers = R.map(function (i) { return i.data['id'] }, network.layers); var z = layers.indexOf('l' + nodes[i].data['layer']) * Options.interLayerDistance; elements['nl' + nodes[i].data.id].z = z; } initEvents(); var api = { step: function () { return physicsSimulator.step(); }, getPositions: function () { return positions; }, getNodePosition: function (node) { var id = 'n' + node.data['node']; return bodies[id].pos; }, setInterLayerDistance: function ( dist ) { Options.interLayerDistance = dist; }, updatePhysics: updatePhysics, linkUIBuilder: Defaults.linkUIBuilder, nodeUIBuilder: Defaults.nodeUIBuilder, nodeRenderer: function (node) { node.ui.position.x = node.position.x; node.ui.position.y = node.position.y; node.ui.position.z = node.z; }, linkRenderer: function (ui) { var ui1 = nodeUIs[ui.from.substring(2)]; // TODO: Fix IDs!! var ui2 = nodeUIs[ui.to.substring(2)]; var from = ui1.pos; var to = ui2.pos; ui.geometry.vertices[0].set(from.x, from.y, ui1.z); ui.geometry.vertices[1].set(to.x, to.y, ui2.z); ui.geometry.verticesNeedUpdate = true; }, getSettings: getSettings, resetStable: function () { physicsSimulator.fire('stable', false); physicsSimulator.step(); } }; eventify(api); return api; function initEvents() { physicsSimulator.on('stable', function ( stable ) { console.log( 'PS fired stable! ' + stable ); api.fire( 'stable', stable ); }); } // After each step, transfer positions?? function initBody(node) { var id = node.data['id'];//get('id'); var body = bodies[id]; if (!body) { var neighbors = getNeighborBodies(node); var position = physicsSimulator.getBestNewBodyPosition(neighbors); body = physicsSimulator.addBodyAt(position); bodies[id] = body; updateBodyMass(id); } } function initLink(edge) { var spring = springs[edge.id]; if (!spring) { updateBodyMass(edge.from); updateBodyMass(edge.to); spring = physicsSimulator.addSpring(bodies[edge.from], bodies[edge.to]); springs[edge.id] = spring; } } function getNeighborBodies(node) { var id = node.id;//get('id'); var neighbors = []; // Go through links of node // Get aggEdges with node.id in to or from var links = _.filter(aggEdges, function (e) { return e.to === id || e.from === id; }); var maxN = Math.min(links.length, 2); for (var i=0;i<maxN;i++) { var link = links[i]; var otherBody = link.from !== id ? bodies[link.from] : bodies[link.to]; neighbors.push(otherBody); } return neighbors; } function getSettings() { return state.physicsSettings || Defaults.physicsSettings; } function updateBodyMass(nodeId) { var body = bodies[nodeId]; body.mass = nodeMass(nodeId); } /** * Calculates mass of a body, which corresponds to node with given id. * * @param {String|Number} nodeId identifier of a node, for which body mass needs to be calculated * @returns {Number} recommended mass of the body; */ function nodeMass(nodeId) { var links = Object.keys(network).filter(function (el) { return el !== "get" && network[el].group === 'edges' && (network[el].data.source === nodeId || network[el].data.target === nodeId); }); //var links = network.get('edges').byNode(network.get('nodes').get(nodeId)); if (!links) return 1; return 1 + links.length / 4.0; } function updatePhysics( settings ) { for (var key in settings) { if (settings.hasOwnProperty(key)) { physicsSimulator.settings[key] = settings[key]; } } physicsSimulator.fire('stable', false); physicsSimulator.step(); } } function createManualLayout( network, settings ) { //var elements = network.elements; //// Set dummy position for each element for testing // //var max = 150; //var min = -150; //network.nodelayers.forEach(function (n) { // var nl = elements['nl' + n.data.id]; // nl.position = {}; // nl.position.x = Math.floor(Math.random() * (max - min + 1)) + min; // nl.position.y = Math.floor(Math.random() * (max - min + 1)) + min; // nl.position.z = Math.floor(Math.random() * (max - min + 1)) + min; //}); return { step: function () { return true; }, getNodePosition: function (node) { //console.log("Hallo!" + JSON.stringify(node)); var id = 'nl' + node.data['node']; return node.position;//network.nodelayers[id].position; }, nodeUIBuilder: Defaults.nodeUIBuilder, linkUIBuilder: Defaults.linkUIBuilder, nodeRenderer: Defaults.nodeRenderer, linkRenderer: Defaults.linkRenderer, setInterLayerDistance: noop, updatePhysics: noop, resetStable: noop }; } var exports = {}; exports.independentMultilayer = createIndependentMultilayerLayout; exports.connectedMultilayer = createConnectedMultilayerLayout; exports.manual = createManualLayout; module.exports = exports;
DennisSchwartz/biojs-vis-munavi
lib/layouts.js
JavaScript
mit
25,765
using System.Data; using Moq; #if NET40 namespace CodeOnlyTests.Net40.StoredProcedureParameters #else namespace CodeOnlyTests.StoredProcedureParameters #endif { public class ParameterTestBase { protected IDbCommand CreateCommand() { var cmd = new Mock<IDbCommand>(); cmd.Setup(c => c.CreateParameter()) .Returns(() => { var p = new Mock<IDbDataParameter>(); p.SetupAllProperties(); return p.Object; }); return cmd.Object; } } }
abe545/CodeOnlyStoredProcedures
CodeOnlyTests/StoredProcedureParameters/ParameterTestBase.cs
C#
mit
608
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Component} from '@angular/core'; @Component({ moduleId: module.id, templateUrl: 'table-demo-page.html', }) export class TableDemoPage { links = [ {name: 'Main Page', link: 'main-demo'}, {name: 'Custom Table', link: 'custom-table'}, {name: 'Direct Data', link: 'data-input-table'}, {name: 'Native Table', link: 'native-table'}, ]; }
tinayuangao/material2
src/demo-app/table/table-demo-page.ts
TypeScript
mit
568
<head> <title>Todo List</title> </head> <body> <div class="container"> <header> <h1>Todo List</h1> <form class="new-task"> <input type="text" name="text" placeholder="Type to add new tasks" /> </form> </header> <ul> {{#each tasks}} {{> task}} {{/each}} </ul> </div> </body> <template name="task"> <li class="{{#if checked}}checked{{/if}}"> <button class="delete">&times;</button> <input type="checkbox" checked="{{checked}}" class="toggle-checked" /> <span class="text">{{text}}</span> </li> </template>
fortino645/ToDoListMeteor
ToDoListMeteor.html
HTML
mit
599
<?php /* * This file is part of the phlexible package. * * (c) Stephan Wentz <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Phlexible\Bundle\GuiBundle\Menu; /** * Hierarchy builder * * @author Stephan Wentz <[email protected]> */ class HierarchicalSorter { /** * @param MenuItemCollection $items * * @return MenuItemCollection */ public function sort(MenuItemCollection $items) { $filteredItems = $this->filterParent(null, $items); return $filteredItems; } /** * Filter handlers by parent name * * @param string $parent * @param MenuItemCollection $items * * @return MenuItemCollection */ private function filterParent($parent, MenuItemCollection $items) { $filteredItems = new MenuItemCollection(); foreach ($items->getItems() as $name => $item) { if ($parent === $item->getParent()) { $subItems = $this->filterParent($name, $items); if (count($subItems)) { $item->setItems($subItems); } $filteredItems->set($name, $item); $items->remove($name); } } return $filteredItems; } }
temp/phlexible
src/Phlexible/Bundle/GuiBundle/Menu/HierarchicalSorter.php
PHP
mit
1,378
#ifndef windy_game #define windy_game #include <memory> #include <string> #include "nana/gui/widgets/group.hpp" #include "nana/gui/widgets/label.hpp" #include "nana/gui/widgets/listbox.hpp" namespace windy { namespace content { class game : public nana::group { public: game(); void init(); void on_item_selected(const nana::arg_listbox& arg); void add_container(std::shared_ptr<class container> container); void remove_container(std::shared_ptr<class container> container); //@TODO arrange predicate builders void container(const std::string& name); std::shared_ptr<class container> container(); private: nana::place _place; nana::label _label; nana::listbox _content; private: std::shared_ptr<class container> _container; private: std::vector<std::shared_ptr<class container> > _containers; private: std::string _current_item; }; } } #endif
Greentwip/Windy
Windy/include/core/content/game.hpp
C++
mit
911
util.AddNetworkString("nutScannerData") util.AddNetworkString("nutScannerPicture") util.AddNetworkString("nutScannerClearPicture") net.Receive("nutScannerData", function(length, client) if (IsValid(client.nutScn) and client:GetViewEntity() == client.nutScn and (client.nutNextPic or 0) < CurTime()) then local delay = nut.config.get("pictureDelay", 15) client.nutNextPic = CurTime() + delay - 1 local length = net.ReadUInt(16) local data = net.ReadData(length) if (length != #data) then return end local receivers = {} for k, v in ipairs(player.GetAll()) do if (hook.Run("CanPlayerReceiveScan", v, client)) then receivers[#receivers + 1] = v v:EmitSound("npc/overwatch/radiovoice/preparevisualdownload.wav") end end if (#receivers > 0) then net.Start("nutScannerData") net.WriteUInt(#data, 16) net.WriteData(data, #data) net.Send(receivers) if (SCHEMA.addDisplay) then SCHEMA:addDisplay("Prepare to receive visual download...") end end end end) net.Receive("nutScannerPicture", function(length, client) if (not IsValid(client.nutScn)) then return end if (client:GetViewEntity() ~= client.nutScn) then return end if ((client.nutNextFlash or 0) >= CurTime()) then return end client.nutNextFlash = CurTime() + 1 client.nutScn:flash() end)
Chessnut/hl2rp
plugins/scanner/sv_photos.lua
Lua
mit
1,524
<?php /* Unsafe sample input : get the field userData from the variable $_GET via an object SANITIZE : use of preg_replace with another regex construction : use of sprintf via a %s with simple quote */ /*Copyright 2015 Bertrand STIVALET Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.*/ class Input{ public function getInput(){ return $_GET['UserData'] ; } } $temp = new Input(); $tainted = $temp->getInput(); $tainted = preg_replace('/\W/si','',$tainted); $query = sprintf("name='%s'", $tainted); //flaw $ds=ldap_connect("localhost"); $r=ldap_bind($ds); $sr=ldap_search($ds,"o=My Company, c=US", $query); ldap_close($ds); ?>
stivalet/PHP-Vulnerability-test-suite
Injection/CWE_90/unsafe/CWE_90__object-directGet__func_preg_replace2__name-sprintf_%s_simple_quote.php
PHP
mit
1,469
<html> <body> <div class="ui-page"> <div id="t-f39803f7-df02-4169-93eb-7547fb8c961a" class="template growth-both firer commentable" name="Template 1"> <div id="alignmentBox"> <link type="text/css" rel="stylesheet" href="./resources/templates/f39803f7-df02-4169-93eb-7547fb8c961a-1415995219533.css" /> <!--[if IE]><link type="text/css" rel="stylesheet" href="./resources/templates/f39803f7-df02-4169-93eb-7547fb8c961a-1415995219533-ie.css" /><![endif]--> <!--[if lte IE 8]><link type="text/css" rel="stylesheet" href="./resources/templates/f39803f7-df02-4169-93eb-7547fb8c961a-1415995219533-ie8.css" /><![endif]--> </div> <div id="loadMark"></div> </div> <div id="s-d18e853f-3059-4c71-8477-6f8b2528ced7" class="screen growth-vertical firer ie-background commentable" name="SignUp"> <div id="alignmentBox"> <link type="text/css" rel="stylesheet" href="./resources/screens/d18e853f-3059-4c71-8477-6f8b2528ced7-1415995219533.css" /> <!--[if IE]><link type="text/css" rel="stylesheet" href="./resources/screens/d18e853f-3059-4c71-8477-6f8b2528ced7-1415995219533-ie.css" /><![endif]--> <!--[if lte IE 8]><link type="text/css" rel="stylesheet" href="./resources/screens/d18e853f-3059-4c71-8477-6f8b2528ced7-1415995219533-ie8.css" /><![endif]--> <div id="s-Group_56" class="group firer ie-background commentable"> <div id="s-Rich_text_20" class="richtext firer commentable" > <div class="clipping"> <div class="content"> <div class="valign"> <span id="rtr-s-Rich_text_20_0"></span> </div> </div> </div> </div> <div id="s-Label_85" class="label firer click ie-background commentable" ><div class="content"><div class="valign"><span>Brand Logo</span></div></div></div> <div id="s-Group_2" class="group firer ie-background commentable"> <img id="s-Image_33" class="image firer ie-background commentable" alt="image" src="./images/889ad097-625f-4d98-acb6-3da5e1cacb41.png"/> <img id="s-Image_36" class="image firer ie-background commentable" alt="image" src="./images/41d12d10-4256-448d-9c96-76c0daa960ee.png"/> <div id="s-Label_5" class="label firer pageload ie-background commentable" ><div class="content"><div class="valign"><span>4:02 PM</span></div></div></div> <div id="s-Label_6" class="label firer ie-background commentable" ><div class="content"><div class="valign"><span>Carrier</span></div></div></div> </div> </div> <div id="s-Input_5" class="text firer focusin commentable" ><div class="content"><div class="valign"><input type="text" value="Enter username" maxlength="100" tabindex="-1" /></div> </div></div> <div id="s-Rectangle_2" class="pie richtext firer ie-background commentable" > <div class="clipping"> <div class="content"> <div class="valign"> <span id="rtr-s-Rectangle_2_0">Username<br /></span> </div> </div> </div> </div> <div id="s-Input_6" class="text firer focusin commentable" ><div class="content"><div class="valign"><input type="text" value="Enter password" maxlength="100" tabindex="-1" /></div> </div></div> <div id="s-Rectangle_3" class="pie richtext firer ie-background commentable" > <div class="clipping"> <div class="content"> <div class="valign"> <span id="rtr-s-Rectangle_3_0">Password</span> </div> </div> </div> </div> <div id="s-Input_7" class="text firer focusin commentable" ><div class="content"><div class="valign"><input type="text" value="Enter weight in lbs." maxlength="100" tabindex="-1" /></div> </div></div> <div id="s-Rectangle_4" class="pie richtext firer ie-background commentable" > <div class="clipping"> <div class="content"> <div class="valign"> <span id="rtr-s-Rectangle_4_0">My Weight</span> </div> </div> </div> </div> <div id="s-Rectangle_5" class="pie richtext firer ie-background commentable" > <div class="clipping"> <div class="content"> <div class="valign"> <span id="rtr-s-Rectangle_5_0">Photo<br /></span> </div> </div> </div> </div> <div id="s-Input_9" class="text firer focusin commentable" ><div class="content"><div class="valign"><input type="text" value="Enter weight in lbs." maxlength="100" tabindex="-1" /></div> </div></div> <div id="s-Rectangle_6" class="pie richtext firer ie-background commentable" > <div class="clipping"> <div class="content"> <div class="valign"> <span id="rtr-s-Rectangle_6_0">Desired Weight<br /></span> </div> </div> </div> </div> <div id="s-Rectangle_7" class="pie richtext firer click ie-background commentable" > <div class="clipping"> <div class="content"> <div class="valign"> <span id="rtr-s-Rectangle_7_0">Create Account</span> </div> </div> </div> </div> <div id="s-Rectangle_8" class="pie richtext firer click ie-background commentable" > <div class="clipping"> <div class="content"> <div class="valign"> <span id="rtr-s-Rectangle_8_0">Additional Options...</span> </div> </div> </div> </div> <img id="s-Image_1" class="image firer ie-background commentable" alt="image" src="./images/GeneratedCross-28.png"/> <div id="s-Rectangle_9" class="pie richtext firer ie-background commentable" > <div class="clipping"> <div class="content"> <div class="valign"> <span id="rtr-s-Rectangle_9_0">Take a picture<br /></span> </div> </div> </div> </div> <div id="s-Rectangle_10" class="pie richtext firer ie-background commentable" > <div class="clipping"> <div class="content"> <div class="valign"> <span id="rtr-s-Rectangle_10_0">Select a picture</span> </div> </div> </div> </div> </div> <div id="loadMark"></div> </div> </div> </body> </html>
hinsenchan/mobile_fitness_app_mockup
review/screens/d18e853f-3059-4c71-8477-6f8b2528ced7.html
HTML
mit
7,044
<?php namespace JakubZapletal\Component\BankStatement\Tests\Parser; class XMLParserTest extends \PHPUnit_Framework_TestCase { /** * @var string */ protected $parserClassName = '\JakubZapletal\Component\BankStatement\Parser\XMLParser'; public function testParseFile() { $content = 'test'; $fileObject = new \SplFileObject(tempnam(sys_get_temp_dir(), 'test_'), 'w+'); $fileObject->fwrite($content); $parserMock = $this->getMockForAbstractClass( $this->parserClassName, array(), '', true, true, true, array('parseContent') ); $parserMock ->expects($this->once()) ->method('parseContent') ->with($this->equalTo($content)) ->will($this->returnArgument(0)) ; $this->assertSame( $content, $parserMock->parseFile($fileObject->getRealPath()) ); } /** * @expectedException \InvalidArgumentException */ public function testParseFileException() { $parserMock = $this->getMockForAbstractClass($this->parserClassName); $parserMock->parseFile('test.file'); } public function testParseContent() { $content = 'test'; $crawlerMock = $this->getMock('\Symfony\Component\DomCrawler\Crawler'); $crawlerMock ->expects($this->once()) ->method('addXmlContent') ->with($this->equalTo($content)) ->will($this->returnValue(0)) ; $parserMock = $this->getMockForAbstractClass( $this->parserClassName, array(), '', true, true, true, array('getCrawlerClass') ); $parserMock ->expects($this->once()) ->method('getCrawlerClass') ->will($this->returnValue($crawlerMock)) ; $parserMock ->expects($this->once()) ->method('parseCrawler') ->with($this->equalTo($crawlerMock)) ->will($this->returnValue($content)) ; $this->assertEquals( $content, $parserMock->parseContent($content) ); } /** * @expectedException \InvalidArgumentException */ public function testParseContentExceptionNotString() { $parserMock = $this->getMockForAbstractClass($this->parserClassName); $parserMock->parseContent(123); } public function testGetCrawlerClass() { $parserMock = $this->getMockForAbstractClass($this->parserClassName); $reflectionParser = new \ReflectionClass($parserMock); $method = $reflectionParser->getMethod('getCrawlerClass'); $method->setAccessible(true); $this->assertInstanceOf( '\Symfony\Component\DomCrawler\Crawler', $method->invoke($parserMock) ); } }
jakubzapletal/bank-statements
Tests/Parser/XMLParserTest.php
PHP
mit
3,006
<?php namespace Oro\Bundle\ImportExportBundle\Serializer; use Doctrine\Common\Collections\Collection; use Symfony\Component\Serializer\Exception\RuntimeException; use Symfony\Component\Serializer\Serializer as BaseSerializer; use Symfony\Component\Serializer\Exception\UnexpectedValueException; use Symfony\Component\Serializer\Exception\LogicException; use Oro\Bundle\ImportExportBundle\Serializer\Normalizer\DenormalizerInterface; use Oro\Bundle\ImportExportBundle\Serializer\Normalizer\NormalizerInterface; class Serializer extends BaseSerializer implements DenormalizerInterface, NormalizerInterface { const PROCESSOR_ALIAS_KEY = 'processorAlias'; /** * {@inheritdoc} */ public function normalize($data, $format = null, array $context = array()) { if (null === $data || is_scalar($data)) { return $data; } elseif (is_object($data) && $this->supportsNormalization($data, $format)) { $this->cleanCacheIfDataIsCollection($data, $format, $context); return $this->normalizeObject($data, $format, $context); } elseif ($data instanceof \Traversable) { $normalized = array(); foreach ($data as $key => $val) { $normalized[$key] = $this->normalize($val, $format, $context); } return $normalized; } elseif (is_array($data)) { foreach ($data as $key => $val) { $data[$key] = $this->normalize($val, $format, $context); } return $data; } throw new UnexpectedValueException( sprintf('An unexpected value could not be normalized: %s', var_export($data, true)) ); } /** * {@inheritdoc} */ public function denormalize($data, $type, $format = null, array $context = []) { if (!$this->normalizers) { throw new LogicException('You must register at least one normalizer to be able to denormalize objects.'); } $cacheKey = $this->getCacheKey($type, $format, $context); if (isset($this->denormalizerCache[$cacheKey])) { return $this->denormalizerCache[$cacheKey]->denormalize($data, $type, $format, $context); } foreach ($this->normalizers as $normalizer) { if ($normalizer instanceof DenormalizerInterface && $normalizer->supportsDenormalization($data, $type, $format, $context)) { $this->denormalizerCache[$cacheKey] = $normalizer; return $normalizer->denormalize($data, $type, $format, $context); } } throw new UnexpectedValueException( sprintf('Could not denormalize object of type %s, no supporting normalizer found.', $type) ); } /** * {@inheritdoc} */ public function supportsNormalization($data, $format = null, array $context = array()) { try { $this->getNormalizer($data, $format, $context); } catch (RuntimeException $e) { return false; } return true; } /** * {@inheritdoc} */ public function supportsDenormalization($data, $type, $format = null, array $context = array()) { try { $this->getDenormalizer($data, $type, $format, $context); } catch (RuntimeException $e) { return false; } return true; } /** * @param string $type * @param string $format * @param array $context * * @return string */ protected function getCacheKey($type, $format, array $context) { return md5($type . $format . $this->getProcessorAlias($context)); } /** * @param array $context * * @return string */ protected function getProcessorAlias(array $context) { return !empty($context[self::PROCESSOR_ALIAS_KEY]) ? $context[self::PROCESSOR_ALIAS_KEY] : ''; } /** * @param object $data * @param string $format * @param array $context */ protected function cleanCacheIfDataIsCollection($data, $format, $context) { if ($data instanceof Collection) { $cacheKey = $this->getCacheKey(get_class($data), $format, $context); // Clear cache of normalizer for collections, // because of wrong behaviour when selecting normalizer for collections of elements with different types unset($this->normalizerCache[$cacheKey]); } } /** * {@inheritdoc} */ private function normalizeObject($object, $format = null, array $context = array()) { if (!$this->normalizers) { throw new LogicException('You must register at least one normalizer to be able to normalize objects.'); } $class = get_class($object); $cacheKey = $this->getCacheKey($class, $format, $context); if (isset($this->normalizerCache[$cacheKey])) { return $this->normalizerCache[$cacheKey]->normalize($object, $format, $context); } foreach ($this->normalizers as $normalizer) { if ($normalizer instanceof NormalizerInterface && $normalizer->supportsNormalization($object, $format)) { $this->normalizerCache[$cacheKey] = $normalizer; return $normalizer->normalize($object, $format, $context); } } throw new UnexpectedValueException( sprintf('Could not normalize object of type %s, no supporting normalizer found.', $class) ); } /** * {@inheritdoc} */ private function getNormalizer($data, $format = null, array $context = array()) { foreach ($this->normalizers as $normalizer) { if (!$normalizer instanceof NormalizerInterface) { continue; } /** @var NormalizerInterface $normalizer */ $supportsNormalization = $normalizer->supportsNormalization($data, $format, $context); if ($supportsNormalization) { return $normalizer; } } throw new RuntimeException(sprintf('No normalizer found for format "%s".', $format)); } /** * {@inheritdoc} */ private function getDenormalizer($data, $type, $format = null, array $context = array()) { foreach ($this->normalizers as $normalizer) { if (!$normalizer instanceof DenormalizerInterface) { continue; } /** @var DenormalizerInterface $normalizer */ $supportsDenormalization = $normalizer->supportsDenormalization( $data, $type, $format, $context ); if ($supportsDenormalization) { return $normalizer; } } throw new RuntimeException(sprintf('No denormalizer found for format "%s".', $format)); } }
MarkThink/OROCRM
vendor/oro/platform/src/Oro/Bundle/ImportExportBundle/Serializer/Serializer.php
PHP
mit
7,018
def new2(): print("This is the new file in the master branch" )
himicakumar/cs3240-labdemo
new2.py
Python
mit
66
<?php namespace gossi\swagger\parts; use phootwork\collection\Map; use phootwork\collection\Set; trait ProducesPart { private $produces; private function parseProduces(Map $data) { $this->produces = $data->get('produces', new Set()); } /** * Return produces * * @return Set */ public function getProduces() { return $this->produces; } }
gossi/swagger
src/parts/ProducesPart.php
PHP
mit
361
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { localize } from 'vs/nls'; import { Event } from 'vs/base/common/event'; import { IWorkspaceFolder, IWorkspace } from 'vs/platform/workspace/common/workspace'; import { URI } from 'vs/base/common/uri'; export const IWorkspacesMainService = createDecorator<IWorkspacesMainService>('workspacesMainService'); export const IWorkspacesService = createDecorator<IWorkspacesService>('workspacesService'); export const WORKSPACE_EXTENSION = 'code-workspace'; export const WORKSPACE_FILTER = [{ name: localize('codeWorkspace', "Code Workspace"), extensions: [WORKSPACE_EXTENSION] }]; export const UNTITLED_WORKSPACE_NAME = 'workspace.json'; /** * A single folder workspace identifier is just the path to the folder. */ export type ISingleFolderWorkspaceIdentifier = URI; export interface IWorkspaceIdentifier { id: string; configPath: string; } export function isStoredWorkspaceFolder(thing: any): thing is IStoredWorkspaceFolder { return isRawFileWorkspaceFolder(thing) || isRawUriWorkspaceFolder(thing); } export function isRawFileWorkspaceFolder(thing: any): thing is IRawFileWorkspaceFolder { return thing && typeof thing === 'object' && typeof thing.path === 'string' && (!thing.name || typeof thing.name === 'string'); } export function isRawUriWorkspaceFolder(thing: any): thing is IRawUriWorkspaceFolder { return thing && typeof thing === 'object' && typeof thing.uri === 'string' && (!thing.name || typeof thing.name === 'string'); } export interface IRawFileWorkspaceFolder { path: string; name?: string; } export interface IRawUriWorkspaceFolder { uri: string; name?: string; } export type IStoredWorkspaceFolder = IRawFileWorkspaceFolder | IRawUriWorkspaceFolder; export interface IResolvedWorkspace extends IWorkspaceIdentifier { folders: IWorkspaceFolder[]; } export interface IStoredWorkspace { folders: IStoredWorkspaceFolder[]; } export interface IWorkspaceSavedEvent { workspace: IWorkspaceIdentifier; oldConfigPath: string; } export interface IWorkspaceFolderCreationData { uri: URI; name?: string; } export interface IWorkspacesMainService extends IWorkspacesService { _serviceBrand: any; onUntitledWorkspaceDeleted: Event<IWorkspaceIdentifier>; saveWorkspaceAs(workspace: IWorkspaceIdentifier, target: string): Promise<IWorkspaceIdentifier>; createUntitledWorkspaceSync(folders?: IWorkspaceFolderCreationData[]): IWorkspaceIdentifier; resolveWorkspaceSync(path: string): IResolvedWorkspace | null; isUntitledWorkspace(workspace: IWorkspaceIdentifier): boolean; deleteUntitledWorkspaceSync(workspace: IWorkspaceIdentifier): void; getUntitledWorkspacesSync(): IWorkspaceIdentifier[]; getWorkspaceId(workspacePath: string): string; getWorkspaceIdentifier(workspacePath: URI): IWorkspaceIdentifier; } export interface IWorkspacesService { _serviceBrand: any; createUntitledWorkspace(folders?: IWorkspaceFolderCreationData[]): Promise<IWorkspaceIdentifier>; } export function isSingleFolderWorkspaceIdentifier(obj: any): obj is ISingleFolderWorkspaceIdentifier { return obj instanceof URI; } export function isWorkspaceIdentifier(obj: any): obj is IWorkspaceIdentifier { const workspaceIdentifier = obj as IWorkspaceIdentifier; return workspaceIdentifier && typeof workspaceIdentifier.id === 'string' && typeof workspaceIdentifier.configPath === 'string'; } export function toWorkspaceIdentifier(workspace: IWorkspace): IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined { if (workspace.configuration) { return { configPath: workspace.configuration.fsPath, id: workspace.id }; } if (workspace.folders.length === 1) { return workspace.folders[0].uri; } // Empty workspace return undefined; } export type IMultiFolderWorkspaceInitializationPayload = IWorkspaceIdentifier; export interface ISingleFolderWorkspaceInitializationPayload { id: string; folder: ISingleFolderWorkspaceIdentifier; } export interface IEmptyWorkspaceInitializationPayload { id: string; } export type IWorkspaceInitializationPayload = IMultiFolderWorkspaceInitializationPayload | ISingleFolderWorkspaceInitializationPayload | IEmptyWorkspaceInitializationPayload; export function isSingleFolderWorkspaceInitializationPayload(obj: any): obj is ISingleFolderWorkspaceInitializationPayload { return isSingleFolderWorkspaceIdentifier((obj.folder as ISingleFolderWorkspaceIdentifier)); }
landonepps/vscode
src/vs/platform/workspaces/common/workspaces.ts
TypeScript
mit
4,817
package com.bornstone.stonehenge.entity.validator; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Created by king on 15-5-4. */ public class Mobile { public static boolean isMobile(String mobile) { Pattern p = Pattern.compile("^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$"); Matcher m = p.matcher(mobile); return m.matches(); } public static void main(String[] args) { System.out.println(Mobile.isMobile("13400000000")); } }
AdonisTang/stonehenge
stonehenge-entity/src/main/java/com/bornstone/stonehenge/entity/validator/Mobile.java
Java
mit
526
"use strict"; const gulp = require('gulp'); gulp.task('release', ['aot', 'copy:build'], function() { return gulp.src(['app-build/**/*'], { dot: true }).pipe(gulp.dest('release/app')); });
voxmachina/igeni.us
gulpfile.js/tasks/release.js
JavaScript
mit
206
<div ng-show="messages.length>0"> <ng-transclude></ng-transclude> <div ng-repeat="obj in messages" ng-class="obj.class"> {{obj.message}} </div> </div>
IDepla/polibox
src/main/webapp/rs/view/common/messagebox.html
HTML
mit
155
<!DOCTYPE html> <!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--> <!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]--> <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--> <html lang="de" ng-app="characterSheetApp"> <!--<![endif]--> <head> <meta charset="utf-8"> <title>Shadowrun Charakterbogen</title> <meta name="description" content=""> <meta name="author" content="Stefan Buchholtz"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <!-- ref:css /css/styles.min.css --> <link rel="stylesheet" href="stylesheets/base.css"> <link rel="stylesheet" href="stylesheets/skeleton.css"> <link rel="stylesheet" href="stylesheets/bootstrap.css"> <link rel="stylesheet" href="stylesheets/layout.css"> <!-- endref --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link rel="shortcut icon" href="favicon.ico"> <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png"> </head> <body> <div ng-view></div> <!-- ref:js /js/application.min.js --> <script src="js/angular.js"></script> <script src="js/angular-route.js"></script> <script src="js/angular-resource.js"></script> <script src="js/angular-bootstrap.js"></script> <script src="js/navigation.js"></script> <script src="js/security.js"></script> <script src="js/characterList.js"></script> <script src="js/sr4CharacterSheet.js"></script> <script src="js/characterService.js"></script> <script src="js/app.js"></script> <!-- endref --> </body> </html>
stefan-buchholtz/CharacterSheet
client/index.html
HTML
mit
1,770
package wasteDisposal.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.ANNOTATION_TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Disposable { }
vanncho/Java-Advanced-OOP-2016
Exams/RecyclingStation/RecyclingStation/src/wasteDisposal/annotations/Disposable.java
Java
mit
315
#include <iostream> #include <opencv2\core\core.hpp> #include <opencv2\highgui\highgui.hpp> #include <opencv2\nonfree\nonfree.hpp> #include "lib_features.h" #include "ib_color.h" using namespace std; using namespace cv; vector<Mat> readTraining(); vector<Mat> readTest(); int main(int argc, char** argv) { // Variable Definitons // Create a instance of FeatureProc class and Colorful class FeatureProc featureProc; Colorful colorful; Mat harris_1, harris_2, img_1, img_2; vector<Mat> img_1_hsv, img_2_hsv; vector<Point> harris_points_vec_1, harris_points_vec_2; vector<KeyPoint> sift_keypoints_vec_1, sift_keypoints_vec_2; // variable that stores user input int user_input = 0; // Flag to used in main loop int is_user_selected = 1; // Check the arguments if (argc < 3) { cout << "Not enough parameters!!" << endl; //return -1; } // Read the images img_1 = imread(argv[1]); img_2 = imread(argv[2]); // Get the intensity value of images img_1_hsv = colorful.convertBGR2HSV(img_1); img_2_hsv = colorful.convertBGR2HSV(img_2); // For Harris const Mat img_I_1_h = img_1_hsv.at(2); const Mat img_I_2_h = img_2_hsv.at(2); // For SIFT const Mat img_I_1_s = img_1_hsv.at(2); const Mat img_I_2_s = img_2_hsv.at(2); while (is_user_selected == 1) { // User Prompt cout << "\nWhich one do you want?\n1 - Harris\n2 - SIFT\n3 - Bag of Words\n4 - Exit" << endl ; cin >> user_input; // route the user according to his/her selection if (user_input == 1) { int threshold; cout << "Enter the threshold: "; cin >> threshold; // user selected Harris Corner Detection harris_points_vec_1 = featureProc.harrisDetector(img_I_1_h, threshold); harris_points_vec_2 = featureProc.harrisDetector(img_I_2_h, threshold); // Set the flag is_user_selected = 1; } else if(user_input == 2) { // user selected SIFT Detection sift_keypoints_vec_1 = featureProc.siftFind(img_I_1_s); sift_keypoints_vec_2 = featureProc.siftFind(img_I_2_s); // Set the flag is_user_selected = 1; } else if (user_input == 3) { // user selected the Bag of Words // read training and test data vector<Mat> training = readTraining(); vector<Mat> test = readTest(); // send them to BoW function featureProc.siftBOW(training, test); // Set the flag is_user_selected = 1; } else { // exit from the loop // Reset the flag is_user_selected = 0; } } return 0; } // method that reads all training images // for BoW section // the training image size is harcoded as 20 // training images must be in training_images folder // and labeled as train_1, train_2 ... vector<Mat> readTraining() { vector<Mat> training; for(int i = 1; i <= 20; i++) { // name of file std::stringstream sstm; sstm << "train_" << i << ".jpg"; string name = sstm.str(); // load them in grayscale Mat temp = imread(name); training.push_back(temp); imshow("training_images", temp); waitKey(300); } destroyAllWindows(); return training; } // method that reads all test images // for BoW section // the test image size is harcoded as 4 // test images must be in test_images folder // and labeled as test_1, test_2 ... vector<Mat> readTest() { vector<Mat> test; for(int i = 1; i <= 4; i++) { // name of file std::stringstream sstm; sstm << "test_" << i << ".jpg"; string name = sstm.str(); // load them in grayscale Mat temp = imread(name); test.push_back(temp); imshow("test_images", temp); waitKey(300); } destroyAllWindows(); return test; }
cagbal/Bag-of-Words_OpenCV
main.cpp
C++
mit
3,610
function initJCrop(){ // Create variables (in this scope) to hold the API and image size var jcrop_api, boundx, boundy, // Grab some information about the preview pane $preview = $('#preview-pane'), $pcnt = $('.dz-image-preview'), $pimg = $('.dz-image-preview img'), xsize = $pcnt.width(), ysize = $pcnt.height(); $pimg.Jcrop({ onChange: updatePreview, onSelect: updatePreview, aspectRatio: 5/7 },function(){ // Use the API to get the real image size); var bounds = this.getBounds(); boundx = bounds[0]; boundy = bounds[1]; // Store the API in the jcrop_api variable jcrop_api = this; jcrop_api.setSelect([0,0,150,100]); jcrop_api.setOptions({ allowSelect: false }); // Move the preview into the jcrop container for css positioning //$preview.appendTo(jcrop_api.ui.holder); }); function updatePreview(c) { if (parseInt(c.w) > 0) { if ($("form[name=jcrop]").length) { $('#jcrop_x').val(c.x); $('#jcrop_y').val(c.y); $('#jcrop_x2').val(c.x2); $('#jcrop_y2').val(c.y2); $('#jcrop_w').val(c.w); $('#jcrop_h').val(c.h); } } }; function getRandom() { var dim = jcrop_api.getBounds(); return [ Math.round(Math.random() * dim[0]), Math.round(Math.random() * dim[1]), Math.round(Math.random() * dim[0]), Math.round(Math.random() * dim[1]) ]; }; };
Joomlamaster/connectionru
src/Connection/WebBundle/Resources/public/js/jcorp/js/settings.js
JavaScript
mit
1,685
<?php global $dataDir, $dirPrefix; if ($page->theme_is_addon) { $theme_path = '/data/_themes/' . $page->theme_name; } else { $theme_path = '/themes/Slate'; } $page->head_css[] = $theme_path . '/bootstrap.css'; $page->jQueryCode .= '$(window).load(function() { $( "button.nav-toggle" ).click(function() { $( "nav" ).toggle( "slow" ); }); $(\'a[href^=#]\').on(\'click\', function(e){ var href = $(this).attr(\'href\'); $(\'html, body\').animate({ scrollTop:$(href).offset().top },\'slow\'); e.preventDefault(); }); });'; ?> <!DOCTYPE html> <html lang="de"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <?php gpOutput::GetHead(); ?> <!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <link href='http://fonts.googleapis.com/css?family=Raleway:200' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'> </head> <body> <div class="header"><a id="top" name="top"></a> <div class="wrap"> <button type="button" class="nav-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> &#9776; </button> <header class="cf"> <?php global $config; $default_value = $config['title']; $GP_ARRANGE = false; gpOutput::Get('Extra','Header'); ?> </header> <?php function is_front_page(){ global $gp_menu, $page; reset($gp_menu); return $page->gp_index == key($gp_menu); } if (is_front_page()) { echo '<section class="block">'; gpOutput::Get('Extra','Info'); echo '</section>'; } ?> <nav> <?php $GP_ARRANGE = false; gpOutput::Get('TopTwoMenu'); ?> </nav> </div> <?php if (is_front_page()) { echo '<a href="#content" class="arrow white" style="position:absolute; bottom:30px;left:50%;margin-left:-25px;">&#8595;</a>'; } ?> </div> <div id="page" class="cf"> <div id="content" class="wrap grid-container"> <?php $page->GetContent(); ?> <a href="#top" class="arrow grey" style="margin:20px 0 20px 10px;">&#8593;</a> </div> </div> <div class="footer"> <footer class="wrap cf"> <section class="col-md-4"> <?php gpOutput::Get('Extra','Footer'); ?> </section> <section class="col-md-4"> <?php if (!file_exists($dataDir.'/data/_extra/Footer2.php')){ gpFiles::SaveFile($dataDir.'/data/_extra/Footer2.php','<h3>Second Footer Area</h3><p>How about some Contact information?<br />Or extra links?</p>'); } gpOutput::Get('Extra','Footer2'); ?> </section> <section class="col-md-4"> <?php if (!file_exists($dataDir.'/data/_extra/Footer3.php')){ gpFiles::SaveFile($dataDir.'/data/_extra/Footer3.php','<h3>Third Footer Area</h3><p>How about some Contact information?<br />Or extra links?</p>'); } gpOutput::Get('Extra','Footer3'); ?> </section> <p class="footerlinks"><?php gpOutput::GetAdminLink(); ?></p> </footer> </div> </body> </html>
cassandre/Slate
template.php
PHP
mit
3,186
using System; using System.CodeDom.Compiler; using System.ComponentModel; using System.Diagnostics; namespace ExportImportPromotion.StoreMarketingWebService { [GeneratedCode("System.Web.Services", "4.0.30319.1"), DesignerCategory("code"), DebuggerStepThrough] public class GetAllMailingListsCompletedEventArgs : AsyncCompletedEventArgs { private object[] results; public MailingListData[] Result { get { base.RaiseExceptionIfNecessary(); return (MailingListData[])this.results[0]; } } internal GetAllMailingListsCompletedEventArgs(object[] results, Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } } }
enticify/ExportImportPromotion
ExportImportPromotion.StoreMarketingWebService/GetAllMailingListsCompletedEventArgs.cs
C#
mit
714
<?php /* * This file is part of the FOSUserBundle package. * * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace UserBundle\Controller; use FOS\UserBundle\FOSUserEvents; use FOS\UserBundle\Event\FormEvent; use FOS\UserBundle\Event\FilterUserResponseEvent; use FOS\UserBundle\Event\GetResponseUserEvent; use FOS\UserBundle\Model\UserInterface; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Security\Core\Exception\AccessDeniedException; /** * Controller managing the password change * * @author Thibault Duplessis <[email protected]> * @author Christophe Coevoet <[email protected]> */ class ChangePasswordController extends Controller { /** * Change user password */ public function changePasswordAction(Request $request) { $user = $this->getUser(); if (!is_object($user) || !$user instanceof UserInterface) { throw new AccessDeniedException('This user does not have access to this section.'); } /** @var $dispatcher \Symfony\Component\EventDispatcher\EventDispatcherInterface */ $dispatcher = $this->get('event_dispatcher'); $event = new GetResponseUserEvent($user, $request); $dispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_INITIALIZE, $event); if (null !== $event->getResponse()) { return $event->getResponse(); } /** @var $formFactory \FOS\UserBundle\Form\Factory\FactoryInterface */ $formFactory = $this->get('fos_user.change_password.form.factory'); $form = $formFactory->createForm(); $form->setData($user); $form->handleRequest($request); if ($form->isValid()) { /** @var $userManager \FOS\UserBundle\Model\UserManagerInterface */ $userManager = $this->get('fos_user.user_manager'); $event = new FormEvent($form, $request); $dispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_SUCCESS, $event); $userManager->updateUser($user); if (null === $response = $event->getResponse()) { $url = $this->generateUrl('fos_user_profile_show'); $response = new RedirectResponse($url); } $dispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_COMPLETED, new FilterUserResponseEvent($user, $request, $response)); return $response; } return $this->render('FOSUserBundle:ChangePassword:changePassword.html.twig', array( 'form' => $form->createView() )); } }
sgourier/projet-d2m
src/UserBundle/Controller/ChangePasswordController.php
PHP
mit
2,816
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magento.com for more information. * * @category Mage * @package Mage_Customer * @copyright Copyright (c) 2006-2019 Magento, Inc. (http://www.magento.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Customer Attribute Abstract Data Model * * @category Mage * @package Mage_Customer * @author Magento Core Team <[email protected]> */ abstract class Mage_Customer_Model_Attribute_Data_Abstract extends Mage_Eav_Model_Attribute_Data_Abstract { }
portchris/NaturalRemedyCompany
src/app/code/core/Mage/Customer/Model/Attribute/Data/Abstract.php
PHP
mit
1,221
<?php global $wp_version; global $wpdb; $action_updated = null; $action_response = __("Package Settings Saved", 'duplicator'); //SAVE RESULTS if (isset($_POST['action']) && $_POST['action'] == 'save') { //Nonce Check if (! isset( $_POST['dup_settings_save_nonce_field'] ) || ! wp_verify_nonce( $_POST['dup_settings_save_nonce_field'], 'dup_settings_save' )) { die('Invalid token permissions to perform this request.'); } //Package $mysqldump_enabled = isset($_POST['package_dbmode']) && $_POST['package_dbmode'] == 'mysql' ? "1" : "0"; $mysqldump_exe_file = isset($_POST['package_mysqldump_path']) ? trim(DUP_DB::escSQL(strip_tags($_POST['package_mysqldump_path']), true)) : null; $mysqldump_path_valid = is_file($mysqldump_exe_file) ? true : false; DUP_Settings::Set('last_updated', date('Y-m-d-H-i-s')); DUP_Settings::Set('package_zip_flush', isset($_POST['package_zip_flush']) ? "1" : "0"); DUP_Settings::Set('package_mysqldump', $mysqldump_enabled ? "1" : "0"); DUP_Settings::Set('package_phpdump_qrylimit', isset($_POST['package_phpdump_qrylimit']) ? $_POST['package_phpdump_qrylimit'] : "100"); if ($mysqldump_path_valid) { $mysqldump_exe_file = DUP_Util::isWindows() ? realpath($mysqldump_exe_file) : $mysqldump_exe_file; DUP_Settings::Set('package_mysqldump_path', $mysqldump_exe_file); } DUP_Settings::Set('package_ui_created', $_POST['package_ui_created']); $action_updated = DUP_Settings::Save(); DUP_Util::initSnapshotDirectory(); } $package_zip_flush = DUP_Settings::Get('package_zip_flush'); $phpdump_chunkopts = array("20", "100", "500", "1000", "2000"); $phpdump_qrylimit = DUP_Settings::Get('package_phpdump_qrylimit'); $package_mysqldump = DUP_Settings::Get('package_mysqldump'); $package_mysqldump_path = trim(DUP_Settings::Get('package_mysqldump_path')); $package_ui_created = is_numeric(DUP_Settings::Get('package_ui_created')) ? DUP_Settings::Get('package_ui_created') : 1; $mysqlDumpPath = DUP_DB::getMySqlDumpPath(); $mysqlDumpFound = ($mysqlDumpPath) ? true : false; ?> <style> form#dup-settings-form input[type=text] {width:500px; } div.dup-feature-found {padding:10px 0 5px 0; color:green;} div.dup-feature-notfound {color:maroon; width:600px; line-height: 18px} select#package_ui_created {font-family: monospace} </style> <form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-settings&tab=package'); ?>" method="post"> <?php wp_nonce_field('dup_settings_save', 'dup_settings_save_nonce_field', false); ?> <input type="hidden" name="action" value="save"> <input type="hidden" name="page" value="duplicator-settings"> <?php if ($action_updated) : ?> <div id="message" class="notice notice-success is-dismissible dup-wpnotice-box"><p><?php echo $action_response; ?></p></div> <?php endif; ?> <h3 class="title"><?php _e("Visual", 'duplicator') ?> </h3> <hr size="1" /> <table class="form-table"> <tr> <th scope="row"><label><?php _e("Created Format", 'duplicator'); ?></label></th> <td> <select name="package_ui_created" id="package_ui_created"> <!-- YEAR --> <optgroup label="<?php _e("By Year", 'duplicator'); ?>"> <option value="1">Y-m-d H:i &nbsp; [2000-01-05 12:00]</option> <option value="2">Y-m-d H:i:s [2000-01-05 12:00:01]</option> <option value="3">y-m-d H:i &nbsp; [00-01-05 12:00]</option> <option value="4">y-m-d H:i:s [00-01-05 12:00:01]</option> </optgroup> <!-- MONTH --> <optgroup label="<?php _e("By Month", 'duplicator'); ?>"> <option value="5">m-d-Y H:i &nbsp; [01-05-2000 12:00]</option> <option value="6">m-d-Y H:i:s [01-05-2000 12:00:01]</option> <option value="7">m-d-y H:i &nbsp; [01-05-00 12:00]</option> <option value="8">m-d-y H:i:s [01-05-00 12:00:01]</option> </optgroup> <!-- DAY --> <optgroup label="<?php _e("By Day", 'duplicator'); ?>"> <option value="9"> d-m-Y H:i &nbsp; [05-01-2000 12:00]</option> <option value="10">d-m-Y H:i:s [05-01-2000 12:00:01]</option> <option value="11">d-m-y H:i &nbsp; [05-01-00 12:00]</option> <option value="12">d-m-y H:i:s [05-01-00 12:00:01]</option> </optgroup> </select> <p class="description"> <?php _e("The date format shown in the 'Created' column on the Packages screen.", 'duplicator'); ?> </p> </td> </tr> </table> <br/> <h3 class="title"><?php _e("Processing", 'duplicator') ?> </h3> <hr size="1" /> <table class="form-table"> <tr> <th scope="row"><label><?php _e("SQL Script", 'duplicator'); ?></label></th> <td> <?php if (!DUP_Util::hasShellExec()) : ?> <input type="radio" disabled="true" /> <label><?php _e("Mysqldump", 'duplicator'); ?> <i style="font-size:12px">(<?php _e("recommended", 'duplicator'); ?>)</i></label> <p class="description" style="width:550px; margin:5px 0 0 20px"> <?php _e("This server does not support the PHP shell_exec function which is required for mysqldump to run. ", 'duplicator'); _e("Please contact the host or server administrator to enable this feature.", 'duplicator'); ?> <br/> <small> <i style="cursor: pointer" data-tooltip-title="<?php _e("Host Recommendation:", 'duplicator'); ?>" data-tooltip="<?php _e('Duplicator recommends going with the high performance pro plan or better from our recommended list', 'duplicator'); ?>"> <i class="fa fa-lightbulb-o" aria-hidden="true"></i> <?php printf("%s <a target='_blank' href='//snapcreek.com/wordpress-hosting/'>%s</a> %s", __("Please visit our recommended", 'duplicator'), __("host list", 'duplicator'), __("for reliable access to mysqldump", 'duplicator')); ?> </i> </small> <br/><br/> </p> <?php else : ?> <input type="radio" name="package_dbmode" value="mysql" id="package_mysqldump" <?php echo ($package_mysqldump) ? 'checked="checked"' : ''; ?> /> <label for="package_mysqldump"><?php _e("Mysqldump", 'duplicator'); ?></label> <i style="font-size:12px">(<?php _e("recommended", 'duplicator'); ?>)</i> <br/> <div style="margin:5px 0px 0px 25px"> <?php if ($mysqlDumpFound) : ?> <div class="dup-feature-found"> <i class="fa fa-check-circle"></i> <?php _e("Successfully Found:", 'duplicator'); ?> &nbsp; <i><?php echo $mysqlDumpPath ?></i> </div><br/> <?php else : ?> <div class="dup-feature-notfound"> <i class="fa fa-exclamation-triangle"></i> <?php _e('Mysqldump was not found at its default location or the location provided. Please enter a custom path to a valid location where mysqldump can run. ' . 'If the problem persist contact your host or server administrator. ', 'duplicator'); printf("%s <a target='_blank' href='//snapcreek.com/wordpress-hosting/'>%s</a> %s", __("See the", 'duplicator'), __("host list", 'duplicator'), __("for reliable access to mysqldump.", 'duplicator')); ?> </div><br/> <?php endif; ?> <i class="fa fa-question-circle" data-tooltip-title="<?php _e("mysqldump path:", 'duplicator'); ?>" data-tooltip="<?php _e('An optional path to the mysqldump program. Add a custom path if the path to mysqldump is not properly detected or needs to be changed.', 'duplicator'); ?>"></i> <label><?php _e("Custom Path:", 'duplicator'); ?></label><br/> <input type="text" name="package_mysqldump_path" id="package_mysqldump_path" value="<?php echo $package_mysqldump_path; ?>" placeholder="<?php _e("/usr/bin/mypath/mysqldump.exe", 'duplicator'); ?>" /> <div class="dup-feature-notfound"> <?php if ($action_updated && $mysqldump_path_valid === false) { $mysqldump_path = DUP_Util::isWindows() ? stripslashes($_POST['package_mysqldump_path']) : $_POST['package_mysqldump_path']; if (strlen($mysqldump_path)) { _e('<i class="fa fa-exclamation-triangle"></i> The custom path provided is not recognized as a valid mysqldump file:<br/>', 'duplicator'); $mysqldump_path = esc_html($mysqldump_path); echo "'{$mysqldump_path}'"; } } ?> </div> <br/><br/> </div> <?php endif; ?> <!-- PHP MODE --> <?php if (! $mysqlDumpFound) : ?> <input type="radio" name="package_dbmode" id="package_phpdump" value="php" checked="checked" /> <?php else : ?> <input type="radio" name="package_dbmode" id="package_phpdump" value="php" <?php echo (! $package_mysqldump) ? 'checked="checked"' : ''; ?> /> <?php endif; ?> <label for="package_phpdump"><?php _e("PHP Code", 'duplicator'); ?></label> &nbsp; <div style="margin:5px 0px 0px 25px"> <i class="fa fa-question-circle" data-tooltip-title="<?php _e("PHP Query Limit Size", 'duplicator'); ?>" data-tooltip="<?php _e('A higher limit size will speed up the database build time, however it will use more memory. If your host has memory caps start off low.', 'duplicator'); ?>"></i> <label for="package_phpdump_qrylimit"><?php _e("Query Limit Size", 'duplicator'); ?></label> &nbsp; <select name="package_phpdump_qrylimit" id="package_phpdump_qrylimit"> <?php foreach($phpdump_chunkopts as $value) { $selected = ( $phpdump_qrylimit == $value ? "selected='selected'" : '' ); echo "<option {$selected} value='{$value}'>" . number_format($value) . '</option>'; } ?> </select> </div><br/> </td> </tr> <tr> <th scope="row"><label><?php _e("Archive Flush", 'duplicator'); ?></label></th> <td> <input type="checkbox" name="package_zip_flush" id="package_zip_flush" <?php echo ($package_zip_flush) ? 'checked="checked"' : ''; ?> /> <label for="package_zip_flush"><?php _e("Attempt Network Keep Alive", 'duplicator'); ?></label> <i style="font-size:12px">(<?php _e("enable only for large archives", 'duplicator'); ?>)</i> <p class="description"> <?php _e("This will attempt to keep a network connection established for large archives.", 'duplicator'); ?> </p> </td> </tr> </table> <p class="submit" style="margin: 20px 0px 0xp 5px;"> <br/> <input type="submit" name="submit" id="submit" class="button-primary" value="<?php _e("Save Package Settings", 'duplicator') ?>" style="display: inline-block;" /> </p> </form> <script> jQuery(document).ready(function($) { $('#package_ui_created').val(<?php echo $package_ui_created ?> ); }); </script>
Atlogex/wpstack
wp-content/plugins/duplicator/views/settings/packages.php
PHP
mit
11,392
<h1>Origins</h1> <p>Developed by From Software, Dark Souls is the spiritual successor to the Playstation exclusive Demon's Souls, an action RPG experience that surprised by not only gaining critical acclaim, but obtaining publishing in 3 regions and racking estimated sales of over 1 million units. The original game's appeal lay with its renowned difficulty and trial-and-error approach, one that Dark Souls promises to sustain, thus attracting Demon's Souls' fanbase. The developer and publisher had both stated that there were no intentions for DLC however, following the release of the Prepare to Die Edition for PC with added content, an expansion DLC was released for both PS3 and Xbox360, titled Artorias of the Abyss. <li class="text-divider"></li> <h1>Software</h1> <p><li>Official title is "Dark Souls"</li> <li>Before it was decided on this name, the developers intended to name it "Dark Ring," in reference to the aura that emanates from the cursed ring of the main character. The name was discarded when the developers were made aware of it being rude slang in Britain.</li> <li>The game was released in Japan on September 22, 2011, on October 4 in North America, and on October 7 in Europe</li> <li>Jointly Developed by From Software and Namco Bandai Games</li> <li>In Japan, the title is a Playstation 3 exclusive and is published by From Software.</li> <li>Internationally, Namco Bandai Games is the publisher, and the title is available to both Playstation 3 and Xbox 360.</li> <li>From Software has stated that they are solely responsible for game content.</li> <li>Namco Bandai Games is confident with this arrangement.</li></p> </li></p> <li class="text-divider"></li> <h1>Concepts</h1> <h2>Developmental</h2> <p><li>High degree of difficulty.</li> <li>The objective is to give players a challenge that is rewarding when met.</li> <li>Difficulty is something anyone can overcome through observation, strategy and choice.</li> <li>Aiming to provide freedom for the player character.</li> <li>Demon's Souls' "learn from your mistakes" theme remains the base for the game.</li> <li>Implementation of a seamless map, that was not realized in Demon's Souls.</li> <li>The analogy for the game is: "Something spicy, but that anyone can enjoy".</li> <li>Whilst happy that the game had international appeal, no special intentions to cater to their tastes. <li>From Software does not feel confident designing based on market data, so they will instead compete by creating a great game.</li> </li> <li>Players will die repeatedly, From Software bets its pride on it.</li></p> <h2>General</h2> <p><li>The game revolves around the appearance of the Undead, that will gradually ruin this world.</li> <li>The game world of medieval fantasy is represented in three main themes: "King and Knight", "Death and the Abyss," "Flame of Chaos"</li> <li>Exploration of the world will be vital and, thanks to a seamless map, accessible by simply walking.</li> <li>No maps in hand, the player will have to rely on descriptions and observation.</li> <li>The game will feature complex environments, with tricks, traps and significant height differences.</li> <li>Bonfires scattered throughout the world will serve as starting points/checkpoints and as oases for recovery. The player will be able to rest by the bonfire to replenish health, Est and spells.</li> <li>Humanity is another new concept, and is represented by a number in the top left corner of the HUD, it controls various aspects of the game. Most importantly, it is used to revive from Undead to Human, and to strengthen Bonfires. A Human player can summon Undead players, but will also be open to invasions.</li> <li>The game will feature different motions and traits for weapons, as well as a great variety of magic and items, encouraging the player to find their own and unique playstyle.</li> <li> <li>The motion will affect the speed and rest of each blow, based on parameters such as the player's strength and ability.</li> <li>Tactics such as bypass armor should also be parameter-dependent.</li> </li> <li>The expected playtime is 1.5 or 2 times that of Demon's Souls, with a significant increase in weapons, armor, magic and items.</li> <li>Whilst Demon's Souls had 40 types of enemies, Dark Souls will include close to 100 of them. Enemies will be able to chase players up stairs and ladders, but can be kicked down.</li> <li>Story will not impose itself upon the player, but it is present. The game world is fragmented, but opportunities for deeper story information are available to players who search.</li> <li>Takes place in the fictional land of Lordran.</li></p> <li class="text-divider"></li> <h1>Notable Differences with Demon Souls</h1> <p><li>All defense has been lowered, and attack power has increased, hence the introduction of the Iron Flesh magic.</li> <li>No more munching on grass. Grass has been removed and instead Est can be collected at the fires and carried in bottles. However the amount of bottles a player can carry will be limited. They want to discourage reckless play followed by munching, and instead ask the player to tread with caution.</li> <li>The player will be able to choose a starting gift at character creation.</li> <li>No Soul Form, instead you switch between a 'human' form and a 'hollowed' form.</li> <li>World Tendency is not present as a server median, but a similar effect can be controlled by players online. See the Online section for more information.</li> <li>The Story and World are not that of Demon's Souls. See the Lore page for more information.</li> <li>There won't be 5 differentiated worlds as presented in Demon's Souls. See the Places page for more information.</li> <li>The weapon upgrade system will be easier to understand and there are armor upgrades available.</li></p> <li class="text-divider"></li> <h1>Game Data</h1> <table class="tables"> <tr> <th>Name</th> <td>DARK SOULS</td> <td>ダークソウル</td> <td></td> <td></td> </tr> <tr> <th>Name</th> <td align="center"><img src="images/covers/dark/ps3.jpg" alt="PS3 Cover" style="height: 189px; width: 150px;" /><br />PS3 Cover</td> <td align="center"><img src="images/covers/dark/360.jpg" alt="XBOX 360 Cover" style="height: 189px; width: 150px;" /><br />XBOX 360 Cover</td> <td align="center"><img src="images/covers/dark/pc.jpg" alt="PC Cover" style="height: 189px; width: 150px;" /><br /> <td align="center"><img src="images/covers/spacer.png" style="height: 189px; width: 150px;" /><br /> </tr> <tr> <th>Release Date</th> <td>NA: 10/07/2011<br /></td> <td>EU: 04/10/2011<br /> *released by Namco</td> <td>JP: 22/09/2011<br /> *released by FROM Software</td> <td>PC: 24/08/2012</td> </tr> <tr> <th>Genre</th> <td>Action</td> <td>RPG</td> <td></td> <td></td> </tr> <tr> <th>Price</th> <td>Regular Edition: <br /> 29.99 USD<br /> 4,700 YEN</td> <td>Prepare to Die Edition: <br /> 39.95 USD</td> <td>DLC: <br /> 15.00 USD<br /> 1,200 YEN</td> <td> </tr> <tr> <th>Rating</th> <td>Mature</td> <td></td> <td></td> <td></td> </tr> <tr> <th>Online</th> <td>PlayStation Network</td> <td>Xbox LIVE</td> <td></td> <td></td> </tr> <tr> <th>Developer</th> <td>From Software</td> <td></td> <td></td> <td></td> </tr> <tr> <th>Publisher</th> <td>From Software (Japan)</td> <td>Namco Bandai Games (Int'l)</td> <td></td> <td></td> </tr> <tr> <th>Director</th> <td>Miyazaki Hidetaka</td> <td></td> <td></td> <td></td> </tr> <tr> <th>Official Site</th> <td><a href="http://www.fromsoftware.jp/darksouls/" rel="nofollow" target="_blank">Japanese Site</a></td> <td></td> <td></td> <td></td> </tr> </table> <br/> <br/> <br/>
dhwong/DHwong
templates/about/dark.html
HTML
mit
7,762
require 'spec_helper' describe CapistranoMugen::CLI::Execute do subject { @cli = CapistranoMugen::CLI.parse(@options) } after { @cli.execute! } describe :execute_init do context :not_enought_options do before { @options = %w{init --deploy 127.0.0.1} } it "print help of init command" do subject.should_receive(:print_init_help) end end end describe :execute_create do context :not_have_stage_name do before { @options = %w{create} } it "print help of create command" do subject.should_receive(:print_create_help) end end context :stage_already_exists do end end describe :no_command do before { @options = %w{--deploy 127.0.0.1} } it "print help of commands" do subject.should_receive(:print_commands_help) end end end
masarakki/capistrano-mugen
spec/mugen/cli/execute_spec.rb
Ruby
mit
834
// Ours const { merge } = require('../../utils/structures'); const { getProjectConfig } = require('../project'); module.exports.getJestConfig = () => { const { jest: projectJestConfig, root, type } = getProjectConfig(); const defaultTransformerPath = require.resolve('./transformer-default'); return merge( { rootDir: root, verbose: true, transform: { '^.+\\.svelte$': require.resolve('./transformer-svelte'), '.*': defaultTransformerPath } }, projectJestConfig ); };
abcnews/aunty
src/config/jest/index.js
JavaScript
mit
530
ObsticleClass = Class.create(EntityClass, { initialize: function($super, aGame, aPos, aImage, aProperties){ var props = { physics: { fixed: true, maskBits: 65535, categoryBits: 65535, size: {w: 1, h: 1} }, userData: { name: 'Obsticle' }, other: { zIndex: 11 } } gUtil.copyProperties(props, aProperties); $super(aGame, aImage, aPos, props); } }); BrickClass = Class.create(ObsticleClass, { initialize: function($super, aGame, aPos, aProperties){ aProperties.userData['name'] = 'Brick wall'; aProperties.physics.size = {w: 1.5, h: 1.5}; $super(aGame, aPos, gCachedData['images/brick_wall.png'], aProperties); this.dieSound = gCachedData['sounds/M1_BreakBlock.wav']; }, break: function(){ this.game.spawnAnimation("BreakBrick", this.getPosition()); if(this.dieSound.loaded) this.game.SM.play(this.dieSound) this.die(); }, onTouch: function(other, contact, impulse){ if(contact.GetManifold().m_pointCount == 0){ return; // Just a sanity check, should not get here. } var x = this.game.physEngine.understandTheContact(contact); // If the brick is hit from below. if(x.dir == 'above' && x.b1 == this.physBody.GetBody()){ // If Mario hit the brick. Now nothing else could reach the // brick from below, but it may happen with future enemies. if(other == this.game.player.physBody.GetBody()){ this.game.player.interact(this); } } } }); DeadBlockClass = Class.create(ObsticleClass, { initialize: function($super, aGame, aPos, aProperties){ aProperties.userData['name'] = 'Dead block'; aProperties.physics.size = {w: 1.5, h: 1.5}; $super(aGame, aPos, gCachedData['deadBlock'], aProperties); } }); SingleGroundPieceClass = Class.create(ObsticleClass, { initialize: function($super, aGame, aPos, anImage, aProperties){ $super(aGame, aPos, anImage, aProperties); } }) GroundClass = { makeGround: function(aGame, aBorders){ // This method is called while setting up the game. var res = []; for(var i = 0; i < aBorders.length; i++){ border = aBorders[i]; var props = { physics: { size: border }, userData: { name: 'Ground' } } // We have to add half width and hight to the position because for the // ground it is an absolute value and not the center. var w = new SingleGroundPieceClass( aGame, {x: border.x + border.w/2, y: border.y + border.h/2}, gCachedData['ground.png'], props ); res.push(w); } return res; } }; TubeClass = Class.create(ObsticleClass, { initialize: function($super, aGame, aPos){ // aPos is considered the top left corner, // so this will dictate the tubes height. var props = { physics: {size: {w: 3, h: 6}}, userData: {name: 'Tube'}, other: {zIndex: 10} } aPos.y += props.physics.size.h/2; $super(aGame, aPos, gCachedData['tube.png'], props); } }); CastleClass = Class.create(ObsticleClass, { initialize: function($super, aGame, aPos){ // aPos is considered the top left corner, // so this will dictate the tubes height. var props = { physics: {size: {w: 11, h: 14}}, userData: {name: 'castle'}} aPos.y += props.physics.size.h/2; $super(aGame, aPos, gCachedData['castle'], props); }, onTouch: function(other, contact, impulse){ if(contact.GetManifold().m_pointCount == 0){ return; // Just a sanity check, should not get here. } // If I hit Mario, he wins. if(other == this.game.player.physBody.GetBody()){ this.game.player.interact(this); } } }); QuestionBrickClass = Class.create(ObsticleClass, { reactionType: null, initialize: function($super, aGame, aPos, aProperties){ var props = { physics: {size: {w: 1.5, h: 1.5}}, userData: {name: 'Question Brick'}, other: {zIndex: 10} }; $super(aGame, aPos, gCachedData['questionBrick'], props); this.reactionType = aProperties.reactionType; }, giveReward: function(){ this.game.spawnEntity("DeadBlock", this.getPosition(), null); this.game.spawnAnimation(this.reactionType, this.getPosition()); this.die(); }, onTouch: function(other, contact, impulse){ if(contact.GetManifold().m_pointCount == 0){ return; // Just a sanity check, should not get here. } var x = this.game.physEngine.understandTheContact(contact); // If the brick is hit from below. if(x.dir == 'above' && x.b1 == this.physBody.GetBody()){ // If Mario hit the brick. Now nothing else could reach the // brick from below, but it may happen with future enemies. if(other == this.game.player.physBody.GetBody()){ this.game.player.interact(this); } } } });
RamziKahil/MarioDemo
Obstacles.js
JavaScript
mit
4,631
@charset "UTF-8"; /* SpryValidationSelect.css - version 0.4 - Spry Pre-Release 1.6.1 */ /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */ /* These are the classes applied on the messages * (required message and invalid state message) * which prevent them from being displayed by default. */ .selectRequiredMsg, .selectInvalidMsg { display: none; } /* These selectors change the way messages look when the widget is in one of the error states (required, invalid). * These classes set a default red border and color for the error text. * The state class (.selectRequiredState or .selectInvalidState) is applied on the top-level container for the widget, * and this way only the specific error message can be shown by setting the display property to "inline". */ .selectRequiredState .selectRequiredMsg, .selectInvalidState .selectInvalidMsg { display: inline; color: #FFF; } /* The next three group selectors control the way the core element (SELECT) looks like when the widget is in one of the states: * focus, required / invalid, valid * There are two selectors for each state, to cover the two main usecases for the widget: * - the widget id is placed on the top level container for the SELECT * - the widget id is placed on the SELECT element itself (there are no error messages) */ /* When the widget is in the valid state the SELECT has a green background applied on it. */ .selectValidState select, select.selectValidState { background-color: #2C332B; border: 0; } /* When the widget is in an invalid state the SELECT has a red background applied on it. */ select.selectRequiredState, .selectRequiredState select, select.selectInvalidState, .selectInvalidState select { background-color: #2C332B; border: 0; } /* When the widget has received focus, the SELECT has a yellow background applied on it. */ .selectFocusState select, select.selectFocusState { background-color: #FFF; }
intaset/eee
_includes/css/SpryAssets/SpryValidationSelect.css
CSS
mit
1,946
using System; namespace RegPetServer.WebAPI.Areas.HelpPage.ModelDescriptions { /// <summary> /// Describes a type model. /// </summary> public abstract class ModelDescription { public string Documentation { get; set; } public Type ModelType { get; set; } public string Name { get; set; } } }
TishoAngelov/RegPetServer
RegPetServer.WebAPI/Areas/HelpPage/ModelDescriptions/ModelDescription.cs
C#
mit
342
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>18 --> 19</title> <link href="./../../assets/style.css" rel="stylesheet"> </head> <body> <h2>You have to be fast</h2> <a href="./4485c63670cf3d8e23f5bffad2ba06c75e97747d7475b4aef4956bb6fdee4147.html">Teleport</a> <hr> <a href="./../../about.md">About</a> (Spoilers! ) <script src="./../../assets/md5.js"></script> <script> window.currentLevel = 7; </script> <script src="./../../assets/script.js"></script> </body> </html>
simonmysun/praxis
TAIHAO2019/pub/SmallGame/AsFastAsYouCan2/f4b72eb69b1608ccbc9f7712df7848f3a100ae7a7993d8a0f744b867877e46d3.html
HTML
mit
550
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>18 --> 19</title> <link href="./../../assets/style.css" rel="stylesheet"> </head> <body> <h2>You have to be fast</h2> <a href="./65746bb3df1beab4cda765df19e677b9dd2c1df1f5b88d385eebb4ac912e2cbf.html">Teleport</a> <hr> <a href="./../../about.md">About</a> (Spoilers! ) <script src="./../../assets/md5.js"></script> <script> window.currentLevel = 7; </script> <script src="./../../assets/script.js"></script> </body> </html>
simonmysun/praxis
TAIHAO2019/pub/SmallGame/AsFastAsYouCan2/62eaf47b7520b0679ce028082fb7ff95003d1198a6e761e8552357823e19633b.html
HTML
mit
550
/* Redline Smalltalk, Copyright (c) James C. Ladd. All rights reserved. See LICENSE in the root of this distribution */ package st.redline.stout; import org.mortbay.jetty.Handler; import org.mortbay.jetty.Server; import org.mortbay.jetty.handler.AbstractHandler; import st.redline.core.CommandLine; import st.redline.core.PrimObject; import st.redline.core.Stic; import st.redline.core.PrimObjectMetaclass; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; public class Run extends Stic { static Server server; static final PrimObject[] DISPATCH_SYMBOLS = new PrimObject[9]; public static void main(String[] args) throws Exception { startServer(args); } public Run(CommandLine commandLine) throws Exception { super(commandLine); } static void startServer(String[] args) throws Exception { server = new Server(8080); server.setHandler(initialHandler(args)); server.start(); server.join(); } static Handler initialHandler(final String[] args) throws Exception { return new AbstractHandler() { public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException { Handler handler; try { handler = continuingHandler(objectFrom(args)); } catch (Exception e) { throw new ServletException(e); } server.setHandler(handler); handler.handle(target, request, response, dispatch); } private PrimObject objectFrom(String[] args) throws Exception { PrimObjectMetaclass eigenClass = (PrimObjectMetaclass) invokeWith(Run.class, args); return PrimObject.CLASSES.get(eigenClass.getClass().getName()).perform("new"); } }; } static Handler continuingHandler(final PrimObject receiver) { return new AbstractHandler() { public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException { try { System.out.println("continuingHandler() " + receiver + " " + request.getMethod() + " " + target); receiver.perform( method(request.getMethod()), string(target), wrapper(request), wrapper(response), dispatch(dispatch), "handle:on:with:and:and:"); } catch (Exception e) { throw new ServletException(e); } } PrimObject wrapper(Object value) { PrimObject object = new PrimObject(); object.javaValue(value); return object; } PrimObject string(String value) { return PrimObject.string(value); } PrimObject dispatch(int dispatch) { if (DISPATCH_SYMBOLS[dispatch] == null) initializeDispatchSymbol(dispatch); return DISPATCH_SYMBOLS[dispatch]; } void initializeDispatchSymbol(int dispatch) { switch (dispatch) { case 1: DISPATCH_SYMBOLS[1] = PrimObject.symbol("Request"); break; case 2: DISPATCH_SYMBOLS[2] = PrimObject.symbol("Forward"); break; case 4: DISPATCH_SYMBOLS[4] = PrimObject.symbol("Include"); break; case 8: DISPATCH_SYMBOLS[8] = PrimObject.symbol("Error"); break; default: throw new IllegalStateException("Dispatch value of " + dispatch + " not understood."); } } PrimObject method(String method) { return PrimObject.symbol(method); } }; } }
nuclearsandwich/redline-smalltalk
src/main/java/st/redline/stout/Run.java
Java
mit
4,377
package intro.proj.p1.v3; public class MinionJobs { private int numOfWorker; // current number of workers declared private int bonus; // current level of bonus private String name; // name of person doing job private String active; // active term for the job private String past; // past term for the job private String verb; // verb of the job // value related methods public int getValue() { return numOfWorker; } public void setValue(int setValue) { numOfWorker = setValue; } public void addValue(int addValue) { numOfWorker = numOfWorker + addValue; } // name related methods public String getName() { return name; } public void setName(String newName) { name = newName; } public void setActive(String input) { active = input; } public String getActive() { return active; } public void setPast(String input) { past = input; } public String getPast() { return past; } public void setVerb(String input) { verb = input; } public String getVerb() { return verb; } // bonus related methods public void setBonus(int newBonus) { bonus = newBonus; } public int getBonus() { return bonus; } }
pegurnee/2013-01-111
complete/src/intro/proj/p1/v3/MinionJobs.java
Java
mit
1,399
@extends('layouts.external') <script> function abrir(url) { open(url,'','top=300,left=300,width=500,height=200, resizable=0') ; } </script> @section('content') <div class="container"> <div class="col-sm-offset-2 col-sm-8"> <!--{!! Breadcrumbs::render('preinscripcion') !!}--> <div class="panel panel-default"> <div class="panel-heading"> Mensaje de Confirmación </div> <div class="panel-body"> <!-- Display Validation Errors --> @include('common.errors') <!-- New Preinscripcion Form --> <form action="{{ url('/') }}" method="GET" class="form-horizontal"> <!-- Tipo de identificacion --> <div class="form-group"> <div class="col-sm-12"> Los documentos han sido cargados correctamente. Próximamente recibirás información sobre tu proceso de inscripción. </div> </div> </form> </div> </div> </div> </div> @endsection
mementosoftwareco/siup
resources/views/documentos/confirmation.blade.php
PHP
mit
1,349
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ru" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Fredcoin</source> <translation>&amp;О Fredcoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Fredcoin&lt;/b&gt; version</source> <translation>&lt;b&gt;Fredcoin&lt;/b&gt; версия</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source> <translation> Это экспериментальная программа. Распространяется на правах лицензии MIT/X11, см. файл license.txt или http://www.opensource.org/licenses/mit-license.php. Этот продукт включает ПО, разработанное OpenSSL Project для использования в OpenSSL Toolkit (http://www.openssl.org/) и криптографическое ПО, написанное Eric Young ([email protected]) и ПО для работы с UPnP, написанное Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Все права защищены</translation> </message> <message> <location line="+0"/> <source>The Fredcoin developers</source> <translation>Разработчики Fredcoin</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>&amp;Адресная книга</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Для того, чтобы изменить адрес или метку, дважды кликните по изменяемому объекту</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Создать новый адрес</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Копировать текущий выделенный адрес в буфер обмена</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Новый адрес</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Fredcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>Это Ваши адреса для получения платежей. Вы можете дать разные адреса отправителям, чтобы отслеживать, кто именно вам платит.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Копировать адрес</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Показать &amp;QR код</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Fredcoin address</source> <translation>Подписать сообщение, чтобы доказать владение адресом Fredcoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>&amp;Подписать сообщение</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Удалить выбранный адрес из списка</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Экспортировать данные из вкладки в файл</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Экспорт</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Fredcoin address</source> <translation>Проверить сообщение, чтобы убедиться, что оно было подписано указанным адресом Fredcoin</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Проверить сообщение</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Удалить</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Fredcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Ваши адреса для получения средств. Совет: проверьте сумму и адрес назначения перед переводом.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Копировать &amp;метку</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Правка</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>&amp;Отправить монеты</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Экспортировать адресную книгу</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Текст, разделённый запятыми (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Ошибка экспорта</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Невозможно записать в файл %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Метка</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Адрес</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>[нет метки]</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Диалог ввода пароля</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Введите пароль</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Новый пароль</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Повторите новый пароль</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Введите новый пароль для бумажника. &lt;br/&gt; Пожалуйста, используйте фразы из &lt;b&gt;10 или более случайных символов,&lt;/b&gt; или &lt;b&gt;восьми и более слов.&lt;/b&gt;</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Зашифровать бумажник</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Для выполнения операции требуется пароль вашего бумажника.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Разблокировать бумажник</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Для выполнения операции требуется пароль вашего бумажника.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Расшифровать бумажник</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Сменить пароль</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Введите старый и новый пароль для бумажника.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Подтвердите шифрование бумажника</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR FREDCOINS&lt;/b&gt;!</source> <translation>Внимание: если вы зашифруете бумажник и потеряете пароль, вы &lt;b&gt;ПОТЕРЯЕТЕ ВСЕ ВАШИ FREDCOIN&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Вы уверены, что хотите зашифровать ваш бумажник?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>ВАЖНО: все предыдущие резервные копии вашего кошелька должны быть заменены новым зашифрованным файлом. В целях безопасности предыдущие резервные копии нешифрованного кошелька станут бесполезны, как только вы начнёте использовать новый шифрованный кошелёк.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Внимание: Caps Lock включен!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Бумажник зашифрован</translation> </message> <message> <location line="-56"/> <source>Fredcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your fredcoins from being stolen by malware infecting your computer.</source> <translation>Сейчас программа закроется для завершения процесса шифрования. Помните, что шифрование вашего бумажника не может полностью защитить ваши Fredcoin от кражи с помощью инфицирования вашего компьютера вредоносным ПО.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Не удалось зашифровать бумажник</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Шифрование бумажника не удалось из-за внутренней ошибки. Ваш бумажник не был зашифрован.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>Введённые пароли не совпадают.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Разблокировка бумажника не удалась</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Указанный пароль не подходит.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Расшифрование бумажника не удалось</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Пароль бумажника успешно изменён.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>&amp;Подписать сообщение...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Синхронизация с сетью...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>О&amp;бзор</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Показать общий обзор действий с бумажником</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Транзакции</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Показать историю транзакций</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Изменить список сохранённых адресов и меток к ним</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Показать список адресов для получения платежей</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>В&amp;ыход</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Закрыть приложение</translation> </message> <message> <location line="+4"/> <source>Show information about Fredcoin</source> <translation>Показать информацию о Fredcoin&apos;е</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>О &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Показать информацию о Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>Оп&amp;ции...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Зашифровать бумажник...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Сделать резервную копию бумажника...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Изменить пароль...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Импортируются блоки с диска...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Идёт переиндексация блоков на диске...</translation> </message> <message> <location line="-347"/> <source>Send coins to a Fredcoin address</source> <translation>Отправить монеты на указанный адрес Fredcoin</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Fredcoin</source> <translation>Изменить параметры конфигурации Fredcoin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Сделать резервную копию бумажника в другом месте</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Изменить пароль шифрования бумажника</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>&amp;Окно отладки</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Открыть консоль отладки и диагностики</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Проверить сообщение...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Fredcoin</source> <translation>Fredcoin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Бумажник</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Отправить</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Получить</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Адреса</translation> </message> <message> <location line="+22"/> <source>&amp;About Fredcoin</source> <translation>&amp;О Fredcoin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Показать / Скрыть</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Показать или скрыть главное окно</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Зашифровать приватные ключи, принадлежащие вашему бумажнику</translation> </message> <message> <location line="+7"/> <source>Sign messages with your Fredcoin addresses to prove you own them</source> <translation>Подписать сообщения вашим адресом Fredcoin, чтобы доказать, что вы им владеете</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Fredcoin addresses</source> <translation>Проверить сообщения, чтобы удостовериться, что они были подписаны определённым адресом Fredcoin</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Файл</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Настройки</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Помощь</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Панель вкладок</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[тестовая сеть]</translation> </message> <message> <location line="+47"/> <source>Fredcoin client</source> <translation>Fredcoin клиент</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Fredcoin network</source> <translation><numerusform>%n активное соединение с сетью</numerusform><numerusform>%n активных соединений с сетью</numerusform><numerusform>%n активных соединений с сетью</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>Источник блоков недоступен...</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>Обработано %1 из %2 (примерно) блоков истории транзакций.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>Обработано %1 блоков истории транзакций.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n час</numerusform><numerusform>%n часа</numerusform><numerusform>%n часов</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n день</numerusform><numerusform>%n дня</numerusform><numerusform>%n дней</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n неделя</numerusform><numerusform>%n недели</numerusform><numerusform>%n недель</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>%1 позади</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>Последний полученный блок был сгенерирован %1 назад.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Транзакции после этой пока не будут видны.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>Ошибка</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Внимание</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Информация</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>Транзакция превышает максимальный размер. Вы можете провести её, заплатив комиссию %1, которая достанется узлам, обрабатывающим эту транзакцию, и поможет работе сети. Вы действительно хотите заплатить комиссию?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Синхронизировано</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Синхронизируется...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Подтвердите комиссию</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Исходящая транзакция</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Входящая транзакция</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Дата: %1 Количество: %2 Тип: %3 Адрес: %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>Обработка URI</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Fredcoin address or malformed URI parameters.</source> <translation>Не удалось обработать URI! Это может быть связано с неверным адресом Fredcoin или неправильными параметрами URI.</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Бумажник &lt;b&gt;зашифрован&lt;/b&gt; и в настоящее время &lt;b&gt;разблокирован&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Бумажник &lt;b&gt;зашифрован&lt;/b&gt; и в настоящее время &lt;b&gt;заблокирован&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Fredcoin can no longer continue safely and will quit.</source> <translation>Произошла неисправимая ошибка. Fredcoin не может безопасно продолжать работу и будет закрыт.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Сетевая Тревога</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Изменить адрес</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Метка</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Метка, связанная с данной записью</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Адрес</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>Адрес, связанный с данной записью.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Новый адрес для получения</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Новый адрес для отправки</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Изменение адреса для получения</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Изменение адреса для отправки</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Введённый адрес «%1» уже находится в адресной книге.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Fredcoin address.</source> <translation>Введённый адрес &quot;%1&quot; не является правильным Fredcoin-адресом.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Не удается разблокировать бумажник.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Генерация нового ключа не удалась.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Fredcoin-Qt</source> <translation>Fredcoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>версия</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Использование:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>параметры командной строки</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>Опции интерфейса</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Выберите язык, например &quot;de_DE&quot; (по умолчанию: как в системе)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Запускать свёрнутым</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Показывать сплэш при запуске (по умолчанию: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Опции</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Главная</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>Необязательная комиссия за каждый КБ транзакции, которая ускоряет обработку Ваших транзакций. Большинство транзакций занимают 1КБ.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Заплатить ко&amp;миссию</translation> </message> <message> <location line="+31"/> <source>Automatically start Fredcoin after logging in to the system.</source> <translation>Автоматически запускать Fredcoin после входа в систему</translation> </message> <message> <location line="+3"/> <source>&amp;Start Fredcoin on system login</source> <translation>&amp;Запускать Fredcoin при входе в систему</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>Сбросить все опции клиента на значения по умолчанию.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>&amp;Сбросить опции</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Сеть</translation> </message> <message> <location line="+6"/> <source>Automatically open the Fredcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Автоматически открыть порт для Fredcoin-клиента на роутере. Работает только если Ваш роутер поддерживает UPnP, и данная функция включена.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Пробросить порт через &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Fredcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Подключаться к сети Fredcoin через прокси SOCKS (например, при подключении через Tor).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Подключаться через SOCKS прокси:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP Прокси: </translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>IP-адрес прокси (например 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>По&amp;рт: </translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Порт прокси-сервера (например, 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Версия SOCKS:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Версия SOCKS-прокси (например, 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Окно</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Показывать только иконку в системном лотке после сворачивания окна.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Cворачивать в системный лоток вместо панели задач</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Сворачивать вместо закрытия. Если данная опция будет выбрана — приложение закроется только после выбора соответствующего пункта в меню.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>С&amp;ворачивать при закрытии</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>О&amp;тображение</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Язык интерфейса:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Fredcoin.</source> <translation>Здесь можно выбрать язык интерфейса. Настройки вступят в силу после перезапуска Fredcoin.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Отображать суммы в единицах: </translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Выберите единицу измерения монет при отображении и отправке.</translation> </message> <message> <location line="+9"/> <source>Whether to show Fredcoin addresses in the transaction list or not.</source> <translation>Показывать ли адреса Fredcoin в списке транзакций.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Показывать адреса в списке транзакций</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>О&amp;К</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Отмена</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Применить</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>по умолчанию</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>Подтвердите сброс опций</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>Некоторые настройки могут потребовать перезапуск клиента, чтобы вступить в силу.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>Желаете продолжить?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Внимание</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Fredcoin.</source> <translation>Эта настройка вступит в силу после перезапуска Fredcoin</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Адрес прокси неверен.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Форма</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Fredcoin network after a connection is established, but this process has not completed yet.</source> <translation>Отображаемая информация может быть устаревшей. Ваш бумажник автоматически синхронизируется с сетью Fredcoin после подключения, но этот процесс пока не завершён.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Баланс:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Не подтверждено:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Бумажник</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Незрелые:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Баланс добытых монет, который ещё не созрел</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Последние транзакции&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Ваш текущий баланс</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Общая сумма всех транзакций, которые до сих пор не подтверждены, и до сих пор не учитываются в текущем балансе</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>не синхронизировано</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start fredcoin: click-to-pay handler</source> <translation>Не удаётся запустить fredcoin: обработчик click-to-pay</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Диалог QR-кода</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Запросить платёж</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Количество:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Метка:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Сообщение:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Сохранить как...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Ошибка кодирования URI в QR-код</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Введено неверное количество, проверьте ещё раз.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>Получившийся URI слишком длинный, попробуйте сократить текст метки / сообщения.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Сохранить QR-код</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG Изображения (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Имя клиента</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>Н/Д</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Версия клиента</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Информация</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Используется версия OpenSSL</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Время запуска</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Сеть</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Число подключений</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>В тестовой сети</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Цепь блоков</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Текущее число блоков</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Расчётное число блоков</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Время последнего блока</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Открыть</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Параметры командной строки</translation> </message> <message> <location line="+7"/> <source>Show the Fredcoin-Qt help message to get a list with possible Fredcoin command-line options.</source> <translation>Показать помощь по Fredcoin-Qt, чтобы получить список доступных параметров командной строки.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Показать</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>Консоль</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Дата сборки</translation> </message> <message> <location line="-104"/> <source>Fredcoin - Debug window</source> <translation>Fredcoin - Окно отладки</translation> </message> <message> <location line="+25"/> <source>Fredcoin Core</source> <translation>Ядро Fredcoin</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Отладочный лог-файл</translation> </message> <message> <location line="+7"/> <source>Open the Fredcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Открыть отладочный лог-файл Fredcoin из текущего каталога данных. Это может занять несколько секунд для больших лог-файлов.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Очистить консоль</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Fredcoin RPC console.</source> <translation>Добро пожаловать в RPC-консоль Fredcoin.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Используйте стрелки вверх и вниз для просмотра истории и &lt;b&gt;Ctrl-L&lt;/b&gt; для очистки экрана.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Напишите &lt;b&gt;help&lt;/b&gt; для просмотра доступных команд.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Отправка</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Отправить нескольким получателям одновременно</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>&amp;Добавить получателя</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Удалить все поля транзакции</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Очистить &amp;всё</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Баланс:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Подтвердить отправку</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Отправить</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; адресату %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Подтвердите отправку монет</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Вы уверены, что хотите отправить %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> и </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>Адрес получателя неверный, пожалуйста, перепроверьте.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Количество монет для отправки должно быть больше 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Количество отправляемых монет превышает Ваш баланс</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Сумма превысит Ваш баланс, если комиссия в размере %1 будет добавлена к транзакции</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Обнаружен дублирующийся адрес. Отправка на один и тот же адрес возможна только один раз за одну операцию отправки</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Ошибка: не удалось создать транзакцию!</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Ошибка: В транзакции отказано. Такое может произойти, если некоторые монеты уже были потрачены, например, если Вы используете одну копию файла wallet.dat, а монеты были потрачены из другой копии, но не были отмечены как потраченные в этой.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Форма</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Ко&amp;личество:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Полу&amp;чатель:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Адрес, на который будет выслан платёж (например Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Введите метку для данного адреса (для добавления в адресную книгу)</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Метка:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Выберите адрес из адресной книги</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Вставить адрес из буфера обмена</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>Удалить этого получателя</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Fredcoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Введите Fredcoin-адрес (например 1LA5FtQhnnWnkK6zjFfutR7Stiit4wKd63)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Подписи - подписать/проверить сообщение</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;Подписать сообщение</translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Вы можете подписывать сообщения своими адресами, чтобы доказать владение ими. Будьте осторожны, не подписывайте что-то неопределённое, так как фишинговые атаки могут обманным путём заставить вас подписать нежелательные сообщения. Подписывайте только те сообщения, с которыми вы согласны вплоть до мелочей.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Адрес, которым вы хотите подписать сообщение (напр. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Выберите адрес из адресной книги</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>Вставить адрес из буфера обмена</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Введите сообщение для подписи</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Подпись</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Скопировать текущую подпись в системный буфер обмена</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Fredcoin address</source> <translation>Подписать сообщение, чтобы доказать владение адресом Fredcoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Подписать &amp;Сообщение</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Сбросить значения всех полей подписывания сообщений</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Очистить &amp;всё</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Проверить сообщение</translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Введите ниже адрес для подписи, сообщение (убедитесь, что переводы строк, пробелы, табы и т.п. в точности скопированы) и подпись, чтобы проверить сообщение. Убедитесь, что не скопировали лишнего в подпись, по сравнению с самим подписываемым сообщением, чтобы не стать жертвой атаки &quot;man-in-the-middle&quot;.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Адрес, которым было подписано сообщение (напр. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Fredcoin address</source> <translation>Проверить сообщение, чтобы убедиться, что оно было подписано указанным адресом Fredcoin</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>Проверить &amp;Сообщение</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Сбросить все поля проверки сообщения</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Fredcoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Введите адрес Fredcoin (напр. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Нажмите &quot;Подписать сообщение&quot; для создания подписи</translation> </message> <message> <location line="+3"/> <source>Enter Fredcoin signature</source> <translation>Введите подпись Fredcoin</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Введённый адрес неверен</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Пожалуйста, проверьте адрес и попробуйте ещё раз.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Введённый адрес не связан с ключом</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Разблокировка бумажника была отменена.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Для введённого адреса недоступен закрытый ключ</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Не удалось подписать сообщение</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Сообщение подписано</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Подпись не может быть раскодирована.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Пожалуйста, проверьте подпись и попробуйте ещё раз.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Подпись не соответствует отпечатку сообщения.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Проверка сообщения не удалась.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Сообщение проверено.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Fredcoin developers</source> <translation>Разработчики Fredcoin</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[тестовая сеть]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Открыто до %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/отключен</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/не подтверждено</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 подтверждений</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Статус</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, разослано через %n узел</numerusform><numerusform>, разослано через %n узла</numerusform><numerusform>, разослано через %n узлов</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Дата</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Источник</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Сгенерированно</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>От</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Для</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>свой адрес</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>метка</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Кредит</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>будет доступно через %n блок</numerusform><numerusform>будет доступно через %n блока</numerusform><numerusform>будет доступно через %n блоков</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>не принято</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Дебет</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Комиссия</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Чистая сумма</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Сообщение</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Комментарий:</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID транзакции</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Сгенерированные монеты должны подождать 120 блоков, прежде чем они могут быть потрачены. Когда Вы сгенерировали этот блок, он был отправлен в сеть для добавления в цепочку блоков. Если данная процедура не удастся, статус изменится на «не подтверждено», и монеты будут недействительны. Это иногда происходит в случае, если другой узел сгенерирует блок на несколько секунд раньше вас.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Отладочная информация</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Транзакция</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Входы</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Количество</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>истина</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>ложь</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, ещё не было успешно разослано</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Открыто для ещё %n блока</numerusform><numerusform>Открыто для ещё %n блоков</numerusform><numerusform>Открыто для ещё %n блоков</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>неизвестно</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Детали транзакции</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Данный диалог показывает детализированную статистику по выбранной транзакции</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Дата</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Тип</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Адрес</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Количество</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>Открыто для ещё %n блока</numerusform><numerusform>Открыто для ещё %n блоков</numerusform><numerusform>Открыто для ещё %n блоков</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Открыто до %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Оффлайн (%1 подтверждений)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Не подтверждено (%1 из %2 подтверждений)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Подтверждено (%1 подтверждений)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>Добытыми монетами можно будет воспользоваться через %n блок</numerusform><numerusform>Добытыми монетами можно будет воспользоваться через %n блока</numerusform><numerusform>Добытыми монетами можно будет воспользоваться через %n блоков</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Этот блок не был получен другими узлами и, возможно, не будет принят!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Сгенерированно, но не подтверждено</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Получено</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Получено от</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Отправлено</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Отправлено себе</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Добыто</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>[не доступно]</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Статус транзакции. Подведите курсор к нужному полю для того, чтобы увидеть количество подтверждений.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Дата и время, когда транзакция была получена.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Тип транзакции.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Адрес назначения транзакции.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Сумма, добавленная, или снятая с баланса.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Все</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Сегодня</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>На этой неделе</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>В этом месяце</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>За последний месяц</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>В этом году</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Промежуток...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Получено на</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Отправлено на</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Отправленные себе</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Добытые</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Другое</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Введите адрес или метку для поиска</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Мин. сумма</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Копировать адрес</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Копировать метку</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Скопировать сумму</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Скопировать ID транзакции</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Изменить метку</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Показать подробности транзакции</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Экспортировать данные транзакций</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Текст, разделённый запятыми (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Подтверждено</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Дата</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Тип</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Метка</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Адрес</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Количество</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Ошибка экспорта</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Невозможно записать в файл %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Промежуток от:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>до</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Отправка</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation>&amp;Экспорт</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Экспортировать данные из вкладки в файл</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Сделать резервную копию бумажника</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Данные бумажника (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Резервное копирование не удалось</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>При попытке сохранения данных бумажника в новое место произошла ошибка.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Резервное копирование успешно завершено</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Данные бумажника успешно сохранены в новое место.</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Fredcoin version</source> <translation>Версия</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Использование:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or fredcoind</source> <translation>Отправить команду на -server или fredcoind</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Список команд </translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Получить помощь по команде</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Опции:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: fredcoin.conf)</source> <translation>Указать конфигурационный файл (по умолчанию: fredcoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: fredcoind.pid)</source> <translation>Задать pid-файл (по умолчанию: fredcoin.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Задать каталог данных</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Установить размер кэша базы данных в мегабайтах (по умолчанию: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation>Принимать входящие подключения на &lt;port&gt; (по умолчанию: 9333 или 19333 в тестовой сети)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Поддерживать не более &lt;n&gt; подключений к узлам (по умолчанию: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Подключиться к узлу, чтобы получить список адресов других участников и отключиться</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Укажите ваш собственный публичный адрес</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Порог для отключения неправильно ведущих себя узлов (по умолчанию: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Число секунд блокирования неправильно ведущих себя узлов (по умолчанию: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Произошла ошибка при открытии RPC-порта %u для прослушивания на IPv4: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9332 or testnet: 19332)</source> <translation>Прослушивать подключения JSON-RPC на &lt;порту&gt; (по умолчанию: 9332 или для testnet: 19332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Принимать командную строку и команды JSON-RPC</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Запускаться в фоне как демон и принимать команды</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Использовать тестовую сеть</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Принимать подключения извне (по умолчанию: 1, если не используется -proxy или -connect)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=fredcoinrpc 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;Fredcoin Alert&quot; [email protected] </source> <translation>%s, вы должны установить опцию rpcpassword в конфигурационном файле: %s Рекомендуется использовать следующий случайный пароль: rpcuser=fredcoinrpc rpcpassword=%s (вам не нужно запоминать этот пароль) Имя и пароль ДОЛЖНЫ различаться. Если файл не существует, создайте его и установите права доступа только для владельца, только для чтения. Также рекомендуется включить alertnotify для оповещения о проблемах; Например: alertnotify=echo %%s | mail -s &quot;Fredcoin Alert&quot; [email protected] </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Произошла ошибка при открытии на прослушивание IPv6 RCP-порта %u, возвращаемся к IPv4: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Привязаться к указанному адресу и всегда прослушивать только его. Используйте [хост]:порт для IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Fredcoin is probably already running.</source> <translation>Не удаётся установить блокировку на каталог данных %s. Возможно, Fredcoin уже работает.</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Ошибка: транзакция была отклонена! Это могло произойти в случае, если некоторые монеты в вашем бумажнике уже были потрачены, например, если вы используете копию wallet.dat, и монеты были использованы в копии, но не отмечены как потраченные здесь.</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>Ошибка: эта транзакция требует комиссию как минимум %s из-за суммы, сложности или использования недавно полученных средств!</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Выполнить команду, когда приходит сообщение о тревоге (%s в команде заменяется на сообщение)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Выполнить команду, когда меняется транзакция в бумажнике (%s в команде заменяется на TxID)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Максимальный размер высокоприоритетных/низкокомиссионных транзакций в байтах (по умолчанию: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Это пре-релизная тестовая сборка - используйте на свой страх и риск - не используйте для добычи или торговых приложений</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Внимание: установлено очень большое значение -paytxfee. Это комиссия, которую вы заплатите при проведении транзакции.</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>Внимание: отображаемые транзакции могут быть некорректны! Вам или другим узлам, возможно, следует обновиться.</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Fredcoin will not work properly.</source> <translation>Внимание: убедитесь, что дата и время на Вашем компьютере выставлены верно. Если Ваши часы идут неправильно, Fredcoin будет работать некорректно.</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Внимание: ошибка чтения wallet.dat! Все ключи прочитаны верно, но данные транзакций или записи адресной книги могут отсутствовать или быть неправильными.</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Внимание: wallet.dat повреждён, данные спасены! Оригинальный wallet.dat сохранён как wallet.{timestamp}.bak в %s; если ваш баланс или транзакции некорректны, вы должны восстановить файл из резервной копии.</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Попытаться восстановить приватные ключи из повреждённого wallet.dat</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Параметры создания блоков:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Подключаться только к указанному узлу(ам)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>БД блоков повреждена</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Определить свой IP (по умолчанию: 1 при прослушивании и если не используется -externalip)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Пересобрать БД блоков прямо сейчас?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>Ошибка инициализации БД блоков</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Ошибка инициализации окружения БД бумажника %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Ошибка чтения базы данных блоков</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Не удалось открыть БД блоков</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Ошибка: мало места на диске!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Ошибка: бумажник заблокирован, невозможно создать транзакцию!</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Ошибка: системная ошибка:</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Не удалось начать прослушивание на порту. Используйте -listen=0 если вас это устраивает.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>Не удалось прочитать информацию блока</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>Не удалось прочитать блок</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>Не удалось синхронизировать индекс блоков</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>Не удалось записать индекс блоков</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>Не удалось записать информацию блока</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>Не удалось записать блок</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>Не удалось записать информацию файла</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>Не удалось записать БД монет</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>Не удалось записать индекс транзакций</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>Не удалось записать данные для отмены</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Искать узлы с помощью DNS (по умолчанию: 1, если не указан -connect)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>Включить добычу монет (по умолчанию: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Сколько блоков проверять при запуске (по умолчанию: 288, 0 = все)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>Насколько тщательно проверять блок (0-4, по умолчанию: 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation>Недостаточно файловых дескрипторов.</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Перестроить индекс цепи блоков из текущих файлов blk000??.dat</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Задать число потоков выполнения(по умолчанию: 4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Проверка блоков...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Проверка бумажника...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Импортировать блоки из внешнего файла blk000??.dat</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>Задать число потоков проверки скрипта (вплоть до 16, 0=авто, &lt;0 = оставить столько ядер свободными, по умолчанию: 0)</translation> </message> <message> <location line="+77"/> <source>Information</source> <translation>Информация</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Неверный адрес -tor: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Неверное количество в параметре -minrelaytxfee=&lt;кол-во&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Неверное количество в параметре -mintxfee=&lt;кол-во&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>Держать полный индекс транзакций (по умолчанию: 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Максимальный размер буфера приёма на соединение, &lt;n&gt;*1000 байт (по умолчанию: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Максимальный размер буфера отправки на соединение, &lt;n&gt;*1000 байт (по умолчанию: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Принимать цепь блоков, только если она соответствует встроенным контрольным точкам (по умолчанию: 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Подключаться только к узлам из сети &lt;net&gt; (IPv4, IPv6 или Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Выводить больше отладочной информации. Включает все остальные опции -debug*</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Выводить дополнительную сетевую отладочную информацию</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Дописывать отметки времени к отладочному выводу</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Fredcoin Wiki for SSL setup instructions)</source> <translation> Параметры SSL: (см. Fredcoin Wiki для инструкций по настройке SSL)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Выбрать версию SOCKS-прокси (4-5, по умолчанию: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Выводить информацию трассировки/отладки на консоль вместо файла debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Отправлять информацию трассировки/отладки в отладчик</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Максимальный размер блока в байтах (по умолчанию: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Минимальный размер блока в байтах (по умолчанию: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Сжимать файл debug.log при запуске клиента (по умолчанию: 1, если нет -debug)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>Не удалось подписать транзакцию</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Таймаут соединения в миллисекундах (по умолчанию: 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Системная ошибка:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation>Объём транзакции слишком мал</translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>Объём транзакции должен быть положителен</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>Транзакция слишком большая</translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Использовать UPnP для проброса порта (по умолчанию: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Использовать UPnP для проброса порта (по умолчанию: 1, если используется прослушивание)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Использовать прокси для скрытых сервисов (по умолчанию: тот же, что и в -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Имя для подключений JSON-RPC</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Внимание</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Внимание: эта версия устарела, требуется обновление!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>Вам необходимо пересобрать базы данных с помощью -reindex, чтобы изменить -txindex</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat повреждён, спасение данных не удалось</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Пароль для подключений JSON-RPC</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Разрешить подключения JSON-RPC с указанного IP</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Посылать команды узлу, запущенному на &lt;ip&gt; (по умолчанию: 127.0.0.1)</translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Выполнить команду, когда появляется новый блок (%s в команде заменяется на хэш блока)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Обновить бумажник до последнего формата</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Установить размер запаса ключей в &lt;n&gt; (по умолчанию: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Перепроверить цепь блоков на предмет отсутствующих в бумажнике транзакций</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Использовать OpenSSL (https) для подключений JSON-RPC</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Файл серверного сертификата (по умолчанию: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Приватный ключ сервера (по умолчанию: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Разрешённые алгоритмы (по умолчанию: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Эта справка</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Невозможно привязаться к %s на этом компьютере (bind вернул ошибку %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Подключаться через socks прокси</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Разрешить поиск в DNS для -addnode, -seednode и -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Загрузка адресов...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Ошибка загрузки wallet.dat: Бумажник поврежден</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Fredcoin</source> <translation>Ошибка загрузки wallet.dat: бумажник требует более новую версию Fredcoin</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Fredcoin to complete</source> <translation>Необходимо перезаписать бумажник, перезапустите Fredcoin для завершения операции.</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Ошибка при загрузке wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Неверный адрес -proxy: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>В параметре -onlynet указана неизвестная сеть: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>В параметре -socks запрошена неизвестная версия: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Не удаётся разрешить адрес в параметре -bind: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Не удаётся разрешить адрес в параметре -externalip: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Неверное количество в параметре -paytxfee=&lt;кол-во&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Неверное количество</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Недостаточно монет</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Загрузка индекса блоков...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Добавить узел для подключения и пытаться поддерживать соединение открытым</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Fredcoin is probably already running.</source> <translation>Невозможно привязаться к %s на этом компьютере. Возможно, Fredcoin уже работает.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Комиссия на килобайт, добавляемая к вашим транзакциям</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Загрузка бумажника...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Не удаётся понизить версию бумажника</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Не удаётся записать адрес по умолчанию</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Сканирование...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Загрузка завершена</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Чтобы использовать опцию %s</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Ошибка</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Вы должны установить rpcpassword=&lt;password&gt; в конфигурационном файле: %s Если файл не существует, создайте его и установите права доступа только для владельца.</translation> </message> </context> </TS>
FredKSchott/fredcoin
src/qt/locale/bitcoin_ru.ts
TypeScript
mit
134,913
/*! * Angular Material Design * https://github.com/angular/material * @license MIT * v1.1.0-rc.5-master-42833aa */ (function( window, angular, undefined ){ "use strict"; (function() { 'use strict'; /** * @ngdoc module * @name material.components.fabToolbar */ angular // Declare our module .module('material.components.fabToolbar', [ 'material.core', 'material.components.fabShared', 'material.components.fabActions' ]) // Register our directive .directive('mdFabToolbar', MdFabToolbarDirective) // Register our custom animations .animation('.md-fab-toolbar', MdFabToolbarAnimation) // Register a service for the animation so that we can easily inject it into unit tests .service('mdFabToolbarAnimation', MdFabToolbarAnimation); /** * @ngdoc directive * @name mdFabToolbar * @module material.components.fabToolbar * * @restrict E * * @description * * The `<md-fab-toolbar>` directive is used present a toolbar of elements (usually `<md-button>`s) * for quick access to common actions when a floating action button is activated (via click or * keyboard navigation). * * You may also easily position the trigger by applying one one of the following classes to the * `<md-fab-toolbar>` element: * - `md-fab-top-left` * - `md-fab-top-right` * - `md-fab-bottom-left` * - `md-fab-bottom-right` * * These CSS classes use `position: absolute`, so you need to ensure that the container element * also uses `position: absolute` or `position: relative` in order for them to work. * * @usage * * <hljs lang="html"> * <md-fab-toolbar md-direction='left'> * <md-fab-trigger> * <md-button aria-label="Add..."><md-icon icon="/img/icons/plus.svg"></md-icon></md-button> * </md-fab-trigger> * * <md-toolbar> * <md-fab-actions> * <md-button aria-label="Add User"> * <md-icon icon="/img/icons/user.svg"></md-icon> * </md-button> * * <md-button aria-label="Add Group"> * <md-icon icon="/img/icons/group.svg"></md-icon> * </md-button> * </md-fab-actions> * </md-toolbar> * </md-fab-toolbar> * </hljs> * * @param {string} md-direction From which direction you would like the toolbar items to appear * relative to the trigger element. Supports `left` and `right` directions. * @param {expression=} md-open Programmatically control whether or not the toolbar is visible. */ function MdFabToolbarDirective() { return { restrict: 'E', transclude: true, template: '<div class="_md-fab-toolbar-wrapper">' + ' <div class="_md-fab-toolbar-content" ng-transclude></div>' + '</div>', scope: { direction: '@?mdDirection', isOpen: '=?mdOpen' }, bindToController: true, controller: 'MdFabController', controllerAs: 'vm', link: link }; function link(scope, element, attributes) { // Add the base class for animations element.addClass('md-fab-toolbar'); // Prepend the background element to the trigger's button element.find('md-fab-trigger').find('button') .prepend('<div class="_md-fab-toolbar-background"></div>'); } } function MdFabToolbarAnimation() { function runAnimation(element, className, done) { // If no className was specified, don't do anything if (!className) { return; } var el = element[0]; var ctrl = element.controller('mdFabToolbar'); // Grab the relevant child elements var backgroundElement = el.querySelector('._md-fab-toolbar-background'); var triggerElement = el.querySelector('md-fab-trigger button'); var toolbarElement = el.querySelector('md-toolbar'); var iconElement = el.querySelector('md-fab-trigger button md-icon'); var actions = element.find('md-fab-actions').children(); // If we have both elements, use them to position the new background if (triggerElement && backgroundElement) { // Get our variables var color = window.getComputedStyle(triggerElement).getPropertyValue('background-color'); var width = el.offsetWidth; var height = el.offsetHeight; // Make it twice as big as it should be since we scale from the center var scale = 2 * (width / triggerElement.offsetWidth); // Set some basic styles no matter what animation we're doing backgroundElement.style.backgroundColor = color; backgroundElement.style.borderRadius = width + 'px'; // If we're open if (ctrl.isOpen) { // Turn on toolbar pointer events when closed toolbarElement.style.pointerEvents = 'inherit'; backgroundElement.style.width = triggerElement.offsetWidth + 'px'; backgroundElement.style.height = triggerElement.offsetHeight + 'px'; backgroundElement.style.transform = 'scale(' + scale + ')'; // Set the next close animation to have the proper delays backgroundElement.style.transitionDelay = '0ms'; iconElement && (iconElement.style.transitionDelay = '.3s'); // Apply a transition delay to actions angular.forEach(actions, function(action, index) { action.style.transitionDelay = (actions.length - index) * 25 + 'ms'; }); } else { // Turn off toolbar pointer events when closed toolbarElement.style.pointerEvents = 'none'; // Scale it back down to the trigger's size backgroundElement.style.transform = 'scale(1)'; // Reset the position backgroundElement.style.top = '0'; if (element.hasClass('md-right')) { backgroundElement.style.left = '0'; backgroundElement.style.right = null; } if (element.hasClass('md-left')) { backgroundElement.style.right = '0'; backgroundElement.style.left = null; } // Set the next open animation to have the proper delays backgroundElement.style.transitionDelay = '200ms'; iconElement && (iconElement.style.transitionDelay = '0ms'); // Apply a transition delay to actions angular.forEach(actions, function(action, index) { action.style.transitionDelay = 200 + (index * 25) + 'ms'; }); } } } return { addClass: function(element, className, done) { runAnimation(element, className, done); done(); }, removeClass: function(element, className, done) { runAnimation(element, className, done); done(); } } } })(); })(window, window.angular);
israel-11/solid-fiesta
node_modules/angular-material/modules/js/fabToolbar/fabToolbar.js
JavaScript
mit
6,794
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * import re class AboutSearch(Koan): def _truth_value(self, condition): """ A little trick to be able to test for True & False """ if condition: return 'true stuff' else: return 'false stuff' def test_search_finds_first_match_of_pattern_in_string(self): """ Search scans through string looking for pattern, stopping at first match. """ pattern = "a" s = "abcdefabcdef" self.assertEqual(__, re.search(pattern, s).group()) def test_search_must_not_start_at_the_beginning(self): """ Search finds pattern even if it is not matching the beginning of the string. """ pattern = "cde" s = "abcdefabcdef" self.assertEqual(__, re.search(pattern, s).group()) def test_empty_string_is_also_a_match(self): """ An empty string produces a zero-length match """ pattern = "" s = "abcdef" self.assertEqual(__, re.search(pattern, s).group()) def test_no_match(self): """ If no match is found, None is returned. """ pattern = "q" s = "abcdef" self.assertEqual(__, re.search(pattern, s)) # You can also test for False self.assertEqual(__, self._truth_value(re.search(pattern, s))) def test_a_successful_search_returns_a_match_object(self): """ A successful search returns a match object. """ pattern = "c" s = "abcdef" m = re.search(pattern, s) self.assertEqual("<type '_sre.SRE_Match'>", str(type(m))) # As explained before, _sre.SRE_Match objects always have a boolean # value of True. self.assertEqual(__, self._truth_value(m))
jnovinger/Python-Regexp-Koans
python2/koans/about_search.py
Python
mit
1,882
package tday93.common.blocks.tileentities; import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ITickable; /** * Created by tday93 on 1/18/2017. */ public class TileShield extends TileBase implements ITickable{ private static final String TAG_TIME = "time"; public int time = 30; @Override public void update(){ if (getWorld().isRemote){ if(time <0) return; if (time ==0) getWorld().setBlockToAir(getPos()); else time --; } } @Override public void writeSharedNBT(NBTTagCompound cmp){ cmp.setInteger(TAG_TIME, time); } @Override public void readSharedNBT(NBTTagCompound cmp){ time = cmp.getInteger(TAG_TIME); } }
tday93/Lrn_2_Spell
src/main/java/tday93/common/blocks/tileentities/TileShield.java
Java
mit
829
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace GarageKit { public class ManagerBase : MonoBehaviour { protected virtual void Awake() { } protected virtual void Start() { } protected virtual void Update() { } } }
sharkattack51/GarageKit_for_Unity
UnityProject/Assets/__ProjectName__/Scripts/Utils/Manager/Base/ManagerBase.cs
C#
mit
347
<section class="vbox"> <section class="scrollable"> <div id="masonry" class="pos-rlt animated fadeInUpBig"> <masonry [options]="masonryOptions"> <masonry-brick class="brick" *ngFor="let event of events"> <div class="item"> <div class="bottom gd bg-info wrapper"> <div class="m-t m-b"><a href="#" class="b-b b-info h4 text-u-c text-lt font-bold">Morbi</a> </div> <p class="hidden-xs">{{event.title}}</p> </div> <a href="#"><img src="assets/images/m9.jpg" alt="" class="img-full"> </a> </div> </masonry-brick> </masonry> </div> </section> </section>
vikasrana1987/angular2-music
src/app/events/events.component.html
HTML
mit
847
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>coinductive-reals: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.12.1 / coinductive-reals - 8.7.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> coinductive-reals <small> 8.7.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2021-11-05 05:36:06 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-11-05 05:36:06 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.12.1 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.07.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.07.1 Official release 4.07.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/coinductive-reals&quot; license: &quot;LGPL&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/CoinductiveReals&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} &quot;coq-qarith-stern-brocot&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword: real numbers&quot; &quot;keyword: co-inductive types&quot; &quot;keyword: co-recursion&quot; &quot;keyword: exact arithmetic&quot; &quot;category: Mathematics/Arithmetic and Number Theory/Real numbers&quot; &quot;date: 2007-04-24&quot; ] authors: [ &quot;Milad Niqui &lt;[email protected]&gt; [http://www.cs.ru.nl/~milad]&quot; ] bug-reports: &quot;https://github.com/coq-contribs/coinductive-reals/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/coinductive-reals.git&quot; synopsis: &quot;Real numbers as coinductive ternary streams&quot; description: &quot;&quot;&quot; http://www.cs.ru.nl/~milad/ETrees/coinductive-field/ See the README file&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/coinductive-reals/archive/v8.7.0.tar.gz&quot; checksum: &quot;md5=add528791eebf008f2236f6c33a12cd4&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-coinductive-reals.8.7.0 coq.8.12.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.12.1). The following dependencies couldn&#39;t be met: - coq-coinductive-reals -&gt; coq &lt; 8.8~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-coinductive-reals.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.07.1-2.0.6/released/8.12.1/coinductive-reals/8.7.0.html
HTML
mit
7,127
import {getMetadataArgsStorage} from "../../globals"; import {EventListenerTypes} from "../../metadata/types/EventListenerTypes"; import {EntityListenerMetadataArgs} from "../../metadata-args/EntityListenerMetadataArgs"; /** * Calls a method on which this decorator is applied before this entity insertion. */ export function BeforeInsert(): PropertyDecorator { return function (object: Object, propertyName: string) { getMetadataArgsStorage().entityListeners.push({ target: object.constructor, propertyName: propertyName, type: EventListenerTypes.BEFORE_INSERT } as EntityListenerMetadataArgs); }; }
typeorm/typeorm
src/decorator/listeners/BeforeInsert.ts
TypeScript
mit
665
// std=c++11 #include <iostream> #include <string> #include <deque> using namespace std; int main() { string str; cin >> str; deque<char> q; for (char i : str) { if (not q.empty() and q.back() == i) q.pop_back(); else q.push_back(i); } while (not q.empty()) { cout << q.front(); q.pop_front(); } cout << endl; return 0; }
hangim/ACM
URAL/1654_Cipher Message/1654.cc
C++
mit
420