repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
sideci-sample/sideci-sample-twitter
spec/twitter/direct_message_spec.rb
8639
# coding: utf-8 require 'helper' describe Twitter::DirectMessage do before do @old_stderr = $stderr $stderr = StringIO.new end after do $stderr = @old_stderr end describe '#==' do it 'returns true when objects IDs are the same' do direct_message = Twitter::DirectMessage.new(:id => 1, :text => 'foo') other = Twitter::DirectMessage.new(:id => 1, :text => 'bar') expect(direct_message == other).to be true end it 'returns false when objects IDs are different' do direct_message = Twitter::DirectMessage.new(:id => 1) other = Twitter::DirectMessage.new(:id => 2) expect(direct_message == other).to be false end it 'returns false when classes are different' do direct_message = Twitter::DirectMessage.new(:id => 1) other = Twitter::Identity.new(:id => 1) expect(direct_message == other).to be false end end describe '#created_at' do it 'returns a Time when created_at is set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345, :created_at => 'Mon Jul 16 12:59:01 +0000 2007') expect(direct_message.created_at).to be_a Time end it 'returns nil when created_at is not set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345) expect(direct_message.created_at).to be_nil end end describe '#created?' do it 'returns true when created_at is set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345, :created_at => 'Mon Jul 16 12:59:01 +0000 2007') expect(direct_message.created?).to be true end it 'returns false when created_at is not set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345) expect(direct_message.created?).to be false end end describe '#entities?' do it 'returns true if there are entities set' do urls_array = [ { :url => 'https://t.co/L2xIBazMPf', :expanded_url => 'http://example.com/expanded', :display_url => 'example.com/expanded…', :indices => [10, 33], } ] tweet = Twitter::DirectMessage.new(:id => 1_825_786_345, :entities => {:urls => urls_array}) expect(tweet.entities?).to be true end it 'returns false if there are blank lists of entities set' do tweet = Twitter::DirectMessage.new(:id => 1_825_786_345, :entities => {:urls => []}) expect(tweet.entities?).to be false end it 'returns false if there are no entities set' do tweet = Twitter::DirectMessage.new(:id => 1_825_786_345) expect(tweet.entities?).to be false end end describe '#recipient' do it 'returns a User when recipient is set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345, :recipient => {:id => 7_505_382}) expect(direct_message.recipient).to be_a Twitter::User end it 'returns nil when recipient is not set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345) expect(direct_message.recipient).to be_nil end end describe '#recipient?' do it 'returns true when recipient is set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345, :recipient => {:id => 7_505_382}) expect(direct_message.recipient?).to be true end it 'returns false when recipient is not set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345) expect(direct_message.recipient?).to be false end end describe '#sender' do it 'returns a User when sender is set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345, :sender => {:id => 7_505_382}) expect(direct_message.sender).to be_a Twitter::User end it 'returns nil when sender is not set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345) expect(direct_message.sender).to be_nil end end describe '#sender?' do it 'returns true when sender is set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345, :sender => {:id => 7_505_382}) expect(direct_message.sender?).to be true end it 'returns false when sender is not set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345) expect(direct_message.sender?).to be false end end describe '#hashtags' do it 'returns an array of Entity::Hashtag when entities are set' do hashtags_array = [ { :text => 'twitter', :indices => [10, 33], } ] hashtags = Twitter::DirectMessage.new(:id => 1_825_786_345, :entities => {:hashtags => hashtags_array}).hashtags expect(hashtags).to be_an Array expect(hashtags.first).to be_a Twitter::Entity::Hashtag expect(hashtags.first.indices).to eq([10, 33]) expect(hashtags.first.text).to eq('twitter') end it 'is empty when not set' do hashtags = Twitter::DirectMessage.new(:id => 1_825_786_345).hashtags expect(hashtags).to be_empty end end describe '#media' do it 'returns media' do media = Twitter::DirectMessage.new(:id => 1_825_786_345, :entities => {:media => [{:id => 1, :type => 'photo'}]}).media expect(media).to be_an Array expect(media.first).to be_a Twitter::Media::Photo end it 'is empty when not set' do media = Twitter::DirectMessage.new(:id => 1_825_786_345).media expect(media).to be_empty end end describe '#symbols' do it 'returns an array of Entity::Symbol when symbols are set' do symbols_array = [ {:text => 'PEP', :indices => [114, 118]}, {:text => 'COKE', :indices => [128, 133]} ] symbols = Twitter::DirectMessage.new(:id => 1_825_786_345, :entities => {:symbols => symbols_array}).symbols expect(symbols).to be_an Array expect(symbols.size).to eq(2) expect(symbols.first).to be_a Twitter::Entity::Symbol expect(symbols.first.indices).to eq([114, 118]) expect(symbols.first.text).to eq('PEP') end it 'is empty when not set' do symbols = Twitter::DirectMessage.new(:id => 1_825_786_345).symbols expect(symbols).to be_empty end end describe '#uris' do it 'returns an array of Entity::URIs when entities are set' do urls_array = [ { :url => 'https://t.co/L2xIBazMPf', :expanded_url => 'http://example.com/expanded', :display_url => 'example.com/expanded…', :indices => [10, 33], } ] direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345, :entities => {:urls => urls_array}) expect(direct_message.uris).to be_an Array expect(direct_message.uris.first).to be_a Twitter::Entity::URI expect(direct_message.uris.first.indices).to eq([10, 33]) expect(direct_message.uris.first.display_uri).to be_a String expect(direct_message.uris.first.display_uri).to eq('example.com/expanded…') end it 'is empty when not set' do direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345) expect(direct_message.uris).to be_empty end it 'can handle strange urls' do urls_array = [ { :url => 'https://t.co/L2xIBazMPf', :expanded_url => 'http://with_underscore.example.com/expanded', :display_url => 'with_underscore.example.com/expanded…', :indices => [10, 33], } ] direct_message = Twitter::DirectMessage.new(:id => 1_825_786_345, :entities => {:urls => urls_array}) uri = direct_message.uris.first expect { uri.url }.not_to raise_error expect { uri.expanded_url }.not_to raise_error expect { uri.display_url }.not_to raise_error end end describe '#user_mentions' do it 'returns an array of Entity::UserMention when entities are set' do user_mentions_array = [ { :screen_name => 'sferik', :name => 'Erik Michaels-Ober', :id_str => '7_505_382', :indices => [0, 6], :id => 7_505_382, } ] user_mentions = Twitter::DirectMessage.new(:id => 1_825_786_345, :entities => {:user_mentions => user_mentions_array}).user_mentions expect(user_mentions).to be_an Array expect(user_mentions.first).to be_a Twitter::Entity::UserMention expect(user_mentions.first.indices).to eq([0, 6]) expect(user_mentions.first.id).to eq(7_505_382) end it 'is empty when not set' do user_mentions = Twitter::DirectMessage.new(:id => 1_825_786_345).user_mentions expect(user_mentions).to be_empty end end end
mit
DMDirc/Util
src/test/java/com/dmdirc/util/collections/ObservableListDecoratorTest.java
4819
/* * Copyright (c) 2006-2017 DMDirc Developers * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package com.dmdirc.util.collections; import java.util.Arrays; import java.util.LinkedList; import java.util.List; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.anyInt; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; public class ObservableListDecoratorTest { private List<String> list; private ObservableList<String> obslist; private ListObserver observer; @Before public void setup() { list = new LinkedList<>(); obslist = new ObservableListDecorator<>(list); observer = mock(ListObserver.class); obslist.addListListener(observer); } @Test public void testAddingSingleEntryFiresListener() { obslist.add("test"); verify(observer).onItemsAdded(obslist, 0, 0); obslist.add("test"); verify(observer).onItemsAdded(obslist, 1, 1); } @Test public void testAddingSingleEntryAtIndexFiresListener() { list.addAll(Arrays.asList("one", "two", "three", "four")); obslist.add(1, "one point five"); verify(observer).onItemsAdded(obslist, 1, 1); } @Test public void testAddingRangeFiresListener() { obslist.addAll(Arrays.asList("one", "two", "three", "four")); verify(observer).onItemsAdded(obslist, 0, 3); obslist.addAll(Arrays.asList("one", "two", "three", "four")); verify(observer).onItemsAdded(obslist, 4, 7); } @Test public void testAddingRangeAtIndexFiresListener() { list.addAll(Arrays.asList("one", "two", "three", "four")); obslist.addAll(1, Arrays.asList("one", "two", "three", "four")); verify(observer).onItemsAdded(obslist, 1, 5); } @Test public void testClearingFiresListener() { list.addAll(Arrays.asList("one", "two", "three", "four")); obslist.clear(); verify(observer).onItemsRemoved(obslist, 0, 3); } @Test public void testClearingEmptyListDoesntFireListener() { obslist.clear(); verify(observer, never()).onItemsRemoved(any(), anyInt(), anyInt()); } @Test public void testRemovingByIndexFiresListener() { list.addAll(Arrays.asList("one", "two", "three", "four")); obslist.remove(2); verify(observer).onItemsRemoved(obslist, 2, 2); } @Test public void testRemovingByObjectFiresListener() { list.addAll(Arrays.asList("one", "two", "three", "four")); obslist.remove("three"); verify(observer).onItemsRemoved(obslist, 2, 2); } @Test public void testRemovingListenerStopsFutureCalls() { obslist.removeListListener(observer); obslist.add("test"); verify(observer, never()).onItemsAdded(obslist, 0, 0); } @Test public void testSize() { assertEquals(0, obslist.size()); obslist.add("test"); assertEquals(1, obslist.size()); obslist.add("test"); assertEquals(2, obslist.size()); } @Test public void testIsEmpty() { assertTrue(obslist.isEmpty()); obslist.add("test"); assertFalse(obslist.isEmpty()); obslist.remove("test"); assertTrue(obslist.isEmpty()); } @Test public void testContains() { assertFalse(obslist.contains("test")); obslist.add("test"); assertTrue(obslist.contains("test")); obslist.remove("test"); assertFalse(obslist.contains("test")); } }
mit
jasonHooten/NightOwl
config/general.js
323
module.exports = { 'notifications' : { enabled: false, //if disabled, no notifications will be sent to: ['jason.hooten@gmail.com'], //default notification list if no alert_to is specified for host or url postmark : { from: 'jason.hooten@gmail.com', api_key : 'your-postmark-key-here' } } };
mit
jarick/bx
src/BX/Validator/Collection/BooleanValidator.php
2990
<?php namespace BX\Validator\Collection; class BooleanValidator extends BaseValidator { use \BX\String\StringTrait, \BX\Translate\TranslateTrait; /** * @var mixed */ protected $true_value = 'Y'; /** * @var mixed */ protected $false_value = 'N'; /** * @var boolean */ protected $strict = false; /** * @var string */ protected $message_invalid = null; /** * @var string */ protected $message_empty = null; /** * Return message empty * * @return string */ protected function getMessageEmpty() { $message = $this->message_empty; if ($message === null){ $message = $this->trans('validator.collection.boolean.empty'); } return $message; } /** * Set message empty * * @param string $message_empty * @return \BX\Validator\Collection\BooleanValidator */ public function setMessageEmpty($message_empty) { $this->message_empty = $message_empty; return $this; } /** * Set message invalid * * @param string $message_invalid * @return \BX\Validator\Collection\Boolean */ public function setMessageInvalid($message_invalid) { $this->message_invalid = $message_invalid; return $this; } /** * Return message invalid * * @return string */ protected function getMessageInvalid() { $message = $this->message_invalid; if ($message === null){ $message = $this->trans('validator.collection.boolean.invalid'); } return $message; } /** * Set value * * @param mixed $true_value * @param mixed $false_value * @return \BX\Validator\Collection\Boolean */ public function setValue($true_value,$false_value) { $this->true_value = $true_value; $this->false_value = $false_value; return $this; } /** * Set strict * * @param boolean $strict * @return \BX\Validator\Collection\Boolean */ public function strict($strict = true) { $this->strict = (bool)$strict; return $this; } /** * Validate * @param string $key * @param string $value * @param string $label * @param array $fields * @return boolean */ public function validate($key,$value,$label,&$fields) { if (is_array($value) || is_object($value)){ $this->addError($key,$this->getMessageInvalid(),['#LABEL#' => $label]); return false; } if ($this->isEmpty($value)){ if (!$this->empty){ $this->addError($key,$this->getMessageEmpty(),['#LABEL#' => $label]); return false; }else{ return true; } } if ($this->strict){ if ($value !== $this->true_value && $value !== $this->false_value){ $this->addError($key,$this->getMessageInvalid(),[ '#LABEL#' => $label, '#TRUE#' => $this->true_value, '#FALSE#' => $this->false_value, ]); return false; } }else{ if ($value != $this->true_value && $value != $this->false_value){ $this->addError($key,$this->getMessageInvalid(),[ '#LABEL#' => $label, '#TRUE#' => $this->true_value, '#FALSE#' => $this->false_value, ]); return false; } } return true; } }
mit
2She2/WebSevices
07.Web-Services-Testing/BugTracker.Data/BugTrackerData.cs
1397
namespace BugTracker.Data { using System; using System.Collections.Generic; using BugTracker.Data.Contracts; using BugTracker.Data.Repositories; using BugTracker.Model; public class BugTrackerData : IBugTrackerData { private readonly IBugTrackerDbContext context; private readonly IDictionary<Type, object> repositories; public BugTrackerData() : this(new BugTrackerDbContext()) { } public BugTrackerData(IBugTrackerDbContext context) { this.context = context; this.repositories = new Dictionary<Type, object>(); } public IRepository<Bug> Bugs { get { return this.GetRepository<Bug>(); } } public void SaveChanges() { this.context.SaveChanges(); } private EfRepository<T> GetRepository<T>() where T : class { var typeOfModel = typeof(T); if (this.repositories.ContainsKey(typeOfModel)) { return (EfRepository<T>)this.repositories[typeOfModel]; } var type = typeof(EfRepository<T>); this.repositories.Add(typeOfModel, Activator.CreateInstance(type, this.context)); return (EfRepository<T>)this.repositories[typeOfModel]; } } }
mit
jilustrisimo/group-project-organizer
config/initializers/session_store.rb
155
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_group-project-organizer_session'
mit
Azure/azure-sdk-for-ruby
management/azure_mgmt_authorization/lib/profiles/v2018_03_01/authorization_v2018_03_01_profile_client.rb
1399
# encoding: utf-8 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. require 'profiles/v2018_03_01/authorization_module_definition' require 'profiles/v2018_03_01/modules/authorization_profile_module' module Azure::Authorization::Profiles::V2018_03_01 module Mgmt # # Client class for the V2018_03_01 profile SDK. # class Client < AuthorizationManagementClass include MsRestAzure::Common::Configurable # # Initializes a new instance of the Client class. # @param options [Hash] hash of client options. # options = { # tenant_id: 'YOUR TENANT ID', # client_id: 'YOUR CLIENT ID', # client_secret: 'YOUR CLIENT SECRET', # subscription_id: 'YOUR SUBSCRIPTION ID', # credentials: credentials, # active_directory_settings: active_directory_settings, # base_url: 'YOUR BASE URL', # options: options # } # 'credentials' are optional and if not passed in the hash, will be obtained # from MsRest::TokenCredentials using MsRestAzure::ApplicationTokenProvider. # # Also, base_url, active_directory_settings & options are optional. # def initialize(options = {}) super(options) end end end end
mit
kevinkraft/RTS_3
src/graphics/TextMaker.cpp
891
#include "SDL.h" #include "SDL_image.h" #include "SDL_ttf.h" #include "TextMaker.h" #include "logging.h" TextMaker::TextMaker(std::string fontFile, SDL_Renderer *renderer, SDL_Window *window) { mRenderer = nullptr; mWindow = nullptr; mRenderer = renderer; mWindow = window; setFontFile(fontFile); openFont(); //setActive(false); } TextMaker::~TextMaker() { std::cout << "TextMaker::~TexMaker: INFO: Closing Font " << std::endl; TTF_CloseFont(mFont); std::cout << "Deleting TextMaker" << std::endl; } void TextMaker::openFont() { //Open the font std::cout << "TextMaker::openFont: INFO: Before Opening the font" << std::endl; TTF_Font *font = TTF_OpenFont(mFontFile.c_str(), mFontSize); if (font == nullptr){ logSDLError(std::cout, "TTF_OpenFont"); } std::cout << "TextMaker::openFont: INFO: After Opening the font" << std::endl; mFont = font; }
mit
bloomen/transwarp
docs/search/searchdata.js
548
var indexSectionsWithContent = { 0: "abcdefghilmnprstuvw", 1: "abcdefilmnprstuvw", 2: "t", 3: "abcdefghilmnprstuvw", 4: "acnrw", 5: "rt", 6: "et", 7: "abcrw", 8: "t" }; var indexSectionNames = { 0: "all", 1: "classes", 2: "namespaces", 3: "functions", 4: "variables", 5: "typedefs", 6: "enums", 7: "enumvalues", 8: "pages" }; var indexSectionLabels = { 0: "All", 1: "Classes", 2: "Namespaces", 3: "Functions", 4: "Variables", 5: "Typedefs", 6: "Enumerations", 7: "Enumerator", 8: "Pages" };
mit
gleblebedev/asynccommand
src/WpfAsyncCommand.net40/AsyncCommandFactory.cs
1692
using System; namespace WpfAsyncCommand { public static class AsyncCommandFactory { #region Public Methods and Operators public static IAsyncCommand<T> Create<T>(Func<T> func) { return new AsyncCommand<T>((a) => func()); } public static IAsyncCommand<T> Create<T>(Func<AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, T> end) { return new AsyncCommand<T>((arg, callback, state) => begin(callback, state), end); } public static IAsyncCommand<T> Create<TARG0, T>(Func<TARG0, T> func, Func<object, Tuple<TARG0>> argFactory) { return new AsyncCommand<T>((object arg) => { return func(argFactory(arg).Item1); }); } public static IAsyncCommand<T> Create<TARG0, T>( Func<TARG0, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, T> end, Func<object, Tuple<TARG0>> argFactory) { return new AsyncCommand<T>((arg, callback, state) => begin(argFactory(arg).Item1, callback, state), end); } public static IAsyncCommand<T> Create<TARG0, TARG1, T>( Func<TARG0, TARG1, T> func, Func<object, Tuple<TARG0, TARG1>> argFactory) { return new AsyncCommand<T>( (object arg) => { var actualArgs = argFactory(arg); return func(actualArgs.Item1, actualArgs.Item2); }); } public static IAsyncCommand<T> Create<TARG0, TARG1, T>( Func<TARG0, TARG1, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, T> end, Func<object, Tuple<TARG0, TARG1>> argFactory) { return new AsyncCommand<T>( (arg, callback, state) => { var actualArgs = argFactory(arg); return begin(actualArgs.Item1, actualArgs.Item2, callback, state); }, end); } #endregion } }
mit
solher/snakepit-seed
validators/sessions.go
506
package validators import ( "github.com/Sirupsen/logrus" "github.com/solher/snakepit" "github.com/solher/snakepit-seed/models" ) type ( Sessions struct { snakepit.Validator } ) func NewSessions(l *logrus.Entry) *Sessions { return &Sessions{ Validator: *snakepit.NewValidator(l), } } func (v *Sessions) Output(sessions []models.Session) []models.Session { for i := range sessions { sessions[i].Policies = nil sessions[i].Payload = "" sessions[i].OwnerToken = "" } return sessions }
mit
ConorOBrien-Foxx/Spacewar-KotH
bots/bot_SmartArrow.js
2421
function SmartArrow_setup(team) { var botVars = {}; botVars['mpref'] = team + '_'; botVars['epref'] = team == 'red' ? 'blue_' : 'red_'; botVars['ecolor'] = team == 'red' ? 'blue' : 'red'; return botVars; } function SmartArrow_getActions(gameInfo, botVars) { var actions = []; var x = gameInfo[botVars['mpref'] + 'x'], y = gameInfo[botVars['mpref'] + 'y'], rot = gameInfo[botVars['mpref'] + 'rot']; // SmartArrow position and rotation var ex = gameInfo[botVars['epref'] + 'x'], ey = gameInfo[botVars['epref'] + 'y']; // Enemy position var sunx = gameInfo.sun_x, suny = gameInfo.sun_y; // Sun position var Dsunx = Math.abs(x - sunx), Dsuny = Math.abs(y - suny); // Sun position delta var dex = Math.abs(x - ex), dey = Math.abs(y - ey); // Enemy position delta var sangle = Math.degrees(Math.atan2(suny - y, sunx - x)), snrot = (rot - sangle + 360) % 360; if (Dsunx < 40 && Dsuny < 40) // If SmartArrow is too close from sun, hyperspace ! return ['hyperspace']; var missiles = gameInfo.missiles; for (var i = 0; i < missiles.length; i++) { // Avoid all these silly missiles var dx = Math.abs(x - missiles[i].x), dy = Math.abs(y - missiles[i].y); if (dx < 10 && dy < 10) return ['hyperspace']; } if (gameInfo[botVars['epref'] + 'alive']) { // If his enemy is alive, SmartArrow try to kill him (logic) var angle = Math.degrees(Math.atan2(ey - y, ex - x)), nrot = (rot - angle + 360) % 360; if (nrot > 90 && nrot < 270) actions.push('turn left'); else actions.push('turn right'); if (nrot > 80 && nrot < 100 && Math.random() > 0.5) actions.push('fire missile'); // If SmartArrow is in a good spot, shot this silly oponnent if (Math.random() > 0.5) actions.push('fire engine'); } else { // Simply (try to) act like SunAvoider if his enemy is dead if (snrot > 90 && snrot < 270) actions.push('turn right'); else actions.push('turn left'); if (Dsunx < 300 && Dsuny < 300) actions.push('fire engine'); if (dex < 40 && dey < 40) actions.push('hyperspace'); // Dying on the corpse of his opponent is dumb. } return actions; }
mit
cristianosoares/Sistema-Dotz
application/forms/Login.php
675
<?php class Application_Form_Login extends Zend_Form { public function init() { $login = new Zend_Form_Element_Text('login'); $login->setLabel('USERNAME') ->setRequired(true) ->addFilter('StripTags') ->addFilter('StringTrim') ->addValidator('NotEmpty'); $senha = new Zend_Form_Element_Password('senha'); $senha->setLabel('PASSWORD') ->setRequired(true) ->addFilter('StripTags') ->addFilter('StringTrim') ->addValidator('NotEmpty'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Login') ->setAttrib('id', 'submitbutton'); $this->addElements(array($login, $senha, $submit)); } }
mit
drorgl/node-alvision
src/opencv/features2d/BRISK.cc
4143
#include "BRISK.h" namespace brisk_general_callback { std::shared_ptr<overload_resolution> overload; NAN_METHOD(callback) { if (overload == nullptr) { throw std::runtime_error("brisk_general_callback is empty"); } return overload->execute("brisk", info); } } Nan::Persistent<FunctionTemplate> BRISK::constructor; void BRISK::Init(Handle<Object> target, std::shared_ptr<overload_resolution> overload) { brisk_general_callback::overload = overload; Local<FunctionTemplate> ctor = Nan::New<FunctionTemplate>(brisk_general_callback::callback); constructor.Reset(ctor); auto itpl = ctor->InstanceTemplate(); itpl->SetInternalFieldCount(1); ctor->SetClassName(Nan::New("BRISK").ToLocalChecked()); ctor->Inherit(Nan::New(Feature2D::constructor)); overload->register_type<BRISK>(ctor, "brisk", "BRISK"); overload->addOverloadConstructor("brisk", "BRISK", {}, New); // //! @addtogroup features2d_main // //! @{ // // /** @brief Class implementing the BRISK keypoint detector and descriptor extractor, described in @cite LCS11 . // */ // class CV_EXPORTS_W BRISK : public Feature2D // { // public: // /** @brief The BRISK constructor // // @param thresh AGAST detection threshold score. // @param octaves detection octaves. Use 0 to do single scale. // @param patternScale apply this scale to the pattern used for sampling the neighbourhood of a // keypoint. // */ // CV_WRAP static Ptr<BRISK> create(int thresh = 30, int octaves = 3, float patternScale = 1.0f); overload->addStaticOverload("brisk", "BRISK", "create", { make_param<int>("thresh","int", 30), make_param<int>("octaves","int", 3), make_param<float>("patternScale","float", 1.0f) }, create_a); // // /** @brief The BRISK constructor for a custom pattern // // @param radiusList defines the radii (in pixels) where the samples around a keypoint are taken (for // keypoint scale 1). // @param numberList defines the number of sampling points on the sampling circle. Must be the same // size as radiusList.. // @param dMax threshold for the short pairings used for descriptor formation (in pixels for keypoint // scale 1). // @param dMin threshold for the long pairings used for orientation determination (in pixels for // keypoint scale 1). // @param indexChange index remapping of the bits. */ // CV_WRAP static Ptr<BRISK> create(const std::vector<float> &radiusList, const std::vector<int> &numberList, // float dMax = 5.85f, float dMin = 8.2f, const std::vector<int>& indexChange = std::vector<int>()); overload->addStaticOverload("brisk", "BRISK", "", { make_param<std::shared_ptr<std::vector<float>>>("radiusList","Array<float>"), make_param<std::shared_ptr<std::vector<int>>>("numberList","Array<int>"), make_param<float>("dMax","float", 5.85f), make_param<float>("dMin","float", 8.2f), make_param<std::shared_ptr<std::vector<int>>>("indexChange","Array<int>",nullptr) }, create_b); // }; Nan::SetMethod(ctor, "create", brisk_general_callback::callback); target->Set(Nan::New("BRISK").ToLocalChecked(), ctor->GetFunction()); } v8::Local<v8::Function> BRISK::get_constructor() { assert(!constructor.IsEmpty() && "constructor is empty"); return Nan::New(constructor)->GetFunction(); } POLY_METHOD(BRISK::New) { auto ret = new BRISK(); ret->Wrap(info.Holder()); info.GetReturnValue().Set(info.Holder()); } POLY_METHOD(BRISK::create_a){ auto thresh = info.at<int>(0); auto octaves = info.at<int>(1); auto patternScale = info.at<float>(2); auto ret = new BRISK(); ret->_algorithm = cv::BRISK::create(thresh, octaves, patternScale); info.SetReturnValue(ret); } POLY_METHOD(BRISK::create_b){ auto radiusList = info.at<std::shared_ptr<std::vector<float>>>(0); auto numberList = info.at<std::shared_ptr<std::vector<int>>>(1); auto dMax = info.at<float>(2); auto dMin = info.at<float>(3); auto indexChange = info.at<std::shared_ptr<std::vector<int>>>(3); auto ret = new BRISK(); ret->_algorithm = cv::BRISK::create(*radiusList, *numberList, dMax, dMin, *indexChange); info.SetReturnValue(ret); }
mit
WsdlToPhp/PackageEws365
src/ServiceType/EwsSend.php
3879
<?php declare(strict_types=1); namespace ServiceType; use SoapFault; use SoapClient\SoapClientBase; /** * This class stands for Send ServiceType * @package Ews * @subpackage Services * @author WsdlToPhp <contact@wsdltophp.com> */ class EwsSend extends SoapClientBase { /** * Sets the ExchangeImpersonation SoapHeader param * @uses SoapClientBase::setSoapHeader() * @param \StructType\EwsExchangeImpersonationType $exchangeImpersonation * @param string $namespace * @param bool $mustUnderstand * @param string $actor * @return \ServiceType\EwsSend */ public function setSoapHeaderExchangeImpersonation(\StructType\EwsExchangeImpersonationType $exchangeImpersonation, string $namespace = 'http://schemas.microsoft.com/exchange/services/2006/types', bool $mustUnderstand = false, ?string $actor = null): self { return $this->setSoapHeader($namespace, 'ExchangeImpersonation', $exchangeImpersonation, $mustUnderstand, $actor); } /** * Sets the MailboxCulture SoapHeader param * @uses SoapClientBase::setSoapHeader() * @param \StructType\EwsMailboxCultureType $mailboxCulture * @param string $namespace * @param bool $mustUnderstand * @param string $actor * @return \ServiceType\EwsSend */ public function setSoapHeaderMailboxCulture(\StructType\EwsMailboxCultureType $mailboxCulture, string $namespace = 'http://schemas.microsoft.com/exchange/services/2006/types', bool $mustUnderstand = false, ?string $actor = null): self { return $this->setSoapHeader($namespace, 'MailboxCulture', $mailboxCulture, $mustUnderstand, $actor); } /** * Sets the RequestServerVersion SoapHeader param * @uses SoapClientBase::setSoapHeader() * @param \StructType\EwsRequestServerVersion $requestServerVersion * @param string $namespace * @param bool $mustUnderstand * @param string $actor * @return \ServiceType\EwsSend */ public function setSoapHeaderRequestServerVersion(\StructType\EwsRequestServerVersion $requestServerVersion, string $namespace = 'http://schemas.microsoft.com/exchange/services/2006/types', bool $mustUnderstand = false, ?string $actor = null): self { return $this->setSoapHeader($namespace, 'RequestServerVersion', $requestServerVersion, $mustUnderstand, $actor); } /** * Method to call the operation originally named SendItem * Meta information extracted from the WSDL * - SOAPHeaderNames: ExchangeImpersonation, MailboxCulture, RequestServerVersion * - SOAPHeaderNamespaces: http://schemas.microsoft.com/exchange/services/2006/types, http://schemas.microsoft.com/exchange/services/2006/types, http://schemas.microsoft.com/exchange/services/2006/types * - SOAPHeaderTypes: \StructType\EwsExchangeImpersonationType, \StructType\EwsMailboxCultureType, \StructType\EwsRequestServerVersion * - SOAPHeaders: required, required, required * @uses SoapClientBase::getSoapClient() * @uses SoapClientBase::setResult() * @uses SoapClientBase::saveLastError() * @param \StructType\EwsSendItemType $request * @return \StructType\EwsSendItemResponseType|bool */ public function SendItem(\StructType\EwsSendItemType $request) { try { $this->setResult($resultSendItem = $this->getSoapClient()->__soapCall('SendItem', [ $request, ], [], [], $this->outputHeaders)); return $resultSendItem; } catch (SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); return false; } } /** * Returns the result * @see SoapClientBase::getResult() * @return \StructType\EwsSendItemResponseType */ public function getResult() { return parent::getResult(); } }
mit
iam1980/android-feedback
web/application/config/user_agents.php
4747
<?php if (! defined('BASEPATH')) exit('No direct script access allowed'); /* | ------------------------------------------------------------------- | USER AGENT TYPES | ------------------------------------------------------------------- | This file contains four arrays of user agent data. It is used by the | User Agent Class to help identify browser, platform, robot, and | mobile device data. The array keys are used to identify the device | and the array values are used to set the actual name of the item. | */ $platforms = array( 'windows nt 6.0' => 'Windows Longhorn', 'windows nt 5.2' => 'Windows 2003', 'windows nt 5.0' => 'Windows 2000', 'windows nt 5.1' => 'Windows XP', 'windows nt 4.0' => 'Windows NT 4.0', 'winnt4.0' => 'Windows NT 4.0', 'winnt 4.0' => 'Windows NT', 'winnt' => 'Windows NT', 'windows 98' => 'Windows 98', 'win98' => 'Windows 98', 'windows 95' => 'Windows 95', 'win95' => 'Windows 95', 'windows' => 'Unknown Windows OS', 'os x' => 'Mac OS X', 'ppc mac' => 'Power PC Mac', 'freebsd' => 'FreeBSD', 'ppc' => 'Macintosh', 'linux' => 'Linux', 'debian' => 'Debian', 'sunos' => 'Sun Solaris', 'beos' => 'BeOS', 'apachebench' => 'ApacheBench', 'aix' => 'AIX', 'irix' => 'Irix', 'osf' => 'DEC OSF', 'hp-ux' => 'HP-UX', 'netbsd' => 'NetBSD', 'bsdi' => 'BSDi', 'openbsd' => 'OpenBSD', 'gnu' => 'GNU/Linux', 'unix' => 'Unknown Unix OS' ); // The order of this array should NOT be changed. Many browsers return // multiple browser types so we want to identify the sub-type first. $browsers = array( 'Flock' => 'Flock', 'Chrome' => 'Chrome', 'Opera' => 'Opera', 'MSIE' => 'Internet Explorer', 'Internet Explorer' => 'Internet Explorer', 'Shiira' => 'Shiira', 'Firefox' => 'Firefox', 'Chimera' => 'Chimera', 'Phoenix' => 'Phoenix', 'Firebird' => 'Firebird', 'Camino' => 'Camino', 'Netscape' => 'Netscape', 'OmniWeb' => 'OmniWeb', 'Safari' => 'Safari', 'Mozilla' => 'Mozilla', 'Konqueror' => 'Konqueror', 'icab' => 'iCab', 'Lynx' => 'Lynx', 'Links' => 'Links', 'hotjava' => 'HotJava', 'amaya' => 'Amaya', 'IBrowse' => 'IBrowse' ); $mobiles = array( // legacy array, old values commented out 'mobileexplorer' => 'Mobile Explorer', // 'openwave' => 'Open Wave', // 'opera mini' => 'Opera Mini', // 'operamini' => 'Opera Mini', // 'elaine' => 'Palm', 'palmsource' => 'Palm', // 'digital paths' => 'Palm', // 'avantgo' => 'Avantgo', // 'xiino' => 'Xiino', 'palmscape' => 'Palmscape', // 'nokia' => 'Nokia', // 'ericsson' => 'Ericsson', // 'blackberry' => 'BlackBerry', // 'motorola' => 'Motorola' // Phones and Manufacturers 'motorola' => "Motorola", 'nokia' => "Nokia", 'palm' => "Palm", 'iphone' => "Apple iPhone", 'ipad' => "iPad", 'ipod' => "Apple iPod Touch", 'sony' => "Sony Ericsson", 'ericsson' => "Sony Ericsson", 'blackberry' => "BlackBerry", 'cocoon' => "O2 Cocoon", 'blazer' => "Treo", 'lg' => "LG", 'amoi' => "Amoi", 'xda' => "XDA", 'mda' => "MDA", 'vario' => "Vario", 'htc' => "HTC", 'samsung' => "Samsung", 'sharp' => "Sharp", 'sie-' => "Siemens", 'alcatel' => "Alcatel", 'benq' => "BenQ", 'ipaq' => "HP iPaq", 'mot-' => "Motorola", 'playstation portable' => "PlayStation Portable", 'hiptop' => "Danger Hiptop", 'nec-' => "NEC", 'panasonic' => "Panasonic", 'philips' => "Philips", 'sagem' => "Sagem", 'sanyo' => "Sanyo", 'spv' => "SPV", 'zte' => "ZTE", 'sendo' => "Sendo", // Operating Systems 'symbian' => "Symbian", 'SymbianOS' => "SymbianOS", 'elaine' => "Palm", 'palm' => "Palm", 'series60' => "Symbian S60", 'windows ce' => "Windows CE", // Browsers 'obigo' => "Obigo", 'netfront' => "Netfront Browser", 'openwave' => "Openwave Browser", 'mobilexplorer' => "Mobile Explorer", 'operamini' => "Opera Mini", 'opera mini' => "Opera Mini", // Other 'digital paths' => "Digital Paths", 'avantgo' => "AvantGo", 'xiino' => "Xiino", 'novarra' => "Novarra Transcoder", 'vodafone' => "Vodafone", 'docomo' => "NTT DoCoMo", 'o2' => "O2", // Fallback 'mobile' => "Generic Mobile", 'wireless' => "Generic Mobile", 'j2me' => "Generic Mobile", 'midp' => "Generic Mobile", 'cldc' => "Generic Mobile", 'up.link' => "Generic Mobile", 'up.browser' => "Generic Mobile", 'smartphone' => "Generic Mobile", 'cellphone' => "Generic Mobile" ); // There are hundreds of bots but these are the most common. $robots = array( 'googlebot' => 'Googlebot', 'msnbot' => 'MSNBot', 'slurp' => 'Inktomi Slurp', 'yahoo' => 'Yahoo', 'askjeeves' => 'AskJeeves', 'fastcrawler' => 'FastCrawler', 'infoseek' => 'InfoSeek Robot 1.0', 'lycos' => 'Lycos' ); /* End of file user_agents.php */ /* Location: ./application/config/user_agents.php */
mit
farchanjo/webcron
src/main/java/br/eti/archanjo/webcron/quartz/listeners/impl/package-info.java
54
package br.eti.archanjo.webcron.quartz.listeners.impl;
mit
PetarAIvanov/DocumentDBRepository
Azure.DocumentDBRepository/Azure.DocumentDBRepository/Partitioning/Util/DocumentClientHelper.cs
15295
namespace Azure.DocumentDBRepository.Partitioning { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Client; using Microsoft.Azure.Documents.Linq; using System.IO; using Newtonsoft.Json; /// <summary> /// Providers common helper methods for working with DocumentClient. /// </summary> public class DocumentClientHelper { /// <summary> /// Get a Database by id, or create a new one if one with the id provided doesn't exist. /// </summary> /// <param name="client">The DocumentDB client instance.</param> /// <param name="id">The id of the Database to search for, or create.</param> /// <returns>The matched, or created, Database object</returns> public static async Task<Database> GetDatabaseAsync(DocumentClient client, string id) { Database database = client.CreateDatabaseQuery().Where(db => db.Id == id).ToArray().FirstOrDefault(); if (database == null) { database = await client.CreateDatabaseAsync(new Database { Id = id }); } return database; } /// <summary> /// Get a Database by id, or create a new one if one with the id provided doesn't exist. /// </summary> /// <param name="client">The DocumentDB client instance.</param> /// <param name="id">The id of the Database to search for, or create.</param> /// <returns>The matched, or created, Database object</returns> public static async Task<Database> GetNewDatabaseAsync(DocumentClient client, string id) { Database database = client.CreateDatabaseQuery().Where(db => db.Id == id).ToArray().FirstOrDefault(); if (database != null) { await client.DeleteDatabaseAsync(database.SelfLink); } database = await client.CreateDatabaseAsync(new Database { Id = id }); return database; } /// <summary> /// Get a DocumentCollection by id, or create a new one if one with the id provided doesn't exist. /// </summary> /// <param name="client">The DocumentDB client instance.</param> /// <param name="database">The Database where this DocumentCollection exists / will be created</param> /// <param name="collectionId">The id of the DocumentCollection to search for, or create.</param> /// <returns>The matched, or created, DocumentCollection object</returns> public static async Task<DocumentCollection> GetCollectionAsync(DocumentClient client, Database database, string collectionId) { DocumentCollection collection = client.CreateDocumentCollectionQuery(database.SelfLink) .Where(c => c.Id == collectionId).ToArray().FirstOrDefault(); if (collection == null) { collection = await CreateDocumentCollectionWithRetriesAsync(client, database, new DocumentCollection { Id = collectionId }); } return collection; } /// <summary> /// Get a DocumentCollection by id, or create a new one if one with the id provided doesn't exist. /// </summary> /// <param name="client">The DocumentDB client instance.</param> /// <param name="database">The Database where this DocumentCollection exists / will be created</param> /// <param name="collectionId">The id of the DocumentCollection to search for, or create.</param> /// <param name="collectionSpec">The spec/template to create collections from.</param> /// <returns>The matched, or created, DocumentCollection object</returns> public static async Task<DocumentCollection> GetCollectionAsync( DocumentClient client, Database database, string collectionId, DocumentCollectionSpec collectionSpec) { DocumentCollection collection = client.CreateDocumentCollectionQuery(database.SelfLink) .Where(c => c.Id == collectionId).ToArray().FirstOrDefault(); if (collection == null) { collection = await CreateNewCollection(client, database, collectionId, collectionSpec); } return collection; } /// <summary> /// Creates a new collection. /// </summary> /// <param name="client">The DocumentDB client instance.</param> /// <param name="database">The Database where this DocumentCollection exists / will be created</param> /// <param name="collectionId">The id of the DocumentCollection to search for, or create.</param> /// <param name="collectionSpec">The spec/template to create collections from.</param> /// <returns>The created DocumentCollection object</returns> public static async Task<DocumentCollection> CreateNewCollection( DocumentClient client, Database database, string collectionId, DocumentCollectionSpec collectionSpec) { DocumentCollection collectionDefinition = new DocumentCollection { Id = collectionId }; if (collectionSpec != null) { CopyIndexingPolicy(collectionSpec, collectionDefinition); } DocumentCollection collection = await CreateDocumentCollectionWithRetriesAsync( client, database, collectionDefinition, (collectionSpec != null) ? collectionSpec.OfferType : null); if (collectionSpec != null) { await RegisterScripts(client, collectionSpec, collection); } return collection; } /// <summary> /// Registers the stored procedures, triggers and UDFs in the collection spec/template. /// </summary> /// <param name="client">The DocumentDB client.</param> /// <param name="collectionSpec">The collection spec/template.</param> /// <param name="collection">The collection.</param> /// <returns>The Task object for asynchronous execution.</returns> public static async Task RegisterScripts(DocumentClient client, DocumentCollectionSpec collectionSpec, DocumentCollection collection) { if (collectionSpec.StoredProcedures != null) { foreach (StoredProcedure sproc in collectionSpec.StoredProcedures) { await client.CreateStoredProcedureAsync(collection.SelfLink, sproc); } } if (collectionSpec.Triggers != null) { foreach (Trigger trigger in collectionSpec.Triggers) { await client.CreateTriggerAsync(collection.SelfLink, trigger); } } if (collectionSpec.UserDefinedFunctions != null) { foreach (UserDefinedFunction udf in collectionSpec.UserDefinedFunctions) { await client.CreateUserDefinedFunctionAsync(collection.SelfLink, udf); } } } /// <summary> /// Copies the indexing policy from the collection spec. /// </summary> /// <param name="collectionSpec">The collection spec/template</param> /// <param name="collectionDefinition">The collection definition to create.</param> public static void CopyIndexingPolicy(DocumentCollectionSpec collectionSpec, DocumentCollection collectionDefinition) { if (collectionSpec.IndexingPolicy != null) { collectionDefinition.IndexingPolicy.Automatic = collectionSpec.IndexingPolicy.Automatic; collectionDefinition.IndexingPolicy.IndexingMode = collectionSpec.IndexingPolicy.IndexingMode; if (collectionSpec.IndexingPolicy.IncludedPaths != null) { foreach (IncludedPath path in collectionSpec.IndexingPolicy.IncludedPaths) { collectionDefinition.IndexingPolicy.IncludedPaths.Add(path); } } if (collectionSpec.IndexingPolicy.ExcludedPaths != null) { foreach (ExcludedPath path in collectionSpec.IndexingPolicy.ExcludedPaths) { collectionDefinition.IndexingPolicy.ExcludedPaths.Add(path); } } } } /// <summary> /// Create a DocumentCollection, and retry when throttled. /// </summary> /// <param name="client">The DocumentDB client instance.</param> /// <param name="database">The database to use.</param> /// <param name="collectionDefinition">The collection definition to use.</param> /// <param name="offerType">The offer type for the collection.</param> /// <returns>The created DocumentCollection.</returns> public static async Task<DocumentCollection> CreateDocumentCollectionWithRetriesAsync( DocumentClient client, Database database, DocumentCollection collectionDefinition, string offerType = "S1") { return await ExecuteWithRetries( client, () => client.CreateDocumentCollectionAsync( database.SelfLink, collectionDefinition, new RequestOptions { OfferType = offerType })); } /// <summary> /// Execute the function with retries on throttle. /// </summary> /// <typeparam name="V">The type of return value from the execution.</typeparam> /// <param name="client">The DocumentDB client instance.</param> /// <param name="function">The function to execute.</param> /// <returns>The response from the execution.</returns> public static async Task<V> ExecuteWithRetries<V>(DocumentClient client, Func<Task<V>> function) { TimeSpan sleepTime = TimeSpan.Zero; while (true) { try { return await function(); } catch (DocumentClientException de) { if ((int)de.StatusCode != 429) { throw; } sleepTime = de.RetryAfter; } catch (AggregateException ae) { if (!(ae.InnerException is DocumentClientException)) { throw; } DocumentClientException de = (DocumentClientException)ae.InnerException; if ((int)de.StatusCode != 429) { throw; } sleepTime = de.RetryAfter; } await Task.Delay(sleepTime); } } /// <summary> /// Bulk import using a stored procedure. /// </summary> /// <param name="client"></param> /// <param name="collection"></param> /// <param name="inputDirectory"></param> /// <param name="inputFileMask"></param> /// <returns></returns> public static async Task RunBulkImport( DocumentClient client, DocumentCollection collection, string inputDirectory, string inputFileMask = "*.json") { int maxFiles = 2000; int maxScriptSize = 50000; // 1. Get the files. string[] fileNames = Directory.GetFiles(inputDirectory, inputFileMask); DirectoryInfo di = new DirectoryInfo(inputDirectory); FileInfo[] fileInfos = di.GetFiles(inputFileMask); int currentCount = 0; int fileCount = maxFiles != 0 ? Math.Min(maxFiles, fileNames.Length) : fileNames.Length; string body = File.ReadAllText(@".\JS\BulkImport.js"); StoredProcedure sproc = new StoredProcedure { Id = "BulkImport", Body = body }; await TryDeleteStoredProcedure(client, collection, sproc.Id); sproc = await ExecuteWithRetries<ResourceResponse<StoredProcedure>>(client, () => client.CreateStoredProcedureAsync(collection.SelfLink, sproc)); while (currentCount < fileCount) { string argsJson = CreateBulkInsertScriptArguments(fileNames, currentCount, fileCount, maxScriptSize); var args = new dynamic[] { JsonConvert.DeserializeObject<dynamic>(argsJson) }; StoredProcedureResponse<int> scriptResult = await ExecuteWithRetries<StoredProcedureResponse<int>>(client, () => client.ExecuteStoredProcedureAsync<int>(sproc.SelfLink, args)); int currentlyInserted = scriptResult.Response; currentCount += currentlyInserted; } } public static async Task TryDeleteStoredProcedure(DocumentClient client, DocumentCollection collection, string sprocId) { StoredProcedure sproc = client.CreateStoredProcedureQuery(collection.SelfLink).Where(s => s.Id == sprocId).AsEnumerable().FirstOrDefault(); if (sproc != null) { await ExecuteWithRetries<ResourceResponse<StoredProcedure>>(client, () => client.DeleteStoredProcedureAsync(sproc.SelfLink)); } } /// <summary> /// Creates the script for insertion /// </summary> /// <param name="currentIndex">the current number of documents inserted. this marks the starting point for this script</param> /// <param name="maxScriptSize">the maximum number of characters that the script can have</param> /// <returns>Script as a string</returns> private static string CreateBulkInsertScriptArguments(string[] docFileNames, int currentIndex, int maxCount, int maxScriptSize) { var jsonDocumentArray = new StringBuilder(); jsonDocumentArray.Append("["); if (currentIndex >= maxCount) { return string.Empty; } jsonDocumentArray.Append(File.ReadAllText(docFileNames[currentIndex])); int scriptCapacityRemaining = maxScriptSize; string separator = string.Empty; int i = 1; while (jsonDocumentArray.Length < scriptCapacityRemaining && (currentIndex + i) < maxCount) { jsonDocumentArray.Append(", " + File.ReadAllText(docFileNames[currentIndex + i])); i++; } jsonDocumentArray.Append("]"); return jsonDocumentArray.ToString(); } } }
mit
GeethTharanga/TicTacToe
TicTacToe/UI/ConsoleUI.cs
1319
// Copyright (c) 2015 Geeth Tharanga // Under the MIT licence - See licence.txt using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace TicTacToe.UI { public class ConsoleUI : IBasicUI { public event EventHandler UIOnClose { add { } remove { } } public void UIRefresh(Core.Board board, Core.Player thisPlayer) { Console.WriteLine("Player: {0}, status :{1}",thisPlayer, board.CurrentStatus); for(int i=0; i<3;i++) { for(int j=0; j<3; j++) { Console.Write(board[i,j].ToString()); } Console.WriteLine(); } } public void UIStart() { Thread t = new Thread(ProcessKeys); t.Start(); } public void ProcessKeys() { while (true) { int row = int.Parse(Console.ReadLine()); int col = int.Parse(Console.ReadLine()); UIOnMove(this, new CellArgs { Col = col, Row = row }); } } public void UIClose() { } public event CellMoveEventHandler UIOnMove; } }
mit
ttsuru/ecx
src/Ecx/EcBundle/Form/Type/CustomerReviewType.php
2036
<?php namespace Ecx\EcBundle\Form\Type; // Symfony use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilder; // Doctrine use Doctrine\ORM\EntityRepository; class CustomerReviewType extends AbstractType { public function buildForm(FormBuilder $builder, array $options) { $builder->add('reviewer_name', 'text', array( 'max_length' => STEXT_LEN, 'required' => false, 'label' => '投稿者名', )); $builder->add('reviewer_url', 'text', array( 'max_length' => MTEXT_LEN, 'required' => false, 'label' => '投稿者URL', )); $builder->add('Sex', 'entity', array( 'class' => 'EcxEcBundle:Sex', 'property' => 'name', 'query_builder' => function(EntityRepository $er) { return $er->createQueryBuilder('s') ->orderBy('s.rank', 'ASC'); }, 'expanded' => true, 'empty_value' => false, 'required' => false, 'label' => '性別', )); $builder->add('Recommend', 'entity', array( 'class' => 'EcxEcBundle:Recommend', 'property' => 'name', 'query_builder' => function(EntityRepository $er) { return $er->createQueryBuilder('r') ->orderBy('r.rank', 'ASC'); }, 'empty_value' => '選択してください', 'required' => false, 'label' => 'おすすめレベル', )); $builder->add('title', 'text', array( 'max_length' => STEXT_LEN, 'required' => false, 'label' => 'タイトル', )); $builder->add('comment', 'textarea', array( 'max_length' => LTEXT_LEN, 'required' => false, 'label' => 'コメント', )); } public function getName() { return 'customer_review'; } }
mit
JonckheereM/Public
library/spoon/datagrid/source.php
908
<?php /** * Spoon Library * * This source file is part of the Spoon Library. More information, * documentation and tutorials can be found @ http://www.spoon-library.com * * @package spoon * @subpackage datagrid * * * @author Davy Hellemans <davy@spoon-library.com> * @author Tijs Verkoyen <tijs@spoon-library.com> * @author Dave Lens <dave@spoon-library.com> * @since 1.0.0 */ /** * This class is the base class for sources used with datagrids * * @package spoon * @subpackage datagrid * * * @author Davy Hellemans <davy@spoon-library.com> * @since 1.0.0 */ class SpoonDatagridSource { /** * Final data * * @var array */ protected $data = array(); /** * Number of results * * @var int */ protected $numResults = 0; /** * Fetch the number of results * * @return int */ public function getNumResults() { return $this->numResults; } } ?>
mit
sh0rtfuse/foodfinder
app/helpers/food_finders_helper.rb
29
module FoodFindersHelper end
mit
ja-mes/experiments
Old/rent_app_accounts_test/config/initializers/devise.rb
13225
# Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render invalid all existing # confirmation, reset password and unlock tokens in the database. # Devise will use the `secret_key_base` as its `secret_key` # by default. You can change it below and use your own secret key. # config.secret_key = 'ccbd4eca8482fcef53ae30ea9b8d552d2d3d6459981e953db439c47c69a2346047049f6e8a07a9ade7849314d1b64c08858e7e09ce694dd5d27157c4e7cb6734' # ==> Mailer Configuration # Configure the e-mail address which will be shown in Devise::Mailer, # note that it will be overwritten if you use your own mailer class # with default "from" parameter. config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' # Configure the class responsible to send e-mails. # config.mailer = 'Devise::Mailer' # Configure the parent class responsible to send e-mails. # config.parent_mailer = 'ActionMailer::Base' # ==> ORM configuration # Load and configure the ORM. Supports :active_record (default) and # :mongoid (bson_ext recommended) by default. Other ORMs may be # available as additional gems. require 'devise/orm/active_record' # ==> Configuration for any authentication mechanism # Configure which keys are used when authenticating a user. The default is # just :email. You can configure it to use [:username, :subdomain], so for # authenticating a user, both parameters are required. Remember that those # parameters are used only when authenticating and not when retrieving from # session. If you need permissions, you should implement that in a before filter. # You can also supply a hash where the value is a boolean determining whether # or not authentication should be aborted when the value is not present. # config.authentication_keys = [:email] # Configure parameters from the request object used for authentication. Each entry # given should be a request method and it will automatically be passed to the # find_for_authentication method and considered in your model lookup. For instance, # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. # The same considerations mentioned for authentication_keys also apply to request_keys. # config.request_keys = [] # Configure which authentication keys should be case-insensitive. # These keys will be downcased upon creating or modifying a user and when used # to authenticate or find a user. Default is :email. config.case_insensitive_keys = [:email] # Configure which authentication keys should have whitespace stripped. # These keys will have whitespace before and after removed upon creating or # modifying a user and when used to authenticate or find a user. Default is :email. config.strip_whitespace_keys = [:email] # Tell if authentication through request.params is enabled. True by default. # It can be set to an array that will enable params authentication only for the # given strategies, for example, `config.params_authenticatable = [:database]` will # enable it only for database (email + password) authentication. # config.params_authenticatable = true # Tell if authentication through HTTP Auth is enabled. False by default. # It can be set to an array that will enable http authentication only for the # given strategies, for example, `config.http_authenticatable = [:database]` will # enable it only for database authentication. The supported strategies are: # :database = Support basic authentication with authentication key + password # config.http_authenticatable = false # If 401 status code should be returned for AJAX requests. True by default. # config.http_authenticatable_on_xhr = true # The realm used in Http Basic Authentication. 'Application' by default. # config.http_authentication_realm = 'Application' # It will change confirmation, password recovery and other workflows # to behave the same regardless if the e-mail provided was right or wrong. # Does not affect registerable. # config.paranoid = true # By default Devise will store the user in session. You can skip storage for # particular strategies by setting this option. # Notice that if you are skipping storage for all authentication paths, you # may want to disable generating routes to Devise's sessions controller by # passing skip: :sessions to `devise_for` in your config/routes.rb config.skip_session_storage = [:http_auth] # By default, Devise cleans up the CSRF token on authentication to # avoid CSRF token fixation attacks. This means that, when using AJAX # requests for sign in and sign up, you need to get a new CSRF token # from the server. You can disable this option at your own risk. # config.clean_up_csrf_token_on_authentication = true # ==> Configuration for :database_authenticatable # For bcrypt, this is the cost for hashing the password and defaults to 11. If # using other algorithms, it sets how many times you want the password to be hashed. # # Limiting the stretches to just one in testing will increase the performance of # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use # a value less than 10 in other environments. Note that, for bcrypt (the default # algorithm), the cost increases exponentially with the number of stretches (e.g. # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). config.stretches = Rails.env.test? ? 1 : 11 # Set up a pepper to generate the hashed password. # config.pepper = '14181b9488fb5fea350825f446600d5f2837ee109828683bff105881e2a08f19b5e3058cdba4e3f1b159249fc07a2e10a7258d98ab9471cc0afdd300dfe2338e' # Send a notification email when the user's password is changed # config.send_password_change_notification = false # ==> Configuration for :confirmable # A period that the user is allowed to access the website even without # confirming their account. For instance, if set to 2.days, the user will be # able to access the website for two days without confirming their account, # access will be blocked just in the third day. Default is 0.days, meaning # the user cannot access the website without confirming their account. # config.allow_unconfirmed_access_for = 2.days # A period that the user is allowed to confirm their account before their # token becomes invalid. For example, if set to 3.days, the user can confirm # their account within 3 days after the mail was sent, but on the fourth day # their account can't be confirmed with the token any more. # Default is nil, meaning there is no restriction on how long a user can take # before confirming their account. # config.confirm_within = 3.days # If true, requires any email changes to be confirmed (exactly the same way as # initial account confirmation) to be applied. Requires additional unconfirmed_email # db field (see migrations). Until confirmed, new email is stored in # unconfirmed_email column, and copied to email column on successful confirmation. config.reconfirmable = true # Defines which key will be used when confirming an account # config.confirmation_keys = [:email] # ==> Configuration for :rememberable # The time the user will be remembered without asking for credentials again. # config.remember_for = 2.weeks # Invalidates all the remember me tokens when the user signs out. config.expire_all_remember_me_on_sign_out = true # If true, extends the user's remember period when remembered via cookie. # config.extend_remember_period = false # Options to be passed to the created cookie. For instance, you can set # secure: true in order to force SSL only cookies. # config.rememberable_options = {} # ==> Configuration for :validatable # Range for password length. config.password_length = 6..128 # Email regex used to validate email formats. It simply asserts that # one (and only one) @ exists in the given string. This is mainly # to give user feedback and not to assert the e-mail validity. config.email_regexp = /\A[^@\s]+@[^@\s]+\z/ # ==> Configuration for :timeoutable # The time you want to timeout the user session without activity. After this # time the user will be asked for credentials again. Default is 30 minutes. # config.timeout_in = 30.minutes # ==> Configuration for :lockable # Defines which strategy will be used to lock an account. # :failed_attempts = Locks an account after a number of failed attempts to sign in. # :none = No lock strategy. You should handle locking by yourself. # config.lock_strategy = :failed_attempts # Defines which key will be used when locking and unlocking an account # config.unlock_keys = [:email] # Defines which strategy will be used to unlock an account. # :email = Sends an unlock link to the user email # :time = Re-enables login after a certain amount of time (see :unlock_in below) # :both = Enables both strategies # :none = No unlock strategy. You should handle unlocking by yourself. # config.unlock_strategy = :both # Number of authentication tries before locking an account if lock_strategy # is failed attempts. # config.maximum_attempts = 20 # Time interval to unlock the account if :time is enabled as unlock_strategy. # config.unlock_in = 1.hour # Warn on the last attempt before the account is locked. # config.last_attempt_warning = true # ==> Configuration for :recoverable # # Defines which key will be used when recovering the password for an account # config.reset_password_keys = [:email] # Time interval you can reset your password with a reset password key. # Don't put a too small interval or your users won't have the time to # change their passwords. config.reset_password_within = 6.hours # When set to false, does not sign a user in automatically after their password is # reset. Defaults to true, so a user is signed in automatically after a reset. # config.sign_in_after_reset_password = true # ==> Configuration for :encryptable # Allow you to use another hashing or encryption algorithm besides bcrypt (default). # You can use :sha1, :sha512 or algorithms from others authentication tools as # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20 # for default behavior) and :restful_authentication_sha1 (then you should set # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper). # # Require the `devise-encryptable` gem when using anything other than bcrypt # config.encryptor = :sha512 # ==> Scopes configuration # Turn scoped views on. Before rendering "sessions/new", it will first check for # "users/sessions/new". It's turned off by default because it's slower if you # are using only default views. # config.scoped_views = false # Configure the default scope given to Warden. By default it's the first # devise role declared in your routes (usually :user). # config.default_scope = :user # Set this configuration to false if you want /users/sign_out to sign out # only the current scope. By default, Devise signs out all scopes. # config.sign_out_all_scopes = true # ==> Navigation configuration # Lists the formats that should be treated as navigational. Formats like # :html, should redirect to the sign in page when the user does not have # access, but formats like :xml or :json, should return 401. # # If you have any extra navigational formats, like :iphone or :mobile, you # should add them to the navigational formats lists. # # The "*/*" below is required to match Internet Explorer requests. # config.navigational_formats = ['*/*', :html] # The default HTTP method used to sign out a resource. Default is :delete. config.sign_out_via = :delete # ==> OmniAuth # Add a new OmniAuth provider. Check the wiki for more information on setting # up on your models and hooks. # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' # ==> Warden configuration # If you want to use other strategies, that are not supported by Devise, or # change the failure app, you can configure them inside the config.warden block. # # config.warden do |manager| # manager.intercept_401 = false # manager.default_strategies(scope: :user).unshift :some_external_strategy # end # ==> Mountable engine configurations # When using Devise inside an engine, let's call it `MyEngine`, and this engine # is mountable, there are some extra configurations to be taken into account. # The following options are available, assuming the engine is mounted as: # # mount MyEngine, at: '/my_engine' # # The router that invoked `devise_for`, in the example above, would be: # config.router_name = :my_engine # # When using OmniAuth, Devise cannot automatically set OmniAuth path, # so you need to do it manually. For the users scope, it would be: # config.omniauth_path_prefix = '/my_engine/users/auth' end
mit
atbaker/account-verification-django
account_verification/forms.py
300
from django.contrib.auth.forms import UserCreationForm from .models import User class RegisterForm(UserCreationForm): """Form class for signing up new users""" class Meta: model = User fields = ['first_name', 'last_name', 'email', 'password1', 'password2', 'phone_number']
mit
danniamar/AndroidClass
ViewApp/app/src/main/java/com/example/a64/viewapp/Fragments/WebFragment.java
1065
package com.example.a64.viewapp.Fragments; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.webkit.WebViewClient; import com.example.a64.viewapp.R; /** * A simple {@link Fragment} subclass. */ public class WebFragment extends Fragment { public WebFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_blank, container, false); WebView webView = (WebView) view.findViewById(R.id.webView); webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new WebViewClient()); webView.loadUrl("http://www.espectador.com/"); // Inflate the layout for this fragment return view; } }
mit
CashStar/backbone-forms
src/editor.js
4995
/** * Base editor (interface). To be extended, not used directly * * @param {Object} options * @param {String} [options.id] Editor ID * @param {Model} [options.model] Use instead of value, and use commit() * @param {String} [options.key] The model attribute key. Required when using 'model' * @param {Mixed} [options.value] When not using a model. If neither provided, defaultValue will be used * @param {Object} [options.schema] Field schema; may be required by some editors * @param {Object} [options.validators] Validators; falls back to those stored on schema * @param {Object} [options.form] The form */ Form.Editor = Form.editors.Base = Backbone.View.extend({ defaultValue: null, hasFocus: false, initialize: function(options) { var options = options || {}; //Set initial value if (options.model) { if (!options.key) throw new Error("Missing option: 'key'"); this.model = options.model; this.value = this.model.get(options.key); } else if (options.value !== undefined) { this.value = options.value; } if (this.value === undefined) this.value = this.defaultValue; //Store important data _.extend(this, _.pick(options, 'key', 'form', 'schemaPath')); var schema = this.schema = options.schema || {}; this.validators = options.validators || schema.validators; //Main attributes this.$el.attr('id', this.id); this.$el.attr('name', this.getName()); if (schema.editorClass) this.$el.addClass(schema.editorClass); if (schema.editorAttrs) this.$el.attr(schema.editorAttrs); }, /** * Get the value for the form input 'name' attribute * * @return {String} * * @api private */ getName: function() { var key = this.key || ''; //Replace periods with underscores (e.g. for when using paths) return key.replace(/\./g, '_'); }, /** * Get editor value * Extend and override this method to reflect changes in the DOM * * @return {Mixed} */ getValue: function() { return this.value; }, /** * Set editor value * Extend and override this method to reflect changes in the DOM * * @param {Mixed} value */ setValue: function(value) { this.value = value; }, /** * Give the editor focus * Extend and override this method */ focus: function() { throw new Error('Not implemented'); }, /** * Remove focus from the editor * Extend and override this method */ blur: function() { throw new Error('Not implemented'); }, /** * Update the model with the current value * * @param {Object} [options] Options to pass to model.set() * @param {Boolean} [options.validate] Set to true to trigger built-in model validation * * @return {Mixed} error */ commit: function(options) { var error = this.validate(); if (error) return error; this.listenTo(this.model, 'invalid', function(model, e) { error = e; }); this.model.set(this.key, this.getValue(), options); if (error) return error; }, /** * Check validity * * @return {Object|Undefined} */ validate: function() { var $el = this.$el, error = null, value = this.getValue(), formValues = this.form ? this.form.getValue() : {}, validators = this.validators, getValidator = this.getValidator; if (validators) { //Run through validators until an error is found _.every(validators, function(validator) { error = getValidator(validator)(value, formValues); return error ? false : true; }); } return error; }, /** * Set this.hasFocus, or call parent trigger() * * @param {String} event */ trigger: function(event) { if (event === 'focus') { this.hasFocus = true; } else if (event === 'blur') { this.hasFocus = false; } return Backbone.View.prototype.trigger.apply(this, arguments); }, /** * Returns a validation function based on the type defined in the schema * * @param {RegExp|String|Function} validator * @return {Function} */ getValidator: function(validator) { var validators = Form.validators; //Convert regular expressions to validators if (_.isRegExp(validator)) { return validators.regexp({ regexp: validator }); } //Use a built-in validator if given a string if (_.isString(validator)) { if (!validators[validator]) throw new Error('Validator "'+validator+'" not found'); return validators[validator](); } //Functions can be used directly if (_.isFunction(validator)) return validator; //Use a customised built-in validator if given an object if (_.isObject(validator) && validator.type) { var config = validator; return validators[config.type](config); } //Unkown validator type throw new Error('Invalid validator: ' + validator); } });
mit
AdapTeach/code-exam
src/session/session.model.js
820
var mongoose = require('mongoose-q')(require('mongoose')), Schema = mongoose.Schema; var sessionSchema = new Schema({ name: {type: String, required: true}, creator: {type: String}, assessments: {type: [String], required: true}, students: {type: [Schema.ObjectId], ref: 'User'}, started: {type: Boolean, required: true, default: false}, closed: {type: Boolean, required: true, default: false} }); sessionSchema.methods.start = function () { this.started = true; }; sessionSchema.methods.close = function () { this.closed = true; }; sessionSchema.methods.reopen = function () { this.closed = false; }; sessionSchema.methods.isRunning = function () { return this.started && !this.closed; }; var Session = mongoose.model('Session', sessionSchema); module.exports = Session;
mit
yetisno/RuleEngine
RuleEngineCore/src/test/java/org/yetiz/service/rulengine/core/condition/XORConditionGroupTest.java
1765
package org.yetiz.service.rulengine.core.condition; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.yetiz.service.rulengine.core.Intention; import org.yetiz.service.rulengine.core.pattern.Pattern; public class XORConditionGroupTest { XORConditionGroup xorConditionGroup; @Before public void setUp() throws Exception { xorConditionGroup = new XORConditionGroup(); } @Test public void testJudge() throws Exception { xorConditionGroup .add(new Condition() { public Intention judge(Pattern pattern) { return Intention.POSITIVE; } }) .add(new Condition() { public Intention judge(Pattern pattern) { return Intention.POSITIVE; } }); Assert.assertEquals(Intention.NEGATIVE, xorConditionGroup.judge(null)); xorConditionGroup .add(new Condition() { public Intention judge(Pattern pattern) { return Intention.POSITIVE; } }); Assert.assertEquals(Intention.POSITIVE, xorConditionGroup.judge(null)); } @Test public void testAdd() throws Exception { xorConditionGroup .add(new Condition() { public Intention judge(Pattern pattern) { return Intention.POSITIVE; } }) .add(new Condition() { public Intention judge(Pattern pattern) { return Intention.POSITIVE; } }); Assert.assertEquals(2, xorConditionGroup.getConditions().size()); } @Test public void testRemove() throws Exception { xorConditionGroup .add(new Condition() { public Intention judge(Pattern pattern) { return Intention.POSITIVE; } }) .add(new Condition() { public Intention judge(Pattern pattern) { return Intention.POSITIVE; } }).remove(1); Assert.assertEquals(1, xorConditionGroup.getConditions().size()); } }
mit
noisyneurons/nCore
bin/Proj3MixtureSelfOrgContextSuper.rb
3305
### VERSION "nCore" ## ../nCore/bin/Proj3MixtureSelfOrgContextSuper.rb # Specific Purpose for this experiment: Get SIMPLEST versions of self-org, context, AND combined with Supervised Learning, understood and "working." # Purpose: Start of Project 7; project to split example set to learn sub-parts, and then combine those parts/neuron-functions that # didn't need to be separated, but instead need to be integrated to obtain better generalization. # Ultimate goal of project 6 is develop analogy processing -- where one function useful for solving one problem # can be of use in solving another problem. The common function(s)/neuron(s) can be thus be 'reused' -- and even potentially made # better by improving the accuracy of the function parameters because more examples are used to learn the parameters. require_relative '../lib/core/Utilities' require_relative '../lib/core/DataSet' require_relative '../lib/core/NeuralParts' require_relative '../lib/core/Layers' require_relative '../lib/core/NetworkFactories' require_relative '../lib/core/NetworkFactories2' require_relative '../lib/core/NeuronLearningStrategies' require_relative '../lib/core/Trainers' require_relative '../lib/plot/CorePlottingCode' require_relative 'BaseLearningExperiment' ######################################################################## logger = StringIO.new args = { :experimentNumber => $globalExperimentNumber, :descriptionOfExperiment => "Proj3MixtureSelfOrgContextSuper; 2 in 4 out; divide but NO Integration", :baseRandomNumberSeed => 0, :classOfTheNetwork => Context4LayerNetworkVer2, :classOfTheTrainer => MixtureTrainer3SelfOrgContextSuper, :classOfDataSetGenerator => Generate4ClassDataSet, # training parameters :learningRate => 0.1, :minMSE => 0.0, :epochsForSelfOrg => 30, # 300, for 30 degree angle rotation of data :epochsForSupervisedTraining => 1000, :trainingSequence => TrainingSequence, # Network Architecture :numberOfInputNeurons => 2, :numberOfHiddenLayer1Neurons => 1, :numberOfHiddenLayer2Neurons => 2, :numberOfOutputNeurons => 4, # Neural Parts Specifications :typeOfLink => Link, :typeOfNeuron => Neuron3, :typeOfLinkToOutput => Link, :typeOfOutputNeuron => OutputNeuron3, :weightRange => 1.0, # Training Set parameters :numberOfExamples => 16, :numberOfTestingExamples => 160, :standardDeviationOfAddedGaussianNoise => 0.6, # 0.000001, :verticalShift => 0.0, :horizontalShift => 0.0, :angleOfClockwiseRotationOfInputData => 0.0, # Results and debugging information storage/access :logger => logger } ###################################### REPEATED Experiments for comparison ########################################## numberOfRepetitions = 1 runner = ExperimentRunner.new(args) lastExperimentRun, results = runner.repeatSimulation(numberOfRepetitions) # logger.puts lastExperimentRun.network logger.puts results loggedData = logger.string $redis.rpush("SimulationList", loggedData) $redis.save retrievedData = $redis.rpoplpush("SimulationList", "SimulationList") puts retrievedData numberOfExperimentsStoredInList = $redis.llen("SimulationList") puts "\n\nnumber Of Experiments Stored In List =\t#{numberOfExperimentsStoredInList}"
mit
dopin/slack-silencer
mute.rb
980
#!/usr/bin/env ruby require 'json' require 'net/http' require 'uri' def get_channels(token:) url = URI.parse "https://slack.com/api/channels.list?token=#{token}" res = Net::HTTP.get url json = JSON.parse res end def mute_channels_ids(token:, channels: []) ch = get_channels token: token ch_ids = {} ch['channels'].select{ |c| c['is_channel'] && c['is_member'] && !c['is_archived'] } .map{ |c| ch_ids[c['name']] = c['id'] } ids = channels.map { |a| ch_ids[a] } ids end def request_mute(token:, channel_ids: nil) url = URI.parse "https://slack.com/api/users.prefs.set?token=#{token}" Net::HTTP.post_form url, { name: 'muted_channels', value: channel_ids.join(',') } end if __FILE__ == $0 token = ENV['SLACK_API_TOKEN'] abort 'Please set SLACK_API_TOKEN' if token.nil? if ARGV.nil? request_mute(token: token) else ids = mute_channels_ids token: token, channels: ARGV request_mute token: token, channel_ids: ids end end
mit
robertlemke/flow-development-collection
TYPO3.Fluid/Tests/Functional/Form/Fixtures/Domain/Model/User.php
1106
<?php namespace TYPO3\Fluid\Tests\Functional\Form\Fixtures\Domain\Model; /* * * This script belongs to the Flow framework. * * * * It is free software; you can redistribute it and/or modify it under * * the terms of the MIT license. * * */ use TYPO3\Flow\Annotations as Flow; use Doctrine\ORM\Mapping as ORM; /** * A test entity which is used to test Fluid forms in combination with * property mapping * * @Flow\Entity */ class User { /** * @var string * @Flow\Validate(type="EmailAddress") */ protected $emailAddress; /** * @return string */ public function getEmailAddress() { return $this->emailAddress; } /** * @param string $email */ public function setEmailAddress($email) { $this->emailAddress = $email; } }
mit
mfine30/terminalboard-display
spec/app/components/application_spec.js
525
require('../spec_helper'); describe('Application', () => { let PipelineList; beforeEach(() => { const Application = require('../../../app/components/application'); PipelineList = require('../../../app/components/pipeline_list'); spyOn(PipelineList.prototype, 'render').and.callThrough(); const config = {title: 'title'}; ReactDOM.render(<Application {...{config, Dispatcher}}/>, root); }); it('has a PipelineList', () => { expect(PipelineList.prototype.render).toHaveBeenCalled() }); });
mit
ousttrue/ModelMotionIO
MMIO/Vector3.cs
1233
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MMIO { public struct Vector2 { public Single X; public Single Y; public Vector2(float x, float y) { X = x; Y = y; } } public struct Vector3 { public Single X; public Single Y; public Single Z; public Vector3(float x, float y, float z) { X = x; Y = y; Z = z; } } public struct Vector4 { public Single X; public Single Y; public Single Z; public Single W; public Vector4(float x, float y, float z, float w) { X = x; Y = y; Z = z; W = w; } } public struct Quaternion { public Single X; public Single Y; public Single Z; public Single W; public Quaternion(float x, float y, float z, float w) { X = x; Y = y; Z = z; W = w; } } }
mit
MaedaSaneyuki/7segmentTimer
7segmentTimer/7segmentTimer/obj/Debug/android/src/md5d4dd78677dce656d5db26c85a3743ef3/WebViewRenderer.java
2559
package md5d4dd78677dce656d5db26c85a3743ef3; public class WebViewRenderer extends md5d4dd78677dce656d5db26c85a3743ef3.ViewRenderer_2 implements mono.android.IGCUserPeer { /** @hide */ public static final String __md_methods; static { __md_methods = ""; mono.android.Runtime.register ("Xamarin.Forms.Platform.Android.WebViewRenderer, Xamarin.Forms.Platform.Android, Version=1.3.3.0, Culture=neutral, PublicKeyToken=null", WebViewRenderer.class, __md_methods); } public WebViewRenderer (android.content.Context p0, android.util.AttributeSet p1, int p2) throws java.lang.Throwable { super (p0, p1, p2); if (getClass () == WebViewRenderer.class) mono.android.TypeManager.Activate ("Xamarin.Forms.Platform.Android.WebViewRenderer, Xamarin.Forms.Platform.Android, Version=1.3.3.0, Culture=neutral, PublicKeyToken=null", "Android.Content.Context, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065:Android.Util.IAttributeSet, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065:System.Int32, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e", this, new java.lang.Object[] { p0, p1, p2 }); } public WebViewRenderer (android.content.Context p0, android.util.AttributeSet p1) throws java.lang.Throwable { super (p0, p1); if (getClass () == WebViewRenderer.class) mono.android.TypeManager.Activate ("Xamarin.Forms.Platform.Android.WebViewRenderer, Xamarin.Forms.Platform.Android, Version=1.3.3.0, Culture=neutral, PublicKeyToken=null", "Android.Content.Context, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065:Android.Util.IAttributeSet, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065", this, new java.lang.Object[] { p0, p1 }); } public WebViewRenderer (android.content.Context p0) throws java.lang.Throwable { super (p0); if (getClass () == WebViewRenderer.class) mono.android.TypeManager.Activate ("Xamarin.Forms.Platform.Android.WebViewRenderer, Xamarin.Forms.Platform.Android, Version=1.3.3.0, Culture=neutral, PublicKeyToken=null", "Android.Content.Context, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065", this, new java.lang.Object[] { p0 }); } private java.util.ArrayList refList; public void monodroidAddReference (java.lang.Object obj) { if (refList == null) refList = new java.util.ArrayList (); refList.add (obj); } public void monodroidClearReferences () { if (refList != null) refList.clear (); } }
mit
Mission3/migrations
Helpers/SharePoint/SPFieldHelper.cs
4628
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Migrations; using Microsoft.SharePoint; using System.Collections.Specialized; namespace GTMigrations.Helpers { public static class SPFieldHelper { public static void InsertFormulaFieldToList(string fieldName, string displayName, SPList list, string formula, SPFieldType type, SPNumberFormatTypes format) { if (list.Fields.ContainsField(fieldName)) { list.Fields.Delete(fieldName); } string temp = list.Fields.Add(displayName, SPFieldType.Calculated, false); SPFieldCalculated f = (SPFieldCalculated)list.Fields[temp]; f.Formula = formula; f.OutputType = type; f.DisplayFormat = format; f.Update(); list.Update(); } public static void InsertTextFieldToList(string fieldName, SPList list) { if (list.Fields.ContainsField(fieldName)) { list.Fields.Delete(fieldName); } SPField f = list.Fields.CreateNewField(SPFieldType.Text.ToString(), fieldName); list.Fields.Add(f); } public static void InsertDateFieldToList(string fieldName, string displayName, SPList list) { if (list.Fields.ContainsField(fieldName)) { list.Fields.Delete(fieldName); } SPFieldDateTime textField = (SPFieldDateTime)list.Fields.CreateNewField(SPFieldType.DateTime.ToString(), fieldName); textField.Title = displayName; list.Fields.Add(textField); list.Update(); } public static void DeleteField(string fieldName, SPList list) { if (list.Fields.ContainsField(fieldName)) { list.Fields.Delete(fieldName); } list.Update(); } public static void DeleteLookupField(string lookupList, SPList list) { for (int i = 0; i < list.Fields.Count; i++) { SPField field = list.Fields[i]; if (field.Title.Contains(lookupList + ":")) { list.Fields.Delete(field.Title); i--; } } list.Update(); } public static void InsertLookupField(string lookupName, SPList list, string lookupList, string lookupFieldName, SPWeb web) { DeleteLookupField(lookupName, list); DeleteLookupField(lookupList, list); DeleteField(lookupName, list); SPFieldLookup lookupField = (SPFieldLookup)list.Fields.CreateNewField(SPFieldType.Lookup.ToString(), lookupName); lookupField.LookupList = web.Lists[lookupList].ID.ToString(); lookupField.LookupField = lookupFieldName; list.Fields.Add(lookupField); list.Update(); } public static void InsertDependentFields(string primaryLookupName, SPList list, string relatedList, SPWeb web, string lookupColumn) { if (list.Fields.ContainsField(primaryLookupName + ":" + lookupColumn)) { list.Fields.Delete(primaryLookupName + ":" + lookupColumn); } SPFieldLookup lookupField = (SPFieldLookup)list.Fields.GetField(primaryLookupName); string secondaryColumn = list.Fields.AddDependentLookup(primaryLookupName + ":" + lookupColumn, lookupField.Id); SPFieldLookup newDependencyLookupField = (SPFieldLookup)list.Fields.GetFieldByInternalName(secondaryColumn); newDependencyLookupField.LookupField = web.Lists.TryGetList(relatedList).Fields[lookupColumn].InternalName; newDependencyLookupField.Update(); list.Update(); } public static void MakeColumnMultiSelect(string fieldName, SPList list) { if (list.Fields.ContainsField(fieldName)) { SPFieldLookup field = (SPFieldLookup)list.Fields.GetField(fieldName); field.AllowMultipleValues = true; field.Update(); } } public static void MakeTextColumnPlainText(string fieldName, SPList list) { if(list.Fields.ContainsField(fieldName)) { SPFieldMultiLineText field = (SPFieldMultiLineText)list.Fields.GetField(fieldName); field.RichText = false; field.Update(); } } } }
mit
arsalansaad/sac
sponsors2017.php
16028
<html> <head> <title>Sponsors</title> <link rel="icon" href="img/meet_14.png"> <link rel="stylesheet" href="css/materialize.min.css"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <script src="js/materialize.min.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="css/style.css"> <style type="text/css"> html { font-size: 15px !important; } </style> <script type="text/javascript"> $(document).ready(function(){ // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered $('.modal-trigger').leanModal(); }); </script> </head> <body> <div class="_wrapper" style="overflow: hidden; background-color: white;"> <?php include 'navbar.php';?> <?php include 'join_us.php' ?> <div class="container" align="center"> <div class="row" > <div class="col l12"> <h2 style="text-align:center;">Co Sponsor <hr></h2> </div> <a href="http://www.tatamotors.com/" target="_blank" > <img class="spons" src="img/spons/2017/Co-Sponsor/TATA-Motors.png" width="350" height="170" /> </a> </div> <br> <br> <div class="row" > <div class="col l12"> <h2 style="text-align:center;">Major Sponsor <hr></h2> </div> <div class="col l6" align="center"><br><a href="http://www.archiesonline.com/" target="_blank" > <img class="spons" src="img/spons/2017/Major Sponsor/a.png" width="350" height="170" /> </a> </div> <div class="col l6" align="center"><br><a href="http://www.wbsetcl.in/" target="_blank" > <img class="spons" src="img/spons/2017/Major Sponsor/wbsetcl.jpg" width="200" height="170" /> </a> </div> <div class="col l4" align="center"><br><a href="http://www.acclimited.com/" target="_blank" > <img class="spons" src="img/spons/2017/Major Sponsor/acc.jpg" width="200" height="170" /> </a> </div> <div class="col l4" align="center"><br><a href="http://www.shapoorjipallonji.in/" target="_blank" > <img class="spons" src="img/spons/2017/Major Sponsor/Shapoorji.jpg" width="200" height="170" /> </a> </div> <div class="col l4" align="center"><br><a href="http://www.tatasteel.com/" target="_blank" > <img class="spons" src="img/spons/2017/Major Sponsor/tata.jpg" width="200" height="170" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Event Sponsors <hr></h2> </div> <div class="col l4 m4 s12" align="center" style="margin-top: 20px"> <a href="https://hurix.com/digital-education/" target="_blank"> <img class="spons" src="img/spons/2017/Event Sponsor/a.png" width="" height="" /> </a> </div> <div class="col l4 m4 s12" align="center"> <a href="#" target="_blank"> <img class="spons" src="img/spons/2017/Event Sponsor/ISA.png" width="" height="120" /> </a> </div> <div class="col l4 m4 s12" align="center"> <a href="http://www.ultragreencc.in/" target="_blank"> <img class="spons" src="img/spons/2017/Event Sponsor/Ultra%20Green.png" width="" height="120" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Banking Partner<hr></h2> </div> <div class=" col l12 m12 s12" align="center"><a href="http://www.bankofbaroda.co.in/" target="_blank" > <img class="spons" src="img/spons/2017/Banking partner/bob.png" width="290" height="140" > </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">In Association With<hr></h2> </div> <div class=" col l12 m12 s12" align="center"><a href="https://www.telegraphindia.com/" target="_blank" > <img class="spons" src="img\spons\2017\In Association with\Telegraph.jpg" width="290" height="140" > </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Media Partner<hr></h2> </div> <div class=" col l12 m12 s12" align="center"><a href="https://www.inshorts.com" target="_blank" > <img class="spons" src="img\spons\2017\Media Partner\logo_inshorts.png" width="290" height="140" > </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center"> Suitings Partner <hr></h2> </div> </div> <div class="row"> <div class="col l12 m12 s12" align="center"> <a href="http://www.siyaram.com//" target="_blank"> <img class="spons" src="img/spons/2017/Premium Suitings Partner/sr.jpg" width="200" height="90" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12 "> <h2 class="spons_head" style="text-align:center;" >Luxury Gift Partners <hr></h2> </div> <div class="col l6 m6 s6 " style="align:center;"> <a href="https://www.giftease.com/" target="_blank"> <img class="spons" src="img/spons/2017/LUXURY GIFT PARTNER/Giftease_Logo.png" width="280" height="200" /> </a> </div> <div class="col l6 m6 s6 " style="align:center;"> <a href="https://www.woodgeekstore.com/" target="_blank"> <img class="spons" src="img/spons/2017/LUXURY GIFT PARTNER/unnamed.png" width="280" height="200" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Electronics Partner<hr></h2> </div> <div class="col l6 m12 s12" align="center"> <a href="http://www.ambraneindia.com/" target="_blank"> <img class="spons" src="img/spons/2017/Electronics partner/a-min.png" width="350px" height="200px" /> </a> </div> <div class="col l6 m12 s12" align="center"> <a href="http://krishproducts.com/" target="_blank"> <img class="spons" src="img/spons/2017/Electronics partner/Krish.png" width="350px" height="200px" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">E Gifting Partner<hr></h2> </div> <div class="col l12 m12 s12" align="center"> <a href="https://www.zokudo.com/" target="_blank"> <img class="spons" src="img/spons/2017/e Gifting Partner/Zokudo1.jpg" width="200px" height="200px" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Energy Partner <hr></h2> </div> <div class="col l12 m12 s12" align="center"> <a href="http://www.glucorade.com/" target="_blank"> <img class="spons" src="img/spons/2017/Energy Partner/ge.png" width="200px" height="200px" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Online Shopping Partner <hr></h2> </div> <div class="col l12 m12 s12" align="center"> <a href="#" target="_blank"> <img class="spons" src="img/spons/2017/ONLINE SHOPPING PARTNER/modalogo.png" width="300px" height="100px" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Beverage Partner <hr></h2> </div> <div class="col l12 m12 s12" align="center"> <a href="http://www.coca-colacompany.com/" target="_blank"> <img class="spons" src="img\spons\2017\Beverage Partner\coca-cola-logo.jpg" width="400px" height="300px" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Banquet Partner <hr></h2> </div> <div class="col l12 m12 s12" align="center"> <a href="http://www.mioamore.net/" target="_blank"> <img class="spons" src="img\spons\2017\Banquet Partner\mio amore.jpg" width="200px" height="200px" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Apparel Partner <hr></h2> </div> <div class="col l3 m6 s6 offset-l3" style="align:center;"> <a href="http://www.mangrove.com.hk/en/introduction.asp" target="_blank"> <img class="spons" src="img/spons/2017/Apparel partner/m.png" width="280" height="200" /> </a> </div> <div class="col l3 m6 s6"> <a href="http://mkapparel.org/" target="_blank"> <img class="spons" src="img/spons/2017/Apparel partner/mk.png" width="180" height="160" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center">Stationary Partner <hr></h2> </div> </div> <div class="row"> <div class="col l6 m12 s12" align="center"> <a href="http://www.jlcollection.de/" target="_blank"> <img class="spons" src="img/spons/2017/Stationery Partner/jl.jpg" width="300" height="150" /> </a> </div> <div class="col l6 m12 s12" align="center"> <a href="https://www.kokuyocamlin.com/" target="_blank"> <img class="spons" src="img/spons/2017/Stationery Partner/Camlin.jpg" width="200" height="150" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12 "> <h2 class="spons_head" style="text-align:center;" >Gift Partners <hr></h2> </div> <div class="col s12 m12 l12"> <div class="col l4 m4 s12 " > <a href="http://www.hidekraft.com/browse/bags" target="_blank"> <img class="spons" src="img/spons/2017/Gift Partner/hcraft.jpg" width="190" height="80" /> </a> </div> <div class="col l4 m4 s12"> <a href="https://www.pebble.com/" target="_blank"> <img class="spons" src="img/spons/2017/Gift Partner/pebble.png" width="190" height="80" /> </a> </div> <div class="col l4 m4 s12"> <a href="http://www.empresscorporategifts.com/" target="_blank"> <img class="spons" src="img/spons/2017/Gift Partner/EMPRESS_LOGO.png" width="190" height="80" /> </a> </div> </div> <br><br> <div class="col l12 m12 s12"> <div class="col l3 m3 s12" align="" > <a href="https://www.phctrends.com/" target="_blank"> <br> <br> <img class="spons" src="img/spons/2017/Gift Partner/phc.png" width="190" height="140" /> </a> </div> <div class="col l3 m3 s12" align=""> <a href="http://www.divinecraft.com/" target="_blank"> <br> <br> <img class="spons" src="img/spons/2017/Gift Partner/dc.jpg" width="190" height="140" /> </a> </div> <div class="col l3 m3 s12" align=""> <a href="http://www.blivusbags.com/" target="_blank"><br> <br> <img class="spons" src="img/spons/2017/Gift Partner/bb.JPG" width="190" height="140" /> </a> </div> <div class="col l3 m3 s12" align=""> <a href="http://capricorngifting.com/" target="_blank"><br> <br> <img class="spons" src="img/spons/2017/Gift Partner/capricon.png" width="190" height="140" /> </a> </div> </div> </div> <br> <br> <div class="row"> <h2 style="text-align:center">Food Partner<hr></h2> <div class="row"> <div class="col l4"><a href="http://www.marinofoods.in/" target="_blank" > <img class="spons" src="img/spons/2017/Food Partner_/m.png" width="290" height="140" /> </a> </div> <div class="col l4"><a href="http://www.bittuchanachur.com/" target="_blank" > <img class="spons" style="position:relative;top:8px;" src="img/spons/2017/Food Partner_/bittu.jpg" width="290" height="100" /> </a> </div> <div class="col l4"><a href="http://unibicindia.com/" target="_blank" > <img class="spons" style="position:relative;top:8px;" src="img/spons/2017/Food Partner_/u.png" width="290" height="100" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Freshness partner<hr></h2> </div> <div class="col l12 m12 s12" align="center"> <a href="http://www.dizzle.com/" target="_blank"> <img class="spons" src="img/spons/2017/Freshness partner/Dizzle.jpg" width="250px" height="250px" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Ride partner<hr></h2> </div> <div class="col l12 m12 s12" align="center"> <a href="http://unirox-gr.com/" target="_blank"> <img class="spons" src="img/spons/2017/RIDE PARTNER\unirox.jpg" width="250px" height="200px" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">Luggage Partner <hr></h2> </div> <div class="col l12 m12 s12" align="center"> <a href="http://www.bleubags.com/" target="_blank"> <img class="spons" src="img/spons/2017/Luggage Partner/bleu.jpg" width="250px" height="150px" /> </a> </div> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 style="text-align:center;">SMS Partners <hr></h2> </div> <div class="col l3 m4 s12"><a href="http://www.siegsms.com/" target="_blank" > <img class="spons" src="img/spons/2017/SMS Partner/s.gif" width="200" height="170" /> </a> </div> <div class="col l3 m4 s12"><a href="https://www.textlocal.in/" target="_blank" ><br><br> <img class="spons" src="img/spons/2017/SMS Partner/t.png" width="200" height="100" /> </a> </div> <div class="col l3 m4 s12"><a href="http://www.truebulksms.com/" target="_blank" ><br> <img class="spons" src="img/spons/2017/SMS Partner/tb.png" width="170" height="120" /> </a> </div> <div class="col l3 m4 s12"><a href="http://www.nettyfish.com/" target="_blank" ><br> <img class="spons" src="img/spons/2017/SMS Partner/Nettyfish.png" width="230" height="120" /> </a> </div> </div> <br> <br> <div class="row"> <div class="col l12 m12 s12"> <h2 class="spons_head" style="text-align:center;" >Online Media Partners <hr></h2> </div> <div class="col l12 m12 s12"> <div class="col l6 m4 s12" align="center"> <a href="https://www.crazyengineers.com/" target="_blank"> <br> <br> <img class="spons" src="img/spons/2017/Online Media Partner/Crazy Engineers.png" width="190" height="80" /> </a> </div> <div class="col l6 m4 s12" align="center"> <a href="http://www.fuccha.in/" target="_blank"> <br> <br> <img class="spons" src="img/spons/2017/Online Media Partner/Fuccha.png" width="190" height="80" /> </a> </div> <div class="col l4 m4 s12" align="center"> <a href="http://campfestiva.com/" target="_blank"> <br> <br> <img class="spons" src="img/spons/2017/Online Media Partner/cam.png" width="190" height="80" /> </a> </div> <div class="col l4 m4 s12" align="center"> <a href="#" target="_blank"> <br> <br> <img class="spons" src="img/spons/2017/Online Media Partner/ae-logo.png" width="190" height="80" /> </a> </div> <div class="col l4 m4 s12" align="center"> <a href="http://beingstudent.com/" target="_blank"><br> <br> <img class="spons" src="img/spons/2017/Online Media Partner/bs.png" width="190" height="80" /> </a> </div> </div> </div> <br><br> </div> </div> <?php include 'footer.php';?> </body> </html>
mit
Seondong/AGDISTIS
src/main/java/org/aksw/agdistis/webapp/RestletApplication.java
550
package org.aksw.agdistis.webapp; import org.restlet.Application; import org.restlet.Restlet; import org.restlet.routing.Router; public class RestletApplication extends Application { /** * Creates a root Restlet that will receive all incoming calls. */ @Override public Restlet createInboundRoot() { // Create a router Restlet that routes each call to a // new instance of GetDisambiguation. Router router = new Router(getContext()); // Defines only one route router.attachDefault(GetDisambiguation.class); return router; } }
mit
Strainy/react-native-http-server
android/src/main/java/com/strainy/RNHttpServer/RNHttpServerReactPackage.java
1060
package com.strainy.RNHttpServer; import java.util.Arrays; import java.util.ArrayList; import java.util.Collections; import java.util.List; import com.facebook.react.ReactPackage; import com.strainy.RNHttpServer.RNHttpServerModule; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; import com.facebook.react.bridge.JavaScriptModule; public class RNHttpServerReactPackage implements ReactPackage { @Override public List<NativeModule> createNativeModules( ReactApplicationContext reactContext) { List<NativeModule> modules = new ArrayList<>(); modules.add(new RNHttpServerModule(reactContext)); return modules; } @Override public List<Class<? extends JavaScriptModule>> createJSModules() { return Collections.emptyList(); } @Override public List<ViewManager> createViewManagers( ReactApplicationContext reactContext) { return Collections.emptyList(); } }
mit
Zoddy/maze.js
maze.js
2694
'use strict' /** * base function for creating a maze * * @param {number} sizeX count of rooms on the x axis * @param {number} sizeY count of rooms on the y axis */ const maze = function (sizeX, sizeY) { maze._directions = [{x: 0, y: -1}, {x: 1, y: 0}, {x: 0, y: 1}, {x: -1, y: 0}] maze._links = {} maze._path = [] maze._size = {x: sizeX, y: sizeY} maze._visitCount = 0 maze._visited = {} // create maze with startpoint maze._create({ x: maze._random(1, maze._size.x), y: maze._random(1, maze._size.y) }) return maze._links } /** * this really creates the maze, room for room * * @param {object} room next room to visit and search, with x- and y-coords */ maze._create = function (room) { // add room to visited rooms and to the path if (maze._visited[`${room.x},${room.y}`] === undefined) { maze._visited[`${room.x},${room.y}`] = true ++maze._visitCount } // get next random room const nextRoom = maze._getDirection(room) if (nextRoom === false) { if (maze._visitCount < maze._size.x * maze._size.y) { // ok, we are stucked, but don't visited all rooms maze._create(maze._path.pop()) } } else { maze._path.push(room) // add room to path maze._links[`${room.x},${room.y}_${nextRoom.x},${nextRoom.y}`] = [ room, nextRoom ] maze._create(nextRoom) // go to next room } } /** * choose the next room to go * * @param {object} room current room to search, with x- and y-coords * @return {object|boolean} returns the next room or false, if we are stucked */ maze._getDirection = function (room) { const directions = [] let nextRoom = {} // can we add north? if (room.y !== 1 && !maze._visited[`${room.x},${room.y - 1}`]) { directions.push(1) } // can we add east? if (room.x !== maze._size.x && !maze._visited[`${room.x + 1},${room.y}`]) { directions.push(2) } // can we add south? if (room.y !== maze._size.y && !maze._visited[`${room.x},${room.y + 1}`]) { directions.push(3) } // can we add west? if (room.x !== 1 && !maze._visited[`${room.x - 1},${room.y}`]) { directions.push(4) } if (directions.length === 0) { nextRoom = false } else { const direction = directions[maze._random(0, directions.length - 1)] - 1 nextRoom = { x: room.x + maze._directions[direction].x, y: room.y + maze._directions[direction].y } } return nextRoom } /** * generates a random number between two numbers * * @param {number} min minimum number * @param {number} max maximum number */ maze._random = function (min, max) { return min + parseInt(Math.random() * (max - min + 1), 10) } module.exports = maze
mit
mrsu986/flammalge
src/Untan.java
2373
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; //import twitter4j.StatusUpdate; import twitter4j.Twitter; import twitter4j.TwitterException; import twitter4j.TwitterFactory; import twitter4j.auth.AccessToken; public class Untan { int td = 0; Untan(){ } Untan(String cutey){ Twitter twitter = new TwitterFactory().getInstance(); twitter.setOAuthConsumer(Keys.consumerKey, Keys.consumerSecret); twitter.setOAuthAccessToken(new AccessToken(Keys.accessToken,Keys.accessTokenSecret)); int i = 0; String Dedede[] = new String[1000]; int core = -1; if(cutey.length()==5){ cutey = cutey.substring(0,4)+""; } String bf = cutey; System.out.println(cutey); for(int a=12353 ; a<12435; a++){//英語があるかチェック char d = (char)a; String d2 = String.valueOf(d); if(cutey.indexOf(d2)!=-1){ cutey = cutey.replaceAll(d2, ""); } } System.out.println(cutey); if(cutey.length()==0){ cutey = bf; try{ File file = new File("data/" + "tantan" + ".txt"); BufferedReader br = new BufferedReader(new FileReader(file)); String str= null; i=0; while((str = br.readLine()) != null){ Dedede[i] = str; if(str.equals(cutey)){ core = i; } i = i +1; } br.close(); }catch(FileNotFoundException e){ System.out.println(e); }catch(IOException e){ System.out.println(e); } if(core == -1){ try{ twitter.updateStatus(cutey); System.out.println("!ツイートしたよ:"+cutey); td = 1; try{ File file = new File("data/" + "tantan" + ".txt"); if (checkBeforeWritefile(file)){ FileWriter filewriter = new FileWriter(file, true); filewriter.write(cutey); filewriter.write("\r\n"); filewriter.close(); }else{ System.out.println("ファイルに書き込めません"); } }catch(IOException e){ System.out.println(e); } }catch(TwitterException e){ System.err.println("ツイート失敗"+e.getMessage()); } } } } private static boolean checkBeforeWritefile(File file){ if (file.exists()){ if (file.isFile() && file.canWrite()){ return true; } } return false; } }
mit
tanure/XFCalendar
Tanure.CalendarPOC/Models/CalendarModel.cs
2694
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tanure.CalendarPOC.Models { public class CalendarModel { #region [ Constants ] private const int MAX_WEEKS = 6; private const int MAX_DAYS = 7; #endregion private DateTime currentDate; private DayModel[,] currentCalendar; public DayModel[,] CurrentCalendar { get { return currentCalendar; } } public int CurrentYear { get { return currentDate.Year; } } public int CurrentMonth { get { return currentDate.Month; } } public ObservableCollection<DayModel> GetSelectedDates() { ObservableCollection<DayModel> selectedDates = new ObservableCollection<DayModel>(); for (int i = 0; i < currentCalendar.GetLength(0); i++) { for(int j = 0; j < currentCalendar.GetLength(1);j++) { if (currentCalendar[i, j] != null && currentCalendar[i, j].Selected) selectedDates.Add(currentCalendar[i, j]); } } return selectedDates; } public CalendarModel(DateTime baseDate) { currentDate = baseDate; this.MakeCurrentCalendar(); } public void NextMonth() { currentDate = currentDate.AddMonths(1); this.MakeCurrentCalendar(); } public void PriorMonth() { currentDate = currentDate.AddMonths(-1); this.MakeCurrentCalendar(); } private void MakeCurrentCalendar() { currentCalendar = new DayModel[MAX_WEEKS, MAX_DAYS]; int lastDay = DateTime.DaysInMonth(currentDate.Year, currentDate.Month); DateTime cDate = new DateTime(currentDate.Year, currentDate.Month, 1); DayModel dayCellAux = null; for (int i = 1, line = 0; i <= lastDay; i++) { dayCellAux = new DayModel(cDate) { Selected = false }; currentCalendar[line, Convert.ToInt32(cDate.DayOfWeek)] = dayCellAux; if (cDate.DayOfWeek == DayOfWeek.Saturday) line++; cDate = cDate.AddDays(1); } } } }
mit
ihasb33r/ef
web/js/maps.js
2712
var addmap = function(id,lat, lng, ttl, name, phone) { var latlng = new google.maps.LatLng(lat, lng); directionsService = new google.maps.DirectionsService(); directionsDisplay = new google.maps.DirectionsRenderer(); var myOptions = { zoom: 15, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false }; var map = new google.maps.Map(document.getElementById(id),myOptions); var marker = new google.maps.Marker({ position: latlng, map: map, title: ttl }); var contentString ="<h5>"+name+"</h5><h6>"+ttl+"</h6><h6>"+phone+"</h6>"; var infowindow = new google.maps.InfoWindow({ content: contentString }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); } var loadmaps = function (){ var mapcontainers = $(".map"); $.each(mapcontainers, function(key, mapcntr){ var myname = $(this).find(".name").text(); var myinfowindow = $(this).find(".infowindow").html(); var mylngf = $(this).find(".lng").text(); var mylatf = $(this).find(".lat").text(); $(this).empty(); var map = new GMaps({ div: "#" + $(this).attr("id"), lat: mylatf, lng: mylngf }); try{ map.addMarker({ lat: mylatf, lng: mylngf, title: myname, infoWindow: { content: myinfowindow } }); } catch(err) { } }); } var initGeolocation = function(){ var map; map = new GMaps({ div: '#setmap', lat: -12.043333, lng: -77.028333, zoom: 17 }); function findlnglat(){ var myaddress = $('#form_address').val() + ", " + $("#form_postalcode").val() + "," + $("#form_town").val(); GMaps.geocode({ address: myaddress, callback: function(results, status) { if (status == 'OK') { var latlng = results[0].geometry.location; map.setCenter(latlng.lat(), latlng.lng()); map.addMarker({ lat: latlng.lat(), lng: latlng.lng() }); $("#form_longitude").attr("value",latlng.lng()); $("#form_latitude").attr("value",latlng.lat()); } } }); } $("#form_town").blur( findlnglat); $("#form_address").blur(findlnglat); $("#form_postalcode").blur(findlnglat); } $(document).ready(function(){ });
mit
nikhaldi/android-view-selector
src/robolectric2-test/test/com/nikhaldimann/viewselector/robolectric2/attributes/ViewAttributesTest.java
590
package com.nikhaldimann.viewselector.robolectric2.attributes; import org.junit.runner.RunWith; import com.nikhaldimann.viewselector.robolectric2.testutil.Robolectric2ViewFactory; import com.nikhaldimann.viewselector.test.abstrakt.attributes.AbstractViewAttributesTest; import com.nikhaldimann.viewselector.test.util.ViewFactory; import org.robolectric.RobolectricTestRunner; @RunWith(RobolectricTestRunner.class) public class ViewAttributesTest extends AbstractViewAttributesTest { protected ViewFactory createViewFactory() { return new Robolectric2ViewFactory(); } }
mit
homobel/makebird-node
test/projects/large/c551.js
52
//~ name c551 alert(c551); //~ component c552.js
mit
ashelley/postcss-selector-parser
src/processor.js
583
'use strict'; import tokenize from './tokenize'; import Root from './selectors/root'; import Parser from './parser'; export default class Processor { constructor (func) { this.func = func || function noop () {}; return this; } process (selectors) { let input = new Parser({ css: selectors, error: (e) => { throw new Error(e); } }); this.res = input; this.func.call(this, input); return this; } get result () { return String(this.res); } }
mit
scalation/fda
scalation_1.3/scalation_modeling/src/main/scala/scalation/analytics/fda/B_Spline.scala
19682
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** @author John Miller, Michael Cotterell, Hao Peng, Dong-Yu Yu * @version 1.2 * @date Thu Sep 22 21:45:58 EDT 2016 * @see LICENSE (MIT style license file). * * @see en.wikipedia.org/wiki/B-spline * @see cran.r-project.org/web/packages/crs/vignettes/spline_primer.pdf * @see http://web.mit.edu/hyperbook/Patrikalakis-Maekawa-Cho/node17.html * @see open.uct.ac.za/bitstream/item/16664/thesis_sci_2015_essomba_rene_franck.pdf?sequence=1 */ package scalation.analytics.fda import scalation.linalgebra.{MatrixD, VectorD} import scalation.math.double_exp import scalation.util.Error import scalation.math.ExtremeD.TOL //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** The `B_Spline` class provides B-Spline basis functions for various orders 'm', * where the order is one more than the degree. A spline function is a piecewise * polynomial function where the pieces are stitched together at knots with the * goal of maintaining continuity and differentability. B-Spline basis functions * form a popular form of basis functions used in Functional Data Analysis. * @see http://web.mit.edu/hyperbook/Patrikalakis-Maekawa-Cho/node17.html *----------------------------------------------------------------------------- * @param ττ the time-points of the original knots in the time dimension * @param mMax the maximum order, allowing splines orders from 1 to mMax */ class B_Spline (ττ: VectorD, mMax: Int = 4) extends Error { private val DEBUG = false // debug flag private val l = ττ.dim - 1 // the number of intervals private val ante = VectorD.fill (mMax-1)(ττ(0)) // "before" knots private val post = VectorD.fill (mMax-1)(ττ(l)) // "after" knots private val τ = ante ++ ττ ++ post // augment to accomodate knots if (mMax < 1 || mMax > 10) flaw ("constructor", "B_Spline order restricted to 1 thru 10") if (DEBUG) { println (s"B_Spline (ττ = $ττ, mMax = $mMax)") println ("intervals l = " + l) println ("augmented τ = " + τ) } // if //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Range of "usable" splines when using the `bs` function. This is needed, * since extra splines may be generated by the general B-spline recurrence. * @param m the order of the spline */ def range (m: Int = mMax) = 0 to l+m-2 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** The number of useable spline basis functions for a specified order, * given the configured knot vector. * @param m the order of the spline */ def size (m: Int = mMax) = range(m).size //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Order one 'm = 1' B-Spline basis functions (flat functions). * @param j indicates which spline function 0 to l-1 * @param t the time parameter */ private def bb1 (k: Int, t: Double): Double = { val tt = if (t == ττ(ττ.dim-1)) t-TOL else t if (τ(k) <= tt && tt < τ(k+1)) 1.0 else 0.0 } // bb1 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Order 'm' B-Spline basis functions (general recurrence). * @param m the order of the spline function (degree = order - 1) * @param j indicates which spline function * @param t the time parameter */ def bb (m: Int)(j: Int, t: Double): Double = { if (mMax < m) flaw ("bb", s"mMax = $mMax can't be less than m = $m") if (m == 1) return bb1 (j, t) val jm = j + m val n1 = t - τ(j) val n2 = τ(jm) - t val d1 = τ(jm-1) - τ(j) + TOL val d2 = τ(jm) - τ(j+1) + TOL val a = (n1 / d1) * bb (m-1)(j, t) val b = (n2 / d2) * bb (m-1)(j+1, t) a + b } // bb // def d0bb (m: Int) (j: Int, t: Double): Double = bb (m)(j, t) //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Adjusted order 'm' B-Spline basis functions (general recurrence). These * are adjusted so that the first "usable" spline is at `j = 0`. The valid * range of usable splines is defined in `range`. * @param m the order of the spline function (degree = order - 1) * @param j indicates which spline function * @param t the time parameter */ def bs (m: Int) (j: Int, t: Double): Double = bb (m)(j+mMax-m, t) // def d0bs (m: Int) (j: Int, t: Double): Double = bs (m)(j, t) //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** First derivatives of order 'm' B-Spline basis functions (general * recurrence). * @param m the order of the spline function (degree = order - 1) * @param j indicates which spline function * @param t the time parameter */ def d1bb (m:Int) (j: Int, t: Double): Double = { if (mMax < m) flaw ("d1bb", s"mMax = $mMax can't be less than m = $m") if (m == 1) return 0.0 val jm = j + m val n1 = t - τ(j) val n2 = τ(jm) - t val d1 = τ(jm-1) - τ(j) + TOL val d2 = τ(jm) - τ(j+1) + TOL val a = ( bb (m-1)(j, t) + n1 * d1bb (m-1)(j, t)) / d1 val b = (-bb (m-1)(j+1, t) + n2 * d1bb (m-1)(j+1, t)) / d2 a + b } // d1bb //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Adjusted derivatives of order 'm' B-Spline basis functions (general * recurrence). These are adjusted so that the first "usable" spline is at * `j = 0`. The valid range of usable splines is defined in `range`. * @param m the order of the spline function (degree = order - 1) * @param j indicates which spline function * @param t the time parameter */ def d1bs (m: Int) (j: Int, t: Double): Double = d1bb (m)(j+mMax-m, t) //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Second derivatives of order 'm' B-Spline basis functions (general * recurrence). * @param m the order of the spline function (degree = order - 1) * @param j indicates which spline function * @param t the time parameter */ def d2bb (m:Int) (j: Int, t: Double): Double ={ if (mMax < m) flaw ("d2bb", s"mMax = $mMax can't be less than m = $m") if (m == 2) return 0.0 val jm = j + m val n1 = t - τ(j) val n2 = τ(jm) - t val d1 = τ(jm-1) - τ(j) + TOL val d2 = τ(jm) - τ(j+1) + TOL val a = ( 2.0 * d1bb (m-1)(j, t) + n1 * d2bb (m-1)(j, t)) / d1 val b = (-2.0 * d1bb (m-1)(j+1, t) + n2 * d2bb (m-1)(j+1, t)) / d2 a + b } // d2bb //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Adjusted seconf derivatives of order 'm' B-Spline basis functions * (general recurrence). These are adjusted so that the first "usable" * spline is at `j = 0`. The valid range of usable splines is defined in * `range`. * @param m the order of the spline function (degree = order - 1) * @param j indicates which spline function * @param t the time parameter */ def d2bs (m: Int) (j: Int, t: Double): Double = d2bb (m)(j+mMax-m, t) //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Adjusted order 'm' B-Spline basis functions (general recurrence). These * are adjusted so that the first "usable" spline is at `j = 0`. The valid * range of usable splines is defined in `range`. * @param m the order of the spline function (degree = order - 1) * @param j indicates which spline function * @param t the time parameter */ def apply (m: Int) (j: Int, t: Double): Double = bs (m)(j, t) //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Adjusted order 'm' B-Spline basis functions (general recurrence). These * are adjusted so that the first "usable" spline is at `j = 0`. The valid * range of usable splines is defined in `range`. * @param m the order of the spline function (degree = order - 1) * @param j indicates which spline function * @param t the time parameter */ //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Plot the B-spline basis functions and as well as their frist and second * derivatives (if available). * @param m the order of the spline function (degree = order - 1) * @param t the time parameter */ def plot (m: Int = mMax) (t: VectorD) { import scalation.linalgebra.MatrixD import scalation.plot.PlotM val ns = range(m).size val n = t.dim val d0y = new MatrixD (ns, n) // τ.dim + mMax, n) // matrix to hold initial B-Splines val d1y = new MatrixD (ns, n) // τ.dim + mMax, n) val d2y = new MatrixD (ns, n) // τ.dim + mMax, n) for (i <- 0 until n; j <- range(m)) { if (m > 0) d0y(j, i) = bs (m)(j, t(i)) if (m > 1) d1y(j, i) = d1bs (m)(j, t(i)) if (m > 2) d2y(j, i) = d2bs (m)(j, t(i)) } // for if (m > 0) new PlotM (t, d0y, null, "B-Spline order " + m) if (m > 1) new PlotM (t, d1y, null, "First Derivative of B-Spline order " + m) if (m > 2) new PlotM (t, d2y, null, "Second Derivative of B-Spline order " + m) } // plot //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Computes the dot/inner product of the second derivatives of the i-th * and j-th basis functions over the supplied time parameter. * derivatives (if available). * @param m the order of the spline function (degree = order - 1) * @param i the index of the first spline basis function * @param j the index of the second spline basis function * @param t the time parameter * ----------------------------------------------------------------------- * `Σ[i,j] = Integral B''[i](t) B''[j](t) dt` */ def sigma (m: Int = mMax) (i: Int, j: Int, t: VectorD): Double = { import scalation.calculus.functionS2S2Hilbert import scalation.calculus.Integral.∫ val a = t(0) // lower limit val b = t(t.dim-1) // upper limit val f = (x: Double) => d2bs (m)(i, x) // first basis function val g = (x: Double) => d2bs (m)(j, x) // second basis function ∫ ((a, b), f * g) } // sigma //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Computes the roughness penalty matrix defined in Ramnsay et al. * (Section 5.8), which is composed of the integrals of products of * the second derivative of basis functions. * @param m the order of the spline function (degree = order - 1) * @param t the time parameter */ def penalty (m: Int = mMax) (t: VectorD): MatrixD = { val ns = range().size // number of splines val Σ = new MatrixD (ns, ns) // penalty matrix for (i <- Σ.range1; j <- Σ.range2) Σ(i, j) = sigma (m)(i, j, t) Σ } // penalty //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Computes a matrix of the basis functions evaluated at the given time * points. * @param m the order of the spline function (degree = order - 1) * @param t the time parameter */ def phi (m: Int = mMax) (t: VectorD): MatrixD = { val nt = t.dim val ns = size (m) val Φ = new MatrixD (nt, ns) for (i <- t.indices; j<- range(m)) Φ(i, j) = bs (m) (j, t(i)) Φ } // phi } // B_Spline class //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** The `B_SplineTest2` object is used to test the `B_Spline` class. * It tests the B-Spline functions using the general recurrence. * > run-main scalation.analytics.fda.B_SplineTest2 */ object B_SplineTest2 extends App { import scalation.plot.Plot val mM = 4 // maximum order to test val τ = VectorD (0.0, 20.0, 40.0, 60.0, 80.0, 100.0) // knot time-points val bs = new B_Spline (τ, mM) // B-Spline generator val n = 100 // number of time-points for plotting val t = VectorD.range (0, n) // time-points for plotting for (m <- 1 to mM) { //--------------------------------------------------------------------- // order m B-Splines (polynomial functions) val y1 = new VectorD (n) val y2 = new VectorD (n) for (i <- 0 until n) { y1(i) = bs.bb (m)(mM-m+1, t(i)) // first "interesting" B-Spline y2(i) = bs.bb (m)(mM-m+2, t(i)) // next B-Spline } // for new Plot (t, y1, y2, "B-Spline order " + m) } // for } // B_SplineTest2 object //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** The `B_SplineTest3` object is used to test the `B_Spline` class. * It tests the B-Spline functions using the general recurrence and plots * several basis functions using `PlotM`. * > run-main scalation.analytics.fda.B_SplineTest3 */ object B_SplineTest3 extends App { import scalation.linalgebra.MatrixD import scalation.plot.PlotM val mM = 5 // maximum order to test val τ = VectorD (0.0, 50.0, 100.0) // knot time-points val bs = new B_Spline (τ, mM) // B-Spline generator val n = 100 // number of time-points for plotting val t = VectorD.range (0, n)/(n-1)*n // time-points for plotting val k = 0 // index for initial B-Spline for (m <- 2 to 4) { //--------------------------------------------------------------------- // order m B-Splines (polynomial functions) val y = new MatrixD (τ.dim + mM, n) // matrix to hold initial B-Splines for (i <- 0 until n; j <- 0 to bs.range(m).last) { y(j, i) = bs (m)(j, t(i)) } // for new PlotM (t, y, null, "B-Spline order " + m) } // for } // B_SplineTest3 object //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** The `B_SplineTest4` object is used to test the `B_Spline` class. * It tests the B-Spline functions using the general recurrence. * > run-main scalation.analytics.fda.B_SplineTest4 */ object B_SplineTest4 extends App { val mM = 4 // maximum order to test val n = 100 // number of time points val τ = VectorD (0.0, 0.5 * (n-1), (n-1)) / (n) // knot vector (unaugmented) val bs = new B_Spline (τ, mM) // B-Spline generator val t = VectorD.range (0, n) / n // time-points for plotting for (m <- 1 to mM) bs.plot (m)(t) // plot } // B_SplineTest4 object //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** The `B_SplineTest5` object is used to test the `B_Spline` class. Here, we * compute the penalty matrix for a ridge regression. * > run-main scalation.analytics.fda.B_SplineTest5 */ object B_SplineTest5 extends App { val mM = 4 // maximum order to test val n = 100 // number of time points val τ = VectorD (0.0, 0.5 * (n-1), (n-1)) / n // knot vector (unaugmented) val bs = new B_Spline (τ, mM) // B-Spline generator val t = VectorD.range (0, n) / n // time-points val ns = bs.size() // number of splines val Σ = bs.penalty()(t) // penalty matrix val λ = 0.01 // regularization parameter println (s" λ = $λ") println (s" Σ = $Σ") println (s"λΣ = ${Σ * λ}") } // B_SplineTest5 object //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** The `B_SplineTest6` object is used to test the `B_Spline` class. Here, we * smooth functional data manually with a roughness penalty. * @see Ramsay et al. page 86 * > run-main scalation.analytics.fda.B_SplineTest5 */ object B_SplineTest6 extends App { import scalation.random.Normal val normal = Normal () val mM = 4 // maximum order to test val n = 100 // number of time points val G = 10 // gap // val τ = VectorD.range (0, n/G) / ((n-1)/G) // knot vector (unaugmented) val t = VectorD.range (0, n) / n // time-points val τ = VectorD.range (0, n/G) / ((n-1)/G) * t(t.dim-1) // knot vector (unaugmented) val bs = new B_Spline (τ, mM) // B-Spline generator val ns = bs.range().size // number of splines val Σ = bs.penalty()(t) // penalty matrix val λ = 1E-1 // regularization parameter val y = new VectorD (n) val w = new VectorD (n) for (i <- 0 until n) { w(i) = t(i) * t(i); y(i) = w(i) + normal.gen } val Φ = bs.phi()(t) // basis matrix val I = MatrixD.eye(ns) // identity matrix val W = MatrixD.eye(n) // weight matrix val c = ((Φ.t * W * Φ) + (Σ * λ)).inverse * Φ.t * W * y // Penalized Ridge //val c = ((Φ.t * Φ) + (I * λ)).inverse * Φ.t * y // Simple Ridge //val c = (Φ.t * Φ).inverse * Φ.t * y // OLS val z = new VectorD (n) // smoothed values for (i <- 0 until n) z(i) = { var sum = 0.0 for (j <- bs.range()) sum += c(j) * bs (mM) (j, t(i)) sum } // for println (s" y = $y") println (s" λ = $λ") println (s" Σ = $Σ") println (s" λΣ = ${Σ * λ}") println (s" λI = ${I * λ}") println (s" Φ = $Φ") println (s"Φ'Φ = ${Φ.t * Φ}") println (s" c = $c") println (s" z = $z") import scalation.plot.Plot new Plot (t, y, z, lines = true) new Plot (t, y, w, lines = true) } // B_SplineTest6 object
mit
Coding/Coding-Android
app/src/main/java/net/coding/program/common/ui/emoji/EmojiFragment.java
8098
package net.coding.program.common.ui.emoji; import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.GridView; import net.coding.program.R; import net.coding.program.common.MyImageGetter; import net.coding.program.common.enter.EnterLayout; import net.coding.program.common.widget.input.EmojiKeyboard; import net.coding.program.common.widget.input.EmojiconSpan; import net.coding.program.common.widget.input.InputAction; /** * Created by chaochen on 14-10-30. * todo 单独的控件 */ public class EmojiFragment extends Fragment { private LayoutInflater mInflater; private String[] mEmojiData; private MyImageGetter myImageGetter; private int deletePos; private InputAction mEnterLayout; private EmojiKeyboard.Type mType; private int mItemLayout = R.layout.gridview_emotion_emoji; BaseAdapter adapterIcon = new BaseAdapter() { @Override public int getCount() { return mEmojiData.length; } @Override public Object getItem(int position) { return mEmojiData[position]; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(mItemLayout, parent, false); holder = new ViewHolder(); holder.icon = convertView.findViewById(R.id.icon); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } String iconName = mEmojiData[position]; if (!iconName.isEmpty()) { holder.icon.setBackgroundDrawable(myImageGetter.getDrawable(iconName)); } return convertView; } @Override public boolean isEnabled(int position) { return !mEmojiData[position].isEmpty() && super.isEnabled(position); } class ViewHolder { public View icon; } }; private int mGridViewColumns; public EmojiFragment() { super(); } public void init(String[] emojis, MyImageGetter imageGetter, InputAction enterLayout, EmojiKeyboard.Type type) { mEmojiData = emojis; myImageGetter = imageGetter; deletePos = emojis.length - 1; mEnterLayout = enterLayout; mType = type; if (type == EmojiKeyboard.Type.Big || type == EmojiKeyboard.Type.Zhongqiu) { mItemLayout = R.layout.gridview_emotion_big; mGridViewColumns = 4; } else { // if (type == Type.Small) { mItemLayout = R.layout.gridview_emotion_emoji; mGridViewColumns = 7; } } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putStringArray("mEmojiData", mEmojiData); outState.putInt("deletePos", deletePos); outState.putSerializable("mType", mType); outState.putInt("mItemLayout", mItemLayout); outState.putInt("mGridViewColumns", mGridViewColumns); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mInflater = inflater; View v = inflater.inflate(R.layout.emoji_gridview, container, false); if (savedInstanceState != null) { mEmojiData = savedInstanceState.getStringArray("mEmojiData"); deletePos = savedInstanceState.getInt("deletePos"); mType = (EmojiKeyboard.Type) savedInstanceState.getSerializable("mType"); mItemLayout = savedInstanceState.getInt("mItemLayout"); mGridViewColumns = savedInstanceState.getInt("mGridViewColumns"); myImageGetter = new MyImageGetter(getActivity()); Activity activity = getActivity(); if (activity instanceof EnterEmojiLayout) { mEnterLayout = ((EnterEmojiLayout) activity).getEnterLayout(); } } GridView gridView = (GridView) v.findViewById(R.id.gridView); gridView.setNumColumns(mGridViewColumns); gridView.setAdapter(adapterIcon); gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (mType == EmojiKeyboard.Type.Small) { int realPos = (int) id; if (realPos == deletePos) { mEnterLayout.deleteOneChar(); } else { String name = (String) adapterIcon.getItem((int) id); if (name.isEmpty()) { return; } if (name.equals("leftwards_arrow_with_hook")) { mEnterLayout.enterAction(); return; } if (name.equals("one") || name.equals("two") || name.equals("three") || name.equals("four") || name.equals("five") || name.equals("six") || name.equals("seven") || name.equals("eight") || name.equals("nine") || name.equals("zero")) { switch (name) { case "one": name = "1"; break; case "two": name = "2"; break; case "three": name = "3"; break; case "four": name = "4"; break; case "five": name = "5"; break; case "six": name = "6"; break; case "seven": name = "7"; break; case "eight": name = "8"; break; case "nine": name = "9"; break; case "zero": name = "0"; break; } mEnterLayout.numberAction(name); return; } if (name.equals("my100")) { name = "100"; } else if (name.equals("a00001")) { name = "+1"; } else if (name.equals("a00002")) { name = "-1"; } mEnterLayout.insertEmoji(name); } } else { String imageName = (String) adapterIcon.getItem((int) id); String editName = EmojiconSpan.imageToText(imageName); mEnterLayout.insertEmoji(editName); } } }); return v; } public interface EnterEmojiLayout { EnterLayout getEnterLayout(); } }
mit
ChronosWS/material2
src/lib/tabs/tab-label.ts
757
/** * @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 {Directive, TemplateRef, ViewContainerRef} from '@angular/core'; import {CdkPortal} from '@angular/cdk/portal'; /** Workaround for https://github.com/angular/angular/issues/17849 */ export const _MatTabLabelBaseClass = CdkPortal; /** Used to flag tab labels for use with the portal directive */ @Directive({ selector: '[mat-tab-label], [matTabLabel]', }) export class MatTabLabel extends _MatTabLabelBaseClass { constructor(templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef) { super(templateRef, viewContainerRef); } }
mit
Zyst/learning-react
react-router-tutorial/modules/Repo.js
175
import React from 'react'; export default React.createClass({ render() { return ( <div> <h2>{this.props.params.repoName}</h2> </div> ) } });
mit
sachinlala/SimplifyLearning
algorithms/src/test/java/com/sl/algorithms/search/pigeonhole/MNFinderTest.java
4815
package com.sl.algorithms.search.pigeonhole; import com.sl.algorithms.core.interfaces.search.pigeonhole.MissingNumberFinder; import org.junit.Assert; import org.junit.Test; public class MNFinderTest { private MissingNumberFinder missingNumberFinder = new LinearTimeMNFinder(); @Test public void testFindMissingNumber() { { Assert.assertEquals(0, missingNumberFinder.findMissingNumber(null)); Assert.assertEquals(0, missingNumberFinder.findMissingNumber(new int[]{})); } { // numbers at (/almost) their expected indices Assert.assertEquals(3, missingNumberFinder.findMissingNumber(new int[]{0, 1, 2, 4, 5})); Assert.assertEquals(6, missingNumberFinder.findMissingNumber(new int[]{0, 1, 2, 3, 4, 5})); } { // jumbled Assert.assertEquals(1, missingNumberFinder.findMissingNumber(new int[]{0, 2, 4, 3})); Assert.assertEquals(0, missingNumberFinder.findMissingNumber(new int[]{1, 2, 4, 3})); } { // n (representing size of the array) itself is missing Assert.assertEquals(4, missingNumberFinder.findMissingNumber(new int[]{0, 1, 2, 3})); } { /** * This one's important to observe: if 0 was in scope of output, then XOR approach won't work rather we'll need to utilize binary search. */ Assert.assertEquals(6, missingNumberFinder.findMissingNumber(new int[]{1, 2, 4, 5})); } } @Test public void testFindFirstMissingPositive() { { // null Assert.assertEquals(1, missingNumberFinder.findFirstMissingPositive(null)); Assert.assertEquals(1, missingNumberFinder.findFirstMissingPositive(new int[]{})); } { // single element Assert.assertEquals(1, missingNumberFinder.findFirstMissingPositive(new int[]{-1})); Assert.assertEquals(1, missingNumberFinder.findFirstMissingPositive(new int[]{0})); Assert.assertEquals(2, missingNumberFinder.findFirstMissingPositive(new int[]{1})); Assert.assertEquals(1, missingNumberFinder.findFirstMissingPositive(new int[]{10})); } { // pair Assert.assertEquals(2, missingNumberFinder.findFirstMissingPositive(new int[]{1, 1})); Assert.assertEquals(3, missingNumberFinder.findFirstMissingPositive(new int[]{1, 2})); Assert.assertEquals(1, missingNumberFinder.findFirstMissingPositive(new int[]{2, 2})); } { // dupes Assert.assertEquals(1, missingNumberFinder.findFirstMissingPositive(new int[]{3, 3, 3})); Assert.assertEquals(3, missingNumberFinder.findFirstMissingPositive(new int[]{1, 1, 2, 2})); Assert.assertEquals(4, missingNumberFinder.findFirstMissingPositive(new int[]{1, 1, 2, 3})); Assert.assertEquals(3, missingNumberFinder.findFirstMissingPositive(new int[]{1, 1, 2, 4})); Assert.assertEquals(3, missingNumberFinder.findFirstMissingPositive(new int[]{0, 0, 1, 2, 2, 4, 5})); Assert.assertEquals(3, missingNumberFinder.findFirstMissingPositive(new int[]{0, 0, 1, 2, 4, 5})); Assert.assertEquals(4, missingNumberFinder.findFirstMissingPositive(new int[]{5, 2, 3, 2, 2, 1})); Assert.assertEquals(4, missingNumberFinder.findFirstMissingPositive(new int[]{-1, 1, 1, 2, 2, 3})); Assert.assertEquals(2, missingNumberFinder.findFirstMissingPositive(new int[]{4, 1, 4, 3})); } { // regular - numbers are (/almost) at their expected indices Assert.assertEquals(4, missingNumberFinder.findFirstMissingPositive(new int[]{0, 1, 2, 3})); Assert.assertEquals(4, missingNumberFinder.findFirstMissingPositive(new int[]{-1, 1, 2, 3})); Assert.assertEquals(3, missingNumberFinder.findFirstMissingPositive(new int[]{0, 1, 2, 4})); Assert.assertEquals(5, missingNumberFinder.findFirstMissingPositive(new int[]{4, 1, 2, 3})); Assert.assertEquals(4, missingNumberFinder.findFirstMissingPositive(new int[]{40, 1, 2, 3})); } { // jumbled Assert.assertEquals(5, missingNumberFinder.findFirstMissingPositive(new int[]{1, 2, 3, 4})); Assert.assertEquals(4, missingNumberFinder.findFirstMissingPositive(new int[]{1, 2, 3})); Assert.assertEquals(5, missingNumberFinder.findFirstMissingPositive(new int[]{1, 3, 2, 4})); Assert .assertEquals(1, missingNumberFinder.findFirstMissingPositive(new int[]{-2, -3, -4, -8})); Assert.assertEquals(3, missingNumberFinder.findFirstMissingPositive(new int[]{1, 2, 4, 5})); Assert.assertEquals(5, missingNumberFinder.findFirstMissingPositive(new int[]{4, 2, 1, 3})); Assert.assertEquals(5, missingNumberFinder.findFirstMissingPositive(new int[]{4, 2, 3, 1})); Assert.assertEquals(2, missingNumberFinder.findFirstMissingPositive(new int[]{3, 4, -1, 1})); Assert.assertEquals(5, missingNumberFinder.findFirstMissingPositive(new int[]{4, 3, 2, 1})); } } }
mit
dbernheisel/ruby_challenges
challenge_07_enumerable.rb
1683
require 'minitest/autorun' require 'minitest/pride' # Write a series of methods which use the .any, .all, .map, .select, .reject, and # .reduce methods in Enumerable. Each of your methods should be one line. # WRITE YOUR CODE HERE. In this challenge, names longer than 5 characters are # considered long. ## LEAVE CODE BELOW INTACT class EnumerableChallenge < MiniTest::Test def test_any assert has_even?([2, 3, 4, 5, 6]) assert has_even?([-2, 3, -4, 5, -6]) refute has_even?([3, 5]) refute has_even?([-3, -5]) end def test_all assert all_short?(["Amy", "Bob", "Cam"]) assert all_short?(["Zeke", "Yoo", "Xod"]) refute all_short?(["Amy", "Bob", "Cammie"]) refute all_short?(["Zachary", "Yoo", "Xod"]) end def test_map assert_equal [1, 4, 9], squares([1, 2, 3]) assert_equal [16, 36, 81], squares([4, 6, 9]) end def test_select assert_equal ["Amy", "Bob", "Cam"], just_short(["Amy", "Bob", "Cam"]) assert_equal ["Zeke", "Yoo", "Xod"], just_short(["Zeke", "Yoo", "Xod"]) assert_equal ["Amy", "Bob"], just_short(["Amy", "Bob", "Cammie"]) assert_equal ["Yoo", "Xod"], just_short(["Zachary", "Yoo", "Xod"]) end def test_reject assert_equal ["Amy", "Bob", "Cam"], no_long(["Amy", "Bob", "Cam"]) assert_equal ["Zeke", "Yoo", "Xod"], no_long(["Zeke", "Yoo", "Xod"]) assert_equal ["Amy", "Bob"], no_long(["Amy", "Bob", "Cammie"]) assert_equal ["Yoo", "Xod"], no_long(["Zachary", "Yoo", "Xod"]) end def test_reduce assert_equal 1, product([1, 1, 1]) assert_equal 150, product([3, 5, 10]) assert_equal 0, product([18, 13, 0]) assert_equal 12, product([2, 3, 2]) end end
mit
marcjohnstonuw/bingo-gen
index.js
2785
const express = require('express'); const app = express(); const bookshelf = require('./server/Bookshelf'); const bodyParser = require('body-parser'); const jwt = require('express-jwt'); const jwksRsa = require('jwks-rsa'); const jwks = require('jwks-rsa'); const jwt_decode = require('jwt-decode'); // const cookieParser = require('cookie-parser'); const GameTypeRoutes = require('./server/routes/GameTypes'); const SquaresRoutes = require('./server/routes/Squares'); const UsersRoutes = require('./server/routes/Users'); const BoardRoutes = require('./server/routes/Board'); const BoardSquareRoutes = require('./server/routes/BoardSquare'); const User = require('./server/models/User'); const path = require('path'); 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"); res.header("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS"); next(); }); var jwtCheck = jwt({ secret: jwks.expressJwtSecret({ cache: true, rateLimit: true, jwksRequestsPerMinute: 5, jwksUri: "https://marcjohnstonuw.auth0.com/.well-known/jwks.json" }), audience: 'https://bingo-gen.api.com', issuer: "https://marcjohnstonuw.auth0.com/", algorithms: ['RS256'] }); app.use(function (req, res, next) { if (req.headers.id) { let decoded = jwt_decode(req.headers.id); User.query({where: {email: decoded.email}}) .fetch() .then((user) => { req.headers.userID = user.id next(); }) .catch((err) => { next(); }) } else { next() } }) //var decoded = jwt_decode(token); // Serve static assets console.log('__dirname', __dirname) app.use(express.static(path.resolve(__dirname, 'build'))); // Always return the main index.html, so react-router render the route in the client app.get('/', (req, res) => { res.sendFile(path.resolve(__dirname, 'build', 'index.html')); }); app.get('/callback', (req, res) => { res.sendFile(path.resolve(__dirname, 'build', 'index.html')); }); app.use(bodyParser.urlencoded()); app.use(bodyParser.json()); app.use('/gameTypes', GameTypeRoutes); app.use('/squares', jwtCheck, SquaresRoutes); app.use('/users', jwtCheck, UsersRoutes); app.use('/boards', jwtCheck, BoardRoutes); app.use('/boardsquares', jwtCheck, BoardSquareRoutes); module.exports = app; // app.listen(8080, () => { // console.log('Server Started on http://localhost:8080'); // console.log('Press CTRL + C to stop server'); // }); // // server/index.js // 'use strict'; // const app = require('./server/app'); const PORT = process.env.PORT || 9000; app.listen(PORT, () => { console.log(`App listening on port ${PORT}!`); });
mit
amitkaps/djembeviz
viz/remap/sketch.js
2801
// Visualise the frequency log domain using FFT var mic var song; var analyzer; // Array of amplitude values (-1 to +1) over Frequency. var samples = []; var currentSource = "mic"; // Create Bass Band and Slider variable var bassBand = 10; var bassSlider; var maxBand; var maxValue; var bass; function preload() { song = loadSound('../../song/bass_tone_slap.mp3'); } function setup() { // Create a black canvas for the entire window createCanvas(windowWidth, windowHeight); colorMode(HSB, 360, 100, 100, 1) background(0,0,0); // create sliders //bassSlider = createSlider(0, 50, bassBand); //bassSlider.position(width*6/8, height*1/8); // Start the microphone and use for input mic = new p5.AudioIn(); mic.start(); // Start the FFT analyzer for the song, default 1024 bin analyzer = new p5.FFT(0.8, 1024); analyzer.setInput(mic); peak = new p5.PeakDetect(); } function draw() { // Repaint the canvas as black background(0,0,0); //fill(37,61,90); noStroke(); // text('press t to toggle source', 20, height - 60); // Set the Slidervalues //bassBand = bassSlider.value(); bassBand = 10; // get a buffer of 1024 samples over Frequency. samples = analyzer.analyze(); var bins = samples.length; console.log(bins); binwidth = width / bins; // Find out the max band maxBand = -1; maxValue = 0; for (var i = 0; i < bins; i++){ if (samples[i] > maxValue) { maxValue = samples[i]; maxBand = i; } } if (maxBand <= bassBand) { bass = 1; } else { bass = 0; } // Create Slider Text //fill(200) //text('Bass Band Select: ' + bassBand, width*6/8, height*1/8 - 10); drawSample(20, bassBand, bass); } function drawSample(bins, bassBand, bass){ var xcum = 0; for (var i = 0; i < bins; i++){ //var x = map(Math.log2(i+2), 0, Math.log2(bins+2), 0, width); var x = map(i, 0, bins, 0, width); var l = map(samples[i], 0, 255, 0, height); var y = height - l; var c = color(round(map(i, 0, bins, 0, 360)), 100, 100, 0.05); if (bass === 1) { if (i <= bassBand) { c = color(round(map(i, 0, bins, 0, 360)), 100, 100, 0.8); } } else { if (i > bassBand){ c = color(round(map(i, 0, bins, 0, 360)), 100, 100, 0.8); } } fill(c); ellipse(xcum, height/2, l/3, l/3); //rect(xcum, y, x - xcum, l); xcum = x; } } // resize canvas on windowResized function windowResized() { resizeCanvas(windowWidth, windowHeight); } // toggle input function keyPressed() { if (key == 'T') { toggleInput(); } } function toggleInput() { if (song.isPlaying() ) { song.pause(); mic.start(); analyzer.setInput(mic); } else { song.play(); mic.stop(); analyzer.setInput(song); } }
mit
pioug/trivia-reddit
src/constants.js
131
const DEFAULT_SUBREDDITS = [ "/r/askscience", "/r/explainlikeimfive", "/r/todayilearned", ]; export { DEFAULT_SUBREDDITS };
mit
hanswolff/dedilib.core
src/test/Test.DediLib/Collections/TestTimedDictionary.cs
12827
using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; using DediLib.Collections; using Xunit; using System.Linq; namespace Test.DediLib.Collections { public class TestTimedDictionary { [Fact] public void Constructor_DefaultExpiry() { using (var timedDictionary = new TimedDictionary<object, object>(TimeSpan.FromSeconds(123))) { Assert.Equal(TimeSpan.FromSeconds(123), timedDictionary.DefaultExpiry); } } [Fact] public void Constructor_DefaultExpiry_CleanUpPeriod() { var defaultExpiry = TimeSpan.FromSeconds(123); var cleanUpPeriod = TimeSpan.FromSeconds(234); using (var timedDictionary = new TimedDictionary<object, object>(defaultExpiry, cleanUpPeriod)) { Assert.Equal(defaultExpiry, timedDictionary.DefaultExpiry); Assert.Equal(cleanUpPeriod, timedDictionary.CleanUpPeriod); } } [Fact] public void Constructor_DefaultExpiry_ConcurrencyLevel_Capacity() { using (var timedDictionary = new TimedDictionary<object, object>(TimeSpan.FromSeconds(123), 5, 6)) { Assert.Equal(TimeSpan.FromSeconds(123), timedDictionary.DefaultExpiry); } } [Fact] public void AddOrUpdate_value_called_first_creates_value() { using (var timedDictionary = new TimedDictionary<string, object>()) { var value = timedDictionary.AddOrUpdate("test", "value", (k, v) => "value2"); Assert.Equal("value", value); Assert.Equal("value", timedDictionary["test"]); } } [Fact] public void AddOrUpdate_value_called_twice_updates_value() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary.AddOrUpdate("test", "value", (k, v) => "value2"); var value = timedDictionary.AddOrUpdate("test", "value", (k, v) => "value2"); Assert.Equal("value2", value); Assert.Equal("value2", timedDictionary["test"]); } } [Fact] public void AddOrUpdate_value_UpdateAccessTime_true() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary.AddOrUpdate("test", "value", (k, v) => v); TimedValue<object> timedValue; Assert.True(timedDictionary.TryGetValue("test", out timedValue)); var lastAccessed = timedValue.LastAccessUtc; Thread.Sleep(15); timedDictionary.AddOrUpdate("test", "", (k, v) => v); Assert.True(timedValue.LastAccessUtc > lastAccessed); } } [Fact] public void AddOrUpdate_value_UpdateAccessTime_false() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary.AddOrUpdate("test", "value", (k, v) => v); TimedValue<object> timedValue; Assert.True(timedDictionary.TryGetValue("test", out timedValue)); var lastAccessed = timedValue.LastAccessUtc; Thread.Sleep(15); timedDictionary.AddOrUpdate("test", "", (k, v) => v, false); Assert.Equal(timedValue.LastAccessUtc, lastAccessed); } } [Fact] public void AddOrUpdate_factory_UpdateAccessTime_true() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary.AddOrUpdate("test", k => "value", (k, v) => v); TimedValue<object> timedValue; Assert.True(timedDictionary.TryGetValue("test", out timedValue)); var lastAccessed = timedValue.LastAccessUtc; Thread.Sleep(15); timedDictionary.AddOrUpdate("test", k => "value", (k, v) => v); Assert.True(timedValue.LastAccessUtc > lastAccessed); } } [Fact] public void AddOrUpdate_factory_UpdateAccessTime_false() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary.AddOrUpdate("test", k => "value", (k, v) => v); TimedValue<object> timedValue; Assert.True(timedDictionary.TryGetValue("test", out timedValue)); var lastAccessed = timedValue.LastAccessUtc; Thread.Sleep(15); timedDictionary.AddOrUpdate("test", k => "value", (k, v) => v, false); Assert.Equal(timedValue.LastAccessUtc, lastAccessed); } } [Fact] public void GetOrAdd_value_called_first_creates_value() { using (var timedDictionary = new TimedDictionary<string, object>()) { var value = timedDictionary.GetOrAdd("test", "value"); Assert.Equal("value", value); Assert.Equal("value", timedDictionary["test"]); } } [Fact] public void GetOrAdd_value_called_twice_creates_value_only_once() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary.GetOrAdd("test", "value"); var value = timedDictionary.GetOrAdd("test", "value2"); Assert.Equal("value", value); Assert.Equal("value", timedDictionary["test"]); } } [Fact] public void GetOrAdd_value_UpdateAccessTime_true() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary.GetOrAdd("test", "value"); TimedValue<object> timedValue; Assert.True(timedDictionary.TryGetValue("test", out timedValue)); var lastAccessed = timedValue.LastAccessUtc; Thread.Sleep(15); timedDictionary.GetOrAdd("test", ""); Assert.True(timedValue.LastAccessUtc > lastAccessed); } } [Fact] public void GetOrAdd_value_UpdateAccessTime_false() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary.GetOrAdd("test", "value"); TimedValue<object> timedValue; Assert.True(timedDictionary.TryGetValue("test", out timedValue)); var lastAccessed = timedValue.LastAccessUtc; Thread.Sleep(15); timedDictionary.GetOrAdd("test", "", false); Assert.Equal(timedValue.LastAccessUtc, lastAccessed); } } [Fact] public void GetOrAdd_factory_UpdateAccessTime_true() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary.GetOrAdd("test", k => "value"); TimedValue<object> timedValue; Assert.True(timedDictionary.TryGetValue("test", out timedValue)); var lastAccessed = timedValue.LastAccessUtc; Thread.Sleep(15); timedDictionary.GetOrAdd("test", k => "value"); Assert.True(timedValue.LastAccessUtc > lastAccessed); } } [Fact] public void GetOrAdd_factory_UpdateAccessTime_false() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary.GetOrAdd("test", k => "value"); TimedValue<object> timedValue; Assert.True(timedDictionary.TryGetValue("test", out timedValue)); var lastAccessed = timedValue.LastAccessUtc; Thread.Sleep(15); timedDictionary.GetOrAdd("test", k => "value", false); Assert.Equal(timedValue.LastAccessUtc, lastAccessed); } } [Fact] public void Indexer_TryGetValue() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary["test"] = 1; object value; Assert.True(timedDictionary.TryGetValue("test", out value)); } } [Fact] public void Indexer_TryRemove_TryGetValue() { using (var timedDictionary = new TimedDictionary<string, object>()) { timedDictionary["test"] = 1; Assert.True(timedDictionary.TryRemove("test")); object value; Assert.False(timedDictionary.TryGetValue("test", out value)); } } [Fact] public void Values_enumeration() { var timedDictionary = new TimedDictionary<string, object> {{"key", "value"}}; Assert.Equal(new object[] { "value" }, timedDictionary.Values.ToArray()); } [Fact] public void TryRemove_not_existing_returns_false() { using (var timedDictionary = new TimedDictionary<string, object>()) { Assert.False(timedDictionary.TryRemove("test")); } } [Fact] public void Indexer_TryGetValue_StringComparer_InvariantCultureIgnoreCase() { using (var timedDictionary = new TimedDictionary<string, object>(1, 1, StringComparer.OrdinalIgnoreCase)) { timedDictionary["Test"] = 1; object value; Assert.True(timedDictionary.TryGetValue("test", out value)); Assert.Equal(1, timedDictionary["test"]); } } [Fact] public void DefaultExpiry_Indexer_StringComparer_InvariantCultureIgnoreCase() { var defaultExpiry = TimeSpan.FromSeconds(123); using (var timedDictionary = new TimedDictionary<string, object>(defaultExpiry, 1, 1, StringComparer.OrdinalIgnoreCase)) { timedDictionary["Test"] = 1; Assert.Equal(defaultExpiry, timedDictionary.DefaultExpiry); Assert.Equal(1, timedDictionary["test"]); } } [Fact] public void CleanUp_HasOneExpiredItem_CountIsOne() { using (var timedDictionary = new TimedDictionary<int, int>(TimeSpan.MaxValue)) { timedDictionary.TryAdd(1, 1); timedDictionary.CleanUp(); Assert.Equal(1, timedDictionary.Count); } } [Fact] public void CleanUp_HasOneExpiredItem_CountIsZero() { using (var timedDictionary = new TimedDictionary<int, int>(TimeSpan.FromMilliseconds(0))) { timedDictionary.TryAdd(1, 1); Thread.Sleep(1); timedDictionary.CleanUp(); Assert.Equal(0, timedDictionary.Count); } } [Fact] public void CleanUp_HasOneExpiredItemWaitForAutomaticCleanUp_CountIsZero() { using (var timedDictionary = new TimedDictionary<int, int>(TimeSpan.FromMilliseconds(0))) { timedDictionary.TryAdd(1, 1); var cancelled = false; var task = Task.Factory.StartNew(() => { while (timedDictionary.Count > 0 && !cancelled) Thread.Sleep(0); }, TaskCreationOptions.LongRunning); { task.Wait(1100); cancelled = true; task.Wait(); } Assert.Equal(0, timedDictionary.Count); } } [Fact] public void ConcurrencyTest() { var exceptions = new List<Exception>(); // TODO: TimedDictionaryWorker.OnCleanUpException += (td, ex) => exceptions.Add(ex); var sw = Stopwatch.StartNew(); using (var timedDictionary = new TimedDictionary<int, byte>(TimeSpan.Zero)) { var added = 0; while (sw.ElapsedMilliseconds < 2000) { if (timedDictionary.TryAdd(added, 0)) added++; } Assert.True(timedDictionary.Count < added); Assert.Equal(0, exceptions.Count); } } } }
mit
leifos/tango_with_django_17
tango_with_django_project_17/urls.py
1014
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static from registration.backends.simple.views import RegistrationView class MyRegistrationView(RegistrationView): def get_success_url(selfself,request, user): return '/rango/' urlpatterns = patterns('', # Examples: # url(r'^$', 'tango_with_django_project_17.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^rango/', include('rango.urls')), url(r'^accounts/register/$', MyRegistrationView.as_view(), name='registration_register'), (r'^accounts/', include('registration.backends.simple.urls')), ) if not settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) if settings.DEBUG: urlpatterns += patterns('django.views.static', (r'media/(?P<path>.*)', 'serve', {'document_root': settings.MEDIA_ROOT}), )
mit
wagenet/broccoli_rails
spec/dummy/node_modules/broccoli-static-compiler/.gittags.rb
630
$tags_cache = {"4ea11aff647dba5bd2bb485b9e140a4094a71e5b"=>"4ea11aff647dba5bd2bb485b9e140a4094a71e5b", "dd61ea79c05ecee81f6e03a0ff33276b3b11ce21"=>"dd61ea79c05ecee81f6e03a0ff33276b3b11ce21", "dd51c7afc7840e0431b0d268942457686236babe"=>"dd51c7afc7840e0431b0d268942457686236babe", "ecdabdf1904c42b99ee6282afd9790d1531a6a73"=>"ecdabdf1904c42b99ee6282afd9790d1531a6a73", "be63b5c98aa3806ba6cf18d32caf627e9afacd12"=>"be63b5c98aa3806ba6cf18d32caf627e9afacd12", "edefc262e8187627aa0cd743bbaf063a2cd26304"=>"edefc262e8187627aa0cd743bbaf063a2cd26304", "cd41c11acdb76bf328749f9548120cd6af7f53cf"=>"cd41c11acdb76bf328749f9548120cd6af7f53cf"}
mit
elsennov/android-ripple-background
library/src/main/java/com/skyfishjy/library/RippleBackground.java
6505
package com.skyfishjy.library; import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Paint; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; import android.widget.RelativeLayout; import java.util.ArrayList; /** * Created by fyu on 11/3/14. */ public class RippleBackground extends RelativeLayout{ private static final int DEFAULT_RIPPLE_COUNT=6; private static final int DEFAULT_DURATION_TIME=3000; private static final float DEFAULT_SCALE=6.0f; private static final int DEFAULT_FILL_TYPE=0; private int rippleColor; private float rippleStrokeWidth; private float rippleRadius; private int rippleDurationTime; private int rippleAmount; private int rippleDelay; private float rippleScale; private int rippleType; private Paint paint; private boolean animationRunning=false; private AnimatorSet animatorSet; private ArrayList<Animator> animatorList; private LayoutParams rippleParams; private ArrayList<RippleView> rippleViewList=new ArrayList<RippleView>(); public RippleBackground(Context context) { super(context); } public RippleBackground(Context context, AttributeSet attrs) { super(context, attrs); init(context, attrs); } public RippleBackground(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context, attrs); } private void init(final Context context, final AttributeSet attrs) { if (isInEditMode()) return; if (null == attrs) { throw new IllegalArgumentException("Attributes should be provided to this view,"); } final TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RippleBackground); rippleColor=typedArray.getColor(R.styleable.RippleBackground_rb_color, getResources().getColor(R.color.rippelColor)); rippleStrokeWidth=typedArray.getDimension(R.styleable.RippleBackground_rb_strokeWidth, getResources().getDimension(R.dimen.rippleStrokeWidth)); rippleRadius=typedArray.getDimension(R.styleable.RippleBackground_rb_radius,getResources().getDimension(R.dimen.rippleRadius)); rippleDurationTime=typedArray.getInt(R.styleable.RippleBackground_rb_duration,DEFAULT_DURATION_TIME); rippleAmount=typedArray.getInt(R.styleable.RippleBackground_rb_rippleAmount,DEFAULT_RIPPLE_COUNT); rippleScale=typedArray.getFloat(R.styleable.RippleBackground_rb_scale,DEFAULT_SCALE); rippleType=typedArray.getInt(R.styleable.RippleBackground_rb_type,DEFAULT_FILL_TYPE); typedArray.recycle(); rippleDelay=rippleDurationTime/rippleAmount; initPaint(); rippleParams=new LayoutParams((int)(2*(rippleRadius+rippleStrokeWidth)),(int)(2*(rippleRadius+rippleStrokeWidth))); rippleParams.addRule(CENTER_IN_PARENT, TRUE); animatorSet = new AnimatorSet(); animatorSet.setInterpolator(new AccelerateDecelerateInterpolator()); animatorList=new ArrayList<Animator>(); for(int i=0;i<rippleAmount;i++){ RippleView rippleView=new RippleView(getContext()); addView(rippleView,rippleParams); rippleViewList.add(rippleView); final ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(rippleView, "ScaleX", 1.0f, rippleScale); scaleXAnimator.setRepeatCount(ObjectAnimator.INFINITE); scaleXAnimator.setRepeatMode(ObjectAnimator.RESTART); scaleXAnimator.setStartDelay(i * rippleDelay); scaleXAnimator.setDuration(rippleDurationTime); animatorList.add(scaleXAnimator); final ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(rippleView, "ScaleY", 1.0f, rippleScale); scaleYAnimator.setRepeatCount(ObjectAnimator.INFINITE); scaleYAnimator.setRepeatMode(ObjectAnimator.RESTART); scaleYAnimator.setStartDelay(i * rippleDelay); scaleYAnimator.setDuration(rippleDurationTime); animatorList.add(scaleYAnimator); final ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(rippleView, "Alpha", 1.0f, 0f); alphaAnimator.setRepeatCount(ObjectAnimator.INFINITE); alphaAnimator.setRepeatMode(ObjectAnimator.RESTART); alphaAnimator.setStartDelay(i * rippleDelay); alphaAnimator.setDuration(rippleDurationTime); animatorList.add(alphaAnimator); } animatorSet.playTogether(animatorList); } private class RippleView extends View{ public RippleView(Context context) { super(context); this.setVisibility(View.INVISIBLE); } @Override protected void onDraw(Canvas canvas) { int radius=(Math.min(getWidth(),getHeight()))/2; canvas.drawCircle(radius,radius,radius-rippleStrokeWidth,paint); } } public void startRippleAnimation(){ if(!isRippleAnimationRunning()){ for(RippleView rippleView:rippleViewList){ rippleView.setVisibility(VISIBLE); } animatorSet.start(); animationRunning=true; } } public void stopRippleAnimation(){ if(isRippleAnimationRunning()){ animatorSet.end(); animationRunning=false; } } public boolean isRippleAnimationRunning(){ return animationRunning; } /** * Change the ripple color programmatically * * @param rippleColor This is the ripple color that must be retrieved from getResources().getColor(R.color.blabla). Not the resource id of the color. */ public void setRippleColor(int rippleColor) { this.rippleColor = rippleColor; initPaint(); for (RippleView rippleView : rippleViewList) { rippleView.invalidate(); } } private void initPaint() { paint = new Paint(); paint.setAntiAlias(true); if(rippleType==DEFAULT_FILL_TYPE){ rippleStrokeWidth=0; paint.setStyle(Paint.Style.FILL); }else paint.setStyle(Paint.Style.STROKE); paint.setColor(rippleColor); } }
mit
codingsince1985/UVa
474/474.go
520
// UVa 474 - Heads / Tails Probability package main import ( "fmt" "os" ) func calc(n int) (float64, int) { base, power := 5.0, 1 for i := 2; i <= n; i++ { base *= 0.5 for base < 1 { base *= 10 power++ } } return base, power } func main() { in, _ := os.Open("474.in") defer in.Close() out, _ := os.Create("474.out") defer out.Close() var n int for { if _, err := fmt.Fscanf(in, "%d", &n); err != nil { break } b, p := calc(n) fmt.Fprintf(out, "2^-%d = %.03fe-%d\n", n, b, p) } }
mit
Domeee/chlycontainer
ChlyContainer/ChlyContainer/ChlyContainer.cs
8987
using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; namespace ChlyContainer { /// <summary> /// A lightweight dependency injection container. /// </summary> public class ChlyContainer : IDependencyContainer { /// <summary> /// Store for registrations. /// </summary> private readonly Dictionary<Type, List<Func<ChlyContainer, Type, object>>> _store; /// <summary> /// True if the current instance already has been disposed. /// </summary> private bool _disposed; /// <summary> /// Initializes a new instance of the <see cref="ChlyContainer" /> class. /// </summary> public ChlyContainer() { _store = new Dictionary<Type, List<Func<ChlyContainer, Type, object>>>(); } #region Resolution /// <summary> /// Resolve an implementation. /// </summary> /// <typeparam name="T">Type registered with the container.</typeparam> /// <returns>The current instance of the container.</returns> public T Resolve<T>() where T : class { return (T) Resolve(typeof (T)); } #endregion Resolution /// <summary> /// Disposing event is fired when the current instance is being disposed. /// </summary> public event EventHandler Disposing; /// <summary> /// Creates a constructor for the type by resolving each argument from the container. /// </summary> /// <param name="type">The type to create a constructor for.</param> /// <returns>The constructor as a delegate.</returns> private static Func<ChlyContainer, Type, object> GetCreator(Type type) { var ctors = type.GetConstructors(); if (ctors == null || ctors.Length == 0) throw new Exception(); var ctor = ctors[0]; var containerParameter = Expression.Parameter(typeof (ChlyContainer), "container"); var typeParameter = Expression.Parameter(typeof (Type), "type"); // Resolve each ctor argument => THAT'S CONSTRUCTOR INJECTION var ctorArguments = ctor.GetParameters() .Select(p => Expression.Call(containerParameter, "Resolve", new[] {p.ParameterType})); var dynamicConstructor = Expression.New(ctor, ctorArguments); var creator = Expression.Lambda<Func<ChlyContainer, Type, object>>(dynamicConstructor, containerParameter, typeParameter); var constructorDelegate = creator.Compile(); return constructorDelegate; } /// <summary> /// Register an instance for a type. /// </summary> /// <param name="type">The type of the instance.</param> /// <param name="instance">The instance to register.</param> /// <returns>The current instance of the container.</returns> private IDependencyContainer RegisterInstance(Type type, object instance) { if (_disposed) throw new ObjectDisposedException(GetType().FullName); List<Func<ChlyContainer, Type, object>> creators; var exists = _store.TryGetValue(type, out creators); if (!exists) { _store.Add(type, creators = new List<Func<ChlyContainer, Type, object>>()); creators.Add((c, t) => instance); RegisterForDisposing(instance); } return this; } /// <summary> /// If instance implements <see cref="IDisposable" />, registers instance for disposing. /// </summary> /// <param name="instance">Instance to register for disposing.</param> private void RegisterForDisposing(object instance) { var disposable = instance as IDisposable; if (disposable != null) { Disposing += (sender, args) => disposable.Dispose(); } } /// <summary> /// Resolve an instance for the type. /// </summary> /// <param name="type">The type registered with the container.</param> /// <returns>An instance for the type.</returns> private object Resolve(Type type) { if (_disposed) throw new ObjectDisposedException(GetType().FullName); if (type == null) throw new ArgumentNullException("type"); List<Func<ChlyContainer, Type, object>> creators; var exists = _store.TryGetValue(type, out creators); if (!exists) throw new ResolutionException(type); var constructor = creators.First(); return constructor(this, type); } #region Registration /// <summary> /// Register an implementation with its interface. /// </summary> /// <param name="from">The interface.</param> /// <param name="to">The type to resolve.</param> /// <returns>The current instance of the container.</returns> public IDependencyContainer Register(Type from, Type to) { if (from == null) throw new ArgumentNullException(nameof(@from)); if (to == null) throw new ArgumentNullException(nameof(to)); if (_disposed) throw new ObjectDisposedException(GetType().FullName); List<Func<ChlyContainer, Type, object>> creators; var exists = _store.TryGetValue(from, out creators); if (!exists) { _store.Add(from, creators = new List<Func<ChlyContainer, Type, object>>()); var typeToConstructor = GetCreator(to); creators.Add(typeToConstructor); } return this; } /// <summary> /// Register an implementation with its interface. /// </summary> /// <typeparam name="TFrom">The interface.</typeparam> /// <typeparam name="TTo">The type to resolve.</typeparam> /// <returns>The current instance of the container.</returns> public IDependencyContainer Register<TFrom, TTo>() where TFrom : class where TTo : class, TFrom { Register(typeof (TFrom), typeof (TTo)); return this; } /// <summary> /// Register an implementation. /// </summary> /// <typeparam name="T">The type to resolve.</typeparam> /// <returns>The current instance of the container.</returns> public IDependencyContainer Register<T>() where T : class { Register(typeof (T), typeof (T)); return this; } /// <summary> /// Register an existing instance. /// </summary> /// <param name="instance">The instance to register.</param> /// <returns>The current instance of the container.</returns> public IDependencyContainer RegisterInstance(object instance) { if (instance == null) throw new ArgumentNullException(nameof(instance)); return RegisterInstance(instance.GetType(), instance); } /// <summary> /// Register an existing instance of type T. /// </summary> /// <typeparam name="T">The type of the instance.</typeparam> /// <param name="instance">The instance to register.</param> /// <returns>The current instance of the container.</returns> public IDependencyContainer RegisterInstance<T>(object instance) where T : class { if (instance == null) throw new ArgumentNullException(nameof(instance)); return RegisterInstance(typeof (T), instance); } /// <summary> /// Register a singleton of a type. /// </summary> /// <typeparam name="T">The type to register.</typeparam> /// <returns>The current instance of the container.</returns> public IDependencyContainer RegisterSingleton<T>() where T : class { if (_disposed) throw new ObjectDisposedException(GetType().FullName); var typeOf = typeof (T); List<Func<ChlyContainer, Type, object>> creators; var exists = _store.TryGetValue(typeOf, out creators); if (!exists) { var creator = GetCreator(typeOf); var instance = creator(this, typeOf); _store.Add(typeOf, creators = new List<Func<ChlyContainer, Type, object>>()); creators.Add((c, t) => instance); RegisterForDisposing(instance); } return this; } #endregion Registration #region Disposing /// <summary> /// Disposes the current instance and all registered instances implementing <see cref="IDisposable" />. /// </summary> public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } /// <summary> /// Calls all registered delegates for the Disposing event. /// </summary> /// <param name="ea">Event arguments for the Disposing event.</param> protected void OnDisposing(EventArgs ea) { var handler = Disposing; handler?.Invoke(this, ea); } /// <summary> /// Dispose pattern specific for this class. Fires the Disposing event. /// </summary> /// <param name="disposing">True if called by consumers. False if called by the <c>finalizer</c>.</param> protected virtual void Dispose(bool disposing) { if (_disposed) return; // Free managed objects here if (disposing) { OnDisposing(EventArgs.Empty); } // Free unmanaged objects here _disposed = true; } #endregion Disposing } }
mit
eanlain/calligraphy
lib/generators/calligraphy/install_generator.rb
513
# frozen_string_literal: true require 'rails/generators/base' module Calligraphy module Generators # Generator used to copy Calligraphy initializer over to your application. class InstallGenerator < ::Rails::Generators::Base source_root File.expand_path('../../templates', __FILE__) desc 'Creates a Calligraphy initializer for your application' #:nodoc: def copy_initializer template 'calligraphy.rb', 'config/initializers/calligraphy.rb' end end end end
mit
vapkarian/soccer-analyzer
src/versions/v0.py
187
from src.models import ScibetMatch from src.settings import match_cache @match_cache def prediction(match: ScibetMatch): if not match.full_data: return None return True
mit
npruehs/slash-tournament
app/org/slashgames/tournament/tournaments/modelcontrollers/MatchModelController.java
2299
package org.slashgames.tournament.tournaments.modelcontrollers; import java.util.List; import org.slashgames.tournament.auth.modelcontrollers.UserModelController; import org.slashgames.tournament.auth.models.User; import org.slashgames.tournament.cms.formdata.MatchData; import org.slashgames.tournament.tournaments.models.TournamentMatch; import org.slashgames.tournament.tournaments.models.Tournament; import com.avaje.ebean.Ebean; import com.avaje.ebean.Expr; import play.Logger; import play.db.ebean.Model; public class MatchModelController { private static Model.Finder<Long, TournamentMatch> find = new Model.Finder<Long, TournamentMatch>( Long.class, TournamentMatch.class); public static TournamentMatch findById(Long id) { return find.byId(id); } public static void addMatch(Tournament tournament, Integer round, User player1, User player2) { TournamentMatch match = new TournamentMatch(); match.tournament = tournament; match.round = round; match.player1 = player1; match.player2 = player2; match.save(); } public static List<TournamentMatch> getMatches(Tournament tournament) { return find.where().eq("tournament", tournament).orderBy().asc("round").orderBy().asc("id").findList(); } public static List<TournamentMatch> getMatches(Tournament tournament, Integer round) { return find.where().eq("tournament", tournament).eq("round", round).findList(); } public static List<TournamentMatch> getMatches(User user) { return find.where().or(Expr.eq("player1", user), Expr.eq("player2", user)).findList(); } public static void addMatch(Tournament tournament, MatchData data) { TournamentMatch match = new TournamentMatch(); match.tournament = tournament; updateMatch(match, data); } public static void updateMatch(TournamentMatch match, MatchData data) { match.round = data.round; match.player1 = UserModelController.getUser(data.player1Id); match.player2 = UserModelController.getUser(data.player2Id); match.player1Wins = data.player1Wins; match.player2Wins = data.player2Wins; match.save(); } public static void removeMatch(TournamentMatch match) { match.delete(); } public static void clearMatches(Tournament tournament) { List<TournamentMatch> matches = getMatches(tournament); Ebean.delete(matches); } }
mit
mahluz/hookyouup
application/modules/beranda/views/profile/header.php
6652
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <title>Profile</title> <link rel="icon" href="<?php echo base_url('assets/images/icon.png'); ?>"> <!-- jQuery library --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <!-- Latest compiled JavaScript --> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <!-- end bootstrap --> <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css"> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <!-- HTML5 shim and Respond.js for 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.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <style> /* USER PROFILE PAGE */ .card { margin-top: 20px; padding: 30px; background-color: rgba(214, 224, 226, 0.2); -webkit-border-top-left-radius:5px; -moz-border-top-left-radius:5px; border-top-left-radius:5px; -webkit-border-top-right-radius:5px; -moz-border-top-right-radius:5px; border-top-right-radius:5px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .card.hovercard { position: relative; padding-top: 0; overflow: hidden; text-align: center; background-color: #fff; background-color: rgba(255, 255, 255, 1); } .card.hovercard .card-background { height: 130px; } .card-background img { -webkit-filter: blur(25px); -moz-filter: blur(25px); -o-filter: blur(25px); -ms-filter: blur(25px); filter: blur(25px); margin-left: -100px; margin-top: -200px; min-width: 130%; } .card.hovercard .useravatar { position: absolute; top: 15px; left: 0; right: 0; } .card.hovercard .useravatar img { width: 100px; height: 100px; max-width: 100px; max-height: 100px; -webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%; border: 5px solid rgba(255, 255, 255, 0.5); } .card.hovercard .card-info { position: absolute; bottom: 14px; left: 0; right: 0; } .card.hovercard .card-info .card-title { padding:0 5px; font-size: 20px; line-height: 1; color: #262626; background-color: rgba(255, 255, 255, 0.1); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .card.hovercard .card-info { overflow: hidden; font-size: 12px; line-height: 20px; color: #737373; text-overflow: ellipsis; } .card.hovercard .bottom { padding: 0 20px; margin-bottom: 17px; } .btn-pref .btn { -webkit-border-radius:0 !important; } </style> </head> <body style="background-color: #E8E8E8;"> <div class="container"> <div class="card hovercard"> <div class="card-background"> <img class="card-bkimg" alt="" src="<?php echo base_url('assets/gallery/'.$this->session->userdata('id_comm').'/users/'.$this->session->userdata('selected_profile').'/'.$user->photo_profile); ?>"> <!-- http://lorempixel.com/850/280/people/9/ --> </div> <div class="useravatar"> <img alt="" src="<?php echo base_url('assets/gallery/'.$this->session->userdata('id_comm').'/users/'.$this->session->userdata('selected_profile').'/'.$user->photo_profile); ?>"> </div> <div class="card-info"> <span class="card-title"><?php echo $user->name; ?></span> </div> </div> <div class="btn-pref btn-group btn-group-justified btn-group-lg" role="group" aria-label="..."> <div class="btn-group" role="group"> <a href="<?php echo base_url('Beranda/profile_post'); ?>"><button type="button" id="post" class="btn btn-primary" ><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> <div class="hidden-xs">Post</div> </button></a> </div> <div class="btn-group" role="group"> <a href="<?php echo base_url('Beranda/profile_biodata'); ?>"><button type="button" id="stars" class="btn btn-default "><span class="glyphicon glyphicon-star" aria-hidden="true"></span> <div class="hidden-xs">Biodata</div> </button></a> </div> <div class="btn-group" role="group"> <a href="<?php echo base_url('Beranda/profile_favorite'); ?>"><button type="button" id="favorites" class="btn btn-default"><span class="glyphicon glyphicon-heart" aria-hidden="true"></span> <div class="hidden-xs">Favorites</div> </button></a> </div> <div class="btn-group" role="group"> <a href="<?php echo base_url('Beranda/profile_following'); ?>"><button type="button" id="following" class="btn btn-default"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> <div class="hidden-xs">Following</div> </button></a> </div> <div class="btn-group" role="group"> <div class="dropdown"> <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown"><span class="caret"></span><div class="hidden-xs">Others</div></button> <ul class="dropdown-menu"> <li><a href="<?php echo base_url('Beranda/profile_change_profile'); ?>">Change Profile</a></li> <li><a href="#">Setting</a></li> <li><a href="<?php echo base_url('Beranda'); ?>">Back to Community</a></li> </ul> </div> </div> </div> </div>
mit
eurofurence/ef-app_android
app/src/main/java/io/swagger/client/model/SendPrivateMessageRequest.java
4081
package io.swagger.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; @ApiModel(description = "") public class SendPrivateMessageRequest { @SerializedName("RecipientUid") private String recipientUid = null; @SerializedName("AuthorName") private String authorName = null; @SerializedName("ToastTitle") private String toastTitle = null; @SerializedName("ToastMessage") private String toastMessage = null; @SerializedName("Subject") private String subject = null; @SerializedName("Message") private String message = null; /** **/ @ApiModelProperty(value = "") public String getRecipientUid() { return recipientUid; } public void setRecipientUid(String recipientUid) { this.recipientUid = recipientUid; } /** **/ @ApiModelProperty(value = "") public String getAuthorName() { return authorName; } public void setAuthorName(String authorName) { this.authorName = authorName; } /** **/ @ApiModelProperty(value = "") public String getToastTitle() { return toastTitle; } public void setToastTitle(String toastTitle) { this.toastTitle = toastTitle; } /** **/ @ApiModelProperty(value = "") public String getToastMessage() { return toastMessage; } public void setToastMessage(String toastMessage) { this.toastMessage = toastMessage; } /** **/ @ApiModelProperty(value = "") public String getSubject() { return subject; } public void setSubject(String subject) { this.subject = subject; } /** **/ @ApiModelProperty(value = "") public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SendPrivateMessageRequest sendPrivateMessageRequest = (SendPrivateMessageRequest) o; return (recipientUid == null ? sendPrivateMessageRequest.recipientUid == null : recipientUid.equals(sendPrivateMessageRequest.recipientUid)) && (authorName == null ? sendPrivateMessageRequest.authorName == null : authorName.equals(sendPrivateMessageRequest.authorName)) && (toastTitle == null ? sendPrivateMessageRequest.toastTitle == null : toastTitle.equals(sendPrivateMessageRequest.toastTitle)) && (toastMessage == null ? sendPrivateMessageRequest.toastMessage == null : toastMessage.equals(sendPrivateMessageRequest.toastMessage)) && (subject == null ? sendPrivateMessageRequest.subject == null : subject.equals(sendPrivateMessageRequest.subject)) && (message == null ? sendPrivateMessageRequest.message == null : message.equals(sendPrivateMessageRequest.message)); } @Override public int hashCode() { int result = 17; result = 31 * result + (recipientUid == null ? 0: recipientUid.hashCode()); result = 31 * result + (authorName == null ? 0: authorName.hashCode()); result = 31 * result + (toastTitle == null ? 0: toastTitle.hashCode()); result = 31 * result + (toastMessage == null ? 0: toastMessage.hashCode()); result = 31 * result + (subject == null ? 0: subject.hashCode()); result = 31 * result + (message == null ? 0: message.hashCode()); return result; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SendPrivateMessageRequest {\n"); sb.append(" recipientUid: ").append(recipientUid).append("\n"); sb.append(" authorName: ").append(authorName).append("\n"); sb.append(" toastTitle: ").append(toastTitle).append("\n"); sb.append(" toastMessage: ").append(toastMessage).append("\n"); sb.append(" subject: ").append(subject).append("\n"); sb.append(" message: ").append(message).append("\n"); sb.append("}\n"); return sb.toString(); } }
mit
talantdev/talant-wallet
src/qt/transactionview.cpp
15151
#include "transactionview.h" #include "transactionfilterproxy.h" #include "transactionrecord.h" #include "walletmodel.h" #include "addresstablemodel.h" #include "transactiontablemodel.h" #include "talantunits.h" #include "csvmodelwriter.h" #include "transactiondescdialog.h" #include "editaddressdialog.h" #include "optionsmodel.h" #include "guiutil.h" #include <QScrollBar> #include <QComboBox> #include <QDoubleValidator> #include <QHBoxLayout> #include <QVBoxLayout> #include <QLineEdit> #include <QTableView> #include <QHeaderView> #include <QMessageBox> #include <QPoint> #include <QMenu> #include <QLabel> #include <QDateTimeEdit> TransactionView::TransactionView(QWidget *parent) : QWidget(parent), model(0), transactionProxyModel(0), transactionView(0) { // Build filter row setContentsMargins(0,0,0,0); QHBoxLayout *hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0,0,0,0); #ifdef Q_OS_MAC hlayout->setSpacing(5); hlayout->addSpacing(26); #else hlayout->setSpacing(0); hlayout->addSpacing(23); #endif dateWidget = new QComboBox(this); #ifdef Q_OS_MAC dateWidget->setFixedWidth(121); #else dateWidget->setFixedWidth(120); #endif dateWidget->addItem(tr("All"), All); dateWidget->addItem(tr("Today"), Today); dateWidget->addItem(tr("This week"), ThisWeek); dateWidget->addItem(tr("This month"), ThisMonth); dateWidget->addItem(tr("Last month"), LastMonth); dateWidget->addItem(tr("This year"), ThisYear); dateWidget->addItem(tr("Range..."), Range); hlayout->addWidget(dateWidget); typeWidget = new QComboBox(this); #ifdef Q_OS_MAC typeWidget->setFixedWidth(121); #else typeWidget->setFixedWidth(120); #endif typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES); typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) | TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther)); typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) | TransactionFilterProxy::TYPE(TransactionRecord::SendToOther)); typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf)); typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated)); typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other)); hlayout->addWidget(typeWidget); addressWidget = new QLineEdit(this); #if QT_VERSION >= 0x040700 /* Do not move this to the XML file, Qt before 4.7 will choke on it */ addressWidget->setPlaceholderText(tr("Enter address or label to search")); #endif hlayout->addWidget(addressWidget); amountWidget = new QLineEdit(this); #if QT_VERSION >= 0x040700 /* Do not move this to the XML file, Qt before 4.7 will choke on it */ amountWidget->setPlaceholderText(tr("Min amount")); #endif #ifdef Q_OS_MAC amountWidget->setFixedWidth(97); #else amountWidget->setFixedWidth(100); #endif amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this)); hlayout->addWidget(amountWidget); QVBoxLayout *vlayout = new QVBoxLayout(this); vlayout->setContentsMargins(0,0,0,0); vlayout->setSpacing(0); QTableView *view = new QTableView(this); vlayout->addLayout(hlayout); vlayout->addWidget(createDateRangeWidget()); vlayout->addWidget(view); vlayout->setSpacing(0); int width = view->verticalScrollBar()->sizeHint().width(); // Cover scroll bar width with spacing #ifdef Q_OS_MAC hlayout->addSpacing(width+2); #else hlayout->addSpacing(width); #endif // Always show scroll bar view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); view->setTabKeyNavigation(false); view->setContextMenuPolicy(Qt::CustomContextMenu); transactionView = view; // Actions QAction *copyAddressAction = new QAction(tr("Copy address"), this); QAction *copyLabelAction = new QAction(tr("Copy label"), this); QAction *copyAmountAction = new QAction(tr("Copy amount"), this); QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this); QAction *editLabelAction = new QAction(tr("Edit label"), this); QAction *showDetailsAction = new QAction(tr("Show transaction details"), this); contextMenu = new QMenu(); contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyLabelAction); contextMenu->addAction(copyAmountAction); contextMenu->addAction(copyTxIDAction); contextMenu->addAction(editLabelAction); contextMenu->addAction(showDetailsAction); // Connect actions connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int))); connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int))); connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString))); connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString))); connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex))); connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress())); connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel())); connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount())); connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID())); connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel())); connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails())); } void TransactionView::setModel(WalletModel *model) { this->model = model; if(model) { transactionProxyModel = new TransactionFilterProxy(this); transactionProxyModel->setSourceModel(model->getTransactionTableModel()); transactionProxyModel->setDynamicSortFilter(true); transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); transactionProxyModel->setSortRole(Qt::EditRole); transactionView->setModel(transactionProxyModel); transactionView->setAlternatingRowColors(true); transactionView->setSelectionBehavior(QAbstractItemView::SelectRows); transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection); transactionView->setSortingEnabled(true); transactionView->sortByColumn(TransactionTableModel::Status, Qt::DescendingOrder); transactionView->verticalHeader()->hide(); transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Status, 23); transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Date, 120); transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Type, 120); transactionView->horizontalHeader()->setResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch); transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Amount, 100); } } void TransactionView::chooseDate(int idx) { if(!transactionProxyModel) return; QDate current = QDate::currentDate(); dateRangeWidget->setVisible(false); switch(dateWidget->itemData(idx).toInt()) { case All: transactionProxyModel->setDateRange( TransactionFilterProxy::MIN_DATE, TransactionFilterProxy::MAX_DATE); break; case Today: transactionProxyModel->setDateRange( QDateTime(current), TransactionFilterProxy::MAX_DATE); break; case ThisWeek: { // Find last Monday QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1)); transactionProxyModel->setDateRange( QDateTime(startOfWeek), TransactionFilterProxy::MAX_DATE); } break; case ThisMonth: transactionProxyModel->setDateRange( QDateTime(QDate(current.year(), current.month(), 1)), TransactionFilterProxy::MAX_DATE); break; case LastMonth: transactionProxyModel->setDateRange( QDateTime(QDate(current.year(), current.month()-1, 1)), QDateTime(QDate(current.year(), current.month(), 1))); break; case ThisYear: transactionProxyModel->setDateRange( QDateTime(QDate(current.year(), 1, 1)), TransactionFilterProxy::MAX_DATE); break; case Range: dateRangeWidget->setVisible(true); dateRangeChanged(); break; } } void TransactionView::chooseType(int idx) { if(!transactionProxyModel) return; transactionProxyModel->setTypeFilter( typeWidget->itemData(idx).toInt()); } void TransactionView::changedPrefix(const QString &prefix) { if(!transactionProxyModel) return; transactionProxyModel->setAddressPrefix(prefix); } void TransactionView::changedAmount(const QString &amount) { if(!transactionProxyModel) return; qint64 amount_parsed = 0; if(TalantUnits::parse(model->getOptionsModel()->getDisplayUnit(), amount, &amount_parsed)) { transactionProxyModel->setMinAmount(amount_parsed); } else { transactionProxyModel->setMinAmount(0); } } void TransactionView::exportClicked() { // CSV is currently the only supported format QString filename = GUIUtil::getSaveFileName( this, tr("Export Transaction Data"), QString(), tr("Comma separated file (*.csv)")); if (filename.isNull()) return; CSVModelWriter writer(filename); // name, column, role writer.setModel(transactionProxyModel); writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole); writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole); writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole); writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole); writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole); writer.addColumn(tr("Amount"), 0, TransactionTableModel::FormattedAmountRole); writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole); if(!writer.write()) { QMessageBox::critical(this, tr("Error exporting"), tr("Could not write to file %1.").arg(filename), QMessageBox::Abort, QMessageBox::Abort); } } void TransactionView::contextualMenu(const QPoint &point) { QModelIndex index = transactionView->indexAt(point); if(index.isValid()) { contextMenu->exec(QCursor::pos()); } } void TransactionView::copyAddress() { GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::AddressRole); } void TransactionView::copyLabel() { GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::LabelRole); } void TransactionView::copyAmount() { GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::FormattedAmountRole); } void TransactionView::copyTxID() { GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxIDRole); } void TransactionView::editLabel() { if(!transactionView->selectionModel() ||!model) return; QModelIndexList selection = transactionView->selectionModel()->selectedRows(); if(!selection.isEmpty()) { AddressTableModel *addressBook = model->getAddressTableModel(); if(!addressBook) return; QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString(); if(address.isEmpty()) { // If this transaction has no associated address, exit return; } // Is address in address book? Address book can miss address when a transaction is // sent from outside the UI. int idx = addressBook->lookupAddress(address); if(idx != -1) { // Edit sending / receiving address QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex()); // Determine type of address, launch appropriate editor dialog type QString type = modelIdx.data(AddressTableModel::TypeRole).toString(); EditAddressDialog dlg(type==AddressTableModel::Receive ? EditAddressDialog::EditReceivingAddress : EditAddressDialog::EditSendingAddress, this); dlg.setModel(addressBook); dlg.loadRow(idx); dlg.exec(); } else { // Add sending address EditAddressDialog dlg(EditAddressDialog::NewSendingAddress, this); dlg.setModel(addressBook); dlg.setAddress(address); dlg.exec(); } } } void TransactionView::showDetails() { if(!transactionView->selectionModel()) return; QModelIndexList selection = transactionView->selectionModel()->selectedRows(); if(!selection.isEmpty()) { TransactionDescDialog dlg(selection.at(0)); dlg.exec(); } } QWidget *TransactionView::createDateRangeWidget() { dateRangeWidget = new QFrame(); dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised); dateRangeWidget->setContentsMargins(1,1,1,1); QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget); layout->setContentsMargins(0,0,0,0); layout->addSpacing(23); layout->addWidget(new QLabel(tr("Range:"))); dateFrom = new QDateTimeEdit(this); dateFrom->setDisplayFormat("dd/MM/yy"); dateFrom->setCalendarPopup(true); dateFrom->setMinimumWidth(100); dateFrom->setDate(QDate::currentDate().addDays(-7)); layout->addWidget(dateFrom); layout->addWidget(new QLabel(tr("to"))); dateTo = new QDateTimeEdit(this); dateTo->setDisplayFormat("dd/MM/yy"); dateTo->setCalendarPopup(true); dateTo->setMinimumWidth(100); dateTo->setDate(QDate::currentDate()); layout->addWidget(dateTo); layout->addStretch(); // Hide by default dateRangeWidget->setVisible(false); // Notify on change connect(dateFrom, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged())); connect(dateTo, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged())); return dateRangeWidget; } void TransactionView::dateRangeChanged() { if(!transactionProxyModel) return; transactionProxyModel->setDateRange( QDateTime(dateFrom->date()), QDateTime(dateTo->date()).addDays(1)); } void TransactionView::focusTransaction(const QModelIndex &idx) { if(!transactionProxyModel) return; QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx); transactionView->scrollTo(targetIdx); transactionView->setCurrentIndex(targetIdx); transactionView->setFocus(); }
mit
adzap/not_only_but_also
spec/not_only_but_also_spec.rb
3151
require 'spec_helper' describe NotOnlyButAlso do before do Object.send(:remove_const, :Post) if Object.const_defined?(:Post) Object.send(:remove_const, :Comment) if Object.const_defined?(:Comment) ActiveSupport::Dependencies.loaded = [] Post.class_eval do class << self attr_accessor :_not_only_but_also_contexts end end end describe ".not_only_but_also" do context "with array of symbols and no block" do it 'should require symbols as files' do NotOnlyButAlso::Helpers.should_receive(:require_context_file).with('Post', :validations) Post._not_only_but_also_contexts = {:validations => lambda { } } Post.also_has :validations end it 'should evaluate the block in the class context' do NotOnlyButAlso::Helpers.stub(:require_context_file).with('Post', :validations) Post._not_only_but_also_contexts = {:validations => lambda { def self.method_in_block; end } } Post.also_has :validations Post.should respond_to(:method_in_block) end end context "with a block" do context "and a context name" do it 'should store the block using context name provided' do Post.also_has(:validations) { } Post._not_only_but_also_contexts[:validations].should be_kind_of(Proc) end end context "and no context name" do it 'should determine context name from file' do Dir.mktmpdir do |dir| filename = "#{dir}/validations.rb" File.open(filename, 'w+') { |f| f.puts "Post.also_has { raise }" } load filename Post._not_only_but_also_contexts.should have_key(:validations) Post._not_only_but_also_contexts[:validations].should be_kind_of(Proc) end end end end end describe NotOnlyButAlso::Helpers do describe ".require_context_file" do it 'should require context file in folder with underscored class name' do NotOnlyButAlso::Helpers.should_receive(:require_dependency).with('post/validations') Post._not_only_but_also_contexts = {:validations => lambda { } } Post.also_has :validations end end describe ".context_name_from_file" do it 'should return a symbol from the filename without the file extension' do NotOnlyButAlso::Helpers.context_name_from_file(__FILE__).should == :not_only_but_also_spec end end end context "integration" do before do # Forced load all files to simulate no autoloading. Dir['spec/rails_root/app/models/post/*.rb'].each {|file| require file } end it 'should load files from named contexts' do Post.should_not respond_to(:class_method_from_validations) Post.should_not respond_to(:class_method_from_foo) Post.should_not respond_to(:class_method_from_bar) Post.also_has :validations, :foo Post.should respond_to(:class_method_from_validations) Post.should respond_to(:class_method_from_foo) Post.should_not respond_to(:class_method_from_bar) end end end
mit
esbencarlsen/vivego
src/vivego.MessageBroker.Host/MessageBrokerHub.cs
2670
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; using Microsoft.AspNetCore.SignalR; using Microsoft.Net.Http.Headers; using vivego.MessageBroker.Abstractions; using vivego.MessageBroker.Client.Http; namespace vivego.MessageBroker.Host; public sealed class MessageBrokerHub : Hub { private readonly IMessageBroker _messageBroker; public MessageBrokerHub(IMessageBroker messageBroker) { _messageBroker = messageBroker ?? throw new ArgumentNullException(nameof(messageBroker)); } public Task Publish( [StringLength(512, MinimumLength = 1)] string topic, byte[] data, string contentType, TimeSpan? timeToLive = default) { if (string.IsNullOrEmpty(topic)) throw new ArgumentException("Value cannot be null or empty.", nameof(topic)); if (data is null) throw new ArgumentNullException(nameof(data)); if (string.IsNullOrEmpty(contentType)) throw new ArgumentException("Value cannot be null or empty.", nameof(contentType)); IDictionary<string, string> metaData = new Dictionary<string, string> { { HeaderNames.ContentType, contentType } }; return _messageBroker.Publish(topic, data, timeToLive, metaData, Context.ConnectionAborted); } public IAsyncEnumerable<MessageBrokerEventDto> Get( [StringLength(512, MinimumLength = 1)] string subscriptionId, long? fromId = default, bool stream = false, bool reverse = false) { if (string.IsNullOrEmpty(subscriptionId)) throw new ArgumentException("Value cannot be null or empty.", nameof(subscriptionId)); if (stream && reverse) throw new ArgumentException("Cannot both stream and get in reverse.", nameof(reverse)); return _messageBroker.MakeGetStream(subscriptionId, fromId, stream, reverse, Context.ConnectionAborted); } public Task Subscribe( [StringLength(512, MinimumLength = 1)] string subscriptionId, SubscriptionType type, [StringLength(512, MinimumLength = 1)] string pattern) { if (subscriptionId is null) throw new ArgumentNullException(nameof(subscriptionId)); if (pattern is null) throw new ArgumentNullException(nameof(pattern)); return _messageBroker.Subscribe(subscriptionId, type, subscriptionId, Context.ConnectionAborted); } public Task UnSubscribe( [StringLength(512, MinimumLength = 1)] string subscriptionId, SubscriptionType type, [StringLength(512, MinimumLength = 1)] string pattern) { if (subscriptionId is null) throw new ArgumentNullException(nameof(subscriptionId)); if (pattern is null) throw new ArgumentNullException(nameof(pattern)); return _messageBroker.UnSubscribe(subscriptionId, type, pattern, Context.ConnectionAborted); } }
mit
spolyak/satori-site
routes/views/post.js
1882
var keystone = require('keystone'); var Post = keystone.list('Post'); PostComment = keystone.list('PostComment'); exports = module.exports = function(req, res) { var view = new keystone.View(req, res), locals = res.locals; // Init locals locals.section = 'blog'; locals.filters = { post: req.params.post }; view.on('init', function(next) { Post.model.findOne() .where('slug', locals.filters.post) .populate('author categories') .exec(function(err, post) { if (err) return res.err(err); if (!post) return res.notfound('Post not found'); // Allow admins or the author to see draft posts if (post.state == 'published' || (req.user && req.user.isAdmin) || (req.user && post.author && (req.user.id == post.author.id))) { locals.post = post; locals.post.populateRelated('comments[author]', next); locals.page.title = post.title + ' - Blog - Satori'; } else { return res.notfound('Post not found'); } }); }); // Load recent posts view.query('data.posts', Post.model.find() .where('state', 'published') .sort('-publishedDate') .populate('author') .limit('4') ); view.on('post', { action: 'create-comment' }, function(next) { // handle form var newPostComment = new PostComment.model({ post: locals.post.id, author: locals.user.id }), updater = newPostComment.getUpdateHandler(req, res, { errorMessage: 'There was an error creating your comment:' }); updater.process(req.body, { flashErrors: true, logErrors: true, fields: 'content' }, function(err) { if (err) { locals.validationErrors = err.errors; } else { req.flash('success', 'Your comment has been added successfully.'); return res.redirect('/blog/post/' + locals.post.slug); } next(); }); }); // Render the view view.render('site/post'); }
mit
Jrocam/UnidosEnSalud
src/app/interacciones/nogubernamentales/nogubernamentales.component.spec.ts
705
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NogubernamentalesComponent } from './nogubernamentales.component'; describe('NogubernamentalesComponent', () => { let component: NogubernamentalesComponent; let fixture: ComponentFixture<NogubernamentalesComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ NogubernamentalesComponent ] }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(NogubernamentalesComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); });
mit
maveron58/indiana
positioning/links/collect/__init__.py
110
from .average import AverageRssis from .permutations import Permutations from .time_related import TimeRelated
mit
azaika/OpenSiv3D
Siv3D/src/Siv3D/Console/SivConsole.cpp
485
//----------------------------------------------- // // This file is part of the Siv3D Engine. // // Copyright (c) 2008-2018 Ryo Suzuki // Copyright (c) 2016-2018 OpenSiv3D Project // // Licensed under the MIT License. // //----------------------------------------------- # include <Siv3D/Console.hpp> # include "../Siv3DEngine.hpp" # include "IConsole.hpp" namespace s3d { namespace detail { void Console_impl::open() const { Siv3DEngine::GetConsole()->open(); } } }
mit
phpservicebus/core
src/Pipeline/Pipeline.php
1389
<?php namespace PSB\Core\Pipeline; class Pipeline implements PipelineInterface { /** * @var PipelineStepInterface[] */ private $stepList; /** * @param PipelineStepInterface[] $stepList */ public function __construct(array $stepList) { $this->stepList = $stepList; } /** * @param PipelineStageContextInterface $context */ public function invoke(PipelineStageContextInterface $context) { $this->invokeNext($context, 0); } /** * @param PipelineStageContextInterface $context * @param int $currentIndex */ private function invokeNext(PipelineStageContextInterface $context, $currentIndex) { if ($currentIndex == count($this->stepList)) { return; } $step = $this->stepList[$currentIndex]; if ($step instanceof StageConnectorInterface) { $step->invoke( $context, function ($newContext) use ($currentIndex) { $this->invokeNext($newContext, $currentIndex + 1); } ); } else { $step->invoke( $context, function () use ($context, $currentIndex) { $this->invokeNext($context, $currentIndex + 1); } ); } } }
mit
Yipit/pyeqs
pyeqs/dsl/match_all.py
257
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import class MatchAll(dict): def __init__(self): super(MatchAll, self).__init__() self._build_dict() def _build_dict(self): self["match_all"] = {}
mit
jtjenkins/my-school
spec/views/students/show.html.erb_spec.rb
275
require 'spec_helper' describe "students/show" do before(:each) do @student = assign(:student, stub_model(Student)) end it "renders attributes in <p>" do render # Run the generator again with the --webrat flag if you want to use webrat matchers end end
mit
Syafiqq/server-gardu-reporter
raw/assets/js/layout/auth/login/admin/auth_login_admin_common_layout.js
4442
/** * This <server-gardu-reporter> project created by : * Name : syafiq * Date / Time : 28 June 2017, 11:03 PM. * Email : syafiq.rezpector@gmail.com * Github : syafiqq */ (function ($) { $(function () { NProgress.configure({ showSpinner: false, template: '<div class="bar" role="bar" style="background-color: red"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>' }); $('form#login').on('submit', function (event) { event.preventDefault(); var form = $(this); var input = form.serializeObject(); input['remember_me'] = $(form).find('input:checkbox[name=remember_me]').prop('checked'); if ((input['remember_me'] === undefined) || (input['remember_me'] === null)) { input['remember_me'] = 0; } else { input['remember_me'] = input['remember_me'] ? 1 : 0; } NProgress.start(); $.post( form.attr('action'), input, null, 'json') .done(function (response) { var status = ['danger', 'info', 'warning', 'success']; var type = ['login', 'validation']; if (response['data'] !== undefined) { if (response['data']['message'] !== undefined) { for (var i = -1, is = type.length; ++i < is;) { if (response['data']['message'][type[i]] !== undefined) { for (var j = -1, js = status.length; ++j < js;) { if (response['data']['message'][type[i]][status[j]] !== undefined) { var template = '<div class="alert alert-' + status[j] + ' alert-dismissible">' + '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>' + '<ul>'; for (var k = -1, ks = response['data']['message'][type[i]][status[j]].length; ++k < ks;) { template += '<li>' + response['data']['message'][type[i]][status[j]][k] + '</li>' } template += '</ul>' + '</div>'; $("div#form-message-container").empty().append(template); } } } } } if (response['data']['redirect'] !== undefined) { location.href = response['data']['redirect']; } if (response['data']['csrf'] !== undefined) { $(form).find('input:hidden[name=' + response['data']['csrf']['name'] + ']').val(response['data']['csrf']['hash']); } } }) .fail(function () { }) .always(function () { NProgress.done(); }); }); $('input').iCheck({ checkboxClass: 'icheckbox_square-blue', radioClass: 'iradio_square-blue', increaseArea: '20%' // optional }); if ((sessionFlashdata !== undefined) && (sessionFlashdata !== null)) { for (var i = -1, is = sessionFlashdata.length; ++i < is;) { $.notify({ message: sessionFlashdata[i] }, { type: 'info' }); } } }); /* * Run right away * */ })(jQuery);
mit
takzhanov/otus-java-2017-10-takzhanov-yury
hw09-myorm/src/main/java/io/github/takzhanov/umbrella/hw09/myorm/DataSetDaoMyOrmImpl.java
3075
package io.github.takzhanov.umbrella.hw09.myorm; import io.github.takzhanov.umbrella.hw09.common.DataSetDao; import io.github.takzhanov.umbrella.hw09.common.Executor; import io.github.takzhanov.umbrella.hw09.domain.DataSet; import io.github.takzhanov.umbrella.hw09.domain.UserDataSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.Connection; import java.sql.SQLException; import java.util.List; public class DataSetDaoMyOrmImpl implements AutoCloseable, DataSetDao { private Logger LOGGER = LoggerFactory.getLogger(DataSetDaoMyOrmImpl.class); private Connection connection; public DataSetDaoMyOrmImpl(Connection connection) { this.connection = connection; } @Override public <T extends DataSet> void insert(T dataSet) { Executor executor = new Executor(connection); try { executor.executeUpdate(MyOrmHelper.makeInsertStatement(dataSet), generatedKeys -> { if (generatedKeys.next()) { dataSet.setId(generatedKeys.getLong(1)); } else { throw new SQLException("Creating failed, no ID obtained."); } return null; }); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e.getCause()); } } @Override public <T extends DataSet> T findById(long id, Class<T> clazz) { Executor executor = new Executor(connection); List<T> listResult = null; try { listResult = executor.executeQuery( MyOrmHelper.makeFindByIdStatement(id, clazz), MyOrmHelper.makeResultHandler(clazz)); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e.getCause()); } if (listResult.size() == 0) { return null; } else if (listResult.size() == 1) { return listResult.get(0); } else { throw new RuntimeException("Not unique ID"); } } @Override public <T extends DataSet> List<T> findAll(Class<T> clazz) { Executor executor = new Executor(connection); try { return executor.executeQuery(MyOrmHelper.makeFindAllStatement(clazz), MyOrmHelper.makeResultHandler(clazz)); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e.getCause()); } } @Override public <T extends UserDataSet> List<T> findByName(String name, Class<T> clazz) { Executor executor = new Executor(connection); try { return executor.executeQuery( MyOrmHelper.makeFindByNameStatement(name, clazz), MyOrmHelper.makeResultHandler(clazz)); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e.getCause()); } } public void close() { try { connection.close(); } catch (SQLException e) { LOGGER.error("Close ex", e); } } }
mit
nagoring/jp-address
src/Nago/JpAddress/StreetData/6/6364.php
255
<?php return ['63640002' => '内町','63640009' => '及位','63640003' => '大沢','63640004' => '大滝','63640006' => '川ノ内','63640008' => '差首鍋','63640010' => '平岡','63640001' => '新町','63640007' => '木ノ下','63640005' => '釜淵',];
mit
philholden/Fireflies
install/app.js
667
/** * Module dependencies. */ var express = require('express') , routes = require('./routes') , http = require('http'); var app = express(); app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.favicon()); app.use(express.logger('dev')); app.use(express.static(__dirname + '/public')); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(app.router); }); app.configure('development', function(){ app.use(express.errorHandler()); }); app.get('/', routes.index); http.createServer(app).listen(3000); console.log("Express server listening on port 3000");
mit
kswoll/npeg
PEG/Proxies/Proxy.cs
14751
using System; using System.Linq; using System.Reflection; using System.Reflection.Emit; using PEG.Proxies.Extensions; namespace PEG.Proxies { /// <summary> /// Generates proxies for the following usage scenarios:<ul> /// /// <li>Create a proxy on a base class where the proxy class should override virtual methods /// in the base class, making those methods available to the proxy. In this context, /// Invocation.Proceed invokes the base method implementation.</li> /// /// <li>Create a proxy on an interface while supplying a target implementation of that /// interface. In this context, Invocation.Proceed invokes the method on the provided /// target.</li> /// /// <li>Create a proxy on an interface, not providing any target. In this context, /// Invocation.Proceed does nothing.</li> /// /// </ul> /// /// <b>Note:</b> Generated implementations are stored in a static field of the generic /// Proxy&lt;T&gt; class. These are instantiated upon first access of a particular /// variant of that class (variant on the type argument), which solves any thread /// contention issues. /// </summary> public class Proxy { /// <summary> /// Creates a proxy for a given type. This method supports two discrete usage scenarios.<p/> /// If T is an interface, the target should be an implementation of that interface. In /// this scenario, T should be <i>explicitly</i> specified unless the type of <i>target</i> /// at the calling site is of that interface. In other words, if the calling site has the /// <i>target</i> declared as the concrete implementation, the proxy will be generated /// for the implementation, rather than for the interface. /// /// If T is a class, the target should be an instance of that class, and a subclassing /// proxy will be created for it. However, because target is specified in this case, /// the base class behavior will be ignored (it will all be delegated to the target). /// </summary> /// <typeparam name="T">The type to create the proxy for. May be an interface or a /// concrete base class.</typeparam> /// <param name="target">The instance of T that should be the recipient of all invocations /// on the proxy via Invocation.Proceed.</param> /// <param name="invocationHandler">This is where you get to inject your logic.</param> /// <returns>The new instance of the proxy that is an instance of T</returns> public static T CreateProxy<T>(T target, Action<Invocation> invocationHandler) { return Proxy<T>.CreateProxy(target, invocationHandler); } /// <summary> /// Creates a proxy for a given type. This overload does not accept a target. If T is /// an interface, then calls to Proceed will do nothing. If T is a class, calls to Proceed /// will invoke the base class behavior. /// </summary> /// <typeparam name="T">The type to create the proxy for. May be an interface or a /// concrete base class.</typeparam> /// <param name="invocationHandler"></param> /// <returns>The new instance of the proxy that is an instance of T</returns> public static T CreateProxy<T>(Action<Invocation> invocationHandler) { return Proxy<T>.CreateProxy(invocationHandler); } } public class Proxy<T> { private static readonly ConstructorInfo invocationConstructor = typeof(Invocation).GetConstructors()[0]; private static readonly MethodInfo invokeMethod = typeof(Action<Invocation>).GetMethod("Invoke"); private static readonly MethodInfo getReturnValue = typeof(Invocation).GetProperty("ReturnValue").GetGetMethod(); private static Type proxyType = CreateProxyType(); public static T CreateProxy(T target, Action<Invocation> invocationHandler) { return (T)Activator.CreateInstance(proxyType, target, invocationHandler); } public static T CreateProxy(Action<Invocation> invocationHandler) { return (T)Activator.CreateInstance(proxyType, invocationHandler); } private static Type CreateProxyType() { string assemblyName = typeof(T).FullName + "__Proxy"; AssemblyBuilder assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName(assemblyName), AssemblyBuilderAccess.Run); ModuleBuilder module = assembly.DefineDynamicModule(assemblyName); bool isIntf = typeof(T).IsInterface; Type baseType = isIntf ? typeof(object) : typeof(T); Type[] intfs = isIntf ? new[] { typeof(T) } : Type.EmptyTypes; var type = module.DefineType(assemblyName, TypeAttributes.Public, baseType, intfs); // Create target field var target = type.DefineField("__target", typeof(T), FieldAttributes.Private); var invocationHandler = type.DefineField("__invocationHandler", typeof(Action<Invocation>), FieldAttributes.Private); // Create default constructor var constructorWithoutTarget = type.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new[] { typeof(Action<Invocation>) }); var constructorWithoutTargetIl = constructorWithoutTarget.GetILGenerator(); constructorWithoutTargetIl.EmitDefaultBaseConstructorCall(typeof(T)); constructorWithoutTargetIl.Emit(OpCodes.Ldarg_0); constructorWithoutTargetIl.Emit(OpCodes.Ldarg_1); constructorWithoutTargetIl.Emit(OpCodes.Stfld, invocationHandler); constructorWithoutTargetIl.Emit(OpCodes.Ret); // Create constructor with target var constructorWithTarget = type.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new[] { typeof(T), typeof(Action<Invocation>) }); var constructorWithTargetIl = constructorWithTarget.GetILGenerator(); constructorWithTargetIl.EmitDefaultBaseConstructorCall(typeof(T)); constructorWithTargetIl.Emit(OpCodes.Ldarg_0); constructorWithTargetIl.Emit(OpCodes.Ldarg_1); constructorWithTargetIl.Emit(OpCodes.Stfld, target); constructorWithTargetIl.Emit(OpCodes.Ldarg_0); constructorWithTargetIl.Emit(OpCodes.Ldarg_2); constructorWithTargetIl.Emit(OpCodes.Stfld, invocationHandler); constructorWithTargetIl.Emit(OpCodes.Ret); var staticConstructor = type.DefineConstructor(MethodAttributes.Private | MethodAttributes.HideBySig | MethodAttributes.Static, CallingConventions.Standard, Type.EmptyTypes); var staticIl = staticConstructor.GetILGenerator(); // Now implement/override all methods foreach (var methodInfo in typeof(T).GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)) { ParameterInfo[] parameterInfos = methodInfo.GetParameters(); // Finalize doesn't work if we try to proxy it and really, who cares? if (methodInfo.Name == "Finalize" && parameterInfos.Length == 0 && methodInfo.DeclaringType == typeof(object)) continue; if (methodInfo.Name == "OnCreated") continue; if (isIntf || methodInfo.IsVirtual) { MethodAttributes methodAttributes; if (isIntf) methodAttributes = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.Virtual; else { methodAttributes = methodInfo.IsPublic ? MethodAttributes.Public : MethodAttributes.Family; methodAttributes |= MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.Virtual; } MethodBuilder method = type.DefineMethod(methodInfo.Name, methodAttributes, methodInfo.ReturnType, parameterInfos.Select(x => x.ParameterType).ToArray()); // Initialize method info in static constructor var methodInfoField = type.DefineField(methodInfo.Name + "__Info", typeof(MethodInfo), FieldAttributes.Private | FieldAttributes.Static); staticIl.StoreMethodInfo(methodInfoField, methodInfo); // Create proceed method var proceed = type.DefineMethod(methodInfo.Name + "__Proceed", MethodAttributes.Private, typeof(object), new[] { typeof(object[]) }); ILGenerator proceedIl = proceed.GetILGenerator(); // Load target for subsequent call proceedIl.Emit(OpCodes.Ldarg_0); proceedIl.Emit(OpCodes.Ldfld, target); proceedIl.Emit(OpCodes.Dup); var targetNotNull = proceedIl.DefineLabel(); // If target is null, we will do a base method invocation, if possible proceedIl.Emit(OpCodes.Brtrue, targetNotNull); // Pop the null target off the stack proceedIl.Emit(OpCodes.Pop); if (!isIntf) { // Target is null and we are overriding a base type, call the base implementation proceedIl.Emit(OpCodes.Ldarg_0); } else { if (method.ReturnType != typeof(void)) { if (methodInfo.ReturnType.IsValueType) { proceedIl.EmitDefaultValue(methodInfo.ReturnType); } else { proceedIl.Emit(OpCodes.Ldnull); } } proceedIl.Emit(OpCodes.Ret); } proceedIl.MarkLabel(targetNotNull); // Decompose array into arguments for (int i = 0; i < parameterInfos.Length; i++) { proceedIl.Emit(OpCodes.Ldarg, (short)1); // Push array proceedIl.Emit(OpCodes.Ldc_I4, i); // Push element index proceedIl.Emit(OpCodes.Ldelem, typeof(object)); // Get element if (parameterInfos[i].ParameterType.IsValueType) proceedIl.Emit(OpCodes.Unbox_Any, parameterInfos[i].ParameterType); else proceedIl.Emit(OpCodes.Castclass, parameterInfos[i].ParameterType); } proceedIl.Emit(isIntf ? OpCodes.Callvirt : OpCodes.Call, methodInfo); if (methodInfo.ReturnType.IsValueType && methodInfo.ReturnType != typeof(void)) proceedIl.Emit(OpCodes.Box, method.ReturnType); proceedIl.Emit(OpCodes.Ret); // Implement method ILGenerator il = method.GetILGenerator(); // Call handler il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Ldfld, invocationHandler); // Load method info il.Emit(OpCodes.Ldsfld, methodInfoField); // Create arguments array il.Emit(OpCodes.Ldc_I4, parameterInfos.Length); // Array length il.Emit(OpCodes.Newarr, typeof(object)); // Instantiate array for (int i = 0; i < parameterInfos.Length; i++) { il.Emit(OpCodes.Dup); // Duplicate array il.Emit(OpCodes.Ldc_I4, i); // Array index il.Emit(OpCodes.Ldarg, (short)(i + 1)); // Element value if (parameterInfos[i].ParameterType.IsValueType) il.Emit(OpCodes.Box, parameterInfos[i].ParameterType); il.Emit(OpCodes.Stelem, typeof(object)); // Set array at index to element value } // Load function pointer to proceed method il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Ldftn, proceed); il.Emit(OpCodes.Newobj, typeof(Func<object[], object>).GetConstructors()[0]); // Instantiate Invocation il.Emit(OpCodes.Newobj, invocationConstructor); // Store invocation il.Emit(OpCodes.Dup); var invocationVariable = il.DeclareLocal(typeof(Invocation)); il.Emit(OpCodes.Stloc, invocationVariable); // Invoke handler il.Emit(OpCodes.Callvirt, invokeMethod); // Extract return value if (methodInfo.ReturnType != typeof(void)) { il.Emit(OpCodes.Ldloc, invocationVariable); il.Emit(OpCodes.Call, getReturnValue); if (methodInfo.ReturnType.IsValueType) { var afterLoadDefaultValue = il.DefineLabel(); var afterUnbox = il.DefineLabel(); il.Emit(OpCodes.Brtrue, afterLoadDefaultValue); il.EmitDefaultValue(methodInfo.ReturnType); il.Emit(OpCodes.Br, afterUnbox); il.MarkLabel(afterLoadDefaultValue); il.Emit(OpCodes.Ldloc, invocationVariable); il.Emit(OpCodes.Call, getReturnValue); il.Emit(OpCodes.Unbox_Any, methodInfo.ReturnType); il.MarkLabel(afterUnbox); } else { il.Emit(OpCodes.Castclass, methodInfo.ReturnType); } } il.Emit(OpCodes.Ret); } } staticIl.Emit(OpCodes.Ret); Type proxyType = type.CreateTypeInfo(); return proxyType; } } }
mit
thesebas/opacclient
opacclient/libopac/src/test/java/de/geeksfactory/opacclient/apis/IOpacAccountTest.java
1702
package de.geeksfactory.opacclient.apis; import org.json.JSONObject; import org.jsoup.Jsoup; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.util.ArrayList; import java.util.Collection; import java.util.List; import de.geeksfactory.opacclient.objects.LentItem; import de.geeksfactory.opacclient.objects.ReservedItem; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @RunWith(Parameterized.class) public class IOpacAccountTest extends BaseHtmlTest { private String file; public IOpacAccountTest(String file) { this.file = file; } private static final String[] FILES = new String[]{"heide.html"}; @Parameterized.Parameters(name = "{0}") public static Collection<String[]> files() { List<String[]> files = new ArrayList<>(); for (String file : FILES) { files.add(new String[]{file}); } return files; } @Test public void testParseMediaList() throws OpacApi.OpacErrorException { String html = readResource("/iopac/" + file); List<LentItem> media = new ArrayList<>(); IOpac.parseMediaList(media, Jsoup.parse(html), new JSONObject()); assertTrue(media.size() > 0); for (LentItem item : media) { assertNotNull(item.getTitle()); assertNotNull(item.getDeadline()); } } @Test public void testParseResList() throws OpacApi.OpacErrorException { String html = readResource("/iopac/" + file); List<ReservedItem> media = new ArrayList<>(); IOpac.parseResList(media, Jsoup.parse(html), new JSONObject()); } }
mit
Xal3ph/MultipleDatePickerX
Gruntfile.js
3182
/*global module:false*/ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), clean:{ build: { src: ['dist/*.css', 'dist/*.js'] } }, concat: { options: { separator: ';' }, js: { src: [ 'multipleDatePickerX.js' ], dest: 'dist/multipleDatePickerX.js' } }, uglify: { options: { }, dist: { src: 'dist/multipleDatePickerX.js', dest: 'dist/multipleDatePickerX.min.js' } }, jshint: { options: { curly: true, immed: true, latedef: true, newcap: true, noarg: true, sub: true, undef: false, boss: true, eqnull: true, devel:true, browser: true, globals: { '_': true, 'angular': true, 'moment': true } }, src: 'multipleDatePickerX.js' }, less: { dist: { options: { cleancss: true, report: 'gzip' }, files: [{ expand: true, cwd: '', src: '*.less', dest: 'dist/', ext: '.css' }] } }, autoprefixer: { options: { browsers: ['last 1 version'] }, dist: { files: [{ expand: true, cwd: '', src: 'dist/*.css', dest: '' }] } }, version: { options:{ prefix: '"?version"?\\s*[:=]\\s*"?' }, defaults: { src: ['multipleDatePickerX.js', 'bower.json'] } }, watch: { js: { files: ['multipleDatePickerX.js'], tasks: ['jshint', 'concat:js', 'uglify'] }, less: { files: ['*.less'], tasks: ['less', 'autoprefixer'] } } }); grunt.loadNpmTasks('grunt-version'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-autoprefixer'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.registerTask('default', ['jshint', 'clean', 'version', 'concat:js', 'uglify', 'less', 'autoprefixer']); grunt.registerTask('dev', ['jshint', 'clean', 'concat:js', 'uglify', 'less', 'autoprefixer', 'watch']); };
mit
Sugarfooot/VeggyBot
Assets/Invector-3rdPersonController/Scripts/FootStep/vInstantiateStepMark.cs
803
using UnityEngine; public class vInstantiateStepMark : MonoBehaviour { public GameObject stepMark; public LayerMask stepLayer; public float timeToDestroy = 5f; void StepMark(Transform _transform) { RaycastHit hit; if (Physics.Raycast(transform.position + new Vector3(0, 0.1f, 0), -_transform.up, out hit, 1f, stepLayer)) { var angle = Quaternion.FromToRotation(_transform.up, hit.normal); if (stepMark != null) { var step = Instantiate(stepMark, hit.point, angle * _transform.rotation) as GameObject; Destroy(step, timeToDestroy); //Destroy(gameObject, timeToDestroy); } else Destroy(gameObject, timeToDestroy); } } }
mit
lyhapp/ghost_zh
core/built/scripts/ghost-tests.js
1318
define("ghost/tests/test-helper", ["ember-cli/test-loader","ember/resolver","ember-mocha"], function(__dependency1__, __dependency2__, __dependency3__) { "use strict"; var TestLoader = __dependency1__["default"]; var Resolver = __dependency2__["default"]; var setResolver = __dependency3__.setResolver; var resolver = Resolver.create(); resolver.namespace = { modulePrefix: 'ghost' }; setResolver(resolver); TestLoader.load(); window.expect = chai.expect; mocha.checkLeaks(); mocha.globals(['jQuery', 'EmberInspector']); mocha.run(); }); define("ghost/tests/unit/components/gh-trim-focus-input_test", ["ember-mocha"], function(__dependency1__) { "use strict"; /* jshint expr:true */ var describeComponent = __dependency1__.describeComponent; var it = __dependency1__.it; describeComponent('gh-trim-focus-input', function () { it('trims value on focusOut', function () { var component = this.subject({ value: 'some random stuff ' }); this.render(); component.$().focusout(); expect(component.$().val()).to.equal('some random stuff'); }); }); }); //# sourceMappingURL=ghost-tests.js.map
mit
Dyala/Test
app/scripts/app.js
6128
'use strict'; /** * @ngdoc overview * @name sbAdminApp * @description * # sbAdminApp * * Main module of the application. */ angular .module('sbAdminApp', [ 'oc.lazyLoad', 'ui.router', 'ui.bootstrap', 'angular-loading-bar', ]) .config(['$stateProvider','$urlRouterProvider','$ocLazyLoadProvider',function ($stateProvider,$urlRouterProvider,$ocLazyLoadProvider) { $ocLazyLoadProvider.config({ debug:false, events:true, }); $urlRouterProvider.otherwise('/login'); $stateProvider .state('dashboard', { url:'/dashboard', templateUrl: 'views/dashboard/main.html', resolve: { loadMyDirectives:function($ocLazyLoad){ return $ocLazyLoad.load( { name:'sbAdminApp', files:[ 'scripts/directives/header/header.js', 'scripts/directives/header/header-notification/header-notification.js', 'scripts/directives/sidebar/sidebar.js', 'scripts/directives/sidebar/sidebar-search/sidebar-search.js' ] }), $ocLazyLoad.load( { name:'toggle-switch', files:["bower_components/angular-toggle-switch/angular-toggle-switch.min.js", "bower_components/angular-toggle-switch/angular-toggle-switch.css" ] }), $ocLazyLoad.load( { name:'ngAnimate', files:['bower_components/angular-animate/angular-animate.js'] }) $ocLazyLoad.load( { name:'ngCookies', files:['bower_components/angular-cookies/angular-cookies.js'] }) $ocLazyLoad.load( { name:'ngResource', files:['bower_components/angular-resource/angular-resource.js'] }) $ocLazyLoad.load( { name:'ngSanitize', files:['bower_components/angular-sanitize/angular-sanitize.js'] }) $ocLazyLoad.load( { name:'ngTouch', files:['bower_components/angular-touch/angular-touch.js'] }) } } }) .state('dashboard.home',{ url:'/home', controller: 'MainCtrl', templateUrl:'views/dashboard/home.html', resolve: { loadMyFiles:function($ocLazyLoad) { return $ocLazyLoad.load({ name:'sbAdminApp', files:[ 'scripts/controllers/main.js', 'scripts/directives/timeline/timeline.js', 'scripts/directives/notifications/notifications.js', 'scripts/directives/chat/chat.js', 'scripts/directives/dashboard/stats/stats.js', // 'scripts/directives/figure1/figureone.js' ] }) } } }) .state('dashboard.form',{ templateUrl:'views/form.html', url:'/form' }) .state('dashboard.profile',{ templateUrl:'views/profile.html', url:'/profile', controller:'ProfileCtrl', resolve: { loadMyFiles:function($ocLazyLoad) { return $ocLazyLoad.load({ name:'sbAdminApp', files:[ 'scripts/controllers/profile.js' ] }) } } }) .state('dashboard.blank',{ templateUrl:'views/pages/blank.html', url:'/blank' }) .state('dashboard.reports',{ templateUrl:'views/reports.html', url:'/reports', controller:'ReportsCtrl', resolve: { loadMyFiles:function($ocLazyLoad) { return $ocLazyLoad.load({ name:'sbAdminApp', files:[ 'scripts/controllers/reports.js' ] }) } } }) .state('dashboard.survey',{ templateUrl:'views/survey.html', url:'/suvery' }) .state('dashboard.terms',{ templateUrl:'views/terms.html', url:'/terms' }) .state('dashboard.about',{ templateUrl:'views/about.html', url:'/about' }) .state('login',{ templateUrl:'views/pages/login.html', url:'/login' }) .state('dashboard.chart',{ templateUrl:'views/chart.html', url:'/chart', controller:'ChartCtrl', resolve: { loadMyFile:function($ocLazyLoad) { return $ocLazyLoad.load({ name:'chart.js', files:[ 'bower_components/angular-chart.js/dist/angular-chart.min.js', 'bower_components/angular-chart.js/dist/angular-chart.css' ] }), $ocLazyLoad.load({ name:'sbAdminApp', files:['scripts/controllers/chartContoller.js'] }) } } }) .state('dashboard.table',{ templateUrl:'views/table.html', url:'/table' }) .state('dashboard.section1',{ templateUrl:'views/survey/section1.html', url:'/section1' }) .state('dashboard.section2',{ templateUrl:'views/survey/section2.html', url:'/section2' }) .state('dashboard.section3',{ templateUrl:'views/survey/section3.html', url:'/section3' }) .state('dashboard.section4',{ templateUrl:'views/survey/section4.html', url:'/section4' }) .state('dashboard.section5',{ templateUrl:'views/survey/section5.html', url:'/section5' }) .state('dashboard.section6',{ templateUrl:'views/survey/section6.html', url:'/section6' }) .state('dashboard.section7',{ templateUrl:'views/survey/section7.html', url:'/section7' }) // .state('dashboard.calculations',{ // templateUrl:'views/reports/calculations.html', // url:'/calculations' // }) // .state('dashboard.figures',{ // templateUrl:'views/reports/figures.html', // url:'/figures' // }) .state('dashboard.panels-wells',{ templateUrl:'views/ui-elements/panels-wells.html', url:'/panels-wells' }) .state('dashboard.buttons',{ templateUrl:'views/ui-elements/buttons.html', url:'/buttons' }) .state('dashboard.notifications',{ templateUrl:'views/ui-elements/notifications.html', url:'/notifications' }) .state('dashboard.typography',{ templateUrl:'views/ui-elements/typography.html', url:'/typography' }) .state('dashboard.icons',{ templateUrl:'views/ui-elements/icons.html', url:'/icons' }) .state('dashboard.grid',{ templateUrl:'views/ui-elements/grid.html', url:'/grid' }) }]);
mit
ekristen/node-phpjs
lib/stream/stream_is_local.js
436
module.exports = function stream_is_local (stream_or_url) { // http://kevin.vanzonneveld.net // + original by: Brett Zamir (http://brett-zamir.me) // * example 1: stream_is_local('/etc'); // * returns 1: true if (typeof stream_or_url === 'string') { return ((/^(https?|ftps?|ssl|tls):/).test(stream_or_url)) ? false : true; // Need a better check than this } return stream_or_url.is_local ? true : false; }
mit
linde002/gstandaard-bundle
Model/GsCoderingGedifferentieerdeTarieven.php
246
<?php namespace PharmaIntelligence\GstandaardBundle\Model; use PharmaIntelligence\GstandaardBundle\Model\om\BaseGsCoderingGedifferentieerdeTarieven; class GsCoderingGedifferentieerdeTarieven extends BaseGsCoderingGedifferentieerdeTarieven { }
mit
joaomoreno/vscode
src/vs/platform/url/node/urlService.ts
1023
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { URI, UriComponents } from 'vs/base/common/uri'; import product from 'vs/platform/product/common/product'; import { AbstractURLService } from 'vs/platform/url/common/urlService'; export class URLService extends AbstractURLService { create(options?: Partial<UriComponents>): URI { let { authority, path, query, fragment } = options ? options : { authority: undefined, path: undefined, query: undefined, fragment: undefined }; if (authority && path && path.indexOf('/') !== 0) { path = `/${path}`; // URI validation requires a path if there is an authority } return URI.from({ scheme: product.urlProtocol, authority, path, query, fragment }); } }
mit
Brocco/angular-cli
tests/legacy-cli/e2e/tests/i18n/legacy.ts
10578
import * as express from 'express'; import { resolve } from 'path'; import { getGlobalVariable } from '../../utils/env'; import { appendToFile, copyFile, expectFileToExist, expectFileToMatch, replaceInFile, writeFile } from '../../utils/fs'; import { installPackage } from '../../utils/packages'; import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; import { expectToFail } from '../../utils/utils'; import { readNgVersion } from '../../utils/version'; // Configurations for each locale. export const baseDir = 'dist/test-project'; export const langTranslations = [ { lang: 'en-US', outputPath: `${baseDir}/en-US`, translation: { helloPartial: 'Hello', hello: 'Hello i18n!', plural: 'Updated 3 minutes ago', date: 'January', }, }, { lang: 'fr', outputPath: `${baseDir}/fr`, translation: { helloPartial: 'Bonjour', hello: 'Bonjour i18n!', plural: 'Mis à jour il y a 3 minutes', date: 'janvier', }, translationReplacements: [ ['Hello', 'Bonjour'], ['Updated', 'Mis à jour'], ['just now', 'juste maintenant'], ['one minute ago', 'il y a une minute'], [/other {/g, 'other {il y a '], ['minutes ago', 'minutes'], ], }, { lang: 'de', outputPath: `${baseDir}/de`, translation: { helloPartial: 'Hallo', hello: 'Hallo i18n!', plural: 'Aktualisiert vor 3 Minuten', date: 'Januar', }, translationReplacements: [ ['Hello', 'Hallo'], ['Updated', 'Aktualisiert'], ['just now', 'gerade jetzt'], ['one minute ago', 'vor einer Minute'], [/other {/g, 'other {vor '], ['minutes ago', 'Minuten'], ], }, ]; export const sourceLocale = langTranslations[0].lang; export const externalServer = (outputPath: string, baseUrl = '/') => { const app = express(); app.use(baseUrl, express.static(resolve(outputPath))); // call .close() on the return value to close the server. return app.listen(4200, 'localhost'); }; export const formats = { 'xlf': { ext: 'xlf', sourceCheck: 'source-language="en-US"', replacements: [ [/source/g, 'target'], ], }, 'xlf2': { ext: 'xlf', sourceCheck: 'srcLang="en-US"', replacements: [ [/source/g, 'target'], ], }, 'xmb': { ext: 'xmb', sourceCheck: '<!DOCTYPE messagebundle', replacements: [ [/messagebundle/g, 'translationbundle'], [/msg/g, 'translation'], [/<source>.*?<\/source>/g, ''], ], }, 'json': { ext: 'json', sourceCheck: '"locale": "en-US"', replacements: [ ], }, 'arb': { ext: 'arb', sourceCheck: '"@@locale": "en-US"', replacements: [ ], } }; export async function setupI18nConfig(useLocalize = true, format: keyof typeof formats = 'xlf') { // Add component with i18n content, both translations and localeData (plural, dates). await writeFile('src/app/app.component.ts', ` import { Component, Inject, LOCALE_ID } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent { constructor(@Inject(LOCALE_ID) public locale: string) { } title = 'i18n'; jan = new Date(2000, 0, 1); minutes = 3; } `); await writeFile(`src/app/app.component.html`, ` <p id="hello" i18n="An introduction header for this sample">Hello {{ title }}! </p> <p id="locale">{{ locale }}</p> <p id="date">{{ jan | date : 'LLLL' }}</p> <p id="plural" i18n>Updated {minutes, plural, =0 {just now} =1 {one minute ago} other {{{minutes}} minutes ago}}</p> `); // Add a dynamic import to ensure syntax is supported // ng serve support: https://github.com/angular/angular-cli/issues/16248 await writeFile('src/app/dynamic.ts', `export const abc = 5;`); await appendToFile('src/app/app.component.ts', ` (async () => { await import('./dynamic'); })(); `); // Add e2e specs for each lang. for (const { lang, translation } of langTranslations) { await writeFile(`./e2e/src/app.${lang}.e2e-spec.ts`, ` import { browser, logging, element, by } from 'protractor'; describe('workspace-project App', () => { const getParagraph = async (name: string) => element(by.css('app-root p#' + name)).getText(); beforeEach(() => browser.get(browser.baseUrl)); afterEach(async () => { // Assert that there are no errors emitted from the browser const logs = await browser.manage().logs().get(logging.Type.BROWSER); expect(logs).not.toContain(jasmine.objectContaining({ level: logging.Level.SEVERE, } as logging.Entry)); }); it('should display welcome message', async () => expect(await getParagraph('hello')).toEqual('${translation.hello}')); it('should display locale', async () => expect(await getParagraph('locale')).toEqual('${lang}')); it('should display localized date', async () => expect(await getParagraph('date')).toEqual('${translation.date}')); it('should display pluralized message', async () => expect(await getParagraph('plural')).toEqual('${translation.plural}')); }); `); } // Update angular.json to build, serve, and test each locale. await updateJsonFile('angular.json', workspaceJson => { const appProject = workspaceJson.projects['test-project']; const appArchitect = workspaceJson.projects['test-project'].architect; const buildConfigs = appArchitect['build'].configurations; const serveConfigs = appArchitect['serve'].configurations; const e2eConfigs = appArchitect['e2e'].configurations; // Make default builds prod. appArchitect['build'].options.optimization = true; appArchitect['build'].options.buildOptimizer = true; appArchitect['build'].options.aot = true; appArchitect['build'].options.fileReplacements = [{ replace: 'src/environments/environment.ts', with: 'src/environments/environment.prod.ts', }]; // Always error on missing translations. appArchitect['build'].options.i18nMissingTranslation = 'error'; if (useLocalize) { // Enable localization for all locales appArchitect['build'].options.localize = true; } // Add i18n config items (app, build, serve, e2e). // tslint:disable-next-line: no-any const i18n: Record<string, any> = (appProject.i18n = { locales: {} }); for (const { lang, outputPath } of langTranslations) { if (!useLocalize) { if (lang == sourceLocale) { buildConfigs[lang] = { outputPath, i18nLocale: lang }; } else { buildConfigs[lang] = { outputPath, i18nFile: `src/locale/messages.${lang}.${formats[format].ext}`, i18nFormat: format, i18nLocale: lang, }; } } else { if (lang == sourceLocale) { i18n.sourceLocale = lang; } else { i18n.locales[lang] = `src/locale/messages.${lang}.${formats[format].ext}`; } buildConfigs[lang] = { localize: [lang] }; } serveConfigs[lang] = { browserTarget: `test-project:build:${lang}` }; e2eConfigs[lang] = { specs: [`./src/app.${lang}.e2e-spec.ts`], devServerTarget: `test-project:serve:${lang}`, }; } }); // Install the localize package if using ivy if (!getGlobalVariable('argv')['ve']) { let localizeVersion = '@angular/localize@' + readNgVersion(); if (getGlobalVariable('argv')['ng-snapshots']) { localizeVersion = require('../../ng-snapshot/package.json').dependencies['@angular/localize']; } await installPackage(localizeVersion); } // Extract the translation messages. await ng( 'extract-i18n', '--output-path=src/locale', `--format=${format}`, ); const translationFile = `src/locale/messages.${formats[format].ext}`; await expectFileToExist(translationFile); await expectFileToMatch(translationFile, formats[format].sourceCheck); if (format !== 'json') { await expectFileToMatch(translationFile, `An introduction header for this sample`); } // Make translations for each language. for (const { lang, translationReplacements } of langTranslations) { if (lang != sourceLocale) { await copyFile(translationFile, `src/locale/messages.${lang}.${formats[format].ext}`); for (const replacements of translationReplacements) { await replaceInFile( `src/locale/messages.${lang}.${formats[format].ext}`, new RegExp(replacements[0], 'g'), replacements[1] as string, ); } for (const replacement of formats[format].replacements) { await replaceInFile( `src/locale/messages.${lang}.${formats[format].ext}`, new RegExp(replacement[0], 'g'), replacement[1] as string, ); } } } } export default async function () { // Setup i18n tests and config. await setupI18nConfig(false); // Legacy option usage with the en-US locale needs $localize when using ivy // Legacy usage did not need to process en-US and typically no i18nLocale options were present // This will currently be the overwhelmingly common scenario for users updating existing projects if (!getGlobalVariable('argv')['ve']) { await appendToFile('src/polyfills.ts', `import '@angular/localize/init';`); } // Build each locale and verify the output. for (const { lang, translation, outputPath } of langTranslations) { await ng('build', `--configuration=${lang}`); await expectFileToMatch(`${outputPath}/main.js`, translation.helloPartial); // Verify the HTML lang attribute is present await expectFileToMatch(`${outputPath}/index.html`, `lang="${lang}"`); // Execute Application E2E tests with dev server await ng('e2e', `--configuration=${lang}`, '--port=0'); // Execute Application E2E tests for a production build without dev server const server = externalServer(outputPath); try { await ng('e2e', `--configuration=${lang}`, '--devServerTarget='); } finally { server.close(); } } // Verify missing translation behaviour. await appendToFile('src/app/app.component.html', '<p i18n>Other content</p>'); await ng('build', '--configuration=fr', '--i18n-missing-translation', 'ignore'); await expectFileToMatch(`${baseDir}/fr/main.js`, /Other content/); await expectToFail(() => ng('build', '--configuration=fr')); }
mit
victor-gil-sepulveda/PhD-ANMPythonHelpers
calc_confs_mode_overlap.py
3656
''' Created on 26/10/2015 @author: victor ''' # one time script! import os from prody.proteins.pdbfile import parsePDB from prody.dynamics.anm import ANM import numpy from anmichelpers.comparison.comparison import cumulative_overlap, overlap from anmichelpers.tools.tools import norm if __name__ == '__main__': distances = [ 33, 29, 24, 17, 13, 07, 04 ] base_folder = "/home/victor/Desktop/1AKE_dyn/" reference_open = "33.pdb" reference_closed = "04.pdb" # Calculate eigenvectors all_eigenvectors = {} NUM_MODES = 8 for distance in distances: pdb_file = "%02d.pdb"%distance pdb_path = os.path.join(base_folder, pdb_file) print pdb_path pdb_struct = parsePDB(pdb_path) pdb_struct_ca = pdb_struct.ca pdb_struct_ca_anm = ANM(pdb_file) pdb_struct_ca_anm.buildHessian(pdb_struct_ca) #cutoff 15 pdb_struct_ca_anm.calcModes(n_modes=NUM_MODES) #cutoff 15 eigenvectors = [] for i in range(NUM_MODES): mode = pdb_struct_ca_anm[i] eigenvectors.append(mode.getEigvec().round(3)) all_eigenvectors[pdb_file] = numpy.array(eigenvectors) others = list(sorted(all_eigenvectors.keys(), reverse=True)) # Calculate transition vectors open_struct = parsePDB(os.path.join(base_folder,reference_open)).ca closed_struct = parsePDB(os.path.join(base_folder,reference_closed)).ca trans_vectors = (open_struct.getCoords() - closed_struct.getCoords()).flatten() # Calculate maximum single overlap with translation most_overlapping_modes_with_translation = [] for pdb_file in others: overlaps = [] for j in range(NUM_MODES): o = overlap(trans_vectors, all_eigenvectors[pdb_file][j]) overlaps.append((o,j)) overlaps.sort(reverse=True) most_overlapping_modes_with_translation.append(overlaps[0]) most_overlapping_modes_with_translation = numpy.array(most_overlapping_modes_with_translation) # Calculate maximum single overlap with first most_overlapping_modes_with_reference = [] for pdb_file in others: overlaps = [] for j in range(NUM_MODES): o = overlap(all_eigenvectors[reference_open][0], all_eigenvectors[pdb_file][j]) overlaps.append((o,j)) overlaps.sort(reverse=True) most_overlapping_modes_with_reference.append(overlaps[0]) most_overlapping_modes_with_reference = numpy.array(most_overlapping_modes_with_reference) # Calculate cumulative overlaps of first reference modes vs the others results = [[i] for i in range(len(others))] for mode_i in range(NUM_MODES): for j, other in enumerate(others): c_ov = cumulative_overlap(all_eigenvectors[reference_open][mode_i], all_eigenvectors[other]) results[j].append(c_ov) # Calculate overlaps of translation vs all modes results_cum_trans = [[i] for i in range(len(others))] for j, other in enumerate(others): c_ov = cumulative_overlap(trans_vectors, all_eigenvectors[other]) results_cum_trans[j].append(c_ov) numpy.savetxt("max_sing_ov_with_trans.txt", numpy.array(most_overlapping_modes_with_translation),fmt="%.3f") numpy.savetxt("max_sing_ov_with_first_ref.txt", numpy.array(most_overlapping_modes_with_reference),fmt="%.3f") numpy.savetxt("cum_overlap_with_trans.txt", numpy.array(results_cum_trans),fmt="%.3f") numpy.savetxt("cum_overlap_with_first_ref.txt", numpy.array(results),fmt="%.3f") numpy.savetxt("distances.txt", numpy.array(distances),fmt="%.1f")
mit
nextmat/yui-rails
test/dummy/config/environments/test.rb
1521
Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! config.cache_classes = true # Configure static asset server for tests with Cache-Control for performance config.serve_yui_rails = true config.static_cache_control = "public, max-age=3600" # Log error messages when you accidentally call methods on nil config.whiny_nils = true # Show full error reports and disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false # Raise exceptions instead of rendering exception templates config.action_dispatch.show_exceptions = false # Disable request forgery protection in test environment config.action_controller.allow_forgery_protection = false # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test # Raise exception on mass assignment protection for Active Record models config.active_record.mass_assignment_sanitizer = :strict # Print deprecation notices to the stderr config.active_support.deprecation = :stderr end
mit
relimited/HearthSim
src/test/java/com/hearthsim/test/spell/TestHammerOfWrath.java
4796
package com.hearthsim.test.spell; import com.hearthsim.card.Card; import com.hearthsim.card.basic.spell.HammerOfWrath; import com.hearthsim.card.minion.Minion; import com.hearthsim.card.minion.MinionMock; import com.hearthsim.exception.HSException; import com.hearthsim.model.BoardModel; import com.hearthsim.model.PlayerModel; import com.hearthsim.model.PlayerSide; import com.hearthsim.util.tree.CardDrawNode; import com.hearthsim.util.tree.HearthTreeNode; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; public class TestHammerOfWrath { private HearthTreeNode board; private PlayerModel currentPlayer; private PlayerModel waitingPlayer; private static final byte mana = 2; private static final byte attack0 = 2; private static final byte health0 = 3; private static final byte health1 = 7; @Before public void setup() throws HSException { board = new HearthTreeNode(new BoardModel()); currentPlayer = board.data_.getCurrentPlayer(); waitingPlayer = board.data_.getWaitingPlayer(); Minion minion0_0 = new MinionMock("" + 0, mana, attack0, health0, attack0, health0, health0); Minion minion0_1 = new MinionMock("" + 0, mana, attack0, (byte)(health1 - 1), attack0, health1, health1); Minion minion1_0 = new MinionMock("" + 0, mana, attack0, health0, attack0, health0, health0); Minion minion1_1 = new MinionMock("" + 0, mana, attack0, (byte)(health1 - 1), attack0, health1, health1); board.data_.placeMinion(PlayerSide.CURRENT_PLAYER, minion0_0); board.data_.placeMinion(PlayerSide.CURRENT_PLAYER, minion0_1); board.data_.placeMinion(PlayerSide.WAITING_PLAYER, minion1_0); board.data_.placeMinion(PlayerSide.WAITING_PLAYER, minion1_1); currentPlayer.setMana((byte) 10); currentPlayer.setMaxMana((byte) 10); } @Test public void test0() throws HSException { HammerOfWrath fb = new HammerOfWrath(); currentPlayer.placeCardHand(fb); Card theCard = currentPlayer.getHand().get(0); HearthTreeNode ret = theCard.useOn(PlayerSide.CURRENT_PLAYER, 0, board); assertFalse(ret == null); assertEquals(currentPlayer.getHand().size(), 0); assertTrue(ret instanceof CardDrawNode); PlayerModel currentPlayer = ret.data_.modelForSide(PlayerSide.CURRENT_PLAYER); assertEquals(((CardDrawNode)ret).getNumCardsToDraw(), 1); assertEquals(currentPlayer.getNumMinions(), 2); assertEquals(waitingPlayer.getNumMinions(), 2); assertEquals(currentPlayer.getHero().getHealth(), 27); assertEquals(waitingPlayer.getHero().getHealth(), 30); assertEquals(currentPlayer.getCharacter(1).getHealth(), health0); assertEquals(currentPlayer.getCharacter(2).getHealth(), health1 - 1); assertEquals(waitingPlayer.getCharacter(1).getHealth(), health0); assertEquals(waitingPlayer.getCharacter(2).getHealth(), health1 - 1); assertEquals(currentPlayer.getCharacter(1).getTotalAttack(), attack0); assertEquals(currentPlayer.getCharacter(2).getTotalAttack(), attack0); assertEquals(waitingPlayer.getCharacter(1).getTotalAttack(), attack0); assertEquals(waitingPlayer.getCharacter(2).getTotalAttack(), attack0); assertFalse(currentPlayer.getCharacter(1).getCharge()); assertFalse(currentPlayer.getCharacter(2).getCharge()); assertFalse(currentPlayer.getCharacter(1).getFrozen()); assertFalse(waitingPlayer.getCharacter(1).getFrozen()); } @Test public void test1() throws HSException { HammerOfWrath fb = new HammerOfWrath(); currentPlayer.placeCardHand(fb); Card theCard = currentPlayer.getHand().get(0); HearthTreeNode ret = theCard.useOn(PlayerSide.WAITING_PLAYER, 1, board); assertFalse(ret == null); assertEquals(currentPlayer.getHand().size(), 0); assertTrue(ret instanceof CardDrawNode); assertEquals(((CardDrawNode)ret).getNumCardsToDraw(), 1); assertEquals(currentPlayer.getNumMinions(), 2); assertEquals(waitingPlayer.getNumMinions(), 1); assertEquals(currentPlayer.getHero().getHealth(), 30); assertEquals(waitingPlayer.getHero().getHealth(), 30); assertEquals(currentPlayer.getCharacter(1).getHealth(), health0); assertEquals(currentPlayer.getCharacter(2).getHealth(), health1 - 1); assertEquals(waitingPlayer.getCharacter(1).getHealth(), health1 - 1); assertEquals(currentPlayer.getCharacter(1).getTotalAttack(), attack0); assertEquals(currentPlayer.getCharacter(2).getTotalAttack(), attack0); assertEquals(waitingPlayer.getCharacter(1).getTotalAttack(), attack0); } }
mit
idxos/charadesagainstcivilizedsociety.com
app/config.js
970
'use strict'; // Declare app level module which depends on filters, and services angular.module('myApp.config', []) // version of this seed app is compatible with angularFire 1.0.0 // see tags for other versions: https://github.com/firebase/angularFire-seed/tags .constant('version', '1.0.0') // where to redirect users if they need to authenticate (see security.js) .constant('loginRedirectPath', '/login') // your Firebase data URL goes here, no trailing slash .constant('FBURL', 'https://charadesagainst.firebaseio.com') // double check that the app has been configured before running it and blowing up space and time .run(['FBURL', '$timeout', function(FBURL, $timeout) { if( FBURL.match('//INSTANCE.firebaseio.com') ) { angular.element(document.body).html('<h1>Please configure app/config.js before running!</h1>'); $timeout(function() { angular.element(document.body).removeClass('hide'); }, 250); } }]);
mit
stevenandrewcarter/exercism
python/pangram/pangram_test.py
992
# -*- coding: utf-8 -*- import unittest from pangram import is_pangram class PangramTests(unittest.TestCase): def test_empty_string(self): self.assertFalse(is_pangram('')) def test_valid_pangram(self): self.assertTrue( is_pangram('the quick brown fox jumps over the lazy dog')) def test_invalid_pangram(self): self.assertFalse( is_pangram('the quick brown fish jumps over the lazy dog')) def test_missing_x(self): self.assertFalse(is_pangram('a quick movement of the enemy will ' 'jeopardize five gunboats')) def test_mixedcase_and_punctuation(self): self.assertTrue(is_pangram('"Five quacking Zephyrs jolt my wax bed."')) def test_unchecked_german_umlaute(self): self.assertTrue(is_pangram('Victor jagt zwölf Boxkämpfer quer über den' ' großen Sylter Deich.')) if __name__ == '__main__': unittest.main()
mit
karim/adila
database/src/main/java/adila/db/ac70cv.java
218
// This file is automatically generated. package adila.db; /* * Archos 70 Copper * * DEVICE: ac70cv * MODEL: Archos 70 Copper */ final class ac70cv { public static final String DATA = "Archos|70 Copper|"; }
mit
bitlek/bitlek
src/qt/locale/bitcoin_fi.ts
112797
<?xml version="1.0" ?><!DOCTYPE TS><TS language="fi" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Bitlek</source> <translation>Tietoa Bitlekista</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Bitlek&lt;/b&gt; version</source> <translation>&lt;b&gt;Bitlek&lt;/b&gt; versio</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation> Tämä on kokeellinen ohjelmisto. Levitetään MIT/X11 ohjelmistolisenssin alaisuudessa. Tarkemmat tiedot löytyvät tiedostosta COPYING tai osoitteesta http://www.opensource.org/licenses/mit-license.php. Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.openssl.org/), Eric Youngin (eay@cryptsoft.com) kehittämän salausohjelmiston sekä Thomas Bernardin UPnP ohjelmiston. </translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Tekijänoikeus</translation> </message> <message> <location line="+0"/> <source>The Bitlek developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Osoitekirja</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Kaksoisnapauta muokataksesi osoitetta tai nimeä</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Luo uusi osoite</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopioi valittu osoite leikepöydälle</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Uusi Osoite</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Bitlek 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>Nämä ovat Bitlek-osoitteesi joihin voit vastaanottaa maksuja. Voit haluta antaa jokaiselle maksajalle omansa, että pystyt seuraamaan keneltä maksut tulevat.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Kopioi Osoite</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Näytä &amp;QR-koodi</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Bitlek address</source> <translation>Allekirjoita viesti todistaaksesi, että omistat Bitlek-osoitteen</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Allekirjoita &amp;viesti</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Poista valittu osoite listalta</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Vie auki olevan välilehden tiedot tiedostoon</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Bitlek address</source> <translation>Tarkista viestin allekirjoitus varmistaaksesi, että se allekirjoitettiin tietyllä Bitlek-osoitteella</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Varmista viesti...</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Poista</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Bitlek addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Kopioi &amp;Nimi</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Muokkaa</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Lähetä &amp;Rahaa</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Vie osoitekirja</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma separated file (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Virhe viedessä osoitekirjaa</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Ei voida kirjoittaa tiedostoon %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Nimi</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Osoite</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(ei nimeä)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Tunnuslauseen Dialogi</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Kirjoita tunnuslause</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Uusi tunnuslause</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Kiroita uusi tunnuslause uudelleen</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>Anna lompakolle uusi tunnuslause.&lt;br/&gt;Käytä tunnuslausetta, jossa on ainakin &lt;b&gt;10 satunnaista mekkiä&lt;/b&gt; tai &lt;b&gt;kahdeksan sanaa&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Salaa lompakko</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Tätä toimintoa varten sinun täytyy antaa lompakon tunnuslause sen avaamiseksi.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Avaa lompakko</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Tätä toimintoa varten sinun täytyy antaa lompakon tunnuslause salauksen purkuun.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Pura lompakon salaus</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Vaihda tunnuslause</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Anna vanha ja uusi tunnuslause.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Vahvista lompakon salaus</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR LITECOINS&lt;/b&gt;!</source> <translation>Varoitus: Jos salaat lompakkosi ja menetät tunnuslauseesi, &lt;b&gt;MENETÄT KAIKKI LITECOINISI&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Haluatko varmasti salata lompakkosi?</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>TÄRKEÄÄ: Kaikki vanhat lompakon varmuuskopiot pitäisi korvata uusilla suojatuilla varmuuskopioilla. Turvallisuussyistä edelliset varmuuskopiot muuttuvat turhiksi, kun aloitat suojatun lompakon käytön.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Varoitus: Caps Lock on käytössä!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Lompakko salattu</translation> </message> <message> <location line="-56"/> <source>Bitlek will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitleks from being stolen by malware infecting your computer.</source> <translation>Bitlek sulkeutuu lopettaakseen salausprosessin. Muista, että salattukaan lompakko ei täysin suojaa sitä haittaohjelmien aiheuttamilta varkauksilta.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Lompakon salaus epäonnistui</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Lompakon salaaminen epäonnistui sisäisen virheen vuoksi. Lompakkoasi ei salattu.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>Annetut tunnuslauseet eivät täsmää.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Lompakon avaaminen epäonnistui.</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Annettu tunnuslause oli väärä.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Lompakon salauksen purku epäonnistui.</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Lompakon tunnuslause vaihdettiin onnistuneesti.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>&amp;Allekirjoita viesti...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Synkronoidaan verkon kanssa...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;Yleisnäkymä</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Lompakon tilanteen yleiskatsaus</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Rahansiirrot</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Selaa rahansiirtohistoriaa</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Muokkaa tallennettujen nimien ja osoitteiden listaa</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Näytä Bitlekien vastaanottamiseen käytetyt osoitteet</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>L&amp;opeta</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Sulje ohjelma</translation> </message> <message> <location line="+4"/> <source>Show information about Bitlek</source> <translation>Näytä tietoa Bitlek-projektista</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Tietoja &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Näytä tietoja QT:ta</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Asetukset...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Salaa lompakko...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Varmuuskopioi Lompakko...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Vaihda Tunnuslause...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Tuodaan lohkoja levyltä</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Ladataan lohkoindeksiä...</translation> </message> <message> <location line="-347"/> <source>Send coins to a Bitlek address</source> <translation>Lähetä kolikoita Bitlek-osoitteeseen</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Bitlek</source> <translation>Muuta Bitlekin konfiguraatioasetuksia</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Varmuuskopioi lompakko toiseen sijaintiin</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Vaihda lompakon salaukseen käytettävä tunnuslause</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>&amp;Testausikkuna</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Avaa debuggaus- ja diagnostiikkakonsoli</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>Varmista &amp;viesti...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Bitlek</source> <translation>Bitlek</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Lompakko</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Lähetä</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Vastaanota</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Osoitteet</translation> </message> <message> <location line="+22"/> <source>&amp;About Bitlek</source> <translation>&amp;Tietoa Bitlekista</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Näytä / Piilota</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Näytä tai piilota Bitlek-ikkuna</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Suojaa yksityiset avaimet, jotka kuuluvat lompakkoosi</translation> </message> <message> <location line="+7"/> <source>Sign messages with your Bitlek addresses to prove you own them</source> <translation>Allekirjoita viestisi omalla Bitlek -osoitteellasi todistaaksesi, että omistat ne</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Bitlek addresses</source> <translation>Varmista, että viestisi on allekirjoitettu määritetyllä Bitlek -osoitteella</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Tiedosto</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Asetukset</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Apua</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Välilehtipalkki</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>Bitlek client</source> <translation>Bitlek-asiakas</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Bitlek network</source> <translation><numerusform>%n aktiivinen yhteys Bitlek-verkkoon</numerusform><numerusform>%n aktiivista yhteyttä Bitlek-verkkoon</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>Käsitelty %1 lohkoa rahansiirtohistoriasta</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n tunti</numerusform><numerusform>%n tuntia</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n viikko</numerusform><numerusform>%n viikkoa</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>Viimeisin vastaanotettu lohko tuotettu %1.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Error</source> <translation>Virhe</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Varoitus</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Tietoa</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 type="unfinished"/> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Rahansiirtohistoria on ajan tasalla</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Saavutetaan verkkoa...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Vahvista maksukulu</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Lähetetyt rahansiirrot</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Saapuva rahansiirto</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Päivä: %1 Määrä: %2 Tyyppi: %3 Osoite: %4</translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>URI käsittely</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Bitlek address or malformed URI parameters.</source> <translation>URIa ei voitu jäsentää! Tämä voi johtua kelvottomasta Bitlek-osoitteesta tai virheellisistä URI parametreista.</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>Lompakko on &lt;b&gt;salattu&lt;/b&gt; ja tällä hetkellä &lt;b&gt;avoinna&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>Lompakko on &lt;b&gt;salattu&lt;/b&gt; ja tällä hetkellä &lt;b&gt;lukittuna&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Bitlek can no longer continue safely and will quit.</source> <translation>Peruuttamaton virhe on tapahtunut. Bitlek ei voi enää jatkaa turvallisesti ja sammutetaan.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Verkkohälytys</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Muokkaa osoitetta</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Nimi</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Tähän osoitteeseen liitetty nimi</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Osoite</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>Osoite, joka liittyy tämän osoitekirjan merkintään. Tätä voidaan muuttaa vain lähtevissä osoitteissa.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Uusi vastaanottava osoite</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Uusi lähettävä osoite</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Muokkaa vastaanottajan osoitetta</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Muokkaa lähtevää osoitetta</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Osoite &quot;%1&quot; on jo osoitekirjassa.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Bitlek address.</source> <translation>Antamasi osoite &quot;%1&quot; ei ole validi Bitlek-osoite.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Lompakkoa ei voitu avata.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Uuden avaimen luonti epäonnistui.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Bitlek-Qt</source> <translation>Bitlek-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>versio</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Käyttö:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>komentorivi parametrit</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>Käyttöliittymäasetukset</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Set language, for example &quot;de_DE&quot; (default: system locale)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Käynnistä pienennettynä</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Näytä aloitusruutu käynnistettäessä (oletus: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Asetukset</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Yleiset</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Maksa rahansiirtopalkkio</translation> </message> <message> <location line="+31"/> <source>Automatically start Bitlek after logging in to the system.</source> <translation>Käynnistä Bitlek kirjautumisen yhteydessä.</translation> </message> <message> <location line="+3"/> <source>&amp;Start Bitlek on system login</source> <translation>&amp;Käynnistä Bitlek kirjautumisen yhteydessä</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Verkko</translation> </message> <message> <location line="+6"/> <source>Automatically open the Bitlek client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Avaa Bitlek-asiakasohjelman portti reitittimellä automaattisesti. Tämä toimii vain, jos reitittimesi tukee UPnP:tä ja se on käytössä.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Portin uudelleenohjaus &amp;UPnP:llä</translation> </message> <message> <location line="+7"/> <source>Connect to the Bitlek network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Ota yhteys Bitlek-verkkoon SOCKS-proxyn läpi (esimerkiksi kun haluat käyttää Tor-verkkoa).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Ota yhteys SOCKS-proxyn kautta:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>Proxyn &amp;IP:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>Välityspalvelimen IP-osoite (esim. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Portti</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Proxyn Portti (esim. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;Versio:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Proxyn SOCKS-versio (esim. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Ikkuna</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Näytä ainoastaan ilmaisinalueella ikkunan pienentämisen jälkeen.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Pienennä ilmaisinalueelle työkalurivin sijasta</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>Ikkunaa suljettaessa vain pienentää Bitlek-ohjelman ikkunan lopettamatta itse ohjelmaa. Kun tämä asetus on valittuna, ohjelman voi sulkea vain valitsemalla Lopeta ohjelman valikosta.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>P&amp;ienennä suljettaessa</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Käyttöliittymä</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Käyttöliittymän kieli</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Bitlek.</source> <translation>Tässä voit määritellä käyttöliittymän kielen. Muutokset astuvat voimaan seuraavan kerran, kun Bitlek käynnistetään.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>Yksikkö jona bitlek-määrät näytetään</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Valitse mitä yksikköä käytetään ensisijaisesti bitlek-määrien näyttämiseen.</translation> </message> <message> <location line="+9"/> <source>Whether to show Bitlek addresses in the transaction list or not.</source> <translation>Näytetäänkö Bitlek-osoitteet rahansiirrot listassa vai ei.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Näytä osoitteet rahansiirrot listassa</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Peruuta</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Hyväksy</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>oletus</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Varoitus</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Bitlek.</source> <translation>Tämä asetus astuu voimaan seuraavalla kerralla, kun Bitlek käynnistetään.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Antamasi proxy-osoite on virheellinen.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Lomake</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitlek network after a connection is established, but this process has not completed yet.</source> <translation>Näytetyt tiedot eivät välttämättä ole ajantasalla. Lompakkosi synkronoituu Bitlek-verkon kanssa automaattisesti yhteyden muodostamisen jälkeen, mutta synkronointi on vielä meneillään.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Vahvistamatta:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Lompakko</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Epäkypsää:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Louhittu saldo, joka ei ole vielä kypsynyt</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Viimeisimmät rahansiirrot&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Tililläsi tällä hetkellä olevien Bitlekien määrä</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>Niiden saapuvien rahansiirtojen määrä, joita Bitlek-verkko ei vielä ole ehtinyt vahvistaa ja siten eivät vielä näy saldossa.</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>Ei ajan tasalla</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start bitlek: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>QR-koodi Dialogi</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Vastaanota maksu</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Määrä:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Tunniste:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Viesti:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Tallenna nimellä...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Virhe käännettäessä URI:a QR-koodiksi.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Syötetty määrä on virheellinen. Tarkista kirjoitusasu.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>Tuloksen URI liian pitkä, yritä lyhentää otsikon tekstiä / viestiä.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Tallenna QR-koodi</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG kuvat (*png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Pääteohjelman nimi</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>Ei saatavilla</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Pääteohjelman versio</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>T&amp;ietoa</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Käytössä oleva OpenSSL-versio</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Käynnistysaika</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Verkko</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Yhteyksien lukumäärä</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Käyttää testiverkkoa</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Lohkoketju</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Nykyinen Lohkojen määrä</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Arvioitu lohkojen kokonaismäärä</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Viimeisimmän lohkon aika</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Avaa</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Komentorivi parametrit</translation> </message> <message> <location line="+7"/> <source>Show the Bitlek-Qt help message to get a list with possible Bitlek command-line options.</source> <translation>Näytä Bitlek-Qt komentoriviparametrien ohjesivu, jossa on listattuna mahdolliset komentoriviparametrit.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Näytä</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Konsoli</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Kääntöpäiväys</translation> </message> <message> <location line="-104"/> <source>Bitlek - Debug window</source> <translation>Bitlek - Debug ikkuna</translation> </message> <message> <location line="+25"/> <source>Bitlek Core</source> <translation>Bitlek-ydin</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Debug lokitiedosto</translation> </message> <message> <location line="+7"/> <source>Open the Bitlek debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Avaa lokitiedosto nykyisestä data-kansiosta. Tämä voi viedä useamman sekunnin, jos lokitiedosto on iso.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Tyhjennä konsoli</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Bitlek RPC console.</source> <translation>Tervetuloa Bitlek RPC konsoliin.</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>Ylös- ja alas-nuolet selaavat historiaa ja &lt;b&gt;Ctrl-L&lt;/b&gt; tyhjentää ruudun.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Kirjoita &lt;b&gt;help&lt;/b&gt; nähdäksesi yleiskatsauksen käytettävissä olevista komennoista.</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>Lähetä Bitlekeja</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Lähetä monelle vastaanottajalle</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Lisää &amp;Vastaanottaja</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Poista kaikki rahansiirtokentät</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>&amp;Tyhjennnä Kaikki</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123,456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Vahvista lähetys</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Lähetä</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; to %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Hyväksy Bitlekien lähettäminen</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Haluatko varmasti lähettää %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> ja </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>Vastaanottajan osoite on virheellinen. Tarkista osoite.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Maksettavan summan tulee olla suurempi kuin 0 Bitlekia.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Määrä ylittää käytettävissä olevan saldon.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Kokonaismäärä ylittää saldosi kun %1 maksukulu lisätään summaan.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Sama osoite toistuu useamman kerran. Samaan osoitteeseen voi lähettää vain kerran per maksu.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Virhe: Rahansiirto hylättiin. Tämä voi tapahtua jos jotkin bitlekeistasi on jo käytetty, esimerkiksi jos olet käyttänyt kopiota wallet.dat-lompakkotiedostosta ja bitlekit on merkitty käytetyksi vain kopiossa.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Lomake</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>M&amp;äärä:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Maksun saaja:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Anna nimi tälle osoitteelle, jos haluat lisätä sen osoitekirjaan</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Nimi:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Valitse osoite osoitekirjasta</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>Liitä osoite leikepöydältä</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>Poista </translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Bitlek address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Anna Bitlek-osoite (esim. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Allekirjoitukset - Allekirjoita / Varmista viesti</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;Allekirjoita viesti</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>Voit allekirjoittaa viestit omalla osoitteellasi todistaaksesi että omistat ne. Ole huolellinen, että et allekirjoita mitään epämääräistä, phishing-hyökkääjät voivat huijata sinua allekirjoittamaan luovuttamalla henkilöllisyytesi. Allekirjoita selvitys täysin yksityiskohtaisesti mihin olet sitoutunut.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Osoite, jolla viesti allekirjoitetaan (esimerkiksi Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Valitse osoite osoitekirjasta</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>Liitä osoite leikepöydältä</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>Kirjoita tähän viesti minkä haluat allekirjoittaa</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Allekirjoitus</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Kopioi tämänhetkinen allekirjoitus leikepöydälle</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Bitlek address</source> <translation>Allekirjoita viesti todistaaksesi, että omistat tämän Bitlek-osoitteen</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Allekirjoita &amp;viesti</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Tyhjennä kaikki allekirjoita-viesti-kentät</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>&amp;Tyhjennä Kaikki</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Varmista viesti</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>Syötä allekirjoittava osoite, viesti ja allekirjoitus alla oleviin kenttiin varmistaaksesi allekirjoituksen aitouden. Varmista että kopioit kaikki kentät täsmälleen oikein, myös rivinvaihdot, välilyönnit, tabulaattorit, jne.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Osoite, jolla viesti allekirjoitettiin (esimerkiksi Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Bitlek address</source> <translation>Tarkista viestin allekirjoitus varmistaaksesi, että se allekirjoitettiin tietyllä Bitlek-osoitteella</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Tyhjennä kaikki varmista-viesti-kentät</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Bitlek address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Anna Bitlek-osoite (esim. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Klikkaa &quot;Allekirjoita Viesti luodaksesi allekirjoituksen </translation> </message> <message> <location line="+3"/> <source>Enter Bitlek signature</source> <translation>Syötä Bitlek-allekirjoitus</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Syötetty osoite on virheellinen.</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>Tarkista osoite ja yritä uudelleen.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Syötetyn osoitteen avainta ei löydy.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Lompakon avaaminen peruttiin.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Yksityistä avainta syötetylle osoitteelle ei ole saatavilla.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Viestin allekirjoitus epäonnistui.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Viesti allekirjoitettu.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Allekirjoitusta ei pystytty tulkitsemaan.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Tarkista allekirjoitus ja yritä uudelleen.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Allekirjoitus ei täsmää viestin tiivisteeseen.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Viestin varmistus epäonnistui.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Viesti varmistettu.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Bitlek developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Avoinna %1 asti</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/offline</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/vahvistamaton</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 vahvistusta</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Tila</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>lähetetty %n noodin läpi</numerusform><numerusform>lähetetty %n noodin läpi</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Päivämäärä</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Lähde</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Generoitu</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Lähettäjä</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Saaja</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>oma osoite</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>nimi</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Credit</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>kypsyy %n lohkon kuluttua</numerusform><numerusform>kypsyy %n lohkon kuluttua</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>ei hyväksytty</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Debit</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Maksukulu</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Netto määrä</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Viesti</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Viesti</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>Siirtotunnus</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>Generoitujen kolikoiden täytyy kypsyä 120 lohkon ajan ennen kuin ne voidaan lähettää. Kun loit tämän lohkon, se lähetettiin verkkoon lisättäväksi lohkoketjuun. Jos se ei päädy osaksi lohkoketjua, sen tila vaihtuu &quot;ei hyväksytty&quot; ja sitä ei voida lähettää. Näin voi joskus käydä, jos toinen noodi löytää lohkon muutamaa sekuntia ennen tai jälkeen sinun lohkosi löytymisen.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Debug tiedot</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Rahansiirto</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Sisääntulot</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Määrä</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>tosi</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>epätosi</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, ei ole vielä onnistuneesti lähetetty</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>tuntematon</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Rahansiirron yksityiskohdat</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Tämä ruutu näyttää yksityiskohtaisen tiedon rahansiirrosta</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Päivämäärä</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Laatu</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Osoite</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Määrä</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Avoinna %1 asti</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Ei yhteyttä verkkoon (%1 vahvistusta)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Vahvistamatta (%1/%2 vahvistusta)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Vahvistettu (%1 vahvistusta)</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>Louhittu saldo on käytettävissä kun se kypsyy %n lohkon päästä</numerusform><numerusform>Louhittu saldo on käytettävissä kun se kypsyy %n lohkon päästä</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>Tätä lohkoa ei vastaanotettu mistään muusta solmusta ja sitä ei mahdollisesti hyväksytä!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Generoitu mutta ei hyväksytty</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Vastaanotettu osoitteella</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Vastaanotettu</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Saaja</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Maksu itsellesi</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Louhittu</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(ei saatavilla)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Rahansiirron tila. Siirrä osoitin kentän päälle nähdäksesi vahvistusten lukumäärä.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Rahansiirron vastaanottamisen päivämäärä ja aika.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Rahansiirron laatu.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Rahansiirron kohteen Bitlek-osoite</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Saldoon lisätty tai siitä vähennetty määrä.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Kaikki</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Tänään</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Tällä viikolla</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Tässä kuussa</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Viime kuussa</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Tänä vuonna</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Alue...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Vastaanotettu osoitteella</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Saaja</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Itsellesi</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Louhittu</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Muu</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Anna etsittävä osoite tai tunniste</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Minimimäärä</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Kopioi osoite</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopioi nimi</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopioi määrä</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Muokkaa nimeä</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Näytä rahansiirron yksityiskohdat</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Vie rahansiirron tiedot</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma separated file (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Vahvistettu</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Aika</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Laatu</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Nimi</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Osoite</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Määrä</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Virhe tietojen viennissä</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Ei voida kirjoittaa tiedostoon %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Alue:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>kenelle</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Lähetä Bitlekeja</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Vie auki olevan välilehden tiedot tiedostoon</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Varmuuskopio Onnistui</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Bitlek version</source> <translation>Bitlekin versio</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Käyttö:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or bitlekd</source> <translation>Lähetä käsky palvelimelle tai bitlekd:lle</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Lista komennoista</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Hanki apua käskyyn</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Asetukset:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: bitlek.conf)</source> <translation>Määritä asetustiedosto (oletus: bitlek.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: bitlekd.pid)</source> <translation>Määritä pid-tiedosto (oletus: bitlek.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Määritä data-hakemisto</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Aseta tietokannan välimuistin koko megatavuina (oletus: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation>Kuuntele yhteyksiä portista &lt;port&gt; (oletus: 9333 tai testnet: 19333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Pidä enintään &lt;n&gt; yhteyttä verkkoihin (oletus: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Yhdistä noodiin hakeaksesi naapurien osoitteet ja katkaise yhteys</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Määritä julkinen osoitteesi</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Kynnysarvo aikakatkaisulle heikosti toimiville verkoille (oletus: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Sekuntien määrä, kuinka kauan uudelleenkytkeydytään verkkoihin (oletus: 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>Virhe valmisteltaessa RPC-portin %u avaamista kuunneltavaksi: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9332 or testnet: 19332)</source> <translation>Kuuntele JSON-RPC -yhteyksiä portista &lt;port&gt; (oletus: 9332 or testnet: 19332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Hyväksy merkkipohjaiset- ja JSON-RPC-käskyt</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Aja taustalla daemonina ja hyväksy komennot</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Käytä test -verkkoa</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Hyväksy yhteyksiä ulkopuolelta (vakioasetus: 1 jos -proxy tai -connect ei määritelty)</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=bitlekrpc 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;Bitlek Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Virhe ilmennyt asetettaessa RPC-porttia %u IPv6:n kuuntelemiseksi, palataan takaisin IPv4:ään %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 type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Bitlek is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Aseta suurin korkean prioriteetin / matalan palkkion siirron koko tavuissa (vakioasetus: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Varoitus: -paytxfee on asetettu erittäin korkeaksi! Tämä on maksukulu jonka tulet maksamaan kun lähetät siirron.</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>Varoitus: Näytetyt siirrot eivät välttämättä pidä paikkaansa! Sinun tai toisten noodien voi olla tarpeen asentaa päivitys.</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 Bitlek will not work properly.</source> <translation>Varoitus: Tarkista että tietokoneesi kellonaika ja päivämäärä ovat paikkansapitäviä! Bitlek ei toimi oikein väärällä päivämäärällä ja/tai kellonajalla.</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Lohkon luonnin asetukset:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Yhidstä ainoastaan määrättyihin noodeihin</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Hae oma IP osoite (vakioasetus: 1 kun kuuntelemassa ja ei -externalip)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Virhe avattaessa lohkoindeksiä</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Varoitus: Levytila on vähissä!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Virhe: Järjestelmävirhe</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Ei onnistuttu kuuntelemaan missään portissa. Käytä -listen=0 jos haluat tätä.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>Lohkon kirjoitus epäonnistui</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Hae naapureita DNS hauilla (vakioasetus: 1 paitsi jos -connect)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Tuodaan lohkoja ulkoisesta blk000??.dat tiedostosta</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation>Tietoa</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Virheellinen -tor osoite &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Suurin vastaanottopuskuri yksittäiselle yhteydelle, &lt;n&gt;*1000 tavua (vakioasetus: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Suurin lähetyspuskuri yksittäiselle yhteydelle, &lt;n&gt;*1000 tavua (vakioasetus: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Yhdistä vain noodeihin verkossa &lt;net&gt; (IPv4, IPv6 tai Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Tulosta enemmän debug tietoa. Aktivoi kaikki -debug* asetukset</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Tulosta lisää verkkoyhteys debug tietoa</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Lisää debuggaustiedon tulostukseen aikaleima</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Bitlek Wiki for SSL setup instructions)</source> <translation>SSL asetukset (katso Bitlek Wikistä tarkemmat SSL ohjeet)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Valitse käytettävän SOCKS-proxyn versio (4-5, vakioasetus: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Lähetä jäljitys/debug-tieto konsoliin, debug.log-tiedoston sijaan</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Lähetä jäljitys/debug-tieto debuggeriin</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Aseta suurin lohkon koko tavuissa (vakioasetus: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Asetan pienin lohkon koko tavuissa (vakioasetus: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Pienennä debug.log tiedosto käynnistyksen yhteydessä (vakioasetus: 1 kun ei -debug)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Määritä yhteyden aikakataisu millisekunneissa (vakioasetus: 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Järjestelmävirhe:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Käytä UPnP:tä kuunneltavan portin avaamiseen (vakioasetus: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Käytä UPnP:tä kuunneltavan portin avaamiseen (vakioasetus: 1 kun kuuntelemassa)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Käytä proxyä tor yhteyksien avaamiseen (vakioasetus: sama kuin -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Käyttäjätunnus JSON-RPC-yhteyksille</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Varoitus</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Varoitus: Tämä versio on vanhentunut, päivitys tarpeen!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Salasana JSON-RPC-yhteyksille</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Salli JSON-RPC yhteydet tietystä ip-osoitteesta</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Lähetä käskyjä solmuun osoitteessa &lt;ip&gt; (oletus: 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>Suorita käsky kun paras lohko muuttuu (%s cmd on vaihdettu block hashin kanssa)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Päivitä lompakko uusimpaan formaattiin</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Aseta avainpoolin koko arvoon &lt;n&gt; (oletus: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Skannaa uudelleen lohkoketju lompakon puuttuvien rahasiirtojen vuoksi</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Käytä OpenSSL:ää (https) JSON-RPC-yhteyksille</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Palvelimen sertifikaatti-tiedosto (oletus: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Palvelimen yksityisavain (oletus: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Hyväksyttävä salaus (oletus: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Tämä ohjeviesti</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Kytkeytyminen %s tällä tietokonella ei onnistu (kytkeytyminen palautti virheen %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Yhdistä socks proxyn läpi</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Salli DNS kyselyt -addnode, -seednode ja -connect yhteydessä</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Ladataan osoitteita...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Virhe ladattaessa wallet.dat-tiedostoa: Lompakko vioittunut</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Bitlek</source> <translation>Virhe ladattaessa wallet.dat-tiedostoa: Tarvitset uudemman version Bitlekista</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Bitlek to complete</source> <translation>Lompakko tarvitsee uudelleenkirjoittaa: käynnistä Bitlek uudelleen</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Virhe ladattaessa wallet.dat-tiedostoa</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Virheellinen proxy-osoite &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Tuntematon verkko -onlynet parametrina: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Tuntematon -socks proxy versio pyydetty: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>-bind osoitteen &apos;%s&apos; selvittäminen epäonnistui</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>-externalip osoitteen &apos;%s&apos; selvittäminen epäonnistui</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>-paytxfee=&lt;amount&gt;: &apos;%s&apos; on virheellinen</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Virheellinen määrä</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Lompakon saldo ei riitä</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Ladataan lohkoindeksiä...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Linää solmu mihin liittyä pitääksesi yhteyden auki</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Bitlek is probably already running.</source> <translation>Kytkeytyminen %s ei onnistu tällä tietokoneella. Bitlek on todennäköisesti jo ajamassa.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Rahansiirtopalkkio per KB lisätään lähettämääsi rahansiirtoon</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Ladataan lompakkoa...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Et voi päivittää lompakkoasi vanhempaan versioon</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Oletusosoitetta ei voi kirjoittaa</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Skannataan uudelleen...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Lataus on valmis</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Käytä %s optiota</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Virhe</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>Sinun täytyy asettaa rpcpassword=&lt;password&gt; asetustiedostoon: %s Jos tiedostoa ei ole, niin luo se ainoastaan omistajan kirjoitusoikeuksin.</translation> </message> </context> </TS>
mit
xiguaaxigua/xiguaaxigua
fastblog/comment.php
1186
<?php /** * @package WordPress * @subpackage Fast_Blog_Theme * @since Fast Blog 1.0 */ ?> <!-- Comment --> <li id="comment-<?php comment_ID(); ?>" class="comment"> <div class="content level-<?php echo min($depth, 5); ?>"> <?php if (!$comment->comment_approved): ?> <p><em><?php _e('Your comment is awaiting moderation.', 'fastblog'); ?></em></p> <?php endif; ?> <?php comment_text(); ?> <div class="tools"> <?php $comment_reply_args = array( 'reply_text' => __('reply', 'fastblog'), 'depth' => $depth ); comment_reply_link(array_merge($args, $comment_reply_args)); edit_comment_link(__('edit', 'fastblog'), $depth < $args['max_depth'] ? ' | ' : ''); ?> </div> </div> <div class="meta"> <?php echo get_avatar($comment, 32, get_option('avatar_default') == 'mystery' ? get_template_directory_uri().'/schemes/'.fastblog_get_option('scheme').'/images/avatar.png' : ''); ?> <div> <p><?php comment_author_link(); ?></p> <p><?php if (get_comment_date('Y.m.d') == date('Y.m.d')) comment_time(); else comment_date(); ?></p> </div> </div> <div class="clear"></div> </li> <!-- // Comment -->
mit
paralleltree/ProgressiveTweet
ProgressiveTweet/Properties/Resources.Designer.cs
3712
//------------------------------------------------------------------------------ // <auto-generated> // このコードはツールによって生成されました。 // ランタイム バージョン:4.0.30319.34209 // // このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 // コードが再生成されるときに損失したりします。 // </auto-generated> //------------------------------------------------------------------------------ namespace ProgressiveTweet.Properties { using System; /// <summary> /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。 /// </summary> // このクラスは StronglyTypedResourceBuilder クラスが ResGen // または Visual Studio のようなツールを使用して自動生成されました。 // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。 /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProgressiveTweet.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、 /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。 /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// (アイコン) に類似した型 System.Drawing.Icon のローカライズされたリソースを検索します。 /// </summary> internal static System.Drawing.Icon MainIcon { get { object obj = ResourceManager.GetObject("MainIcon", resourceCulture); return ((System.Drawing.Icon)(obj)); } } } }
mit
klibs/klibs_web
src/systemjs.config.js
1638
/** * System configuration for Angular samples * Adjust as necessary for your application needs. */ (function (global) { System.config({ paths: { // paths serve as alias 'npm:': 'node_modules/' }, // map tells the System loader where to look for things map: { // our app is within the app folder 'app': 'app', // angular bundles '@angular/core': 'npm:@angular/core/bundles/core.umd.js', '@angular/common': 'npm:@angular/common/bundles/common.umd.js', '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', '@angular/http': 'npm:@angular/http/bundles/http.umd.js', '@angular/router': 'npm:@angular/router/bundles/router.umd.js', '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', // other libraries 'rxjs': 'npm:rxjs', 'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js', '@ng-bootstrap/ng-bootstrap': 'npm:@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js' }, // packages tells the System loader how to load when no filename and/or no extension packages: { app: { defaultExtension: 'js', meta: { './*.js': { loader: 'systemjs-angular-loader.js' } } }, rxjs: { defaultExtension: 'js' } } }); })(this);
mit
acropolium/Rest4Net
src/Rest4Net.BitLy/Responses/IValidDomain.cs
164
namespace Rest4Net.BitLy.Responses { public interface IValidDomain { string Domain { get; } bool BitlyProDomain { get; } } }
mit