code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
line_mean
float64
0.5
100
line_max
int64
1
1k
alpha_frac
float64
0.25
1
autogenerated
bool
1 class
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Petri Net Plans: Deprecated List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Petri Net Plans </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.6.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <div class="title">Deprecated List </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><dl class="reflist"> <dt><a class="anchor" id="_deprecated000001"></a>Member <a class="el" href="namespacelearnpnp.html#a27c77d1b0ba7ad05ba6c0537d9fc25e0">learnpnp::TD0Params</a> </dt> <dd>This used to be a structure subclassed by TDLParams but should not be used any more. TDLParams's lambda defaults to 0.</dd> </dl> </div></div><!-- contents --> <hr class="footer"/><address class="footer"><small> Generated on Thu Oct 9 2014 02:16:35 for Petri Net Plans by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.7.6.1 </small></address> </body> </html>
Musi13/bwi_experimental
bwi_tasks_pnp/pnp/doc/html/deprecated.html
HTML
bsd-3-clause
2,033
28.897059
164
0.6424
false
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/browser/media/android/browser_media_player_manager.h" #include "base/android/scoped_java_ref.h" #include "base/command_line.h" #include "content/browser/android/content_view_core_impl.h" #include "content/browser/android/media_players_observer.h" #include "content/browser/media/android/browser_demuxer_android.h" #include "content/browser/media/android/media_resource_getter_impl.h" #include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/web_contents/web_contents_view_android.h" #include "content/common/media/media_player_messages_android.h" #include "content/public/browser/android/content_view_core.h" #include "content/public/browser/android/external_video_surface_container.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" #include "media/base/android/media_player_bridge.h" #include "media/base/android/media_source_player.h" #include "media/base/android/media_url_interceptor.h" #include "media/base/media_switches.h" using media::MediaPlayerAndroid; using media::MediaPlayerBridge; using media::MediaPlayerManager; using media::MediaSourcePlayer; namespace content { // Threshold on the number of media players per renderer before we start // attempting to release inactive media players. const int kMediaPlayerThreshold = 1; const int kInvalidMediaPlayerId = -1; static BrowserMediaPlayerManager::Factory g_factory = NULL; static media::MediaUrlInterceptor* media_url_interceptor_ = NULL; // static void BrowserMediaPlayerManager::RegisterFactory(Factory factory) { // TODO(aberent) nullptr test is a temporary fix to simplify upstreaming Cast. // Until Cast is fully upstreamed we want the downstream factory to take // priority over the upstream factory. The downstream call happens first, // so this will ensure that it does. if (g_factory == nullptr) g_factory = factory; } // static void BrowserMediaPlayerManager::RegisterMediaUrlInterceptor( media::MediaUrlInterceptor* media_url_interceptor) { media_url_interceptor_ = media_url_interceptor; } // static BrowserMediaPlayerManager* BrowserMediaPlayerManager::Create( RenderFrameHost* rfh, MediaPlayersObserver* audio_monitor) { if (g_factory) return g_factory(rfh, audio_monitor); return new BrowserMediaPlayerManager(rfh, audio_monitor); } ContentViewCore* BrowserMediaPlayerManager::GetContentViewCore() const { return ContentViewCoreImpl::FromWebContents(web_contents()); } MediaPlayerAndroid* BrowserMediaPlayerManager::CreateMediaPlayer( const MediaPlayerHostMsg_Initialize_Params& media_player_params, bool hide_url_log, MediaPlayerManager* manager, BrowserDemuxerAndroid* demuxer) { switch (media_player_params.type) { case MEDIA_PLAYER_TYPE_URL: { const std::string user_agent = GetContentClient()->GetUserAgent(); MediaPlayerBridge* media_player_bridge = new MediaPlayerBridge( media_player_params.player_id, media_player_params.url, media_player_params.first_party_for_cookies, user_agent, hide_url_log, manager, base::Bind(&BrowserMediaPlayerManager::OnMediaResourcesRequested, weak_ptr_factory_.GetWeakPtr()), media_player_params.frame_url, media_player_params.allow_credentials); BrowserMediaPlayerManager* browser_media_player_manager = static_cast<BrowserMediaPlayerManager*>(manager); ContentViewCoreImpl* content_view_core_impl = static_cast<ContentViewCoreImpl*>(ContentViewCore::FromWebContents( browser_media_player_manager->web_contents_)); if (!content_view_core_impl) { // May reach here due to prerendering. Don't extract the metadata // since it is expensive. // TODO(qinmin): extract the metadata once the user decided to load // the page. browser_media_player_manager->OnMediaMetadataChanged( media_player_params.player_id, base::TimeDelta(), 0, 0, false); } else if (!content_view_core_impl->ShouldBlockMediaRequest( media_player_params.url)) { media_player_bridge->Initialize(); } return media_player_bridge; } case MEDIA_PLAYER_TYPE_MEDIA_SOURCE: { return new MediaSourcePlayer( media_player_params.player_id, manager, base::Bind(&BrowserMediaPlayerManager::OnMediaResourcesRequested, weak_ptr_factory_.GetWeakPtr()), demuxer->CreateDemuxer(media_player_params.demuxer_client_id), media_player_params.frame_url); } } NOTREACHED(); return NULL; } BrowserMediaPlayerManager::BrowserMediaPlayerManager( RenderFrameHost* render_frame_host, MediaPlayersObserver* audio_monitor) : render_frame_host_(render_frame_host), audio_monitor_(audio_monitor), fullscreen_player_id_(kInvalidMediaPlayerId), fullscreen_player_is_released_(false), web_contents_(WebContents::FromRenderFrameHost(render_frame_host)), weak_ptr_factory_(this) { } BrowserMediaPlayerManager::~BrowserMediaPlayerManager() { // During the tear down process, OnDestroyPlayer() may or may not be called // (e.g. the WebContents may be destroyed before the render process). So // we cannot DCHECK(players_.empty()) here. Instead, all media players in // |players_| will be destroyed here because |player_| is a ScopedVector. } void BrowserMediaPlayerManager::ExitFullscreen(bool release_media_player) { if (WebContentsDelegate* delegate = web_contents_->GetDelegate()) delegate->ExitFullscreenModeForTab(web_contents_); if (RenderWidgetHostViewAndroid* view_android = static_cast<RenderWidgetHostViewAndroid*>( web_contents_->GetRenderWidgetHostView())) { view_android->SetOverlayVideoMode(false); } Send( new MediaPlayerMsg_DidExitFullscreen(RoutingID(), fullscreen_player_id_)); video_view_.reset(); MediaPlayerAndroid* player = GetFullscreenPlayer(); fullscreen_player_id_ = kInvalidMediaPlayerId; if (!player) return; #if defined(VIDEO_HOLE) if (external_video_surface_container_) external_video_surface_container_->OnFrameInfoUpdated(); #endif // defined(VIDEO_HOLE) if (release_media_player) ReleaseFullscreenPlayer(player); else player->SetVideoSurface(gfx::ScopedJavaSurface()); } void BrowserMediaPlayerManager::OnTimeUpdate( int player_id, base::TimeDelta current_timestamp, base::TimeTicks current_time_ticks) { Send(new MediaPlayerMsg_MediaTimeUpdate( RoutingID(), player_id, current_timestamp, current_time_ticks)); } void BrowserMediaPlayerManager::SetVideoSurface( gfx::ScopedJavaSurface surface) { MediaPlayerAndroid* player = GetFullscreenPlayer(); if (!player) return; bool empty_surface = surface.IsEmpty(); player->SetVideoSurface(surface.Pass()); if (empty_surface) return; if (RenderWidgetHostViewAndroid* view_android = static_cast<RenderWidgetHostViewAndroid*>( web_contents_->GetRenderWidgetHostView())) { view_android->SetOverlayVideoMode(true); } } void BrowserMediaPlayerManager::OnMediaMetadataChanged( int player_id, base::TimeDelta duration, int width, int height, bool success) { Send(new MediaPlayerMsg_MediaMetadataChanged( RoutingID(), player_id, duration, width, height, success)); if (fullscreen_player_id_ == player_id) video_view_->UpdateMediaMetadata(); } void BrowserMediaPlayerManager::OnPlaybackComplete(int player_id) { Send(new MediaPlayerMsg_MediaPlaybackCompleted(RoutingID(), player_id)); if (fullscreen_player_id_ == player_id) video_view_->OnPlaybackComplete(); } void BrowserMediaPlayerManager::OnMediaInterrupted(int player_id) { // Tell WebKit that the audio should be paused, then release all resources Send(new MediaPlayerMsg_MediaPlayerReleased(RoutingID(), player_id)); OnReleaseResources(player_id); } void BrowserMediaPlayerManager::OnBufferingUpdate( int player_id, int percentage) { Send(new MediaPlayerMsg_MediaBufferingUpdate( RoutingID(), player_id, percentage)); if (fullscreen_player_id_ == player_id) video_view_->OnBufferingUpdate(percentage); } void BrowserMediaPlayerManager::OnSeekRequest( int player_id, const base::TimeDelta& time_to_seek) { Send(new MediaPlayerMsg_SeekRequest(RoutingID(), player_id, time_to_seek)); } void BrowserMediaPlayerManager::ReleaseAllMediaPlayers() { for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin(); it != players_.end(); ++it) { if ((*it)->player_id() == fullscreen_player_id_) fullscreen_player_is_released_ = true; (*it)->Release(); } } void BrowserMediaPlayerManager::OnSeekComplete( int player_id, const base::TimeDelta& current_time) { Send(new MediaPlayerMsg_SeekCompleted(RoutingID(), player_id, current_time)); } void BrowserMediaPlayerManager::OnError(int player_id, int error) { Send(new MediaPlayerMsg_MediaError(RoutingID(), player_id, error)); if (fullscreen_player_id_ == player_id) video_view_->OnMediaPlayerError(error); } void BrowserMediaPlayerManager::OnVideoSizeChanged( int player_id, int width, int height) { Send(new MediaPlayerMsg_MediaVideoSizeChanged(RoutingID(), player_id, width, height)); if (fullscreen_player_id_ == player_id) video_view_->OnVideoSizeChanged(width, height); } void BrowserMediaPlayerManager::OnAudibleStateChanged( int player_id, bool is_audible) { audio_monitor_->OnAudibleStateChanged( render_frame_host_, player_id, is_audible); } void BrowserMediaPlayerManager::OnWaitingForDecryptionKey(int player_id) { Send(new MediaPlayerMsg_WaitingForDecryptionKey(RoutingID(), player_id)); } media::MediaResourceGetter* BrowserMediaPlayerManager::GetMediaResourceGetter() { if (!media_resource_getter_.get()) { RenderProcessHost* host = web_contents()->GetRenderProcessHost(); BrowserContext* context = host->GetBrowserContext(); StoragePartition* partition = host->GetStoragePartition(); storage::FileSystemContext* file_system_context = partition ? partition->GetFileSystemContext() : NULL; // Eventually this needs to be fixed to pass the correct frame rather // than just using the main frame. media_resource_getter_.reset(new MediaResourceGetterImpl( context, file_system_context, host->GetID(), web_contents()->GetMainFrame()->GetRoutingID())); } return media_resource_getter_.get(); } media::MediaUrlInterceptor* BrowserMediaPlayerManager::GetMediaUrlInterceptor() { return media_url_interceptor_; } MediaPlayerAndroid* BrowserMediaPlayerManager::GetFullscreenPlayer() { return GetPlayer(fullscreen_player_id_); } MediaPlayerAndroid* BrowserMediaPlayerManager::GetPlayer(int player_id) { for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin(); it != players_.end(); ++it) { if ((*it)->player_id() == player_id) return *it; } return NULL; } void BrowserMediaPlayerManager::RequestFullScreen(int player_id) { if (fullscreen_player_id_ == player_id) return; if (fullscreen_player_id_ != kInvalidMediaPlayerId) { // TODO(qinmin): Determine the correct error code we should report to WMPA. OnError(player_id, MediaPlayerAndroid::MEDIA_ERROR_DECODE); return; } Send(new MediaPlayerMsg_RequestFullscreen(RoutingID(), player_id)); } #if defined(VIDEO_HOLE) void BrowserMediaPlayerManager::AttachExternalVideoSurface(int player_id, jobject surface) { MediaPlayerAndroid* player = GetPlayer(player_id); if (player) { player->SetVideoSurface( gfx::ScopedJavaSurface::AcquireExternalSurface(surface)); } } void BrowserMediaPlayerManager::DetachExternalVideoSurface(int player_id) { MediaPlayerAndroid* player = GetPlayer(player_id); if (player) player->SetVideoSurface(gfx::ScopedJavaSurface()); } void BrowserMediaPlayerManager::OnFrameInfoUpdated() { if (fullscreen_player_id_ != kInvalidMediaPlayerId) return; if (external_video_surface_container_) external_video_surface_container_->OnFrameInfoUpdated(); } void BrowserMediaPlayerManager::OnNotifyExternalSurface( int player_id, bool is_request, const gfx::RectF& rect) { if (!web_contents_) return; if (is_request) { OnRequestExternalSurface(player_id, rect); } if (external_video_surface_container_) { external_video_surface_container_->OnExternalVideoSurfacePositionChanged( player_id, rect); } } void BrowserMediaPlayerManager::ReleasePlayerOfExternalVideoSurfaceIfNeeded( int future_player) { int current_player = ExternalVideoSurfaceContainer::kInvalidPlayerId; if (external_video_surface_container_) current_player = external_video_surface_container_->GetCurrentPlayerId(); if (current_player == ExternalVideoSurfaceContainer::kInvalidPlayerId) return; if (current_player != future_player) OnMediaInterrupted(current_player); } void BrowserMediaPlayerManager::OnRequestExternalSurface( int player_id, const gfx::RectF& rect) { if (!external_video_surface_container_) { ContentBrowserClient* client = GetContentClient()->browser(); external_video_surface_container_.reset( client->OverrideCreateExternalVideoSurfaceContainer(web_contents_)); } // It's safe to use base::Unretained(this), because the callbacks will not // be called after running ReleaseExternalVideoSurface(). if (external_video_surface_container_) { // In case we're stealing the external surface from another player. ReleasePlayerOfExternalVideoSurfaceIfNeeded(player_id); external_video_surface_container_->RequestExternalVideoSurface( player_id, base::Bind(&BrowserMediaPlayerManager::AttachExternalVideoSurface, base::Unretained(this)), base::Bind(&BrowserMediaPlayerManager::DetachExternalVideoSurface, base::Unretained(this))); } } #endif // defined(VIDEO_HOLE) void BrowserMediaPlayerManager::OnEnterFullscreen(int player_id) { DCHECK_EQ(fullscreen_player_id_, kInvalidMediaPlayerId); #if defined(VIDEO_HOLE) // If this fullscreen player is started when another player // uses the external surface, release that other player. ReleasePlayerOfExternalVideoSurfaceIfNeeded(player_id); if (external_video_surface_container_) external_video_surface_container_->ReleaseExternalVideoSurface(player_id); #endif // defined(VIDEO_HOLE) if (video_view_.get()) { fullscreen_player_id_ = player_id; video_view_->OpenVideo(); return; } else if (!ContentVideoView::GetInstance()) { // In Android WebView, two ContentViewCores could both try to enter // fullscreen video, we just ignore the second one. video_view_.reset(new ContentVideoView(this)); base::android::ScopedJavaLocalRef<jobject> j_content_video_view = video_view_->GetJavaObject(base::android::AttachCurrentThread()); if (!j_content_video_view.is_null()) { fullscreen_player_id_ = player_id; return; } } // Force the second video to exit fullscreen. Send(new MediaPlayerMsg_DidExitFullscreen(RoutingID(), player_id)); video_view_.reset(); } void BrowserMediaPlayerManager::OnExitFullscreen(int player_id) { if (fullscreen_player_id_ == player_id) { MediaPlayerAndroid* player = GetPlayer(player_id); if (player) player->SetVideoSurface(gfx::ScopedJavaSurface()); video_view_->OnExitFullscreen(); } } void BrowserMediaPlayerManager::OnInitialize( const MediaPlayerHostMsg_Initialize_Params& media_player_params) { DCHECK(media_player_params.type != MEDIA_PLAYER_TYPE_MEDIA_SOURCE || media_player_params.demuxer_client_id > 0) << "Media source players must have positive demuxer client IDs: " << media_player_params.demuxer_client_id; RemovePlayer(media_player_params.player_id); RenderProcessHostImpl* host = static_cast<RenderProcessHostImpl*>( web_contents()->GetRenderProcessHost()); MediaPlayerAndroid* player = CreateMediaPlayer(media_player_params, host->GetBrowserContext()->IsOffTheRecord(), this, host->browser_demuxer_android().get()); if (!player) return; AddPlayer(player); } void BrowserMediaPlayerManager::OnStart(int player_id) { MediaPlayerAndroid* player = GetPlayer(player_id); if (!player) return; player->Start(); if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) { video_view_->OpenVideo(); fullscreen_player_is_released_ = false; } } void BrowserMediaPlayerManager::OnSeek( int player_id, const base::TimeDelta& time) { MediaPlayerAndroid* player = GetPlayer(player_id); if (player) player->SeekTo(time); } void BrowserMediaPlayerManager::OnPause( int player_id, bool is_media_related_action) { MediaPlayerAndroid* player = GetPlayer(player_id); if (player) player->Pause(is_media_related_action); } void BrowserMediaPlayerManager::OnSetVolume(int player_id, double volume) { MediaPlayerAndroid* player = GetPlayer(player_id); if (player) player->SetVolume(volume); } void BrowserMediaPlayerManager::OnSetPoster(int player_id, const GURL& url) { // To be overridden by subclasses. } void BrowserMediaPlayerManager::OnReleaseResources(int player_id) { MediaPlayerAndroid* player = GetPlayer(player_id); if (player) ReleasePlayer(player); if (player_id == fullscreen_player_id_) fullscreen_player_is_released_ = true; } void BrowserMediaPlayerManager::OnDestroyPlayer(int player_id) { RemovePlayer(player_id); if (fullscreen_player_id_ == player_id) fullscreen_player_id_ = kInvalidMediaPlayerId; } void BrowserMediaPlayerManager::OnRequestRemotePlayback(int /* player_id */) { // Does nothing if we don't have a remote player } void BrowserMediaPlayerManager::OnRequestRemotePlaybackControl( int /* player_id */) { // Does nothing if we don't have a remote player } void BrowserMediaPlayerManager::AddPlayer(MediaPlayerAndroid* player) { DCHECK(!GetPlayer(player->player_id())); players_.push_back(player); } void BrowserMediaPlayerManager::RemovePlayer(int player_id) { for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin(); it != players_.end(); ++it) { if ((*it)->player_id() == player_id) { ReleaseMediaResources(player_id); players_.erase(it); audio_monitor_->RemovePlayer(render_frame_host_, player_id); break; } } } scoped_ptr<media::MediaPlayerAndroid> BrowserMediaPlayerManager::SwapPlayer( int player_id, media::MediaPlayerAndroid* player) { media::MediaPlayerAndroid* previous_player = NULL; for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin(); it != players_.end(); ++it) { if ((*it)->player_id() == player_id) { previous_player = *it; ReleaseMediaResources(player_id); players_.weak_erase(it); players_.push_back(player); break; } } return scoped_ptr<media::MediaPlayerAndroid>(previous_player); } int BrowserMediaPlayerManager::RoutingID() { return render_frame_host_->GetRoutingID(); } bool BrowserMediaPlayerManager::Send(IPC::Message* msg) { return render_frame_host_->Send(msg); } void BrowserMediaPlayerManager::ReleaseFullscreenPlayer( MediaPlayerAndroid* player) { ReleasePlayer(player); } void BrowserMediaPlayerManager::OnMediaResourcesRequested(int player_id) { int num_active_player = 0; ScopedVector<MediaPlayerAndroid>::iterator it; for (it = players_.begin(); it != players_.end(); ++it) { if (!(*it)->IsPlayerReady()) continue; // The player is already active, ignore it. if ((*it)->player_id() == player_id) return; else num_active_player++; } // Number of active players are less than the threshold, do nothing. if (num_active_player < kMediaPlayerThreshold) return; for (it = players_.begin(); it != players_.end(); ++it) { if ((*it)->IsPlayerReady() && !(*it)->IsPlaying() && fullscreen_player_id_ != (*it)->player_id()) { ReleasePlayer(*it); Send(new MediaPlayerMsg_MediaPlayerReleased(RoutingID(), (*it)->player_id())); } } } void BrowserMediaPlayerManager::ReleaseMediaResources(int player_id) { #if defined(VIDEO_HOLE) if (external_video_surface_container_) external_video_surface_container_->ReleaseExternalVideoSurface(player_id); #endif // defined(VIDEO_HOLE) } void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { player->Release(); ReleaseMediaResources(player->player_id()); } } // namespace content
mou4e/zirconium
content/browser/media/android/browser_media_player_manager.cc
C++
bsd-3-clause
21,457
34.233169
80
0.719672
false
<?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @category Zend * @package Zend_Session * @subpackage UnitTests * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id:$ */ namespace ZendTest\Session; use Zend\Session\Storage\SessionStorage, Zend\Session\Storage\ArrayStorage; /** * @category Zend * @package Zend_Session * @subpackage UnitTests * @group Zend_Session * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class SessionStorageTest extends \PHPUnit_Framework_TestCase { public function setUp() { $_SESSION = array(); $this->storage = new SessionStorage; } public function tearDown() { $_SESSION = array(); } public function testSessionStorageInheritsFromArrayStorage() { $this->assertTrue($this->storage instanceof SessionStorage); $this->assertTrue($this->storage instanceof ArrayStorage); } public function testStorageWritesToSessionSuperglobal() { $this->storage['foo'] = 'bar'; $this->assertSame($_SESSION, $this->storage); unset($this->storage['foo']); $this->assertFalse(array_key_exists('foo', $_SESSION)); } public function testPassingArrayToConstructorOverwritesSessionSuperglobal() { $_SESSION['foo'] = 'bar'; $array = array('foo' => 'FOO'); $storage = new SessionStorage($array); $expected = array( 'foo' => 'FOO', '__ZF' => array( '_REQUEST_ACCESS_TIME' => $storage->getRequestAccessTime(), ), ); $this->assertSame($expected, (array) $_SESSION); } public function testModifyingSessionSuperglobalDirectlyUpdatesStorage() { $_SESSION['foo'] = 'bar'; $this->assertTrue(isset($this->storage['foo'])); } public function testDestructorSetsSessionToArray() { $this->storage->foo = 'bar'; $expected = array( '__ZF' => array( '_REQUEST_ACCESS_TIME' => $this->storage->getRequestAccessTime(), ), 'foo' => 'bar', ); $this->storage->__destruct(); $this->assertSame($expected, $_SESSION); } public function testModifyingOneSessionObjectModifiesTheOther() { $this->storage->foo = 'bar'; $storage = new SessionStorage(); $storage->bar = 'foo'; $this->assertEquals('foo', $this->storage->bar); } public function testMarkingOneSessionObjectImmutableShouldMarkOtherInstancesImmutable() { $this->storage->foo = 'bar'; $storage = new SessionStorage(); $this->assertEquals('bar', $storage['foo']); $this->storage->markImmutable(); $this->assertTrue($storage->isImmutable(), var_export($_SESSION, 1)); } }
Techlightenment/zf2
tests/Zend/Session/SessionStorageTest.php
PHP
bsd-3-clause
3,470
29.982143
91
0.616138
false
<?php /* Prototype : proto int strcspn(string str, string mask [, int start [, int len]]) * Description: Finds length of initial segment consisting entirely of characters not found in mask. If start or/and length is provided works like strcspn(substr($s,$start,$len),$bad_chars) * Source code: ext/standard/string.c * Alias to functions: none */ error_reporting(E_ALL & ~E_NOTICE); /* * Testing strspn() : with different unexpected values for str argument */ echo "*** Testing strcspn() : with unexpected values for str argument ***\n"; // Initialise function arguments not being substititued (if any) $mask = 'abons1234567890'; $start = 1; $len = 10; //get an unset variable $unset_var = 10; unset ($unset_var); // declaring class class sample { public function __toString() { return "object"; } } // creating a file resource $file_handle = fopen(__FILE__, 'r'); //array of values to iterate over $values = array( // int data 0, 1, 12345, -2345, // float data 10.5, -10.5, 10.1234567e10, 10.7654321E-10, .5, // array data array(), array(0), array(1), array(1, 2), array('color' => 'red', 'item' => 'pen'), // null data NULL, null, // boolean data true, false, TRUE, FALSE, // empty data "", '', // object data new sample, // undefined data $undefined_var, // unset data $unset_var, // resource $file_handle ); // loop through each element of the array for str foreach($values as $value) { echo "\n-- Iteration with str value as \"$value\"\n"; var_dump( strcspn($value,$mask) ); // with default args var_dump( strcspn($value,$mask,$start) ); // with default len value var_dump( strcspn($value,$mask,$start,$len) ); // with all args }; // closing the resource fclose($file_handle); echo "Done" ?>
JSchwehn/php
testdata/fuzzdir/corpus/ext_standard_tests_strings_strcspn_variation1.php
PHP
bsd-3-clause
1,993
18.732673
105
0.58003
false
#include <atomic> #include <chrono> #include <cstdlib> #include <cstring> #include <errno.h> #include <inttypes.h> #include <memory> #include <mutex> #if !defined(_WIN32) #include <pthread.h> #include <signal.h> #include <unistd.h> #endif #include <setjmp.h> #include <stdint.h> #include <stdio.h> #include <string.h> #include <thread> #include <time.h> #include <vector> #if defined(__APPLE__) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2) int pthread_threadid_np(pthread_t, __uint64_t *); #elif defined(__linux__) #include <sys/syscall.h> #elif defined(__NetBSD__) #include <lwp.h> #elif defined(_WIN32) #include <windows.h> #endif static const char *const RETVAL_PREFIX = "retval:"; static const char *const SLEEP_PREFIX = "sleep:"; static const char *const STDERR_PREFIX = "stderr:"; static const char *const SET_MESSAGE_PREFIX = "set-message:"; static const char *const PRINT_MESSAGE_COMMAND = "print-message:"; static const char *const GET_DATA_ADDRESS_PREFIX = "get-data-address-hex:"; static const char *const GET_STACK_ADDRESS_COMMAND = "get-stack-address-hex:"; static const char *const GET_HEAP_ADDRESS_COMMAND = "get-heap-address-hex:"; static const char *const GET_CODE_ADDRESS_PREFIX = "get-code-address-hex:"; static const char *const CALL_FUNCTION_PREFIX = "call-function:"; static const char *const THREAD_PREFIX = "thread:"; static const char *const THREAD_COMMAND_NEW = "new"; static const char *const THREAD_COMMAND_PRINT_IDS = "print-ids"; static const char *const THREAD_COMMAND_SEGFAULT = "segfault"; static const char *const PRINT_PID_COMMAND = "print-pid"; static bool g_print_thread_ids = false; static std::mutex g_print_mutex; static bool g_threads_do_segfault = false; static std::mutex g_jump_buffer_mutex; static jmp_buf g_jump_buffer; static bool g_is_segfaulting = false; static char g_message[256]; static volatile char g_c1 = '0'; static volatile char g_c2 = '1'; static void print_pid() { #if defined(_WIN32) fprintf(stderr, "PID: %d\n", ::GetCurrentProcessId()); #else fprintf(stderr, "PID: %d\n", getpid()); #endif } static void print_thread_id() { // Put in the right magic here for your platform to spit out the thread id (tid) // that debugserver/lldb-gdbserver would see as a TID. Otherwise, let the else // clause print out the unsupported text so that the unit test knows to skip // verifying thread ids. #if defined(__APPLE__) __uint64_t tid = 0; pthread_threadid_np(pthread_self(), &tid); printf("%" PRIx64, tid); #elif defined(__linux__) // This is a call to gettid() via syscall. printf("%" PRIx64, static_cast<uint64_t>(syscall(__NR_gettid))); #elif defined(__NetBSD__) // Technically lwpid_t is 32-bit signed integer printf("%" PRIx64, static_cast<uint64_t>(_lwp_self())); #elif defined(_WIN32) printf("%" PRIx64, static_cast<uint64_t>(::GetCurrentThreadId())); #else printf("{no-tid-support}"); #endif } static void signal_handler(int signo) { #if defined(_WIN32) // No signal support on Windows. #else const char *signal_name = nullptr; switch (signo) { case SIGUSR1: signal_name = "SIGUSR1"; break; case SIGSEGV: signal_name = "SIGSEGV"; break; default: signal_name = nullptr; } // Print notice that we received the signal on a given thread. { std::lock_guard<std::mutex> lock(g_print_mutex); if (signal_name) printf("received %s on thread id: ", signal_name); else printf("received signo %d (%s) on thread id: ", signo, strsignal(signo)); print_thread_id(); printf("\n"); } // Reset the signal handler if we're one of the expected signal handlers. switch (signo) { case SIGSEGV: if (g_is_segfaulting) { // Fix up the pointer we're writing to. This needs to happen if nothing // intercepts the SIGSEGV (i.e. if somebody runs this from the command // line). longjmp(g_jump_buffer, 1); } break; case SIGUSR1: if (g_is_segfaulting) { // Fix up the pointer we're writing to. This is used to test gdb remote // signal delivery. A SIGSEGV will be raised when the thread is created, // switched out for a SIGUSR1, and then this code still needs to fix the // seg fault. (i.e. if somebody runs this from the command line). longjmp(g_jump_buffer, 1); } break; } // Reset the signal handler. sig_t sig_result = signal(signo, signal_handler); if (sig_result == SIG_ERR) { fprintf(stderr, "failed to set signal handler: errno=%d\n", errno); exit(1); } #endif } static void swap_chars() { #if defined(__x86_64__) || defined(__i386__) asm volatile("movb %1, (%2)\n\t" "movb %0, (%3)\n\t" "movb %0, (%2)\n\t" "movb %1, (%3)\n\t" : : "i"('0'), "i"('1'), "r"(&g_c1), "r"(&g_c2) : "memory"); #elif defined(__aarch64__) asm volatile("strb %w1, [%2]\n\t" "strb %w0, [%3]\n\t" "strb %w0, [%2]\n\t" "strb %w1, [%3]\n\t" : : "r"('0'), "r"('1'), "r"(&g_c1), "r"(&g_c2) : "memory"); #elif defined(__arm__) asm volatile("strb %1, [%2]\n\t" "strb %0, [%3]\n\t" "strb %0, [%2]\n\t" "strb %1, [%3]\n\t" : : "r"('0'), "r"('1'), "r"(&g_c1), "r"(&g_c2) : "memory"); #else #warning This may generate unpredictible assembly and cause the single-stepping test to fail. #warning Please add appropriate assembly for your target. g_c1 = '1'; g_c2 = '0'; g_c1 = '0'; g_c2 = '1'; #endif } static void hello() { std::lock_guard<std::mutex> lock(g_print_mutex); printf("hello, world\n"); } static void *thread_func(void *arg) { static std::atomic<int> s_thread_index(1); const int this_thread_index = s_thread_index++; if (g_print_thread_ids) { std::lock_guard<std::mutex> lock(g_print_mutex); printf("thread %d id: ", this_thread_index); print_thread_id(); printf("\n"); } if (g_threads_do_segfault) { // Sleep for a number of seconds based on the thread index. // TODO add ability to send commands to test exe so we can // handle timing more precisely. This is clunky. All we're // trying to do is add predictability as to the timing of // signal generation by created threads. int sleep_seconds = 2 * (this_thread_index - 1); std::this_thread::sleep_for(std::chrono::seconds(sleep_seconds)); // Test creating a SEGV. { std::lock_guard<std::mutex> lock(g_jump_buffer_mutex); g_is_segfaulting = true; int *bad_p = nullptr; if (setjmp(g_jump_buffer) == 0) { // Force a seg fault signal on this thread. *bad_p = 0; } else { // Tell the system we're no longer seg faulting. // Used by the SIGUSR1 signal handler that we inject // in place of the SIGSEGV so it only tries to // recover from the SIGSEGV if this seg fault code // was in play. g_is_segfaulting = false; } } { std::lock_guard<std::mutex> lock(g_print_mutex); printf("thread "); print_thread_id(); printf(": past SIGSEGV\n"); } } int sleep_seconds_remaining = 60; std::this_thread::sleep_for(std::chrono::seconds(sleep_seconds_remaining)); return nullptr; } int main(int argc, char **argv) { lldb_enable_attach(); std::vector<std::thread> threads; std::unique_ptr<uint8_t[]> heap_array_up; int return_value = 0; #if !defined(_WIN32) // Set the signal handler. sig_t sig_result = signal(SIGALRM, signal_handler); if (sig_result == SIG_ERR) { fprintf(stderr, "failed to set SIGALRM signal handler: errno=%d\n", errno); exit(1); } sig_result = signal(SIGUSR1, signal_handler); if (sig_result == SIG_ERR) { fprintf(stderr, "failed to set SIGUSR1 handler: errno=%d\n", errno); exit(1); } sig_result = signal(SIGSEGV, signal_handler); if (sig_result == SIG_ERR) { fprintf(stderr, "failed to set SIGUSR1 handler: errno=%d\n", errno); exit(1); } #endif // Process command line args. for (int i = 1; i < argc; ++i) { if (std::strstr(argv[i], STDERR_PREFIX)) { // Treat remainder as text to go to stderr. fprintf(stderr, "%s\n", (argv[i] + strlen(STDERR_PREFIX))); } else if (std::strstr(argv[i], RETVAL_PREFIX)) { // Treat as the return value for the program. return_value = std::atoi(argv[i] + strlen(RETVAL_PREFIX)); } else if (std::strstr(argv[i], SLEEP_PREFIX)) { // Treat as the amount of time to have this process sleep (in seconds). int sleep_seconds_remaining = std::atoi(argv[i] + strlen(SLEEP_PREFIX)); // Loop around, sleeping until all sleep time is used up. Note that // signals will cause sleep to end early with the number of seconds // remaining. std::this_thread::sleep_for( std::chrono::seconds(sleep_seconds_remaining)); } else if (std::strstr(argv[i], SET_MESSAGE_PREFIX)) { // Copy the contents after "set-message:" to the g_message buffer. // Used for reading inferior memory and verifying contents match // expectations. strncpy(g_message, argv[i] + strlen(SET_MESSAGE_PREFIX), sizeof(g_message)); // Ensure we're null terminated. g_message[sizeof(g_message) - 1] = '\0'; } else if (std::strstr(argv[i], PRINT_MESSAGE_COMMAND)) { std::lock_guard<std::mutex> lock(g_print_mutex); printf("message: %s\n", g_message); } else if (std::strstr(argv[i], GET_DATA_ADDRESS_PREFIX)) { volatile void *data_p = nullptr; if (std::strstr(argv[i] + strlen(GET_DATA_ADDRESS_PREFIX), "g_message")) data_p = &g_message[0]; else if (std::strstr(argv[i] + strlen(GET_DATA_ADDRESS_PREFIX), "g_c1")) data_p = &g_c1; else if (std::strstr(argv[i] + strlen(GET_DATA_ADDRESS_PREFIX), "g_c2")) data_p = &g_c2; std::lock_guard<std::mutex> lock(g_print_mutex); printf("data address: %p\n", data_p); } else if (std::strstr(argv[i], GET_HEAP_ADDRESS_COMMAND)) { // Create a byte array if not already present. if (!heap_array_up) heap_array_up.reset(new uint8_t[32]); std::lock_guard<std::mutex> lock(g_print_mutex); printf("heap address: %p\n", heap_array_up.get()); } else if (std::strstr(argv[i], GET_STACK_ADDRESS_COMMAND)) { std::lock_guard<std::mutex> lock(g_print_mutex); printf("stack address: %p\n", &return_value); } else if (std::strstr(argv[i], GET_CODE_ADDRESS_PREFIX)) { void (*func_p)() = nullptr; if (std::strstr(argv[i] + strlen(GET_CODE_ADDRESS_PREFIX), "hello")) func_p = hello; else if (std::strstr(argv[i] + strlen(GET_CODE_ADDRESS_PREFIX), "swap_chars")) func_p = swap_chars; std::lock_guard<std::mutex> lock(g_print_mutex); printf("code address: %p\n", func_p); } else if (std::strstr(argv[i], CALL_FUNCTION_PREFIX)) { void (*func_p)() = nullptr; // Default to providing the address of main. if (std::strcmp(argv[i] + strlen(CALL_FUNCTION_PREFIX), "hello") == 0) func_p = hello; else if (std::strcmp(argv[i] + strlen(CALL_FUNCTION_PREFIX), "swap_chars") == 0) func_p = swap_chars; else { std::lock_guard<std::mutex> lock(g_print_mutex); printf("unknown function: %s\n", argv[i] + strlen(CALL_FUNCTION_PREFIX)); } if (func_p) func_p(); } else if (std::strstr(argv[i], THREAD_PREFIX)) { // Check if we're creating a new thread. if (std::strstr(argv[i] + strlen(THREAD_PREFIX), THREAD_COMMAND_NEW)) { threads.push_back(std::thread(thread_func, nullptr)); } else if (std::strstr(argv[i] + strlen(THREAD_PREFIX), THREAD_COMMAND_PRINT_IDS)) { // Turn on thread id announcing. g_print_thread_ids = true; // And announce us. { std::lock_guard<std::mutex> lock(g_print_mutex); printf("thread 0 id: "); print_thread_id(); printf("\n"); } } else if (std::strstr(argv[i] + strlen(THREAD_PREFIX), THREAD_COMMAND_SEGFAULT)) { g_threads_do_segfault = true; } else { // At this point we don't do anything else with threads. // Later use thread index and send command to thread. } } else if (std::strstr(argv[i], PRINT_PID_COMMAND)) { print_pid(); } else { // Treat the argument as text for stdout. printf("%s\n", argv[i]); } } // If we launched any threads, join them for (std::vector<std::thread>::iterator it = threads.begin(); it != threads.end(); ++it) it->join(); return return_value; }
endlessm/chromium-browser
third_party/llvm/lldb/test/API/tools/lldb-server/main.cpp
C++
bsd-3-clause
12,886
32.041026
93
0.605463
false
//===- mlir-tblgen.cpp - Top-Level TableGen implementation for MLIR -------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file contains the main function for MLIR's TableGen. // //===----------------------------------------------------------------------===// #include "mlir/TableGen/GenInfo.h" #include "mlir/TableGen/GenNameParser.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FormatVariadic.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Signals.h" #include "llvm/TableGen/Error.h" #include "llvm/TableGen/Main.h" #include "llvm/TableGen/Record.h" #include "llvm/TableGen/TableGenBackend.h" using namespace llvm; using namespace mlir; static llvm::ManagedStatic<std::vector<GenInfo>> generatorRegistry; mlir::GenRegistration::GenRegistration(StringRef arg, StringRef description, GenFunction function) { generatorRegistry->emplace_back(arg, description, function); } GenNameParser::GenNameParser(llvm::cl::Option &opt) : llvm::cl::parser<const GenInfo *>(opt) { for (const auto &kv : *generatorRegistry) { addLiteralOption(kv.getGenArgument(), &kv, kv.getGenDescription()); } } void GenNameParser::printOptionInfo(const llvm::cl::Option &O, size_t GlobalWidth) const { GenNameParser *TP = const_cast<GenNameParser *>(this); llvm::array_pod_sort(TP->Values.begin(), TP->Values.end(), [](const GenNameParser::OptionInfo *VT1, const GenNameParser::OptionInfo *VT2) { return VT1->Name.compare(VT2->Name); }); using llvm::cl::parser; parser<const GenInfo *>::printOptionInfo(O, GlobalWidth); } // Generator that prints records. GenRegistration printRecords("print-records", "Print all records to stdout", [](const RecordKeeper &records, raw_ostream &os) { os << records; return false; }); // Generator to invoke. const mlir::GenInfo *generator; // TableGenMain requires a function pointer so this function is passed in which // simply wraps the call to the generator. static bool MlirTableGenMain(raw_ostream &os, RecordKeeper &records) { if (!generator) { os << records; return false; } return generator->invoke(records, os); } int main(int argc, char **argv) { llvm::InitLLVM y(argc, argv); llvm::cl::opt<const mlir::GenInfo *, false, mlir::GenNameParser> generator( "", llvm::cl::desc("Generator to run")); cl::ParseCommandLineOptions(argc, argv); ::generator = generator.getValue(); return TableGenMain(argv[0], &MlirTableGenMain); }
endlessm/chromium-browser
third_party/llvm/mlir/tools/mlir-tblgen/mlir-tblgen.cpp
C++
bsd-3-clause
3,055
35.807229
80
0.621931
false
# # Base docker image for Ubuntu that sets up # FROM ubuntu:trusty MAINTAINER gavinr@aweber.com # Let aptitude know it's a non-interactive install ENV DEBIAN_FRONTEND noninteractive ENV HOME /root # Hack for initctl # See: https://github.com/dotcloud/docker/issues/1024 RUN \ rm /sbin/initctl && \ ln -sf /bin/true /sbin/initctl && \ dpkg-divert --local --rename --add /sbin/initctl # Don't let upstart start installed services ADD usr/sbin/policy-rc.d /usr/sbin/policy-rc.d RUN /bin/chmod 755 /usr/sbin/policy-rc.d # Remove auto-installed cron jobs RUN rm /etc/cron.daily/apt \ /etc/cron.daily/dpkg \ /etc/cron.daily/passwd \ /etc/cron.daily/upstart \ /etc/cron.weekly/fstrim # Add RabbitMQ and Erlang repos RUN \ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv F7B8CEA6056E8E56 && \ echo "deb http://www.rabbitmq.com/debian/ testing main" > /etc/apt/sources.list.d/rabbitmq.list && \ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv D208507CA14F4FCA && \ echo "deb http://packages.erlang-solutions.com/debian precise contrib" > /etc/apt/sources.list.d/erlang-solutions.list # Update the repository indexes and install Erlang and RabbitMQ RUN apt-get -qq update && apt-get install -y -qq curl build-essential git rabbitmq-server supervisor unzip && apt-get clean # Install consul RUN \ curl -o /tmp/consul.zip -L https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip && \ unzip /tmp/consul.zip -d /tmp/ && \ chmod +x /tmp/consul && \ mv /tmp/consul /usr/local/bin/consul && \ rm /tmp/consul.zip && \ mkdir -p /etc/consul.d # Configuration files ADD etc/security/limits.conf /etc/security/limits.conf ADD etc/sysctl.conf /etc/sysctl.conf ADD etc/consul.d/consul.json /etc/consul.d/consul.json ADD etc/supervisord.conf /etc/ ADD etc/supervisor.d/consul.conf /etc/supervisor.d/ ADD etc/supervisor.d/rabbitmq.conf /etc/supervisor.d/ ADD etc/rabbitmq/rabbitmq.config /etc/rabbitmq/ ADD var/lib/rabbitmq/.erlang.cookie /var/lib/rabbitmq/ ADD var/lib/rabbitmq/.erlang.cookie /root/ ADD autocluster-0.0.0.ez /usr/lib/rabbitmq/lib/rabbitmq_server-3.5.4/plugins/ RUN \ chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie && \ chmod 0600 /var/lib/rabbitmq/.erlang.cookie && \ chmod 0600 /root/.erlang.cookie && \ rabbitmq-plugins enable --offline rabbitmq_management autocluster # For consul ENV GOMAXPROCS 10 # Export the volumes for configuration and log file examination VOLUME ["/etc/rabbitmq", "/var/log/rabbitmq", "/var/log/supervisor"] # Set the HOME env variable to the right location for RabbitMQ to run ENV HOME /var/lib/rabbitmq EXPOSE 5672 15672 25672 ENTRYPOINT ["/usr/bin/supervisord", "-n"]
BAM-X/rabbitmq-autocluster
docker/Dockerfile
Dockerfile
bsd-3-clause
2,712
33.329114
123
0.728982
false
/* * Copyright (c) 2011-2014, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include "Subsystem.h" class CSkeletonSubsystem : public CSubsystem { public: CSkeletonSubsystem(const string& strName); };
pafonso/parameter-framework
skeleton-subsystem/SkeletonSubsystem.h
C
bsd-3-clause
1,721
42.025
83
0.772225
false
{% extends "base.html" %} {% set c = collection %} {% block title %}{{ page_title(_('{0} :: Collections')|fe(c.name)) }}{% endblock %} {% block bodyclass %}inverse{% endblock %} {% block rss_feed %} <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ url('collections.detail.rss', c.author_username, c.slug) }}"> {% endblock %} {% block content %} <hgroup> <h2 class="collection" data-collectionid="{{ collection.id }}"> <img src="{{ c.icon_url }}" class="icon" alt=""> <span>{{ c.name }}</span> {% if not c.listed %} <span class="private">{{ _('private') }}</span> {% endif %} </h2> {% if collection.author %} <h4 class='author'> {% trans users=users_list([collection.author]) %} by {{ users }} {% endtrans %} </h4> {% endif %} </hgroup> <div class="primary"> <div class="featured"> <div class="featured-inner object-lead"> <div class="meta"> <ul> {% if c.listed %} <li>{{ barometer(collection) }}</li> <li class="followers"> {% trans p=c.subscribers, num=c.subscribers|numberfmt %} <span>{{ num }}</span> follower {% pluralize %} <span>{{ num }}</span> followers {% endtrans %} </li> {% endif %} <li>{{ _('Updated {0}')|f(c.modified|datetime) }}</li> </ul> </div> <div class='object-details'> <h3>{{ _('About this Collection') }}</h3> {% if c.type == amo.COLLECTION_FAVORITES %} {{ favorites_description() }} {% elif c.description %} <p>{{ c.description|no_links }}</p> {% elif c.type == amo.COLLECTION_MOBILE %} <p>{{ _('Add-ons synced to my Mobile Firefox') }}</p> {% endif %} {% if c.type == amo.COLLECTION_FAVORITES and c.owned_by(user) %} <ul id="collection-favorites-opts"> <li> <form method="post" action="{{ url('collections.edit_privacy', c.author_username, c.slug) }}"> {{ csrf() }} <button type="submit"> {% if c.listed %} {{ _('Make this Collection Private') }} {% else %} {{ _('Make this Collection Public') }} {% endif %} </button> </form> </li> <li> <a href="{{ url('pages.faq') }}#collections"> {{ _('Learn about collections') }}</a> </li> </ul> {% endif %} {{ collection_widgets(c) }} {% if request.check_ownership(c) %} <p class="highlight collection-admin"> {{ _('More Options:') }} <a class="edit" href="{{ c.edit_url() }}">{{ _('Edit Collection') }}</a> {% if request.check_ownership(c, require_owner=True) %} <a class="delete" href="{{ c.delete_url() }}">{{ _('Delete Collection') }}</a> {% endif %} </p> {% endif %} </div> </div> </div> {% cache addons.object_list %} {% if c.all_personas %} <div class='collections-personas'> <h3> {% trans num=addons.paginator.count %} {{ num }} Theme in this Collection {% pluralize %} {{ num }} Themes in this Collection {% endtrans %} </h3> {{ persona_grid(addons.object_list) }} </div> {% else %} <div class="separated-listing"> <h3> {% trans num=addons.paginator.count %} {{ num }} Add-on in this Collection {% pluralize %} {{ num }} Add-ons in this Collection {% endtrans %} </h3> <form class="item-sort go"> <label for="sortby">{{ _('Sort by:') }}</label> <select id="sortby" name="{{ filter.key }}"> {% for value, title in filter.opts %} <option value="{{ value }}" {{ value|ifeq(filter.field, 'selected') }}> {{ title }}</option> {% endfor %} </select> <button type="submit">{{ _('Go') }}</button> </form> {{ addon_listing_items(addons.object_list, notes=notes.next(), src="collection") }} </div> {% endif %} {{ addons|paginator }} {% endcache %} </div> {# primary #} <div class="secondary"> <div class="highlight"> <h3>{{ _('What are Collections?') }}</h3> <p>{% trans %} Collections are groups of related add-ons that anyone can create and share. {% endtrans %}</p> <a class="more-info" href="{{ url('collections.list') }}"> {{ _('Explore Collections') }}</a> </div> {% if tags %} <div> <h3>{{ _('Common Tags') }}</h3> <ul class="addon-tags"> {% for tag in tags %} <li class="usertag"> <a class="tagitem" href="{{ tag.get_url_path() }}"> {{ tag.tag_text }}</a> </li> {% endfor %} </ul> </div> {% endif %} {% if author_collections %} <div> <h3>{{ _('More by this User') }}</h3> <ul class="addon-collections"> {% for ac in author_collections %} <li><a class="collectionitem" href="{{ ac.get_url_path() }}"> {{ ac.name }}</a></li> {% endfor %} </ul> <a class="more-info n" href="{{ url('collections.user', c.author.username) }}"> {{ _('See all collections by this user') }}</a> </div> {% endif %} </div> {# secondary #} {% endblock %} {% macro favorites_description() %} {% if c.owned_by(user) %} {% if c.listed %} <p>{% trans %} Add-ons that you mark as favorites using the <b>Add to Favorites</b> feature appear below. This collection is currently <b>public</b>, which means everyone can see it. If you would like to hide it from public view, click the button below to make it private. {% endtrans %}</p> {% else %} <p>{% trans %} Add-ons that you mark as favorites using the <b>Add to Favorites</b> feature appear below. This collection is currently <b>private</b>, which means only you can see it. If you would like everyone to be able to see your favorites, click the button below to make it public. {% endtrans %}</p> {% endif %} {% else %} {# owned-by #} {% if c.description %} <p>{{ c.description|no_links }}</p> {% else %} <p>{{ _('My favorite add-ons') }}</p> {% endif %} {% endif %} {% endmacro %}
mstriemer/olympia
src/olympia/bandwagon/templates/bandwagon/collection_detail.html
HTML
bsd-3-clause
6,293
31.606218
106
0.507071
false
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/webui/profiler_ui.h" #include <string> // When testing the javacript code, it is cumbersome to have to keep // re-building the resouces package and reloading the browser. To solve // this, enable the following flag to read the webapp's source files // directly off disk, so all you have to do is refresh the page to // test the modifications. // #define USE_SOURCE_FILES_DIRECTLY #include "base/bind.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string_util.h" #include "base/tracked_objects.h" #include "base/values.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/task_profiler/task_profiler_data_serializer.h" #include "chrome/common/url_constants.h" #include "components/metrics/profiler/tracking_synchronizer.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #ifdef USE_SOURCE_FILES_DIRECTLY #include "base/base_paths.h" #include "base/files/file_util.h" #include "base/memory/ref_counted_memory.h" #include "base/path_service.h" #endif // USE_SOURCE_FILES_DIRECTLY using content::BrowserThread; using content::WebContents; using content::WebUIMessageHandler; using metrics::TrackingSynchronizer; namespace { #ifdef USE_SOURCE_FILES_DIRECTLY class ProfilerWebUIDataSource : public content::URLDataSource { public: ProfilerWebUIDataSource() { } protected: // content::URLDataSource implementation. virtual std::string GetSource() override { return chrome::kChromeUIProfilerHost; } virtual std::string GetMimeType(const std::string& path) const override { if (EndsWith(path, ".js", false)) return "application/javascript"; return "text/html"; } virtual void StartDataRequest( const std::string& path, bool is_incognito, const content::URLDataSource::GotDataCallback& callback) override { base::FilePath base_path; PathService::Get(base::DIR_SOURCE_ROOT, &base_path); base_path = base_path.AppendASCII("chrome"); base_path = base_path.AppendASCII("browser"); base_path = base_path.AppendASCII("resources"); base_path = base_path.AppendASCII("profiler"); // If no resource was specified, default to profiler.html. std::string filename = path.empty() ? "profiler.html" : path; base::FilePath file_path; file_path = base_path.AppendASCII(filename); // Read the file synchronously and send it as the response. base::ThreadRestrictions::ScopedAllowIO allow; std::string file_contents; if (!base::ReadFileToString(file_path, &file_contents)) LOG(ERROR) << "Couldn't read file: " << file_path.value(); scoped_refptr<base::RefCountedString> response = new base::RefCountedString(); response->data() = file_contents; callback.Run(response); } private: DISALLOW_COPY_AND_ASSIGN(ProfilerWebUIDataSource); }; #else // USE_SOURCE_FILES_DIRECTLY content::WebUIDataSource* CreateProfilerHTMLSource() { content::WebUIDataSource* source = content::WebUIDataSource::Create(chrome::kChromeUIProfilerHost); source->SetJsonPath("strings.js"); source->AddResourcePath("profiler.js", IDR_PROFILER_JS); source->SetDefaultResource(IDR_PROFILER_HTML); return source; } #endif // This class receives javascript messages from the renderer. // Note that the WebUI infrastructure runs on the UI thread, therefore all of // this class's methods are expected to run on the UI thread. class ProfilerMessageHandler : public WebUIMessageHandler { public: ProfilerMessageHandler() {} // WebUIMessageHandler implementation. void RegisterMessages() override; // Messages. void OnGetData(const base::ListValue* list); private: DISALLOW_COPY_AND_ASSIGN(ProfilerMessageHandler); }; void ProfilerMessageHandler::RegisterMessages() { DCHECK_CURRENTLY_ON(BrowserThread::UI); web_ui()->RegisterMessageCallback("getData", base::Bind(&ProfilerMessageHandler::OnGetData, base::Unretained(this))); } void ProfilerMessageHandler::OnGetData(const base::ListValue* list) { ProfilerUI* profiler_ui = static_cast<ProfilerUI*>(web_ui()->GetController()); profiler_ui->GetData(); } } // namespace ProfilerUI::ProfilerUI(content::WebUI* web_ui) : WebUIController(web_ui), weak_ptr_factory_(this) { web_ui->AddMessageHandler(new ProfilerMessageHandler()); // Set up the chrome://profiler/ source. Profile* profile = Profile::FromWebUI(web_ui); #if defined(USE_SOURCE_FILES_DIRECTLY) content::URLDataSource::Add(profile, new ProfilerWebUIDataSource); #else content::WebUIDataSource::Add(profile, CreateProfilerHTMLSource()); #endif } ProfilerUI::~ProfilerUI() { } void ProfilerUI::GetData() { TrackingSynchronizer::FetchProfilerDataAsynchronously( weak_ptr_factory_.GetWeakPtr()); } void ProfilerUI::ReceivedProfilerData( const tracked_objects::ProcessDataPhaseSnapshot& process_data_phase, base::ProcessId process_id, content::ProcessType process_type, int profiling_phase, base::TimeDelta phase_start, base::TimeDelta phase_finish, const metrics::ProfilerEvents& past_events) { // Serialize the data to JSON. base::DictionaryValue json_data; task_profiler::TaskProfilerDataSerializer::ToValue( process_data_phase, process_id, process_type, &json_data); // Send the data to the renderer. web_ui()->CallJavascriptFunction("g_browserBridge.receivedData", json_data); }
mou4e/zirconium
chrome/browser/ui/webui/profiler_ui.cc
C++
bsd-3-clause
5,841
31.45
80
0.739086
false
""" This urlconf exists because Django expects ROOT_URLCONF to exist. URLs should be added within the test folders, and use TestCase.urls to set them. This helps the tests remain isolated. """ urlpatterns = []
ipsosante/django-audit-log
audit_log/tests/urls.py
Python
bsd-3-clause
212
22.666667
75
0.759434
false
/**************************************************************************\ * Copyright (c) Kongsberg Oil & Gas Technologies AS * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \**************************************************************************/ /*! \class dimeUCSTable dime/tables/UCSTable.h \brief The dimeUCSTable class reads and writes UCS tables. */ #include <dime/tables/UCSTable.h> #include <dime/Input.h> #include <dime/Output.h> #include <dime/util/MemHandler.h> #include <dime/Model.h> #include <dime/records/Record.h> #include <string.h> static const char tableName[] = "UCS"; /*! Constructor. */ dimeUCSTable::dimeUCSTable() : origin(0,0,0), xaxis(1,0,0), yaxis(0,1,0) { } //! dimeTableEntry * dimeUCSTable::copy(dimeModel * const model) const { dimeMemHandler *memh = model->getMemHandler(); dimeUCSTable *u = new(memh) dimeUCSTable; u->xaxis = this->xaxis; u->yaxis = this->yaxis; u->origin = this->origin; if (!this->copyRecords(u, model)) { // check if allocated on heap. if (!memh) delete u; u = NULL; } return u; } //! const char * dimeUCSTable::getTableName() const { return tableName; } //! bool dimeUCSTable::write(dimeOutput * const file) { bool ret = true; file->writeGroupCode(0); file->writeString(tableName); file->writeGroupCode(10); file->writeDouble(this->origin[0]); file->writeGroupCode(20); file->writeDouble(this->origin[1]); file->writeGroupCode(30); file->writeDouble(this->origin[2]); file->writeGroupCode(11); file->writeDouble(this->xaxis[0]); file->writeGroupCode(21); file->writeDouble(this->xaxis[1]); file->writeGroupCode(31); file->writeDouble(this->xaxis[2]); file->writeGroupCode(12); file->writeDouble(this->yaxis[0]); file->writeGroupCode(22); file->writeDouble(this->yaxis[1]); file->writeGroupCode(32); file->writeDouble(this->yaxis[2]); ret = dimeTableEntry::write(file); return ret; } //! int dimeUCSTable::typeId() const { return dimeBase::dimeUCSTableType; } //! bool dimeUCSTable::handleRecord(const int groupcode, const dimeParam &param, dimeMemHandler * const memhandler) { switch(groupcode) { case 10: case 20: case 30: this->origin[(groupcode/10)-1] = param.double_data; return true; case 11: case 21: case 31: this->xaxis[(groupcode/10)-1] = param.double_data; return true; case 12: case 22: case 32: this->yaxis[(groupcode/10)-1] = param.double_data; return true; } return dimeTableEntry::handleRecord(groupcode, param, memhandler); } //! int dimeUCSTable::countRecords() const { int cnt = 1 + 3 + 3 + 3; // header + origin + xaxis + yaxis return cnt + dimeTableEntry::countRecords(); }
weiznich/dime
src/tables/UCSTable.cpp
C++
bsd-3-clause
4,207
25.459119
76
0.684098
false
//===--- OverloadedUnaryAndCheck.h - clang-tidy -----------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OVERLOADEDUNARYANDCHECK_H #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OVERLOADEDUNARYANDCHECK_H #include "../ClangTidyCheck.h" namespace clang { namespace tidy { namespace google { namespace runtime { /// Finds overloads of unary `operator &`. /// /// https://google.github.io/styleguide/cppguide.html#Operator_Overloading /// /// Corresponding cpplint.py check name: 'runtime/operator'. class OverloadedUnaryAndCheck : public ClangTidyCheck { public: OverloadedUnaryAndCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context) {} bool isLanguageVersionSupported(const LangOptions &LangOpts) const override { return LangOpts.CPlusPlus; } void registerMatchers(ast_matchers::MatchFinder *Finder) override; void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; } // namespace runtime } // namespace google } // namespace tidy } // namespace clang #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OVERLOADEDUNARYANDCHECK_H
endlessm/chromium-browser
third_party/llvm/clang-tools-extra/clang-tidy/google/OverloadedUnaryAndCheck.h
C
bsd-3-clause
1,418
34.45
80
0.703103
false
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ // @see http://docs.openstack.org/api/openstack-identity-service/2.0/content/DELETE_deleteUser_v2.0_users__userId__Admin_API_Service_Developer_Operations-d1e1356.html return array( 'url' => '/v2.0/users/' . urlencode($params[0]), 'header' => array( 'Content-Type' => 'application/json' ), 'method' => 'DELETE', 'response' => array( 'valid_codes' => array('204') ) );
brighten01/zf2-openstack-api
vendor/ZF2/library/ZendService/OpenStack/api/identity/deleteUser.php
PHP
bsd-3-clause
717
34.85
166
0.65272
false
{% load i18n %} <p> {% blocktrans %} Hello, {% endblocktrans %} </p> <p> {% blocktrans %} A transfer of project space has been initiated by {{ from_username }} to {{ to_username }}. If you believe this is an error, please contact Dimagi immediately at support@dimagi.com and follow <a href="{{ settings_url }}">this link</a> to deactivate the transfer: {{ settings_url }} {% endblocktrans %} </p> <p> {% blocktrans %} Thanks for using our site! {% endblocktrans %} </p> <p>-The CommCareHQ team</p>
puttarajubr/commcare-hq
corehq/apps/domain/templates/domain/email/domain_transfer_from_request.html
HTML
bsd-3-clause
538
25.9
286
0.620818
false
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>libpqxx: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">libpqxx &#160;<span id="projectnumber">4.0.1</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1.2 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('a00061.html','');}); </script> <div id="doc-content"> <div class="header"> <div class="headertitle"> <div class="title">pqxx::not_null_violation Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="a00061.html">pqxx::not_null_violation</a>, including all inherited members.</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="a00038.html#a0e7e8831fed026375c499ee03f501f50">failure</a>(const std::string &amp;)</td><td class="entry"><a class="el" href="a00038.html">pqxx::failure</a></td><td class="entry"><span class="mlabel">explicit</span></td></tr> <tr><td class="entry"><a class="el" href="a00048.html#a9fa871a08c23b2722a42fa545cecd2ab">integrity_constraint_violation</a>(const std::string &amp;err)</td><td class="entry"><a class="el" href="a00048.html">pqxx::integrity_constraint_violation</a></td><td class="entry"><span class="mlabel">explicit</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="a00048.html#a505ae8d71add1a4c19e69f5cf96cea9d">integrity_constraint_violation</a>(const std::string &amp;err, const std::string &amp;Q)</td><td class="entry"><a class="el" href="a00048.html">pqxx::integrity_constraint_violation</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="a00061.html#a43eceacf51e6bb47d6bb90517a574c2a">not_null_violation</a>(const std::string &amp;err)</td><td class="entry"><a class="el" href="a00061.html">pqxx::not_null_violation</a></td><td class="entry"><span class="mlabel">explicit</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="a00061.html#a5372bb4e822109abf338516fa6b0733e">not_null_violation</a>(const std::string &amp;err, const std::string &amp;Q)</td><td class="entry"><a class="el" href="a00061.html">pqxx::not_null_violation</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="a00086.html#ae9e8799eed6ff45bbb44e481821cbfa2">query</a>() const </td><td class="entry"><a class="el" href="a00086.html">pqxx::sql_error</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="a00086.html#ad2f7fa865d0410824b39ac27dab99d92">sql_error</a>()</td><td class="entry"><a class="el" href="a00086.html">pqxx::sql_error</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="a00086.html#affcbefe5ad9a1cae7073d170f85352d0">sql_error</a>(const std::string &amp;)</td><td class="entry"><a class="el" href="a00086.html">pqxx::sql_error</a></td><td class="entry"><span class="mlabel">explicit</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="a00086.html#af3e94ddc4c6428d5a1d7763936a5b781">sql_error</a>(const std::string &amp;, const std::string &amp;Q)</td><td class="entry"><a class="el" href="a00086.html">pqxx::sql_error</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="a00074.html#a9386d73e8176de81de9b1fe38afa6952">~pqxx_exception</a>()=0</td><td class="entry"><a class="el" href="a00074.html">pqxx::pqxx_exception</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="a00086.html#a7db2ae4924fda2aec297cfa1c8363ec7">~sql_error</a>()</td><td class="entry"><a class="el" href="a00086.html">pqxx::sql_error</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr> </table></div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Sun Jan 20 2013 13:09:11 for libpqxx by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.2 </li> </ul> </div> </body> </html>
fineshift/pqxx
doc/html/Reference/a00241.html
HTML
bsd-3-clause
6,260
63.536082
321
0.663898
false
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @package Zend_OAuth */ namespace Oauth\Service; use ZendOAuth\Consumer as ZendConsumer; use ZendOAuth\Exception; /** * @category Zend * @package Zend_OAuth */ class Consumer extends ZendConsumer { public function getRequestToken( array $customServiceParameters = null, $httpMethod = null, \ZendOAuth\Http\RequestToken $request = null ) { if ($request === null) { $request = new \Oauth\Service\Http\RequestToken($this, $customServiceParameters); } elseif($customServiceParameters !== null) { $request->setParameters($customServiceParameters); } if ($httpMethod !== null) { $request->setMethod($httpMethod); } else { $request->setMethod($this->getRequestMethod()); } $this->_requestToken = $request->execute(); return $this->_requestToken; } public function getRedirectUrl( array $customServiceParameters = null, \ZendOAuth\Token\Request $token = null, \ZendOAuth\Http\UserAuthorization $redirect = null ) { $requestToken = $this->getRequestToken(); return $this->getAuthorizeUrl() . '?' . http_build_query($requestToken->toArray()); } public function getAccessToken( $queryData, \ZendOAuth\Token\Request $token, $httpMethod = null, \ZendOAuth\Http\AccessToken $request = null ) { $authorizedToken = new Token\AuthorizedRequest($queryData); if (!$authorizedToken->isValid()) { throw new Exception\InvalidArgumentException( 'Response from Service Provider is not a valid authorized request token'); } if ($request === null) { $request = new Http\AccessToken($this); } if($authorizedToken->getParam('code')){ $request->setParameters(array( 'code' => $authorizedToken->getParam('code') )); } if ($httpMethod !== null) { $request->setMethod($httpMethod); } else { $request->setMethod($this->getRequestMethod()); } $this->_requestToken = $token; $this->_accessToken = $request->execute(); return $this->_accessToken; } public function __construct($options = null) { $this->_config = new Config\Oauth2Config; if ($options !== null) { if ($options instanceof Traversable) { $options = ArrayUtils::iteratorToArray($options); } $this->_config->setOptions($options); } } }
Brother-Simon/eva-engine
module/Oauth/src/Oauth/Service/Consumer.php
PHP
bsd-3-clause
2,931
30.180851
93
0.58956
false
/**************************************************************************************************** Custom CSS for Dijit Forms This CSS file can be used as a base for customizing the size of Dijit form elements. The settings here use certain sizes, but the real effort is in cross-browser targeting specific widgets and elements within them. This should provide you with a base that can be modfied and built upon to make it easier to achieve perfect layouts. Author: Mike Wilcox, SitePen Inc. ***************************************************************************************************** ***************************************************************************************************** *****************************************************************************************************/ /**************************************************************************************************** Large Form Boxes *****************************************************************************************************/ .tundra .myField.dijitTextBox, /* TextBox, ValidationTextBox, Date Box */ .tundra .myField.dijitSpinner, /* Number Spinner */ .myField.dijitTextBox.dijitTimeTextBox, /* Time Text Box */ .tundra .myField.dijitTextArea /* TextArea */ { width:311px !important; margin:5px 0 0 0 !important; } .dj_ie6 .tundra .myField.dijitTextArea { width:315px !important; /* TextArea is a different size in IE6 */ } .tundra .myField.dijitSpinner { width:320px !important; /* Number Spinner's different structure */ } /* forces the padding in, reducing width*/ .myField.dijitTextBox, .myField.dijitTextBox.dijitTimeTextBox, .tundra .dijitTextArea.myField { padding:5px; /* General Text Padding */ } .dijitSpinner{ padding:0px !important; /* Prevent outter padding (in IE6) */ } .myField .dijitSpinnerButtonContainer { line-height:23px; /* Making Spinner buttons taller */ } .dj_ie .myField .dijitSpinnerButtonContainer { height:25px; /* A little taller in IE6 */ } .dijitInputLayoutContainer .dijitInputField input{ padding:5px 0px 0px 5px; /* Centering text in Spinners */ } .dj_webkit .dijitInputLayoutContainer .dijitInputField input{ padding:10px 0px 0px 5px; /* Webkit has a funny padding collapse - 2x*/ } /***************************************************************************************************** Small Form Boxes ******************************************************************************************************/ .tundra .myField.third, .tundra .myField.third { width:100px !important; /* Small Spinners and TimeBox */ } /**************************************************************************************************** Buttons *****************************************************************************************************/ .myButton.dijitButton .dijitButtonNode { width:151px !important; margin:3px 0px 0px -2px !important; line-height:30px; } .dj_ie .myButton.dijitButton .dijitButtonNode, .dj_webkit .myButton.dijitButton .dijitButtonNode { width:153px !important; /* Firefox's buttons are a few pixels smaller */ } .myButton.dijitButton.save .dijitButtonNode { margin-left:-1px; /* Changes to save button */ font-weight:bold; } /************************************************************************************************** IE6 Surgery In IE6 (and IE7 to a lesser degree) adding padding or margins to the INPUT of the spinners causes major rendering errors. Left padding produced no harm though, and line-height was used to get the top padding. Set the overflow to visible so the text wouldn't be chopped. ***************************************************************************************************/ .dj_ie6 .dijitInputLayoutContainer{ padding:0px 0px 0px 5px; } .dj_ie6 .dijitInputLayoutContainer .dijitInputField input{ padding:0px; line-height:22px; overflow-y:visible; }
OSrce/SitRep_javaBackendOld
src/main/webapp/lib/srd/css/form.css
CSS
bsd-3-clause
3,987
33.669565
103
0.50163
false
/* * Portions of this file Copyright 1999-2005 University of Chicago * Portions of this file Copyright 1999-2005 The University of Southern California. * * This file or a portion of this file is licensed under the * terms of the Globus Toolkit Public License, found at * http://www.globus.org/toolkit/download/license.html. * If you redistribute this file, with or without * modifications, you must include this notice in the file. */ package org.globus.io.streams; import java.io.IOException; import org.globus.io.gass.client.GassException; import org.globus.gsi.GSIConstants; import org.globus.gsi.gssapi.GSSConstants; import org.globus.gsi.gssapi.net.GssSocket; import org.globus.gsi.gssapi.net.GssSocketFactory; import org.globus.gsi.gssapi.auth.Authorization; import org.globus.gsi.gssapi.auth.SelfAuthorization; import org.gridforum.jgss.ExtendedGSSManager; import org.gridforum.jgss.ExtendedGSSContext; import org.ietf.jgss.GSSManager; import org.ietf.jgss.GSSCredential; import org.ietf.jgss.GSSException; import org.ietf.jgss.GSSContext; public class GassOutputStream extends HTTPOutputStream { /** * Opens Gass output stream in secure mode with default * user credentials. * * @param host host name of the gass server. * @param port port number of the gass server. * @param file name of the file on the remote side. * @param length total size of the data to be transfered. * Use -1 if unknown. The data then will be * transfered in chunks. * @param append if true, append data to existing file. * Otherwise, the file will be overwritten. */ public GassOutputStream(String host, int port, String file, long length, boolean append) throws GassException, GSSException, IOException { this(null, SelfAuthorization.getInstance(), host, port, file, length, append); } /** * Opens Gass output stream in secure mode with specified * user credentials. * * @param cred user credentials to use. If null, * default user credentials will be used. * @param host host name of the gass server. * @param port port number of the gass server. * @param file name of the file on the remote side. * @param length total size of the data to be transfered. * Use -1 if unknown. The data then will be * transfered in chunks. * @param append if true, append data to existing file. * Otherwise, the file will be overwritten. */ public GassOutputStream(GSSCredential cred, String host, int port, String file, long length, boolean append) throws GassException, GSSException, IOException { this(cred, SelfAuthorization.getInstance(), host, port, file, length, append); } /** * Opens Gass output stream in secure mode with specified * user credentials. * * @param cred user credentials to use. If null, * default user credentials will be used. * @param host host name of the gass server. * @param port port number of the gass server. * @param file name of the file on the remote side. * @param length total size of the data to be transfered. * Use -1 if unknown. The data then will be * transfered in chunks. * @param append if true, append data to existing file. * Otherwise, the file will be overwritten. */ public GassOutputStream(GSSCredential cred, Authorization auth, String host, int port, String file, long length, boolean append) throws GassException, GSSException, IOException { super(); this.size = length; this.append = append; GSSManager manager = ExtendedGSSManager.getInstance(); ExtendedGSSContext context = (ExtendedGSSContext)manager.createContext(null, GSSConstants.MECH_OID, cred, GSSContext.DEFAULT_LIFETIME); context.setOption(GSSConstants.GSS_MODE, GSIConstants.MODE_SSL); GssSocketFactory factory = GssSocketFactory.getDefault(); socket = factory.createSocket(host, port, context); ((GssSocket)socket).setAuthorization(auth); put(host, file, length, -1); } }
NCIP/cagrid2-wsrf
wsrf-jglobus/src/main/java/org/globus/io/streams/GassOutputStream.java
Java
bsd-3-clause
4,485
33.767442
83
0.651728
false
// Copyright 2011 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/objects/contexts.h" #include "src/ast/modules.h" #include "src/debug/debug.h" #include "src/execution/isolate-inl.h" #include "src/init/bootstrapper.h" #include "src/objects/module-inl.h" namespace v8 { namespace internal { Handle<ScriptContextTable> ScriptContextTable::Extend( Handle<ScriptContextTable> table, Handle<Context> script_context) { Handle<ScriptContextTable> result; int used = table->used(); int length = table->length(); CHECK(used >= 0 && length > 0 && used < length); if (used + kFirstContextSlotIndex == length) { CHECK(length < Smi::kMaxValue / 2); Isolate* isolate = script_context->GetIsolate(); Handle<FixedArray> copy = isolate->factory()->CopyFixedArrayAndGrow(table, length); copy->set_map(ReadOnlyRoots(isolate).script_context_table_map()); result = Handle<ScriptContextTable>::cast(copy); } else { result = table; } result->set_used(used + 1); DCHECK(script_context->IsScriptContext()); result->set(used + kFirstContextSlotIndex, *script_context); return result; } void Context::Initialize(Isolate* isolate) { ScopeInfo scope_info = this->scope_info(); int header = scope_info.ContextHeaderLength(); for (int var = 0; var < scope_info.ContextLocalCount(); var++) { if (scope_info.ContextLocalInitFlag(var) == kNeedsInitialization) { set(header + var, ReadOnlyRoots(isolate).the_hole_value()); } } } bool ScriptContextTable::Lookup(Isolate* isolate, ScriptContextTable table, String name, LookupResult* result) { DisallowHeapAllocation no_gc; // Static variables cannot be in script contexts. IsStaticFlag is_static_flag; for (int i = 0; i < table.used(); i++) { Context context = table.get_context(i); DCHECK(context.IsScriptContext()); int slot_index = ScopeInfo::ContextSlotIndex( context.scope_info(), name, &result->mode, &result->init_flag, &result->maybe_assigned_flag, &is_static_flag); if (slot_index >= 0) { result->context_index = i; result->slot_index = slot_index; return true; } } return false; } bool Context::is_declaration_context() { if (IsFunctionContext() || IsNativeContext() || IsScriptContext() || IsModuleContext()) { return true; } if (IsEvalContext()) { return scope_info().language_mode() == LanguageMode::kStrict; } if (!IsBlockContext()) return false; return scope_info().is_declaration_scope(); } Context Context::declaration_context() { Context current = *this; while (!current.is_declaration_context()) { current = current.previous(); } return current; } Context Context::closure_context() { Context current = *this; while (!current.IsFunctionContext() && !current.IsScriptContext() && !current.IsModuleContext() && !current.IsNativeContext() && !current.IsEvalContext()) { current = current.previous(); } return current; } JSObject Context::extension_object() { DCHECK(IsNativeContext() || IsFunctionContext() || IsBlockContext() || IsEvalContext() || IsCatchContext()); HeapObject object = extension(); if (object.IsUndefined()) return JSObject(); DCHECK(object.IsJSContextExtensionObject() || (IsNativeContext() && object.IsJSGlobalObject())); return JSObject::cast(object); } JSReceiver Context::extension_receiver() { DCHECK(IsNativeContext() || IsWithContext() || IsEvalContext() || IsFunctionContext() || IsBlockContext()); return IsWithContext() ? JSReceiver::cast(extension()) : extension_object(); } ScopeInfo Context::scope_info() { return ScopeInfo::cast(get(SCOPE_INFO_INDEX)); } SourceTextModule Context::module() { Context current = *this; while (!current.IsModuleContext()) { current = current.previous(); } return SourceTextModule::cast(current.extension()); } JSGlobalObject Context::global_object() { return JSGlobalObject::cast(native_context().extension()); } Context Context::script_context() { Context current = *this; while (!current.IsScriptContext()) { current = current.previous(); } return current; } JSGlobalProxy Context::global_proxy() { return native_context().global_proxy_object(); } /** * Lookups a property in an object environment, taking the unscopables into * account. This is used For HasBinding spec algorithms for ObjectEnvironment. */ static Maybe<bool> UnscopableLookup(LookupIterator* it, bool is_with_context) { Isolate* isolate = it->isolate(); Maybe<bool> found = JSReceiver::HasProperty(it); if (!is_with_context || found.IsNothing() || !found.FromJust()) return found; Handle<Object> unscopables; ASSIGN_RETURN_ON_EXCEPTION_VALUE( isolate, unscopables, JSReceiver::GetProperty(isolate, Handle<JSReceiver>::cast(it->GetReceiver()), isolate->factory()->unscopables_symbol()), Nothing<bool>()); if (!unscopables->IsJSReceiver()) return Just(true); Handle<Object> blacklist; ASSIGN_RETURN_ON_EXCEPTION_VALUE( isolate, blacklist, JSReceiver::GetProperty(isolate, Handle<JSReceiver>::cast(unscopables), it->name()), Nothing<bool>()); return Just(!blacklist->BooleanValue(isolate)); } static PropertyAttributes GetAttributesForMode(VariableMode mode) { DCHECK(IsSerializableVariableMode(mode)); return IsConstVariableMode(mode) ? READ_ONLY : NONE; } // static Handle<Object> Context::Lookup(Handle<Context> context, Handle<String> name, ContextLookupFlags flags, int* index, PropertyAttributes* attributes, InitializationFlag* init_flag, VariableMode* variable_mode, bool* is_sloppy_function_name) { Isolate* isolate = context->GetIsolate(); bool follow_context_chain = (flags & FOLLOW_CONTEXT_CHAIN) != 0; *index = kNotFound; *attributes = ABSENT; *init_flag = kCreatedInitialized; *variable_mode = VariableMode::kVar; if (is_sloppy_function_name != nullptr) { *is_sloppy_function_name = false; } if (FLAG_trace_contexts) { PrintF("Context::Lookup("); name->ShortPrint(); PrintF(")\n"); } do { if (FLAG_trace_contexts) { PrintF(" - looking in context %p", reinterpret_cast<void*>(context->ptr())); if (context->IsScriptContext()) PrintF(" (script context)"); if (context->IsNativeContext()) PrintF(" (native context)"); PrintF("\n"); } // 1. Check global objects, subjects of with, and extension objects. DCHECK_IMPLIES(context->IsEvalContext() && context->has_extension(), context->extension().IsTheHole(isolate)); if ((context->IsNativeContext() || context->IsWithContext() || context->IsFunctionContext() || context->IsBlockContext()) && context->has_extension() && !context->extension_receiver().is_null()) { Handle<JSReceiver> object(context->extension_receiver(), isolate); if (context->IsNativeContext()) { DisallowHeapAllocation no_gc; if (FLAG_trace_contexts) { PrintF(" - trying other script contexts\n"); } // Try other script contexts. ScriptContextTable script_contexts = context->global_object().native_context().script_context_table(); ScriptContextTable::LookupResult r; if (ScriptContextTable::Lookup(isolate, script_contexts, *name, &r)) { Context context = script_contexts.get_context(r.context_index); if (FLAG_trace_contexts) { PrintF("=> found property in script context %d: %p\n", r.context_index, reinterpret_cast<void*>(context.ptr())); } *index = r.slot_index; *variable_mode = r.mode; *init_flag = r.init_flag; *attributes = GetAttributesForMode(r.mode); return handle(context, isolate); } } // Context extension objects needs to behave as if they have no // prototype. So even if we want to follow prototype chains, we need // to only do a local lookup for context extension objects. Maybe<PropertyAttributes> maybe = Nothing<PropertyAttributes>(); if ((flags & FOLLOW_PROTOTYPE_CHAIN) == 0 || object->IsJSContextExtensionObject()) { maybe = JSReceiver::GetOwnPropertyAttributes(object, name); } else { // A with context will never bind "this", but debug-eval may look into // a with context when resolving "this". Other synthetic variables such // as new.target may be resolved as VariableMode::kDynamicLocal due to // bug v8:5405 , skipping them here serves as a workaround until a more // thorough fix can be applied. // TODO(v8:5405): Replace this check with a DCHECK when resolution of // of synthetic variables does not go through this code path. if (ScopeInfo::VariableIsSynthetic(*name)) { DCHECK(context->IsWithContext()); maybe = Just(ABSENT); } else { LookupIterator it(isolate, object, name, object); Maybe<bool> found = UnscopableLookup(&it, context->IsWithContext()); if (found.IsNothing()) { maybe = Nothing<PropertyAttributes>(); } else { // Luckily, consumers of |maybe| only care whether the property // was absent or not, so we can return a dummy |NONE| value // for its attributes when it was present. maybe = Just(found.FromJust() ? NONE : ABSENT); } } } if (maybe.IsNothing()) return Handle<Object>(); DCHECK(!isolate->has_pending_exception()); *attributes = maybe.FromJust(); if (maybe.FromJust() != ABSENT) { if (FLAG_trace_contexts) { PrintF("=> found property in context object %p\n", reinterpret_cast<void*>(object->ptr())); } return object; } } // 2. Check the context proper if it has slots. if (context->IsFunctionContext() || context->IsBlockContext() || context->IsScriptContext() || context->IsEvalContext() || context->IsModuleContext() || context->IsCatchContext()) { DisallowHeapAllocation no_gc; // Use serialized scope information of functions and blocks to search // for the context index. ScopeInfo scope_info = context->scope_info(); VariableMode mode; InitializationFlag flag; MaybeAssignedFlag maybe_assigned_flag; IsStaticFlag is_static_flag; int slot_index = ScopeInfo::ContextSlotIndex(scope_info, *name, &mode, &flag, &maybe_assigned_flag, &is_static_flag); DCHECK(slot_index < 0 || slot_index >= MIN_CONTEXT_SLOTS); if (slot_index >= 0) { // Re-direct lookup to the ScriptContextTable in case we find a hole in // a REPL script context. REPL scripts allow re-declaration of // script-level let bindings. The value itself is stored in the script // context of the first script that declared a variable, all other // script contexts will contain 'the hole' for that particular name. if (scope_info.IsReplModeScope() && context->get(slot_index).IsTheHole(isolate)) { context = Handle<Context>(context->previous(), isolate); continue; } if (FLAG_trace_contexts) { PrintF("=> found local in context slot %d (mode = %hhu)\n", slot_index, static_cast<uint8_t>(mode)); } *index = slot_index; *variable_mode = mode; *init_flag = flag; *attributes = GetAttributesForMode(mode); return context; } // Check the slot corresponding to the intermediate context holding // only the function name variable. It's conceptually (and spec-wise) // in an outer scope of the function's declaration scope. if (follow_context_chain && context->IsFunctionContext()) { int function_index = scope_info.FunctionContextSlotIndex(*name); if (function_index >= 0) { if (FLAG_trace_contexts) { PrintF("=> found intermediate function in context slot %d\n", function_index); } *index = function_index; *attributes = READ_ONLY; *init_flag = kCreatedInitialized; *variable_mode = VariableMode::kConst; if (is_sloppy_function_name != nullptr && is_sloppy(scope_info.language_mode())) { *is_sloppy_function_name = true; } return context; } } // Lookup variable in module imports and exports. if (context->IsModuleContext()) { VariableMode mode; InitializationFlag flag; MaybeAssignedFlag maybe_assigned_flag; int cell_index = scope_info.ModuleIndex(*name, &mode, &flag, &maybe_assigned_flag); if (cell_index != 0) { if (FLAG_trace_contexts) { PrintF("=> found in module imports or exports\n"); } *index = cell_index; *variable_mode = mode; *init_flag = flag; *attributes = SourceTextModuleDescriptor::GetCellIndexKind( cell_index) == SourceTextModuleDescriptor::kExport ? GetAttributesForMode(mode) : READ_ONLY; return handle(context->module(), isolate); } } } else if (context->IsDebugEvaluateContext()) { // Check materialized locals. Object ext = context->get(EXTENSION_INDEX); if (ext.IsJSReceiver()) { Handle<JSReceiver> extension(JSReceiver::cast(ext), isolate); LookupIterator it(isolate, extension, name, extension); Maybe<bool> found = JSReceiver::HasProperty(&it); if (found.FromMaybe(false)) { *attributes = NONE; return extension; } } // Check blacklist. Names that are listed, cannot be resolved further. Object blacklist = context->get(BLACK_LIST_INDEX); if (blacklist.IsStringSet() && StringSet::cast(blacklist).Has(isolate, name)) { if (FLAG_trace_contexts) { PrintF(" - name is blacklisted. Aborting.\n"); } break; } // Check the original context, but do not follow its context chain. Object obj = context->get(WRAPPED_CONTEXT_INDEX); if (obj.IsContext()) { Handle<Context> context(Context::cast(obj), isolate); Handle<Object> result = Context::Lookup(context, name, DONT_FOLLOW_CHAINS, index, attributes, init_flag, variable_mode); if (!result.is_null()) return result; } } // 3. Prepare to continue with the previous (next outermost) context. if (context->IsNativeContext()) break; context = Handle<Context>(context->previous(), isolate); } while (follow_context_chain); if (FLAG_trace_contexts) { PrintF("=> no property/slot found\n"); } return Handle<Object>::null(); } void NativeContext::AddOptimizedCode(Code code) { DCHECK(code.kind() == Code::OPTIMIZED_FUNCTION); DCHECK(code.next_code_link().IsUndefined()); code.set_next_code_link(get(OPTIMIZED_CODE_LIST)); set(OPTIMIZED_CODE_LIST, code, UPDATE_WEAK_WRITE_BARRIER); } void NativeContext::SetOptimizedCodeListHead(Object head) { set(OPTIMIZED_CODE_LIST, head, UPDATE_WEAK_WRITE_BARRIER); } Object NativeContext::OptimizedCodeListHead() { return get(OPTIMIZED_CODE_LIST); } void NativeContext::SetDeoptimizedCodeListHead(Object head) { set(DEOPTIMIZED_CODE_LIST, head, UPDATE_WEAK_WRITE_BARRIER); } Object NativeContext::DeoptimizedCodeListHead() { return get(DEOPTIMIZED_CODE_LIST); } Handle<Object> Context::ErrorMessageForCodeGenerationFromStrings() { Isolate* isolate = GetIsolate(); Handle<Object> result(error_message_for_code_gen_from_strings(), isolate); if (!result->IsUndefined(isolate)) return result; return isolate->factory()->NewStringFromStaticChars( "Code generation from strings disallowed for this context"); } #define COMPARE_NAME(index, type, name) \ if (string->IsOneByteEqualTo(StaticCharVector(#name))) return index; int Context::IntrinsicIndexForName(Handle<String> string) { NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(COMPARE_NAME); return kNotFound; } #undef COMPARE_NAME #define COMPARE_NAME(index, type, name) \ { \ const int name_length = static_cast<int>(arraysize(#name)) - 1; \ if ((length == name_length) && strncmp(string, #name, name_length) == 0) \ return index; \ } int Context::IntrinsicIndexForName(const unsigned char* unsigned_string, int length) { const char* string = reinterpret_cast<const char*>(unsigned_string); NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(COMPARE_NAME); return kNotFound; } #undef COMPARE_NAME #ifdef DEBUG bool Context::IsBootstrappingOrValidParentContext(Object object, Context child) { // During bootstrapping we allow all objects to pass as // contexts. This is necessary to fix circular dependencies. if (child.GetIsolate()->bootstrapper()->IsActive()) return true; if (!object.IsContext()) return false; Context context = Context::cast(object); return context.IsNativeContext() || context.IsScriptContext() || context.IsModuleContext() || !child.IsModuleContext(); } #endif void NativeContext::ResetErrorsThrown() { set_errors_thrown(Smi::FromInt(0)); } void NativeContext::IncrementErrorsThrown() { int previous_value = errors_thrown().value(); set_errors_thrown(Smi::FromInt(previous_value + 1)); } int NativeContext::GetErrorsThrown() { return errors_thrown().value(); } STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 2); STATIC_ASSERT(Context::MIN_CONTEXT_EXTENDED_SLOTS == 3); STATIC_ASSERT(NativeContext::kScopeInfoOffset == Context::OffsetOfElementAt(NativeContext::SCOPE_INFO_INDEX)); STATIC_ASSERT(NativeContext::kPreviousOffset == Context::OffsetOfElementAt(NativeContext::PREVIOUS_INDEX)); STATIC_ASSERT(NativeContext::kExtensionOffset == Context::OffsetOfElementAt(NativeContext::EXTENSION_INDEX)); STATIC_ASSERT(NativeContext::kStartOfStrongFieldsOffset == Context::OffsetOfElementAt(-1)); STATIC_ASSERT(NativeContext::kStartOfWeakFieldsOffset == Context::OffsetOfElementAt(NativeContext::FIRST_WEAK_SLOT)); STATIC_ASSERT(NativeContext::kMicrotaskQueueOffset == Context::SizeFor(NativeContext::NATIVE_CONTEXT_SLOTS)); STATIC_ASSERT(NativeContext::kSize == (Context::SizeFor(NativeContext::NATIVE_CONTEXT_SLOTS) + kSystemPointerSize)); } // namespace internal } // namespace v8
endlessm/chromium-browser
v8/src/objects/contexts.cc
C++
bsd-3-clause
19,318
36.583658
79
0.63723
false
<?php $list = new SplDoublyLinkedList(); $a = $list->offsetExists(); if(is_null($a)) { echo 'PASS'; } ?>
evnix/go-php-parser
testdata/fuzzdir/corpus/ext_spl_tests_SplDoublyLinkedList_offsetExists_invalid_parameter.php
PHP
bsd-3-clause
106
14.142857
34
0.59434
false
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the qmake spec of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H #ifdef UNICODE #ifndef _UNICODE #define _UNICODE #endif #endif // Get Qt defines/settings #include "qglobal.h" #include <tchar.h> #include <io.h> #include <direct.h> #include <stdio.h> #include <fcntl.h> #include <errno.h> #include <sys/stat.h> #include <stdlib.h> #include <qt_windows.h> #include <limits.h> #if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500) typedef enum { NameUnknown = 0, NameFullyQualifiedDN = 1, NameSamCompatible = 2, NameDisplay = 3, NameUniqueId = 6, NameCanonical = 7, NameUserPrincipal = 8, NameCanonicalEx = 9, NameServicePrincipal = 10, NameDnsDomain = 12 } EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT; #endif #define Q_FS_FAT #ifdef QT_LARGEFILE_SUPPORT #define QT_STATBUF struct _stati64 // non-ANSI defs #define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs #define QT_STAT ::_stati64 #define QT_FSTAT ::_fstati64 #else #define QT_STATBUF struct _stat // non-ANSI defs #define QT_STATBUF4TSTAT struct _stat // non-ANSI defs #define QT_STAT ::_stat #define QT_FSTAT ::_fstat #endif #define QT_STAT_REG _S_IFREG #define QT_STAT_DIR _S_IFDIR #define QT_STAT_MASK _S_IFMT #if defined(_S_IFLNK) # define QT_STAT_LNK _S_IFLNK #endif #define QT_FILENO _fileno #define QT_OPEN ::_open #define QT_CLOSE ::_close #ifdef QT_LARGEFILE_SUPPORT #define QT_LSEEK ::_lseeki64 #ifndef UNICODE #define QT_TSTAT ::_stati64 #else #define QT_TSTAT ::_wstati64 #endif #else #define QT_LSEEK ::_lseek #ifndef UNICODE #define QT_TSTAT ::_stat #else #define QT_TSTAT ::_wstat #endif #endif #define QT_READ ::_read #define QT_WRITE ::_write #define QT_ACCESS ::_access #define QT_GETCWD ::_getcwd #define QT_CHDIR ::_chdir #define QT_MKDIR ::_mkdir #define QT_RMDIR ::_rmdir #define QT_OPEN_LARGEFILE 0 #define QT_OPEN_RDONLY _O_RDONLY #define QT_OPEN_WRONLY _O_WRONLY #define QT_OPEN_RDWR _O_RDWR #define QT_OPEN_CREAT _O_CREAT #define QT_OPEN_TRUNC _O_TRUNC #define QT_OPEN_APPEND _O_APPEND #if defined(O_TEXT) # define QT_OPEN_TEXT _O_TEXT # define QT_OPEN_BINARY _O_BINARY #endif #include "../common/c89/qplatformdefs.h" #ifdef QT_LARGEFILE_SUPPORT #undef QT_FSEEK #undef QT_FTELL #undef QT_OFF_T #define QT_FSEEK ::fseeko64 #define QT_FTELL ::ftello64 #define QT_OFF_T off64_t #endif #define QT_SIGNAL_ARGS int #define QT_VSNPRINTF ::_vsnprintf #define QT_SNPRINTF ::_snprintf # define F_OK 0 # define X_OK 1 # define W_OK 2 # define R_OK 4 #endif // QPLATFORMDEFS_H
blorenz/phantomjs
src/qt/mkspecs/win32-g++-4.6/qplatformdefs.h
C
bsd-3-clause
4,321
26.176101
77
0.681324
false
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ServiceStack.Text")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ServiceStack")] [assembly: AssemblyProduct("ServiceStack.Text")] [assembly: AssemblyCopyright("Copyright © ServiceStack 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("a352d4d3-df2a-4c78-b646-67181a6333a6")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.9.60.0")] //[assembly: AssemblyFileVersion("1.0.0.0")]
fanta-mnix/ServiceStack.Text
src/ServiceStack.Text/Properties/AssemblyInfo.cs
C#
bsd-3-clause
1,398
38.857143
84
0.74552
false
/* -*- mode: C; c-basic-offset: 4 -*- */ /* ex: set shiftwidth=4 tabstop=4 expandtab: */ /* * Copyright (c) 2013, Georgia Tech Research Corporation * All rights reserved. * * Author(s): Neil T. Dantam <ntd@gatech.edu> * Georgia Tech Humanoid Robotics Lab * Under Direction of Prof. Mike Stilman <mstilman@cc.gatech.edu> * * * This file is provided under the following "BSD-style" License: * * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #ifndef AA_AMINO_ARCH_ARCH_H #define AA_AMINO_ARCH_ARCH_H #ifdef __GNUC__ #include "amino/arch/gcc.h" #endif #endif //AA_AMINO_ARCH_ARCH_H
golems/amino
include/amino/arch/arch.h
C
bsd-3-clause
1,911
37.22
70
0.722658
false
/**************************************************************************** * * Copyright (c) 2020 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name PX4 nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ #ifndef ORBIT_EXECUTION_STATUS_HPP #define ORBIT_EXECUTION_STATUS_HPP #include <uORB/topics/orbit_status.h> class MavlinkStreamOrbitStatus : public MavlinkStream { public: static MavlinkStream *new_instance(Mavlink *mavlink) { return new MavlinkStreamOrbitStatus(mavlink); } static constexpr const char *get_name_static() { return "ORBIT_EXECUTION_STATUS"; } static constexpr uint16_t get_id_static() { return MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS; } const char *get_name() const override { return get_name_static(); } uint16_t get_id() override { return get_id_static(); } unsigned get_size() override { return _orbit_status_sub.advertised() ? MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES : 0; } private: explicit MavlinkStreamOrbitStatus(Mavlink *mavlink) : MavlinkStream(mavlink) {} uORB::Subscription _orbit_status_sub{ORB_ID(orbit_status)}; bool send() override { orbit_status_s orbit_status; if (_orbit_status_sub.update(&orbit_status)) { mavlink_orbit_execution_status_t msg{}; msg.time_usec = orbit_status.timestamp; msg.radius = orbit_status.radius; msg.frame = orbit_status.frame; msg.x = orbit_status.x * 1e7; msg.y = orbit_status.y * 1e7; msg.z = orbit_status.z; mavlink_msg_orbit_execution_status_send_struct(_mavlink->get_channel(), &msg); return true; } return false; } }; #endif // ORBIT_EXECUTION_STATUS_HPP
PX4/Firmware
src/modules/mavlink/streams/ORBIT_EXECUTION_STATUS.hpp
C++
bsd-3-clause
3,151
36.963855
120
0.706125
false
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>jQuery plugin: Tablesorter - Assorted date parsers</title> <!-- jQuery --> <script src="js/jquery-latest.min.js"></script> <!-- Demo stuff --> <link rel="stylesheet" href="css/jq.css"> <link href="css/prettify.css" rel="stylesheet"> <script src="js/prettify.js"></script> <script src="js/docs.js"></script> <style> th { width: 14%; } </style> <link href="../css/theme.blue.css" rel="stylesheet"> <script src="../js/jquery.tablesorter.js"></script> <!-- load month, weekday and two digit year parsers --> <script src="../js/parsers/parser-date-month.js"></script> <script src="../js/parsers/parser-date-weekday.js"></script> <script src="../js/parsers/parser-date-two-digit-year.js"></script> <!-- http://sugarjs.com/dates#comparing_dates --> <script src="js/sugar.min.js"></script> <script src="../js/parsers/parser-date.js"></script> <script id="js">$(function() { // See http://mottie.github.io/tablesorter/docs/example-widget-grouping.html // for details on how to use CLDR data for a locale to add data for this parser // CLDR returns { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", ... } // or copy the data directly as it is shown here: // ************************ // French localization modified from days "abbreviated" format // https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/fr/ca-gregorian.json // It does *not* include the periods $.tablesorter.dates.weekdays.fr = { "sun" : "Dim", "mon" : "Lun", "tue" : "Mar", "wed" : "Mer", "thu" : "Jeu", "fri" : "Ven", "sat" : "Sam" }; // CLDR returns an object { 1: "Jan", 2: "Feb", 3: "Mar", ..., 12: "Dec" } // French localization modified from months "abbreviated" format // https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/fr/ca-gregorian.json // It does *not* include the periods $.tablesorter.dates.months.fr = { "1" : "Janv", "2" : "Févr", "3" : "Mars", "4" : "Avr", "5" : "Mai", "6" : "Juin", "7" : "Juil", "8" : "Août", "9" : "Sept", "10" : "Oct", "11" : "Nov", "12" : "Déc" }; // call the tablesorter plugin $("table").tablesorter({ theme : 'blue', // option used by weekday, month & globalize parsers (v2.24.1) globalize : { // columns that use French data 2 : { lang: 'fr' }, 4 : { lang: 'fr' } }, widgets : ["zebra"], // date range used by the two-digit year parser (added v2.14.0) dateRange : 30 }); });</script> </head> <body> <div id="banner"> <h1>table<em>sorter</em></h1> <h2>Assorted date parsers</h2> <h3>Flexible client-side table sorting</h3> <a href="index.html">Back to documentation</a> </div> <div id="main"> <p class="tip"> <em>NOTE!</em> <ul> <li>In <span class="version">v2.24.1</span>, <ul> <li>Updated weekday &amp; month parsers to better integrate with <a href="https://github.com/jquery/globalize">jQuery Globalize</a>.</li> <li>This demo now includes a column for French named weekdays &amp; months.</li> </ul> </li> <li>Parse Dates with these parsers <ul> <li>The "Date" column is using the <a href="http://sugarjs.com/dates#comparing_dates">sugar</a> library to parse dates. Make sure to include the sugar library and the sugar-date-parser.</li> <li>The "Weekday" column uses the included "weekday" parser. You can modify parser to match whatever language you are using.</li> <li>The "Month" column uses the included "month" parser. You can also modify the month names within the parser to match whatever language you are using.</li> <li>The "Year" column is just using the included two digit year parser: <ul> <li>Formats for "mmddyy", "ddmmyy" and "yymmdd" are available</li> <li>Within the parser code is a <code>range</code> variable which is set to <code>50</code> years range, which sets the date be within +/- range of the listed two digit year.</li> <li>So if the current year is <code>2020</code>, and the listed two digit year is <code>80</code> (<code>2080 - 2020 &gt; 50</code>), it becomes <code>1980</code>.</li> <li>If the listed two digit year is <code>50</code> (<code>2050 - 2020 &lt; 50</code>), then it becomes <code>2050</code>. I hope that makes it clearer.</li> <li>Try out the two digit year calculator below the table.</li> <li>In <span class="version">v2.14.0</span>, the range can be set using the <code>dateRange</code> option (see the initialization code below).</li> </ul> </li> <li>The "Time" column is using the built-in time parser which has been always been included with tablesorter .</li> </ul> </li> </ul> <p> <h1>Demo</h1> <div id="demo"><table class="tablesorter"> <thead> <tr> <th class="sorter-sugar">Date</th> <th class="sorter-weekday">Weekday</th> <th class="sorter-weekday">Weekday (French)</th> <th class="sorter-month">Month</th> <th class="sorter-month">Month (French)</th> <th class="sorter-mmddyy">MM/DD/YY</th> <!-- "sorter-ddmmyy" also available --> <th class="sorter-time">Time</th> </tr> </thead> <tbody> <tr><td>next friday</td><td>Friday</td><td>Vendredi</td><td>Aug</td><td>Août</td><td>02/1/16</td><td>12:00 PM</td></tr> <tr><td>today</td><td>Sunday</td><td>Dim</td><td>September</td><td>Septembre</td><td>1/2/16</td><td>00:00</td></tr> <tr><td>last Tuesday</td><td>Fri</td><td>Ven</td><td>Mar</td><td>Mars</td><td>11/1/15</td><td>18:00</td></tr> <tr><td>the day after tomorrow</td><td>Wed</td><td>Mer</td><td>July</td><td>Juillet</td><td>01/1/16</td><td>13:00</td></tr> <tr><td>2010-05-25T12:30:40.299+01:00</td><td>Monday</td><td>Lun</td><td>Jan</td><td>Janvier</td><td>1/11/15</td><td>1:30 PM</td></tr> <tr><td>May 25th of next year</td><td>Tues</td><td>Mardi</td><td>Nov</td><td>Novembre</td><td>1/1/15</td><td>14:00</td></tr> <tr><td>25 May 2010</td><td>Tuesday</td><td>Mar</td><td>November</td><td>Nov</td><td>3/1/15</td><td>1:58 PM</td></tr> <tr><td>the last day of March</td><td>Sat</td><td>Sam</td><td>December</td><td>Décembre</td><td>1/15/15</td><td>2:10 PM</td></tr> <tr><td>last month</td><td>Wednesday</td><td>Mercredi</td><td>April</td><td>Avr</td><td>11/11/16</td><td>13:50</td></tr> <tr><td>one day before yesterday</td><td>Thursday</td><td>Jeudi</td><td>Feb</td><td>Février</td><td>5/1/15</td><td>4:00 AM</td></tr> </tbody> </table></div> <h3>Two digit year calculator:</h3> <div>two digit year <input class="tdy" type="number" min="0" max="99" value="20"> becomes <span class="result">2020</span></div> <div class="params"> ( <label>range</label> <input class="range" type="number" value="50" min="0" max="99"> <label>"current year"</label> <input class="current" type="number" value="2011" min="1900" max="9999"> ) </div> <h1>Page Header</h1> <div> <pre class="prettyprint lang-html">&lt;!-- blue theme stylesheet with additional css styles added in v2.0.17 --&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;../css/theme.blue.css&quot;&gt; &lt;!-- tablesorter plugin --&gt; &lt;script src=&quot;../js/jquery.tablesorter.js&quot;&gt;&lt;/script&gt; &lt;!-- load month, weekday and two digit year parsers --&gt; &lt;script src=&quot;../js/parsers/parser-date-month.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;../js/parsers/parser-date-weekday.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;../js/parsers/parser-date-two-digit-year.js&quot;&gt;&lt;/script&gt; &lt;!-- http://sugarjs.com/dates#comparing_dates --&gt; &lt;script src=&quot;../js/sugar.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;../js/parsers/parser-date-sugar.js&quot;&gt;&lt;/script&gt;</pre> </div> <h1>Javascript</h1> <div id="javascript"> <pre class="prettyprint lang-javascript"></pre> </div> <h1>HTML</h1> <div id="html"> <pre class="prettyprint lang-html"></pre> </div> <div class="next-up"> <hr /> Next up: <a href="example-widget-filter.html">Applying the filter widget &rsaquo;&rsaquo;</a> </div> </div> <style> .result, .tdy { color: red; } .params { font-size: 0.8em; } </style> <script> $(function(){ var tdy = $('.tdy'), // two digit year a = $('.result'), // answer r = $('.range'), // range c = $('.current'), // current year y = new Date().getFullYear(); tdy.val( (y + 20).toString().slice(-2) ); // use this year + 20 c.val( y ); $('input').on('change', function(){ var y = parseInt(tdy.val(), 10), result = 1900 + y, range = parseInt(r.val(), 10); if (y < 10) { tdy.val('0' + y); } y = parseInt(c.val(), 10); while (y - result > range) { result += 100; } a.html(result); }).change(); }); </script> </body> </html>
lucky1603/PmsApp
public/tablesorter-master/docs/example-parsers-dates.html
HTML
bsd-3-clause
8,683
37.22467
195
0.626484
false
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import pytest import numpy as np from qtpy import QtWidgets, QtCore from planetaryimage import PDS3Image from ginga.qtw.ImageViewCanvasQt import ImageViewCanvas from pdsview import pdsview from pdsview.channels_dialog import ChannelsDialog from pdsview.histogram import HistogramWidget, HistogramModel FILE_1 = os.path.join( 'tests', 'mission_data', '2m132591087cfd1800p2977m2f1.img') FILE_2 = os.path.join( 'tests', 'mission_data', '2p129641989eth0361p2600r8m1.img') FILE_3 = os.path.join( 'tests', 'mission_data', '1p190678905erp64kcp2600l8c1.img') FILE_4 = os.path.join( 'tests', 'mission_data', 'h58n3118.img') FILE_5 = os.path.join( 'tests', 'mission_data', '1p134482118erp0902p2600r8m1.img') FILE_6 = os.path.join( 'tests', 'mission_data', '0047MH0000110010100214C00_DRCL.IMG') FILE_1_NAME = '2m132591087cfd1800p2977m2f1.img' FILE_2_NAME = '2p129641989eth0361p2600r8m1.img' FILE_3_NAME = '1p190678905erp64kcp2600l8c1.img' FILE_4_NAME = 'h58n3118.img' FILE_5_NAME = '1p134482118erp0902p2600r8m1.img' FILE_6_NAME = '0047MH0000110010100214C00_DRCL.IMG' def test_image_stamp(): """Test that ImageStamp sets correct attributes to pds compatible image""" pds_image = PDS3Image.open(FILE_1) test_image = pdsview.ImageStamp(FILE_1, FILE_1, pds_image, pds_image.data) assert test_image.file_name == FILE_1_NAME assert test_image.image_name == FILE_1 assert 'PDS' in test_image.label[0] assert isinstance(test_image.label, list) assert not test_image.cuts assert not test_image.sarr assert not test_image.zoom assert not test_image.rotation assert not test_image.transforms assert test_image.not_been_displayed class TestImageSet(object): filepaths = [FILE_1, FILE_2, FILE_3, FILE_4, FILE_5] test_set = pdsview.ImageSet(filepaths) def test_init(self): assert self.test_set._views == set() assert len(self.test_set.images) == len(self.filepaths) filepaths = sorted(self.filepaths) for image, filepath in zip(self.test_set.images, filepaths): assert image[0].file_name == os.path.basename(filepath) assert self.test_set._current_image_index == 0 assert self.test_set._channel == 0 # assert self.test_set._last_channel is None assert self.test_set._x_value == 0 assert self.test_set._y_value == 0 assert self.test_set._pixel_value == (0, ) assert self.test_set.use_default_text assert self.test_set.rgb == [] assert self.test_set.current_image is not None def test_next_prev_enabled(self): assert self.test_set.next_prev_enabled test_set2 = pdsview.ImageSet([]) assert not test_set2.next_prev_enabled @pytest.mark.parametrize( "index, expected, channel", [ (1, 1, 1), (5, 0, 4), (11, 1, -1), (-1, 4, 7), (-13, 2, 42), (0, 0, 0) ]) def test_current_image_index(self, index, expected, channel): self.test_set.channel = channel self.test_set.current_image_index = index assert self.test_set.current_image_index == expected assert self.test_set.current_image == self.test_set.images[expected] assert self.test_set.channel == 0 def test_channel(self): assert self.test_set._channel == self.test_set.channel assert len(self.test_set.current_image) == 1 self.test_set.channel = 42 # When the current image only has one band, don't change the channel assert self.test_set.channel == 0 assert self.test_set._channel == self.test_set.channel # TODO: When an rgb image is in the default test_mission_data, test # actually chaning the channel def test_x_value(self): assert self.test_set.x_value == self.test_set._x_value self.test_set.x_value = 42.123456789 assert isinstance(self.test_set.x_value, int) assert self.test_set.x_value == 42 assert self.test_set.x_value == self.test_set._x_value self.test_set.x_value = 0 assert self.test_set.x_value == 0 assert self.test_set.x_value == self.test_set._x_value def test_y_value(self): assert self.test_set.y_value == self.test_set._y_value self.test_set.y_value = 42.123456789 assert isinstance(self.test_set.y_value, int) assert self.test_set.y_value == 42 assert self.test_set.y_value == self.test_set._y_value self.test_set.y_value = 0 assert self.test_set.y_value == 0 assert self.test_set.y_value == self.test_set._y_value def test_pixel_value(self): def check_pixel_value(new_pixel, expected): self.test_set.pixel_value = new_pixel assert self.test_set.pixel_value == expected assert isinstance(self.test_set.pixel_value, tuple) for val in self.test_set.pixel_value: assert isinstance(val, float) assert self.test_set.pixel_value == (0.0,) check_pixel_value( (2.3456, 3.4567, 4.5678), (2.346, 3.457, 4.568)) check_pixel_value([2.3456, 3.4567, 4.5678], (2.346, 3.457, 4.568)) check_pixel_value( np.array([2.3456, 3.4567, 4.5678]), (2.346, 3.457, 4.568)) check_pixel_value( 42.1234, (42.123,)) check_pixel_value( int(42), (42.0,)) check_pixel_value( 0, (0,)) def test_pixel_value_text(self): assert self.test_set.pixel_value_text == 'Value: 0.000' # TODO: TEST WITH RGB IMAGE def test_image_set_append_method(self): """Test append method with multiple images""" filepaths = [FILE_1] new_files = [FILE_2, FILE_3] test_set = pdsview.ImageSet(filepaths) assert test_set.current_image_index == 0 assert test_set.current_image[0].file_name == FILE_1_NAME assert len(test_set.images) == 1 assert not(test_set.next_prev_enabled) # Mimic how append method is used in pdsview first_new_image = len(test_set.images) test_set.append(new_files, first_new_image) assert test_set.current_image_index == 1 assert test_set.current_image[0].file_name == FILE_2_NAME assert FILE_3_NAME in str(test_set.images) assert test_set.next_prev_enabled def test_bands_are_composite(self): self.test_set.rgb = [image[0] for image in self.test_set.images[:3]] assert not self.test_set.bands_are_composite # TODO: TEST WITH RGB IMAGE # TODO: TEST create_rgb_image WHEN RGB IMAGE IN TEST DATA def test_ROI_data(self): """Test the ROI_data to cut out the correct region of data""" test_set = pdsview.ImageSet([FILE_3]) width = test_set.current_image[0].width height = test_set.current_image[0].height test_data_1 = test_set.ROI_data(0, 0, width, height) assert test_data_1[0][0] == 23 assert test_data_1[512][16] == 25 assert test_data_1[1023][31] == 115 test_data_2 = test_set.ROI_data(9.5, 18.5, 11.5, 20.5) assert test_data_2[0][0] == 22 assert test_data_2[0][1] == 23 assert test_data_2[1][0] == 24 assert test_data_2[1][1] == 24 def test_ROI_pixels(self): """Test ROI_pixels to return the correct number of pixels for a ROI""" test_set = pdsview.ImageSet([FILE_3]) test_pixels = test_set.ROI_pixels(9.5, 18.5, 11.5, 20.5) assert test_pixels == 4 def test_ROI_std_dev(self): """Test ROI_std_dev to return the correct standard deviation for ROI""" test_set = pdsview.ImageSet([FILE_3]) test_std_dev = test_set.ROI_std_dev(9.5, 18.5, 11.5, 20.5) assert test_std_dev == 0.829156 def test_ROI_mean(self): """Test ROI_mean to return the correct mean value of pixels for ROI""" test_set = pdsview.ImageSet([FILE_3]) test_mean = test_set.ROI_mean(9.5, 18.5, 11.5, 20.5) assert test_mean == 23.25 def test_ROI_median(self): """Test ROI_median to return the correct median value for a ROI""" test_set = pdsview.ImageSet([FILE_3]) test_median = test_set.ROI_median(9.5, 18.5, 11.5, 20.5) assert test_median == 23.5 def test_ROI_min(self): """Test ROI_min to return the correct minimum pixel value for a ROI""" test_set = pdsview.ImageSet([FILE_3]) test_min = test_set.ROI_min(9.5, 18.5, 11.5, 20.5) assert test_min == 22 def test_ROI_max(self): """Test ROI_mx to return the correct maximum pixel value for a ROI""" test_set = pdsview.ImageSet([FILE_3]) test_max = test_set.ROI_max(9.5, 18.5, 11.5, 20.5) assert test_max == 24 # TODO test channels when there is a 3 band test image class TestPDSController(object): filepaths = [FILE_1, FILE_2, FILE_3, FILE_4, FILE_5] test_set = pdsview.ImageSet(filepaths) controller = pdsview.PDSController(test_set, None) def test_init(self): assert self.controller.model == self.test_set assert self.controller.view is None def test_next_image(self): assert self.test_set.current_image_index == 0 self.controller.next_image() assert self.test_set.current_image_index == 1 self.test_set.current_image_index = len(self.test_set.images) - 1 self.controller.next_image() assert self.test_set.current_image_index == 0 def test_previous_image(self): assert self.test_set.current_image_index == 0 self.controller.previous_image() last = len(self.test_set.images) - 1 assert self.test_set.current_image_index == last self.test_set.current_image_index = 1 self.controller.previous_image() assert self.test_set.current_image_index == 0 def test_next_channel(self): assert self.test_set.channel == 0 self.controller.next_channel() assert self.test_set.channel == 0 # TODO: TEST MORE WHEN THERE IS AN RGB IMAGE def test_previous_channel(self): assert self.test_set.channel == 0 self.controller.previous_channel() assert self.test_set.channel == 0 # TODO: TEST MORE WHEN THERE IS AN RGB IMAGE def test_new_x_value(self): self.controller.new_x_value(42.123456789) assert isinstance(self.test_set.x_value, int) assert self.test_set.x_value == 42 assert self.test_set.x_value == self.test_set._x_value self.controller.new_x_value(0) assert self.test_set.x_value == 0 assert self.test_set.x_value == self.test_set._x_value def test_new_y_value(self): assert self.test_set.y_value == self.test_set._y_value self.controller.new_y_value(42.123456789) assert isinstance(self.test_set.y_value, int) assert self.test_set.y_value == 42 assert self.test_set.y_value == self.test_set._y_value self.controller.new_y_value(0) assert self.test_set.y_value == 0 assert self.test_set.y_value == self.test_set._y_value def test_new_pixel_value(self): def check_pixel_value(new_pixel, expected): self.controller.new_pixel_value(new_pixel) assert self.test_set.pixel_value == expected assert isinstance(self.test_set.pixel_value, tuple) for val in self.test_set.pixel_value: assert isinstance(val, float) assert self.test_set.pixel_value == (0.0,) check_pixel_value( (2.3456, 3.4567, 4.5678), (2.346, 3.457, 4.568)) check_pixel_value([2.3456, 3.4567, 4.5678], (2.346, 3.457, 4.568)) check_pixel_value( np.array([2.3456, 3.4567, 4.5678]), (2.346, 3.457, 4.568)) check_pixel_value( 42.1234, (42.123,)) check_pixel_value( int(42), (42.0,)) check_pixel_value( 0, (0,)) images = test_set.images @pytest.mark.parametrize( 'image_index, expected', [ (0, [images[0][0], images[1][0], images[2][0]]), (1, [images[1][0], images[2][0], images[3][0]]), (len(images) - 1, [images[-1][0], images[0][0], images[1][0]]) ]) def test_populate_rgb(self, image_index, expected): test_rgb = self.controller._populate_rgb(image_index) assert test_rgb == expected def test_update_rgb(self): expected = [self.images[0][0], self.images[1][0], self.images[2][0]] self.test_set.rgb = [1, 2, 3] self.controller.update_rgb() assert self.test_set.rgb != [1, 2, 3] assert self.test_set.rgb == expected class TestPDSViewer(object): filepaths = [FILE_1, FILE_2, FILE_3, FILE_4, FILE_5] test_set = pdsview.ImageSet(filepaths) viewer = pdsview.PDSViewer(test_set) viewer.show() def test_init(self): assert self.viewer.image_set == self.test_set assert self.viewer in self.test_set._views assert self.viewer._label_window is None assert self.viewer._label_window_pos is None assert self.viewer.channels_window is None assert not self.viewer.channels_window_is_open assert self.viewer.channels_window_pos is None assert isinstance( self.viewer.view_canvas, ImageViewCanvas) assert isinstance( self.viewer.next_image_btn, QtWidgets.QPushButton) assert isinstance( self.viewer.previous_image_btn, QtWidgets.QPushButton) assert isinstance( self.viewer.open_label, QtWidgets.QPushButton) assert isinstance( self.viewer.next_channel_btn, QtWidgets.QPushButton) assert isinstance( self.viewer.previous_channel_btn, QtWidgets.QPushButton) assert isinstance( self.viewer.restore_defaults, QtWidgets.QPushButton) assert isinstance( self.viewer.channels_button, QtWidgets.QPushButton) assert isinstance( self.viewer.x_value_lbl, QtWidgets.QLabel) assert isinstance( self.viewer.y_value_lbl, QtWidgets.QLabel) assert isinstance( self.viewer.pixel_value_lbl, QtWidgets.QLabel) assert isinstance( self.viewer.pixels, QtWidgets.QLabel) assert isinstance( self.viewer.std_dev, QtWidgets.QLabel) assert isinstance( self.viewer.mean, QtWidgets.QLabel) assert isinstance( self.viewer.median, QtWidgets.QLabel) assert isinstance( self.viewer.min, QtWidgets.QLabel) assert isinstance( self.viewer.max, QtWidgets.QLabel) assert isinstance( self.viewer.histogram, HistogramModel) assert isinstance( self.viewer.histogram_widget, HistogramWidget) assert isinstance( self.viewer.rgb_check_box, QtWidgets.QCheckBox) assert self.viewer.windowTitle() == FILE_5_NAME assert self.viewer.pixels.text() == '#Pixels: 32768' assert self.viewer.std_dev.text() == 'Std Dev: 16.100793' assert self.viewer.mean.text() == 'Mean: 24.6321' assert self.viewer.median.text() == 'Median: 22.0' assert self.viewer.min.text() == 'Min: 17' assert self.viewer.max.text() == 'Max: 114' assert self.viewer.x_value_lbl.text() == 'X: ????' assert self.viewer.y_value_lbl.text() == 'Y: ????' assert self.viewer.pixel_value_lbl.text() == 'Value: ????' assert not self.viewer.rgb_check_box.isChecked() def test_current_image(self): expected = self.test_set.current_image[self.test_set.channel] assert self.viewer.current_image == expected def test_refresh_ROI_text(self): self.viewer.min.setText("Min: 0") self.viewer.max.setText("Max: 100") self.viewer._refresh_ROI_text() assert self.viewer.min.text() == 'Min: 17' assert self.viewer.max.text() == 'Max: 114' def test_reset_ROI(self): self.viewer.min.setText("Min: 0") self.viewer.max.setText("Max: 100") self.viewer._reset_ROI() assert self.viewer.min.text() == 'Min: 17' assert self.viewer.max.text() == 'Max: 114' # TODO: When have RGB Image Test _disable_next_previous def test_reset_display_values(self): self.viewer.x_value_lbl.setText("X: 42") self.viewer.y_value_lbl.setText("Y: 42") self.viewer.pixel_value_lbl.setText("Value: 42") self.viewer._reset_display_values() assert self.viewer.x_value_lbl.text() == 'X: ????' assert self.viewer.y_value_lbl.text() == 'Y: ????' assert self.viewer.pixel_value_lbl.text() == 'Value: ????' def test_window_cascade(self, qtbot): """Tests the window cascade.""" # Initial checks assert self.viewer._label_window is None assert self.viewer.open_label.isEnabled() # Open the label window and run appropriate checks qtbot.mouseClick(self.viewer.open_label, QtCore.Qt.LeftButton) qtbot.add_widget(self.viewer._label_window) assert self.viewer._label_window is not None assert self.viewer._label_window._finder_window is None assert self.viewer._label_window.is_open # Open the finder window and run appropriate checks qtbot.mouseClick( self.viewer._label_window.find_button, QtCore.Qt.LeftButton) assert self.viewer._label_window._finder_window is not None qtbot.add_widget(self.viewer._label_window._finder_window) assert not(self.viewer._label_window._finder_window.query_edit) # Hide windows and check to make sure they are hidden qtbot.mouseClick( self.viewer._label_window._finder_window.ok_button, QtCore.Qt.LeftButton) assert self.viewer._label_window._finder_window.isHidden() qtbot.mouseClick( self.viewer._label_window.cancel_button, QtCore.Qt.LeftButton) assert self.viewer._label_window.isHidden() # Test the ability for the parent (label) to hide the child (finder) qtbot.mouseClick( self.viewer.open_label, QtCore.Qt.LeftButton) qtbot.mouseClick( self.viewer._label_window.find_button, QtCore.Qt.LeftButton) assert not(self.viewer._label_window.isHidden()) assert not(self.viewer._label_window._finder_window.isHidden()) qtbot.mouseClick( self.viewer._label_window.cancel_button, QtCore.Qt.LeftButton) assert self.viewer._label_window.isHidden() assert self.viewer._label_window._finder_window.isHidden() def test_label_refresh(self, qtbot): """Tests the label display and refresh features.""" qtbot.mouseClick(self.viewer.open_label, QtCore.Qt.LeftButton) qtbot.add_widget(self.viewer._label_window) label_contents = self.viewer._label_window.label_contents assert label_contents.toPlainText()[233:236] == "341" qtbot.mouseClick(self.viewer.next_image_btn, QtCore.Qt.LeftButton) label_contents = self.viewer._label_window.label_contents assert label_contents.toPlainText()[228:231] == "338" qtbot.mouseClick(self.viewer.previous_image_btn, QtCore.Qt.LeftButton) label_contents = self.viewer._label_window.label_contents assert label_contents.toPlainText()[233:236] == "341" def test_channels_dialog(self, qtbot): assert self.viewer.channels_window is None assert not self.viewer.channels_window_is_open assert self.viewer.channels_window_pos is None qtbot.add_widget(self.viewer) qtbot.mouseClick(self.viewer.channels_button, QtCore.Qt.LeftButton) assert self.viewer.channels_window is not None assert self.viewer.channels_window_is_open assert isinstance(self.viewer.channels_window, ChannelsDialog) assert self.viewer.channels_window_pos is None qtbot.add_widget(self.viewer.channels_window) new_pos = QtCore.QPoint(42, 24) self.viewer.channels_window.move(new_pos) qtbot.mouseClick( self.viewer.channels_window.close_button, QtCore.Qt.LeftButton) assert self.viewer.channels_window_pos is not None assert self.viewer.channels_window_pos == new_pos qtbot.mouseClick(self.viewer.channels_button, QtCore.Qt.LeftButton) self.viewer.channels_window.pos() == new_pos def test_apply_parameters(self, qtbot): """Test that images maintain their parameters""" self.viewer.save_parameters() image1 = self.viewer.current_image assert image1.sarr[0] == 0 assert image1.sarr[255] == 255 # assert image1.zoom == 1.0 assert image1.rotation == 0.0 assert image1.transforms == (False, False, False) assert image1.cuts == (17, 25) # Change parameters image1.sarr[0] = 42 image1.sarr[255] = 13 self.viewer.view_canvas.get_rgbmap().set_sarr(image1.sarr) # self.viewer.view_canvas.zoom_to(3) self.viewer.view_canvas.rotate(45) self.viewer.view_canvas.transform(False, True, False) self.viewer.view_canvas.cut_levels(24, 95) qtbot.mouseClick(self.viewer.next_image_btn, QtCore.Qt.LeftButton) # Test the second image parameters are None by defualt image2 = self.viewer.current_image # Test the view was reset to defualt paramters for the image assert self.viewer.view_canvas.get_rgbmap().get_sarr()[0] == 0 assert self.viewer.view_canvas.get_rgbmap().get_sarr()[255] == 255 # assert self.viewer.view_canvas.get_zoom() == 1.0 assert self.viewer.view_canvas.get_rotation() == 0.0 assert self.viewer.view_canvas.get_transforms() == ( False, False, False ) assert self.viewer.view_canvas.get_cut_levels() == (22, 26) # Test changing back to the first image maintains image1's parameters qtbot.mouseClick(self.viewer.previous_image_btn, QtCore.Qt.LeftButton) image1 = self.viewer.image_set.current_image[0] assert image1.sarr[0] == 42 assert image1.sarr[255] == 13 # assert image1.zoom == 3.0 assert image1.rotation == 45.0 assert image1.transforms == (False, True, False) assert image1.cuts == (24, 95) # Test that image2 stored its parameters image2 = self.viewer.image_set.images[1][0] assert image2.sarr[0] == 0 assert image2.sarr[255] == 255 # assert image2.zoom == 4.746031746031746 assert image2.rotation == 0.0 assert image2.transforms == (False, False, False) assert image2.cuts == (22, 26) def test_restore(self, qtbot): image1 = self.viewer.image_set.current_image[0] image1.sarr[0] = 42 image1.sarr[255] = 13 self.viewer.view_canvas.get_rgbmap().set_sarr(image1.sarr) # self.viewer.view_canvas.zoom_to(3) self.viewer.view_canvas.rotate(45) self.viewer.view_canvas.transform(False, True, False) self.viewer.view_canvas.cut_levels(24, 95) assert image1.sarr[0] == 42 assert image1.sarr[255] == 13 # assert image1.zoom == 3.0 assert image1.rotation == 45.0 assert image1.transforms == (False, True, False) assert image1.cuts == (24, 95) qtbot.mouseClick(self.viewer.restore_defaults, QtCore.Qt.LeftButton) self.viewer.save_parameters() assert image1.sarr[0] == 0 assert image1.sarr[255] == 255 # assert image1.zoom == 1.0 assert image1.rotation == 0.0 assert image1.transforms == (False, False, False) assert image1.cuts == (17, 25) def test_set_ROI_text(self, qtbot): """Test the ROI text to contain the correct values""" # Test Whole image ROI assert self.viewer.pixels.text() == '#Pixels: 32768' assert self.viewer.std_dev.text() == 'Std Dev: 16.100793' assert self.viewer.mean.text() == 'Mean: 24.6321' assert self.viewer.median.text() == 'Median: 22.0' assert self.viewer.min.text() == 'Min: 17' assert self.viewer.max.text() == 'Max: 114' # Test 2x2 random ROI # .5 values because these are the edge of the ROI pixels self.viewer.set_ROI_text(14.5, 512.5, 16.5, 514.5) assert self.viewer.pixels.text() == '#Pixels: 4' assert self.viewer.std_dev.text() == 'Std Dev: 1.000000' assert self.viewer.mean.text() == 'Mean: 23.0000' assert self.viewer.median.text() == 'Median: 23.0' assert self.viewer.min.text() == 'Min: 22' assert self.viewer.max.text() == 'Max: 24' def test_top_right_pixel_snap(self): test_snap_1 = self.viewer.top_right_pixel_snap(10, 5) assert test_snap_1[0] == 5.5 assert test_snap_1[1] test_snap_2 = self.viewer.top_right_pixel_snap(-5, 5) assert not test_snap_2[1] test_snap_3 = self.viewer.top_right_pixel_snap(5.4, 10) assert test_snap_3[0] == 5.5 assert test_snap_3[1] test_snap_4 = self.viewer.top_right_pixel_snap(5.5, 10) assert test_snap_4[0] == 5.5 assert test_snap_4[1] test_snap_5 = self.viewer.top_right_pixel_snap(5.6, 10) assert test_snap_5[0] == 6.5 assert test_snap_5[1] def test_bottom_left_pixel_snap(self): test_snap_1 = self.viewer.bottom_left_pixel_snap(-5, 5) assert test_snap_1[0] == -0.5 assert test_snap_1[1] test_snap_2 = self.viewer.bottom_left_pixel_snap(10, 5) assert not test_snap_2[1] test_snap_3 = self.viewer.bottom_left_pixel_snap(5.4, 10) assert test_snap_3[0] == 4.5 assert test_snap_3[1] test_snap_4 = self.viewer.bottom_left_pixel_snap(5.5, 10) assert test_snap_4[0] == 5.5 assert test_snap_4[1] def test_left_right_bottom_top(self): test_coords_1 = self.viewer.left_right_bottom_top(1, 2, 1, 2) assert test_coords_1[0:4] == (1, 2, 1, 2) assert test_coords_1[4] assert test_coords_1[5] test_coords_2 = self.viewer.left_right_bottom_top(2, 1, 1, 2) assert test_coords_2[0:4] == (1, 2, 1, 2) assert not test_coords_2[4] assert test_coords_2[5] test_coords_3 = self.viewer.left_right_bottom_top(1, 2, 2, 1) assert test_coords_3[0:4] == (1, 2, 1, 2) assert test_coords_3[4] assert not test_coords_3[5] test_coords_4 = self.viewer.left_right_bottom_top(2, 1, 2, 1) assert test_coords_4[0:4] == (1, 2, 1, 2) assert not test_coords_4[4] assert not test_coords_4[5]
planetarypy/pdsview
tests/test_pdsview.py
Python
bsd-3-clause
26,909
41.443218
79
0.621874
false
/* * yosys -- Yosys Open SYnthesis Suite * * Copyright (C) 2012 Claire Xenia Wolf <claire@yosyshq.com> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #include "kernel/yosys.h" #include "kernel/sigtools.h" #include "kernel/celltypes.h" #include "kernel/utils.h" USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN struct CheckPass : public Pass { CheckPass() : Pass("check", "check for obvious problems in the design") { } void help() override { // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---| log("\n"); log(" check [options] [selection]\n"); log("\n"); log("This pass identifies the following problems in the current design:\n"); log("\n"); log(" - combinatorial loops\n"); log(" - two or more conflicting drivers for one wire\n"); log(" - used wires that do not have a driver\n"); log("\n"); log("Options:\n"); log("\n"); log(" -noinit\n"); log(" also check for wires which have the 'init' attribute set\n"); log("\n"); log(" -initdrv\n"); log(" also check for wires that have the 'init' attribute set and are not\n"); log(" driven by an FF cell type\n"); log("\n"); log(" -mapped\n"); log(" also check for internal cells that have not been mapped to cells of the\n"); log(" target architecture\n"); log("\n"); log(" -allow-tbuf\n"); log(" modify the -mapped behavior to still allow $_TBUF_ cells\n"); log("\n"); log(" -assert\n"); log(" produce a runtime error if any problems are found in the current design\n"); log("\n"); } void execute(std::vector<std::string> args, RTLIL::Design *design) override { int counter = 0; bool noinit = false; bool initdrv = false; bool mapped = false; bool allow_tbuf = false; bool assert_mode = false; size_t argidx; for (argidx = 1; argidx < args.size(); argidx++) { if (args[argidx] == "-noinit") { noinit = true; continue; } if (args[argidx] == "-initdrv") { initdrv = true; continue; } if (args[argidx] == "-mapped") { mapped = true; continue; } if (args[argidx] == "-allow-tbuf") { allow_tbuf = true; continue; } if (args[argidx] == "-assert") { assert_mode = true; continue; } break; } extra_args(args, argidx, design); log_header(design, "Executing CHECK pass (checking for obvious problems).\n"); for (auto module : design->selected_whole_modules_warn()) { log("Checking module %s...\n", log_id(module)); SigMap sigmap(module); dict<SigBit, vector<string>> wire_drivers; dict<SigBit, int> wire_drivers_count; pool<SigBit> used_wires; TopoSort<string> topo; for (auto &proc_it : module->processes) { std::vector<RTLIL::CaseRule*> all_cases = {&proc_it.second->root_case}; for (size_t i = 0; i < all_cases.size(); i++) { for (auto action : all_cases[i]->actions) { for (auto bit : sigmap(action.first)) if (bit.wire) { wire_drivers[bit].push_back( stringf("action %s <= %s (case rule) in process %s", log_signal(action.first), log_signal(action.second), log_id(proc_it.first))); } for (auto bit : sigmap(action.second)) if (bit.wire) used_wires.insert(bit); } for (auto switch_ : all_cases[i]->switches) { for (auto case_ : switch_->cases) { all_cases.push_back(case_); for (auto compare : case_->compare) for (auto bit : sigmap(compare)) if (bit.wire) used_wires.insert(bit); } } } for (auto &sync : proc_it.second->syncs) { for (auto bit : sigmap(sync->signal)) if (bit.wire) used_wires.insert(bit); for (auto action : sync->actions) { for (auto bit : sigmap(action.first)) if (bit.wire) wire_drivers[bit].push_back( stringf("action %s <= %s (sync rule) in process %s", log_signal(action.first), log_signal(action.second), log_id(proc_it.first))); for (auto bit : sigmap(action.second)) if (bit.wire) used_wires.insert(bit); } for (auto memwr : sync->mem_write_actions) { for (auto bit : sigmap(memwr.address)) if (bit.wire) used_wires.insert(bit); for (auto bit : sigmap(memwr.data)) if (bit.wire) used_wires.insert(bit); for (auto bit : sigmap(memwr.enable)) if (bit.wire) used_wires.insert(bit); } } } for (auto cell : module->cells()) { if (mapped && cell->type.begins_with("$") && design->module(cell->type) == nullptr) { if (allow_tbuf && cell->type == ID($_TBUF_)) goto cell_allowed; log_warning("Cell %s.%s is an unmapped internal cell of type %s.\n", log_id(module), log_id(cell), log_id(cell->type)); counter++; cell_allowed:; } for (auto &conn : cell->connections()) { SigSpec sig = sigmap(conn.second); bool logic_cell = yosys_celltypes.cell_evaluable(cell->type); if (cell->input(conn.first)) for (auto bit : sig) if (bit.wire) { if (logic_cell) topo.edge(stringf("wire %s", log_signal(bit)), stringf("cell %s (%s)", log_id(cell), log_id(cell->type))); used_wires.insert(bit); } if (cell->output(conn.first)) for (int i = 0; i < GetSize(sig); i++) { if (logic_cell) topo.edge(stringf("cell %s (%s)", log_id(cell), log_id(cell->type)), stringf("wire %s", log_signal(sig[i]))); if (sig[i].wire) wire_drivers[sig[i]].push_back(stringf("port %s[%d] of cell %s (%s)", log_id(conn.first), i, log_id(cell), log_id(cell->type))); } if (!cell->input(conn.first) && cell->output(conn.first)) for (auto bit : sig) if (bit.wire) wire_drivers_count[bit]++; } } pool<SigBit> init_bits; for (auto wire : module->wires()) { if (wire->port_input) { SigSpec sig = sigmap(wire); for (int i = 0; i < GetSize(sig); i++) wire_drivers[sig[i]].push_back(stringf("module input %s[%d]", log_id(wire), i)); } if (wire->port_output) for (auto bit : sigmap(wire)) if (bit.wire) used_wires.insert(bit); if (wire->port_input && !wire->port_output) for (auto bit : sigmap(wire)) if (bit.wire) wire_drivers_count[bit]++; if (wire->attributes.count(ID::init)) { Const initval = wire->attributes.at(ID::init); for (int i = 0; i < GetSize(initval) && i < GetSize(wire); i++) if (initval[i] == State::S0 || initval[i] == State::S1) init_bits.insert(sigmap(SigBit(wire, i))); if (noinit) { log_warning("Wire %s.%s has an unprocessed 'init' attribute.\n", log_id(module), log_id(wire)); counter++; } } } for (auto it : wire_drivers) if (wire_drivers_count[it.first] > 1) { string message = stringf("multiple conflicting drivers for %s.%s:\n", log_id(module), log_signal(it.first)); for (auto str : it.second) message += stringf(" %s\n", str.c_str()); log_warning("%s", message.c_str()); counter++; } for (auto bit : used_wires) if (!wire_drivers.count(bit)) { log_warning("Wire %s.%s is used but has no driver.\n", log_id(module), log_signal(bit)); counter++; } topo.sort(); for (auto &loop : topo.loops) { string message = stringf("found logic loop in module %s:\n", log_id(module)); for (auto &str : loop) message += stringf(" %s\n", str.c_str()); log_warning("%s", message.c_str()); counter++; } if (initdrv) { for (auto cell : module->cells()) { if (RTLIL::builtin_ff_cell_types().count(cell->type) == 0) continue; for (auto bit : sigmap(cell->getPort(ID::Q))) init_bits.erase(bit); } SigSpec init_sig(init_bits); init_sig.sort_and_unify(); for (auto chunk : init_sig.chunks()) { log_warning("Wire %s.%s has 'init' attribute and is not driven by an FF cell.\n", log_id(module), log_signal(chunk)); counter++; } } } log("Found and reported %d problems.\n", counter); if (assert_mode && counter > 0) log_error("Found %d problems in 'check -assert'.\n", counter); } } CheckPass; PRIVATE_NAMESPACE_END
YosysHQ/yosys
passes/cmds/check.cc
C++
isc
8,913
32.382022
124
0.589364
false
\documentclass{beamer} \hypersetup{bookmarksdepth=5} \usepackage[T1]{fontenc} % required for luximono! \usepackage{lmodern} \usepackage[scaled=0.8]{luximono} % typewriter font with bold face % To install the luximono font files: % getnonfreefonts-sys --all or % getnonfreefonts-sys luximono % % when there are trouble you might need to: % - Create /etc/texmf/updmap.d/99local-luximono.cfg % containing the single line: Map ul9.map % - Run update-updmap followed by mktexlsr and updmap-sys % % This commands must be executed as root with a root environment % (i.e. run "sudo su" and then execute the commands in the root % shell, don't just prefix the commands with "sudo"). % formats the text according the set language \usepackage[english]{babel} \usepackage{amsmath} \usepackage{multirow} \usepackage{booktabs} \usepackage{listings} \usepackage{setspace} \usepackage{skull} \usepackage{units} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{arrows} \usetikzlibrary{scopes} \usetikzlibrary{through} \usetikzlibrary{shapes.geometric} \lstset{basicstyle=\ttfamily} \def\B#1{{\tt\textbackslash{}#1}} \def\C#1{\lstinline[language=C++]{#1}} \def\V#1{\lstinline[language=Verilog]{#1}} \lstdefinelanguage{liberty}{ morecomment=[s]{/*}{*/}, morekeywords={library,cell,area,pin,direction,function,clocked_on,next_state,clock,ff}, morestring=[b]", } \lstdefinelanguage{rtlil}{ morecomment=[l]{\#}, morekeywords={module,attribute,parameter,wire,memory,auto,width,offset,size,input,output,inout,cell,connect,switch,case,assign,sync,low,high,posedge,negedge,edge,always,update,process,end}, morestring=[b]", } \lstdefinelanguage{ys}{ morecomment=[l]{\#}, } \lstset{ commentstyle=\color{YosysGreen}, } \newenvironment{boxalertenv}{\begin{altenv}% {\usebeamertemplate{alerted text begin}\usebeamercolor[fg]{alerted text}\usebeamerfont{alerted text}\setlength{\fboxsep}{1pt}\colorbox{bg}} {\usebeamertemplate{alerted text end}}{\color{.}}{}}{\end{altenv}} \newcommand<>{\boxalert}[1]{{% \begin{boxalertenv}#2{#1}\end{boxalertenv}% }} \newcommand{\subsectionpagesuffix}{ \vfill\begin{centering} {\usebeamerfont{subsection name}\usebeamercolor[fg]{subsection name}of \sectionname~\insertsectionnumber} \vskip1em\par \setbeamercolor{graybox}{bg=gray} \begin{beamercolorbox}[sep=8pt,center]{graybox} \usebeamerfont{subsection title}\insertsection\par \end{beamercolorbox} \end{centering}} \title{Yosys Open SYnthesis Suite} \author{Clifford Wolf} \institute{http://www.clifford.at/yosys/} \usetheme{Madrid} \usecolortheme{seagull} \beamertemplatenavigationsymbolsempty \definecolor{YosysGreen}{RGB}{85,136,102} \definecolor{MyBlue}{RGB}{85,130,180} \setbeamercolor{title}{fg=black,bg=YosysGreen!70} \setbeamercolor{titlelike}{fg=black,bg=YosysGreen!70} \setbeamercolor{frametitle}{fg=black,bg=YosysGreen!70} \setbeamercolor{block title}{fg=black,bg=YosysGreen!70} \setbeamercolor{item projected}{fg=black,bg=YosysGreen} \begin{document} \begin{frame} \titlepage \end{frame} \setcounter{section}{-3} \section{Abstract} \begin{frame}{Abstract} Yosys is the first full-featured open source software for Verilog HDL synthesis. It supports most of Verilog-2005 and is well tested with real-world designs from the ASIC and FPGA world. \bigskip Learn how to use Yosys to create your own custom synthesis flows and discover why open source HDL synthesis is important for researchers, hobbyists, educators and engineers alike. \bigskip This presentation covers basic concepts of Yosys, writing synthesis scripts for a wide range of applications, creating Yosys scripts for various non-synthesis applications (such as formal equivalence checking) and writing extensions to Yosys using the C++ API. \end{frame} \section{About me} \begin{frame}{About me} Hi! I'm Clifford Wolf. \bigskip I like writing open source software. For example: \begin{itemize} \item Yosys \item OpenSCAD (now maintained by Marius Kintel) \item SPL (a not very popular scripting language) \item EmbedVM (a very simple compiler+vm for 8 bit micros) \item Lib(X)SVF (a library to play SVF/XSVF files over JTAG) \item ROCK Linux (discontinued since 2010) \end{itemize} \end{frame} \section{Outline} \begin{frame}{Outline} Yosys is an Open Source Verilog synthesis tool, and more. \bigskip Outline of this presentation: \begin{itemize} \item Introduction to the field and Yosys \item Yosys by example: synthesis \item Yosys by example: advanced synthesis \item Yosys by example: beyond synthesis \item Writing Yosys extensions in C++ \end{itemize} \end{frame} \include{PRESENTATION_Intro} \include{PRESENTATION_ExSyn} \include{PRESENTATION_ExAdv} \include{PRESENTATION_ExOth} \include{PRESENTATION_Prog} \end{document}
azonenberg/yosys
manual/presentation.tex
TeX
isc
4,716
28.111111
190
0.773961
false
/* Search */ #search { -webkit-appearance: textfield; width: 300px; height: 20px; } #results { visibility: visible; } #results tr { width: 600px; height: 20px; display: block; border: 1px solid #333; } /*visibility: hidden;*/ .hidden { visibility: hidden; } ul.dropdown { position: relative; } ul.dropdown li { font-weight: bold; float: left; zoom: 1; background: #ccc; } ul.dropdown a:hover { color: #000; } ul.dropdown a:active { color: #ffa500; } ul.dropdown li a { display: block; padding: 4px 8px; border-right: 1px solid #333; color: #222; } ul.dropdown li:last-child a { border-right: none; } /* Doesn't work in IE */ ul.dropdown li.hover, ul.dropdown li:hover { background: #F3D673; color: black; position: relative; } ul.dropdown li.hover a { color: black; } /* LEVEL TWO */ ul.dropdown ul { width: 220px; visibility: hidden; position: absolute; top: 100%; left: 0; } ul.dropdown ul li { font-weight: normal; background: #f6f6f6; color: #000; border-bottom: 1px solid #ccc; float: none; } /* IE 6 & 7 Needs Inline Block */ ul.dropdown ul li a { border-right: none; width: 100%; display: inline-block; } /* LEVEL THREE */ ul.dropdown ul ul { left: 100%; top: 0; } ul.dropdown li:hover > ul { visibility: visible; } /* LEVEL ONE */ input.dropdown { position: relative; } input.dropdown li { font-weight: bold; float: left; zoom: 1; background: #ccc; } input.dropdown a:hover { color: #000; } input.dropdown a:active { color: #ffa500; } input.dropdown li a { display: block; padding: 4px 8px; border-right: 1px solid #333; color: #222; } input.dropdown li:last-child a { border-right: none; } /* Doesn't work in IE */ input.dropdown li.hover, input.dropdown li:hover { background: #F3D673; color: black; position: relative; } input.dropdown li.hover a { color: black; }
JTarball/docker-django-polymer-starter-kit
docker/app/app/backend/apps/_archive/search_orig/static/redis_search/css/style.css
CSS
isc
2,239
31.449275
108
0.547566
false
require 'redistat/core_ext/hash' module Redistat class Buffer include Synchronize def self.instance @instance ||= self.new end def size synchronize do @size ||= 0 end end def size=(value) synchronize do @size = value end end def count @count ||= 0 end def store(key, stats, depth_limit, opts) return false unless should_buffer? to_flush = {} buffkey = buffer_key(key, opts) synchronize do if !queue.has_key?(buffkey) queue[buffkey] = { :key => key, :stats => {}, :depth_limit => depth_limit, :opts => opts } end queue[buffkey][:stats].merge_and_incr!(stats) incr_count # return items to be flushed if buffer size limit has been reached to_flush = reset_queue end # flush any data that's been cleared from the queue flush_data(to_flush) true end def flush(force = false) to_flush = {} synchronize do to_flush = reset_queue(force) end flush_data(to_flush) end private # should always be called from within a synchronize block def incr_count @count ||= 0 @count += 1 end def queue @queue ||= {} end def should_buffer? size > 1 # buffer size of 1 would be equal to not using buffer end # should always be called from within a synchronize block def should_flush? (!queue.blank? && count >= size) end # returns items to be flushed if buffer size limit has been reached # should always be called from within a synchronize block def reset_queue(force = false) return {} if !force && !should_flush? data = queue @queue = {} @count = 0 data end def flush_data(buffer_data) buffer_data.each do |k, item| Summary.update(item[:key], item[:stats], item[:depth_limit], item[:opts]) end end # depth_limit is not needed as it's evident in key.to_s def buffer_key(key, opts) # covert keys to strings, as sorting a Hash with Symbol keys fails on # Ruby 1.8.x. opts = opts.inject({}) do |result, (k, v)| result[k.to_s] = v result end "#{key.to_s}:#{opts.sort.flatten.join(':')}" end end end
jimeh/redistat
lib/redistat/buffer.rb
Ruby
mit
2,452
21.290909
81
0.548532
false
<?php /* * This file is part of the Sonata package. * * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sonata\ProductBundle\Model; use Sonata\DoctrineORMAdminBundle\Model\ModelManager; use Sonata\Component\Product\Pool; use Symfony\Bridge\Doctrine\RegistryInterface; /** * this method overwrite the default AdminModelManager to call * the custom methods from the dedicated media manager */ class DoctrineModelManager extends ModelManager { /** * @var Pool */ protected $pool; /** * @param RegistryInterface $registry * @param Pool $pool */ public function __construct(RegistryInterface $registry, Pool $pool) { parent::__construct($registry); $this->pool = $pool; } /** * {@inheritdoc} */ public function create($object) { $this->pool->getManager($object)->save($object); } /** * {@inheritdoc} */ public function update($object) { $this->pool->getManager($object)->save($object); } /** * {@inheritdoc} */ public function delete($object) { $this->pool->getManager($object)->delete($object); } }
sonata-project/sandbox-build
vendor/sonata-project/ecommerce/src/ProductBundle/Model/DoctrineModelManager.php
PHP
mit
1,338
20.580645
74
0.622571
false
# Require Consistent This (consistent-this) It is often necessary to capture the current execution context in order to make it available subsequently. A prominent example of this are jQuery callbacks: ```js var that = this; jQuery('li').click(function (event) { // here, "this" is the HTMLElement where the click event occurred that.setFoo(42); }); ``` There are many commonly used aliases for `this` such as `that`, `self` or `me`. It is desirable to ensure that whichever alias the team agrees upon is used consistently throughout the application. ## Rule Details This rule designates a variable as the chosen alias for `this`. It then enforces two things: * if a variable with the designated name is declared or assigned to, it *must* explicitly be assigned the current execution context, i.e. `this` * if `this` is explicitly assigned to a variable, the name of that variable must be the designated one ### Options This rule takes one option, a string, which is the designated `this` variable. The default is `that`. Additionally, you may configure extra aliases for cases where there are more than one supported alias for `this`. ```js { "consistent-this": [ 2, "self", "vm" ] } ] } ``` #### Usage You can set the rule configuration like this: ```json "consistent-this": [2, "that"] ``` The following patterns are considered problems: ```js /*eslint consistent-this: [2, "that"]*/ var that = 42; /*error Designated alias 'that' is not assigned to 'this'.*/ var self = this; /*error Unexpected alias 'self' for 'this'.*/ that = 42; /*error Designated alias 'that' is not assigned to 'this'.*/ self = this; /*error Unexpected alias 'self' for 'this'.*/ ``` The following patterns are not considered problems: ```js /*eslint consistent-this: [2, "that"]*/ var that = this; var self = 42; var self; that = this; foo.bar = this; ``` A declaration of an alias does not need to assign `this` in the declaration, but it must perform an appropriate assignment in the same scope as the declaration. The following patterns are also considered okay: ```js /*eslint consistent-this: [2, "that"]*/ var that; that = this; var foo, that; foo = 42; that = this; ``` But the following pattern is considered a warning: ```js /*eslint consistent-this: [2, "that"]*/ var that; /*error Designated alias 'that' is not assigned to 'this'.*/ function f() { that = this; } ``` ## When Not To Use It If you need to capture nested context, `consistent-this` is going to be problematic. Code of that nature is usually difficult to read and maintain and you should consider refactoring it.
glenjamin/eslint
docs/rules/consistent-this.md
Markdown
mit
2,632
26.416667
209
0.707447
false
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/01736/ by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:01:54 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=ISO-8859-1" /><!-- /Added by HTTrack --> <head> <title>Index of /lghtml/lawstat/version2/01736</title> </head> <body> <h1>Index of /lghtml/lawstat/version2/01736</h1> <ul><li><a href="../index.html"> Parent Directory</a></li> <li><a href="0173674101100.html"> 0173674101100.htm</a></li> </ul> </body> <!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/01736/ by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:01:54 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=ISO-8859-1" /><!-- /Added by HTTrack --> </html>
g0v/laweasyread-data
rawdata/utf8_lawstat/version2/01736/index.html
HTML
mit
871
50.235294
141
0.673938
false
// @flow import { describe, it } from "flow-typed-test"; import { apply } from "redux-saga/effects"; describe("apply(context, fn, [args])", () => { const context = { some: "contextObject" }; const fn0 = (): Promise<number> => Promise.resolve(1); const fn1 = (a: string): Promise<number> => Promise.resolve(1); const fn2 = (a: string, b: number): Promise<number> => Promise.resolve(1); const fn3 = (a: string, b: number, c: string): Promise<number> => Promise.resolve(1); const fn4 = (a: string, b: number, c: string, d: number): Promise<number> => Promise.resolve(1); const fn5 = (a: string, b: number, c: string, d: number, e: string): Promise<number> => Promise.resolve(1); const fn6 = (a: string, b: number, c: string, d: number, e: string, f: number): Promise<number> => Promise.resolve(1); const fn7 = ( a: string, b: number, c: string, d: number, e: string, f: number, g: string ): Promise<number> => Promise.resolve(1); const fn8 = ( a: string, b: number, c: string, d: number, e: string, f: number, g: string, h: number ): Promise<number> => Promise.resolve(1); const c0 = apply(context, fn0); const c1 = apply(context, fn1, "1"); const c2 = apply(context, fn2, "1", 2); const c3 = apply(context, fn3, "1", 2, "3"); const c4 = apply(context, fn4, "1", 2, "3", 4); const c5 = apply(context, fn5, "1", 2, "3", 4, "5"); const c6 = apply(context, fn6, "1", 2, "3", 4, "5", 6); const c7 = apply(context, fn6, "1", 2, "3", 4, "5", 6, "7"); const c8 = apply(context, fn6, "1", 2, "3", 4, "5", 6, "7", 8); describe("arguments tests", () => { it("must passes when used properly", () => { (c0.payload.args: []); (c1.payload.args: [string]); (c2.payload.args: [string, number]); (c3.payload.args: [string, number, string]); (c4.payload.args: [string, number, string, number]); (c5.payload.args: [string, number, string, number, string]); (c6.payload.args: [string, number, string, number, string, number]); (c7.payload.args: [string, number, string, number, string, number, string]); (c8.payload.args: [string, number, string, number, string, number, string, number]); }); it("must raises an error", () => { // $FlowExpectedError: Too few arguments apply(context, fn6, "1", 2, "3", 4); // $FlowExpectedError: Wrong argument types apply(context, fn1, 1); // $FlowExpectedError: First parameter is a string, not a number (c1.payload.args: [number]); }); }); describe("function test", () => { it("must passes when used properly", () => { (c1.payload.fn: typeof fn1); (c2.payload.fn: typeof fn2); (c3.payload.fn: typeof fn3); (c4.payload.fn: typeof fn4); (c5.payload.fn: typeof fn5); (c6.payload.fn: typeof fn6); (c7.payload.fn: typeof fn7); (c8.payload.fn: typeof fn8); }); it("must raises an error", () => { // NOTE: This should actually fail, but apparently more parameter are fine.. (c1.payload.fn: typeof fn6); // $FlowExpectedError: fn returns a Promise<string> not Promise<number> (c1.payload.fn: (a: boolean) => Promise<number>); // $FlowExpectedError: 'a' is actually of type string (c4.payload.fn: (a: number, b: number) => Promise<string>); // $FlowExpectedError: Less parameter are noticed (c6.payload.fn: typeof fn1); }); }); describe("context tests", () => { it("must haven't context", () => { (c1.payload.context: typeof context); (c2.payload.context: typeof context); (c3.payload.context: typeof context); (c4.payload.context: typeof context); (c5.payload.context: typeof context); (c6.payload.context: typeof context); (c7.payload.context: typeof context); (c8.payload.context: typeof context); }); it("must raises an error when lead context to null", () => { // $FlowExpectedError (c1.payload.context: null); }); }); });
flowtype/flow-typed
definitions/npm/redux-saga_v1.x.x/flow_v0.76.0-v0.103.x/test_redux-saga_1.x.x_apply.js
JavaScript
mit
4,062
34.017241
100
0.587395
false
/** * Clear test and aggregate reports, either for a specific framework or for * all frameworks. * * @method velocity/reports/reset * @param {Object} [options] * @param {String} [options.framework] The name of a specific framework * to clear results for. Ex. 'jasmine' or 'mocha' * @param {Array} [options.notIn] A list of test Ids which should be kept * (not cleared). These Ids must match the * ones passed to `velocity/reports/submit`. */ Velocity.Methods['velocity/reports/reset'] = function (options) { var query = {}; options = options || {}; check(options, { framework: Match.Optional(String), notIn: Match.Optional([String]) }); if (options.framework) { query.framework = options.framework; Velocity.Collections.AggregateReports.upsert({name: options.framework}, {$set: {result: 'pending'}}); } if (options.notIn) { query = _.assign(query, {_id: {$nin: options.notIn}}); } Velocity.Collections.TestReports.remove(query); VelocityInternals.updateAggregateReports(); };
meteor-velocity/velocity
src/methods/reports/reports_reset.js
JavaScript
mit
1,129
31.257143
77
0.627104
false
<!DOCTYPE html> <html lang="en"> <head> <title>Getting Started Reference</title> <link rel="stylesheet" type="text/css" href="css/jazzy.css" /> <link rel="stylesheet" type="text/css" href="css/highlight.css" /> <meta charset='utf-8'> <script src="js/jquery.min.js" defer></script> <script src="js/jazzy.js" defer></script> </head> <body> <a title="Getting Started Reference"></a> <header> <div class="content-wrapper"> <p><a href="index.html">IGListKit Docs</a> (98% documented)</p> <p class="header-right"><a href="https://github.com/Instagram/IGListKit"><img src="img/gh.png"/>View on GitHub</a></p> </div> </header> <div class="content-wrapper"> <p id="breadcrumbs"> <a href="index.html">IGListKit Reference</a> <img id="carat" src="img/carat.png" /> Getting Started Reference </p> </div> <div class="content-wrapper"> <nav class="sidebar"> <ul class="nav-groups"> <li class="nav-group-name"> <a href="Guides.html">Guides</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="best-practices-and-faq.html">Best Practices and FAQ</a> </li> <li class="nav-group-task"> <a href="generating-your-models.html">Generating your models</a> </li> <li class="nav-group-task"> <a href="getting-started.html">Getting Started</a> </li> <li class="nav-group-task"> <a href="iglistdiffable-and-equality.html">IGListDiffable and Equality</a> </li> <li class="nav-group-task"> <a href="installation.html">Installation</a> </li> <li class="nav-group-task"> <a href="migration.html">Migration</a> </li> <li class="nav-group-task"> <a href="modeling-and-binding.html">Modeling and Binding</a> </li> <li class="nav-group-task"> <a href="vision.html">VISION</a> </li> <li class="nav-group-task"> <a href="working-with-core-data.html">Working with Core Data</a> </li> <li class="nav-group-task"> <a href="working-with-uicollectionview.html">Working with UICollectionView</a> </li> </ul> </li> <li class="nav-group-name"> <a href="Classes.html">Classes</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="Classes/IGListAdapter.html">IGListAdapter</a> </li> <li class="nav-group-task"> <a href="Classes/IGListAdapterUpdater.html">IGListAdapterUpdater</a> </li> <li class="nav-group-task"> <a href="Classes/IGListBatchUpdateData.html">IGListBatchUpdateData</a> </li> <li class="nav-group-task"> <a href="Classes/IGListBindingSectionController.html">IGListBindingSectionController</a> </li> <li class="nav-group-task"> <a href="Classes/IGListCollectionView.html">IGListCollectionView</a> </li> <li class="nav-group-task"> <a href="Classes/IGListCollectionViewLayout.html">IGListCollectionViewLayout</a> </li> <li class="nav-group-task"> <a href="Classes/IGListGenericSectionController.html">IGListGenericSectionController</a> </li> <li class="nav-group-task"> <a href="Classes/IGListIndexPathResult.html">IGListIndexPathResult</a> </li> <li class="nav-group-task"> <a href="Classes/IGListIndexSetResult.html">IGListIndexSetResult</a> </li> <li class="nav-group-task"> <a href="Classes/IGListMoveIndex.html">IGListMoveIndex</a> </li> <li class="nav-group-task"> <a href="Classes/IGListMoveIndexPath.html">IGListMoveIndexPath</a> </li> <li class="nav-group-task"> <a href="Classes.html#/c:objc(cs)IGListReloadDataUpdater">IGListReloadDataUpdater</a> </li> <li class="nav-group-task"> <a href="Classes/IGListSectionController.html">IGListSectionController</a> </li> <li class="nav-group-task"> <a href="Classes/IGListSingleSectionController.html">IGListSingleSectionController</a> </li> <li class="nav-group-task"> <a href="Classes/IGListStackedSectionController.html">IGListStackedSectionController</a> </li> </ul> </li> <li class="nav-group-name"> <a href="Constants.html">Constants</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="Constants.html#/c:@IGListKitVersionNumber">IGListKitVersionNumber</a> </li> <li class="nav-group-task"> <a href="Constants.html#/c:@IGListKitVersionString">IGListKitVersionString</a> </li> </ul> </li> <li class="nav-group-name"> <a href="Enums.html">Enumerations</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="Enums/IGListAdapterUpdateType.html">IGListAdapterUpdateType</a> </li> <li class="nav-group-task"> <a href="Enums/IGListDiffOption.html">IGListDiffOption</a> </li> <li class="nav-group-task"> <a href="Enums/IGListExperiment.html">IGListExperiment</a> </li> </ul> </li> <li class="nav-group-name"> <a href="Protocols.html">Protocols</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="Protocols/IGListAdapterDataSource.html">IGListAdapterDataSource</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListAdapterDelegate.html">IGListAdapterDelegate</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListAdapterMoveDelegate.html">IGListAdapterMoveDelegate</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListAdapterUpdateListener.html">IGListAdapterUpdateListener</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListAdapterUpdaterDelegate.html">IGListAdapterUpdaterDelegate</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListBatchContext.html">IGListBatchContext</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListBindable.html">IGListBindable</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListBindingSectionControllerDataSource.html">IGListBindingSectionControllerDataSource</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListBindingSectionControllerSelectionDelegate.html">IGListBindingSectionControllerSelectionDelegate</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListCollectionContext.html">IGListCollectionContext</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListCollectionViewDelegateLayout.html">IGListCollectionViewDelegateLayout</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListDiffable.html">IGListDiffable</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListDisplayDelegate.html">IGListDisplayDelegate</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListScrollDelegate.html">IGListScrollDelegate</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListSingleSectionControllerDelegate.html">IGListSingleSectionControllerDelegate</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListSupplementaryViewSource.html">IGListSupplementaryViewSource</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListTransitionDelegate.html">IGListTransitionDelegate</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListUpdatingDelegate.html">IGListUpdatingDelegate</a> </li> <li class="nav-group-task"> <a href="Protocols/IGListWorkingRangeDelegate.html">IGListWorkingRangeDelegate</a> </li> </ul> </li> <li class="nav-group-name"> <a href="Type Definitions.html">Type Definitions</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListItemUpdateBlock">IGListItemUpdateBlock</a> </li> <li class="nav-group-task"> <a href="Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListObjectTransitionBlock">IGListObjectTransitionBlock</a> </li> <li class="nav-group-task"> <a href="Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListReloadUpdateBlock">IGListReloadUpdateBlock</a> </li> <li class="nav-group-task"> <a href="Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellConfigureBlock">IGListSingleSectionCellConfigureBlock</a> </li> <li class="nav-group-task"> <a href="Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellSizeBlock">IGListSingleSectionCellSizeBlock</a> </li> <li class="nav-group-task"> <a href="Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListToObjectBlock">IGListToObjectBlock</a> </li> <li class="nav-group-task"> <a href="Type Definitions.html#/c:IGListAdapter.h@T@IGListUpdaterCompletion">IGListUpdaterCompletion</a> </li> <li class="nav-group-task"> <a href="Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListUpdatingCompletion">IGListUpdatingCompletion</a> </li> </ul> </li> <li class="nav-group-name"> <a href="Functions.html">Functions</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="Functions.html#/c:@F@IGListDiff">IGListDiff</a> </li> <li class="nav-group-task"> <a href="Functions.html#/c:@F@IGListDiffExperiment">IGListDiffExperiment</a> </li> <li class="nav-group-task"> <a href="Functions.html#/c:@F@IGListDiffPaths">IGListDiffPaths</a> </li> <li class="nav-group-task"> <a href="Functions.html#/c:@F@IGListDiffPathsExperiment">IGListDiffPathsExperiment</a> </li> <li class="nav-group-task"> <a href="Functions.html#/c:IGListExperiments.h@F@IGListExperimentEnabled">IGListExperimentEnabled</a> </li> </ul> </li> </ul> </nav> <article class="main-content"> <section> <section class="section"> <h1 id='getting-started' class='heading'>Getting Started</h1> <p>This guide provides a brief overview for how to get started using <code>IGListKit</code>.</p> <h2 id='creating-your-first-list' class='heading'>Creating your first list</h2> <p>After installing <code>IGListKit</code>, creating a new list is easy.</p> <h3 id='creating-a-section-controller' class='heading'>Creating a section controller</h3> <p>Creating a new section controller is simple. Subclass <code><a href="Classes/IGListSectionController.html">IGListSectionController</a></code> and override at least <code>cellForItemAtIndex:</code> and <code>sizeForItemAtIndex:</code>.</p> <p>Take a look at <a href="https://raw.githubusercontent.com/Instagram/IGListKit/master/Examples/Examples-iOS/IGListKitExamples/SectionControllers/LabelSectionController.swift">LabelSectionController</a> for an example section controller that handles a <code>String</code> and configures a single cell with a <code>UILabel</code>.</p> <pre class="highlight swift"><code><span class="kd">class</span> <span class="kt">LabelSectionController</span><span class="p">:</span> <span class="kt">ListSectionController</span> <span class="p">{</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">sizeForItem</span><span class="p">(</span><span class="n">at</span> <span class="nv">index</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">CGSize</span> <span class="p">{</span> <span class="k">return</span> <span class="kt">CGSize</span><span class="p">(</span><span class="nv">width</span><span class="p">:</span> <span class="n">collectionContext</span><span class="o">!.</span><span class="n">containerSize</span><span class="o">.</span><span class="n">width</span><span class="p">,</span> <span class="nv">height</span><span class="p">:</span> <span class="mi">55</span><span class="p">)</span> <span class="p">}</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">cellForItem</span><span class="p">(</span><span class="n">at</span> <span class="nv">index</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">UICollectionViewCell</span> <span class="p">{</span> <span class="k">return</span> <span class="n">collectionContext</span><span class="o">!.</span><span class="nf">dequeueReusableCell</span><span class="p">(</span><span class="nv">of</span><span class="p">:</span> <span class="kt">MyCell</span><span class="o">.</span><span class="k">self</span><span class="p">,</span> <span class="nv">for</span><span class="p">:</span> <span class="k">self</span><span class="p">,</span> <span class="nv">at</span><span class="p">:</span> <span class="n">index</span><span class="p">)</span> <span class="p">}</span> <span class="p">}</span> </code></pre> <h3 id='creating-the-ui' class='heading'>Creating the UI</h3> <p>After creating at least one section controller, you must create a <code>UICollectionView</code> and <code><a href="Classes/IGListAdapter.html">IGListAdapter</a></code>.</p> <pre class="highlight swift"><code><span class="k">let</span> <span class="nv">layout</span> <span class="o">=</span> <span class="kt">UICollectionViewFlowLayout</span><span class="p">()</span> <span class="k">let</span> <span class="nv">collectionView</span> <span class="o">=</span> <span class="kt">UICollectionView</span><span class="p">(</span><span class="nv">frame</span><span class="p">:</span> <span class="o">.</span><span class="n">zero</span><span class="p">,</span> <span class="nv">collectionViewLayout</span><span class="p">:</span> <span class="n">layout</span><span class="p">)</span> <span class="k">let</span> <span class="nv">updater</span> <span class="o">=</span> <span class="kt">ListAdapterUpdater</span><span class="p">()</span> <span class="k">let</span> <span class="nv">adapter</span> <span class="o">=</span> <span class="kt">ListAdapter</span><span class="p">(</span><span class="nv">updater</span><span class="p">:</span> <span class="n">updater</span><span class="p">,</span> <span class="nv">viewController</span><span class="p">:</span> <span class="k">self</span><span class="p">)</span> <span class="n">adapter</span><span class="o">.</span><span class="n">collectionView</span> <span class="o">=</span> <span class="n">collectionView</span> </code></pre> <blockquote> <p><strong>Note:</strong> This example is done within a <code>UIViewController</code> and uses both a stock <code>UICollectionViewFlowLayout</code> and <code><a href="Classes/IGListAdapterUpdater.html">IGListAdapterUpdater</a></code>. You can use your own layout and updater if you need advanced features!</p> </blockquote> <h3 id='connecting-the-data-source' class='heading'>Connecting the data source</h3> <p>The last step is the <code><a href="Classes/IGListAdapter.html">IGListAdapter</a></code>&lsquo;s data source and returning some data.</p> <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">objects</span><span class="p">(</span><span class="k">for</span> <span class="nv">listAdapter</span><span class="p">:</span> <span class="kt">ListAdapter</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt">ListDiffable</span><span class="p">]</span> <span class="p">{</span> <span class="c1">// this can be anything!</span> <span class="k">return</span> <span class="p">[</span> <span class="s">"Foo"</span><span class="p">,</span> <span class="s">"Bar"</span><span class="p">,</span> <span class="mi">42</span><span class="p">,</span> <span class="s">"Biz"</span> <span class="p">]</span> <span class="p">}</span> <span class="kd">func</span> <span class="nf">listAdapter</span><span class="p">(</span><span class="n">_</span> <span class="nv">listAdapter</span><span class="p">:</span> <span class="kt">ListAdapter</span><span class="p">,</span> <span class="n">sectionControllerFor</span> <span class="nv">object</span><span class="p">:</span> <span class="kt">Any</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">ListSectionController</span> <span class="p">{</span> <span class="k">if</span> <span class="n">object</span> <span class="k">is</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">return</span> <span class="kt">LabelSectionController</span><span class="p">()</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span> <span class="k">return</span> <span class="kt">NumberSectionController</span><span class="p">()</span> <span class="p">}</span> <span class="p">}</span> <span class="kd">func</span> <span class="nf">emptyView</span><span class="p">(</span><span class="k">for</span> <span class="nv">listAdapter</span><span class="p">:</span> <span class="kt">ListAdapter</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">UIView</span><span class="p">?</span> <span class="p">{</span> <span class="k">return</span> <span class="kc">nil</span> <span class="p">}</span> </code></pre> <p>After you have created the data source you need to connect it to the <code><a href="Classes/IGListAdapter.html">IGListAdapter</a></code> by setting its <code>dataSource</code> property:</p> <pre class="highlight swift"><code><span class="n">adapter</span><span class="o">.</span><span class="n">dataSource</span> <span class="o">=</span> <span class="k">self</span> </code></pre> <p>You can return an array of <em>any</em> type of data, as long as it conforms to <code><a href="Protocols/IGListDiffable.html">IGListDiffable</a></code>.</p> <h3 id='immutability' class='heading'>Immutability</h3> <p>The data should be immutable. If you return mutable objects that you will be editing later, <code>IGListKit</code> will not be able to diff the models accurately. This is because the instances have already been changed. Thus, the updates to the objects would be lost. Instead, always return a newly instantiated, immutable object and implement <code><a href="Protocols/IGListDiffable.html">IGListDiffable</a></code>.</p> <h2 id='diffing' class='heading'>Diffing</h2> <p><code>IGListKit</code> uses an algorithm adapted from a paper titled <a href="http://dl.acm.org/citation.cfm?id=359467&dl=ACM&coll=DL">A technique for isolating differences between files</a> by Paul Heckel. This algorithm uses a technique known as the <em>longest common subsequence</em> to find a minimal diff between collections in linear time <code>O(n)</code>. It finds all <strong>inserts</strong>, <strong>deletes</strong>, <strong>updates</strong>, and <strong>moves</strong> between arrays of data.</p> <p>To add custom, diffable models, you need to conform to the <code><a href="Protocols/IGListDiffable.html">IGListDiffable</a></code> protocol and implement <code>diffIdentifier()</code> and <code>isEqual(toDiffableObject:)</code>.</p> <blockquote> <p><strong>Note:</strong> an object&rsquo;s <code>diffIdentifier()</code> should never change. If an object mutates it&rsquo;s <code>diffIdentifer()</code> the behavior of IGListKit is undefined (and almost assuredly undesirable).</p> </blockquote> <p>For an example, consider the following model:</p> <pre class="highlight swift"><code><span class="kd">class</span> <span class="kt">User</span> <span class="p">{</span> <span class="k">let</span> <span class="nv">primaryKey</span><span class="p">:</span> <span class="kt">Int</span> <span class="k">let</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span> <span class="c1">// implementation, etc</span> <span class="p">}</span> </code></pre> <p>The user&rsquo;s <code>primaryKey</code> uniquely identifies user data, and the <code>name</code> is just the value for that user.</p> <p>Let&rsquo;s say a server returns a <code>User</code> object that looks like this:</p> <pre class="highlight swift"><code><span class="k">let</span> <span class="nv">shayne</span> <span class="o">=</span> <span class="kt">User</span><span class="p">(</span><span class="nv">primaryKey</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> <span class="nv">name</span><span class="p">:</span> <span class="s">"Shayne"</span><span class="p">)</span> </code></pre> <p>But sometime after the client receives <code>shayne</code>, someone changes their name:</p> <pre class="highlight swift"><code><span class="k">let</span> <span class="nv">ann</span> <span class="o">=</span> <span class="kt">User</span><span class="p">(</span><span class="nv">primaryKey</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> <span class="nv">name</span><span class="p">:</span> <span class="s">"Ann"</span><span class="p">)</span> </code></pre> <p>Both <code>shayne</code> and <code>ann</code> represent the same <em>unique</em> data because they share the same <code>primaryKey</code>, but they are not <em>equal</em> because their names are different.</p> <p>To represent this in <code>IGListKit</code>&rsquo;s diffing, add and implement the <code><a href="Protocols/IGListDiffable.html">IGListDiffable</a></code> protocol:</p> <pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">User</span><span class="p">:</span> <span class="kt">ListDiffable</span> <span class="p">{</span> <span class="kd">func</span> <span class="nf">diffIdentifier</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">NSObjectProtocol</span> <span class="p">{</span> <span class="k">return</span> <span class="n">primaryKey</span> <span class="p">}</span> <span class="kd">func</span> <span class="nf">isEqual</span><span class="p">(</span><span class="n">toDiffableObject</span> <span class="nv">object</span><span class="p">:</span> <span class="kt">Any</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">if</span> <span class="k">let</span> <span class="nv">object</span> <span class="o">=</span> <span class="n">object</span> <span class="k">as?</span> <span class="kt">User</span> <span class="p">{</span> <span class="k">return</span> <span class="n">name</span> <span class="o">==</span> <span class="n">object</span><span class="o">.</span><span class="n">name</span> <span class="p">}</span> <span class="k">return</span> <span class="kc">false</span> <span class="p">}</span> <span class="p">}</span> </code></pre> <p>The algorithm will skip updating two <code>User</code> objects that have the same <code>primaryKey</code> and <code>name</code>, even if they are different instances! You now avoid unnecessary UI updates in the collection view even when providing new instances.</p> <blockquote> <p><strong>Note:</strong> Remember that <code>isEqual(toDiffableObject:)</code> should return <code>false</code> when you want to reload the cells in the corresponding section controller.</p> </blockquote> <h3 id='diffing-outside-of-iglistkit' class='heading'>Diffing outside of IGListKit</h3> <p>If you want to use the diffing algorithm outside of <code><a href="Classes/IGListAdapter.html">IGListAdapter</a></code> and <code>UICollectionView</code>, you can! The diffing algorithm was built with the flexibility to be used with any models that conform to <code><a href="Protocols/IGListDiffable.html">IGListDiffable</a></code>.</p> <pre class="highlight swift"><code><span class="k">let</span> <span class="nv">result</span> <span class="o">=</span> <span class="kt">ListDiff</span><span class="p">(</span><span class="nv">oldArray</span><span class="p">:</span> <span class="n">oldUsers</span><span class="p">,</span> <span class="nv">newArray</span><span class="p">:</span> <span class="n">newUsers</span><span class="p">,</span> <span class="o">.</span><span class="n">equality</span><span class="p">)</span> </code></pre> <p>With this you have all of the deletes, reloads, moves, and inserts! There&rsquo;s even a function to generate <code>NSIndexPath</code> results.</p> <h2 id='advanced-features' class='heading'>Advanced Features</h2> <h3 id='working-range' class='heading'>Working Range</h3> <p>A <em>working range</em> is a range of section controllers who aren&rsquo;t yet visible, but are near the screen. Section controllers are notified of their entrance and exit to this range. This concept lets your section controllers <strong>prepare content</strong> before they come on screen (e.g. download images).</p> <p>The <code><a href="Classes/IGListAdapter.html">IGListAdapter</a></code> must be initialized with a range value in order to work. This value is a multiple of the visible height or width, depending on the scroll-direction.</p> <pre class="highlight swift"><code><span class="k">let</span> <span class="nv">adapter</span> <span class="o">=</span> <span class="kt">ListAdapter</span><span class="p">(</span><span class="nv">updater</span><span class="p">:</span> <span class="kt">ListAdapterUpdater</span><span class="p">(),</span> <span class="nv">viewController</span><span class="p">:</span> <span class="k">self</span><span class="p">,</span> <span class="nv">workingRangeSize</span><span class="p">:</span> <span class="mi">1</span><span class="p">)</span> <span class="c1">// 1 before/after visible objects</span> </code></pre> <p><img src="https://raw.githubusercontent.com/Instagram/IGListKit/master/Resources/workingrange.png" alt="working-range"></p> <p>You can set the weak <code>workingRangeDelegate</code> on a section controller to receive events.</p> <h3 id='supplementary-views' class='heading'>Supplementary Views</h3> <p>Adding supplementary views to section controllers is as simple as setting the (weak) <code>supplementaryViewSource</code> and implementing the <code><a href="Protocols/IGListSupplementaryViewSource.html">IGListSupplementaryViewSource</a></code> protocol. This protocol works nearly the same as returning and configuring cells.</p> <h3 id='display-delegate' class='heading'>Display Delegate</h3> <p>Section controllers can set the weak <code>displayDelegate</code> delegate to an object, including <code>self</code>, to receive display events about a section controller and individual cells.</p> <h3 id='custom-updaters' class='heading'>Custom Updaters</h3> <p>The default <code><a href="Classes/IGListAdapterUpdater.html">IGListAdapterUpdater</a></code> should handle any <code>UICollectionView</code> update that you need. However, if you find the functionality lacking, or want to perform updates in a very specific way, you can create an object that conforms to the <code><a href="Protocols/IGListUpdatingDelegate.html">IGListUpdatingDelegate</a></code> protocol and initialize a new <code><a href="Classes/IGListAdapter.html">IGListAdapter</a></code> with it.</p> <p>Check out the updater <code><a href="Classes.html#/c:objc(cs)IGListReloadDataUpdater">IGListReloadDataUpdater</a></code> (used in unit tests) for an example.</p> </section> </section> <section id="footer"> <p>&copy; 2018 <a class="link" href="https://twitter.com/fbOpenSource" target="_blank" rel="external">Instagram</a>. All rights reserved. (Last updated: 2018-05-01)</p> <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p> </section> </article> </div> </body> </div> </html>
zhubofei/IGListKit
docs/getting-started.html
HTML
mit
29,819
71.016908
530
0.631997
false
//go:build windows // +build windows package vhd import ( "fmt" "syscall" "github.com/Microsoft/go-winio/pkg/guid" "golang.org/x/sys/windows" ) //go:generate go run mksyscall_windows.go -output zvhd_windows.go vhd.go //sys createVirtualDisk(virtualStorageType *VirtualStorageType, path string, virtualDiskAccessMask uint32, securityDescriptor *uintptr, createVirtualDiskFlags uint32, providerSpecificFlags uint32, parameters *CreateVirtualDiskParameters, overlapped *syscall.Overlapped, handle *syscall.Handle) (win32err error) = virtdisk.CreateVirtualDisk //sys openVirtualDisk(virtualStorageType *VirtualStorageType, path string, virtualDiskAccessMask uint32, openVirtualDiskFlags uint32, parameters *openVirtualDiskParameters, handle *syscall.Handle) (win32err error) = virtdisk.OpenVirtualDisk //sys attachVirtualDisk(handle syscall.Handle, securityDescriptor *uintptr, attachVirtualDiskFlag uint32, providerSpecificFlags uint32, parameters *AttachVirtualDiskParameters, overlapped *syscall.Overlapped) (win32err error) = virtdisk.AttachVirtualDisk //sys detachVirtualDisk(handle syscall.Handle, detachVirtualDiskFlags uint32, providerSpecificFlags uint32) (win32err error) = virtdisk.DetachVirtualDisk //sys getVirtualDiskPhysicalPath(handle syscall.Handle, diskPathSizeInBytes *uint32, buffer *uint16) (win32err error) = virtdisk.GetVirtualDiskPhysicalPath type ( CreateVirtualDiskFlag uint32 VirtualDiskFlag uint32 AttachVirtualDiskFlag uint32 DetachVirtualDiskFlag uint32 VirtualDiskAccessMask uint32 ) type VirtualStorageType struct { DeviceID uint32 VendorID guid.GUID } type CreateVersion2 struct { UniqueID guid.GUID MaximumSize uint64 BlockSizeInBytes uint32 SectorSizeInBytes uint32 PhysicalSectorSizeInByte uint32 ParentPath *uint16 // string SourcePath *uint16 // string OpenFlags uint32 ParentVirtualStorageType VirtualStorageType SourceVirtualStorageType VirtualStorageType ResiliencyGUID guid.GUID } type CreateVirtualDiskParameters struct { Version uint32 // Must always be set to 2 Version2 CreateVersion2 } type OpenVersion2 struct { GetInfoOnly bool ReadOnly bool ResiliencyGUID guid.GUID } type OpenVirtualDiskParameters struct { Version uint32 // Must always be set to 2 Version2 OpenVersion2 } // The higher level `OpenVersion2` struct uses bools to refer to `GetInfoOnly` and `ReadOnly` for ease of use. However, // the internal windows structure uses `BOOLS` aka int32s for these types. `openVersion2` is used for translating // `OpenVersion2` fields to the correct windows internal field types on the `Open____` methods. type openVersion2 struct { getInfoOnly int32 readOnly int32 resiliencyGUID guid.GUID } type openVirtualDiskParameters struct { version uint32 version2 openVersion2 } type AttachVersion2 struct { RestrictedOffset uint64 RestrictedLength uint64 } type AttachVirtualDiskParameters struct { Version uint32 Version2 AttachVersion2 } const ( VIRTUAL_STORAGE_TYPE_DEVICE_VHDX = 0x3 // Access Mask for opening a VHD VirtualDiskAccessNone VirtualDiskAccessMask = 0x00000000 VirtualDiskAccessAttachRO VirtualDiskAccessMask = 0x00010000 VirtualDiskAccessAttachRW VirtualDiskAccessMask = 0x00020000 VirtualDiskAccessDetach VirtualDiskAccessMask = 0x00040000 VirtualDiskAccessGetInfo VirtualDiskAccessMask = 0x00080000 VirtualDiskAccessCreate VirtualDiskAccessMask = 0x00100000 VirtualDiskAccessMetaOps VirtualDiskAccessMask = 0x00200000 VirtualDiskAccessRead VirtualDiskAccessMask = 0x000d0000 VirtualDiskAccessAll VirtualDiskAccessMask = 0x003f0000 VirtualDiskAccessWritable VirtualDiskAccessMask = 0x00320000 // Flags for creating a VHD CreateVirtualDiskFlagNone CreateVirtualDiskFlag = 0x0 CreateVirtualDiskFlagFullPhysicalAllocation CreateVirtualDiskFlag = 0x1 CreateVirtualDiskFlagPreventWritesToSourceDisk CreateVirtualDiskFlag = 0x2 CreateVirtualDiskFlagDoNotCopyMetadataFromParent CreateVirtualDiskFlag = 0x4 CreateVirtualDiskFlagCreateBackingStorage CreateVirtualDiskFlag = 0x8 CreateVirtualDiskFlagUseChangeTrackingSourceLimit CreateVirtualDiskFlag = 0x10 CreateVirtualDiskFlagPreserveParentChangeTrackingState CreateVirtualDiskFlag = 0x20 CreateVirtualDiskFlagVhdSetUseOriginalBackingStorage CreateVirtualDiskFlag = 0x40 CreateVirtualDiskFlagSparseFile CreateVirtualDiskFlag = 0x80 CreateVirtualDiskFlagPmemCompatible CreateVirtualDiskFlag = 0x100 CreateVirtualDiskFlagSupportCompressedVolumes CreateVirtualDiskFlag = 0x200 // Flags for opening a VHD OpenVirtualDiskFlagNone VirtualDiskFlag = 0x00000000 OpenVirtualDiskFlagNoParents VirtualDiskFlag = 0x00000001 OpenVirtualDiskFlagBlankFile VirtualDiskFlag = 0x00000002 OpenVirtualDiskFlagBootDrive VirtualDiskFlag = 0x00000004 OpenVirtualDiskFlagCachedIO VirtualDiskFlag = 0x00000008 OpenVirtualDiskFlagCustomDiffChain VirtualDiskFlag = 0x00000010 OpenVirtualDiskFlagParentCachedIO VirtualDiskFlag = 0x00000020 OpenVirtualDiskFlagVhdsetFileOnly VirtualDiskFlag = 0x00000040 OpenVirtualDiskFlagIgnoreRelativeParentLocator VirtualDiskFlag = 0x00000080 OpenVirtualDiskFlagNoWriteHardening VirtualDiskFlag = 0x00000100 OpenVirtualDiskFlagSupportCompressedVolumes VirtualDiskFlag = 0x00000200 // Flags for attaching a VHD AttachVirtualDiskFlagNone AttachVirtualDiskFlag = 0x00000000 AttachVirtualDiskFlagReadOnly AttachVirtualDiskFlag = 0x00000001 AttachVirtualDiskFlagNoDriveLetter AttachVirtualDiskFlag = 0x00000002 AttachVirtualDiskFlagPermanentLifetime AttachVirtualDiskFlag = 0x00000004 AttachVirtualDiskFlagNoLocalHost AttachVirtualDiskFlag = 0x00000008 AttachVirtualDiskFlagNoSecurityDescriptor AttachVirtualDiskFlag = 0x00000010 AttachVirtualDiskFlagBypassDefaultEncryptionPolicy AttachVirtualDiskFlag = 0x00000020 AttachVirtualDiskFlagNonPnp AttachVirtualDiskFlag = 0x00000040 AttachVirtualDiskFlagRestrictedRange AttachVirtualDiskFlag = 0x00000080 AttachVirtualDiskFlagSinglePartition AttachVirtualDiskFlag = 0x00000100 AttachVirtualDiskFlagRegisterVolume AttachVirtualDiskFlag = 0x00000200 // Flags for detaching a VHD DetachVirtualDiskFlagNone DetachVirtualDiskFlag = 0x0 ) // CreateVhdx is a helper function to create a simple vhdx file at the given path using // default values. func CreateVhdx(path string, maxSizeInGb, blockSizeInMb uint32) error { params := CreateVirtualDiskParameters{ Version: 2, Version2: CreateVersion2{ MaximumSize: uint64(maxSizeInGb) * 1024 * 1024 * 1024, BlockSizeInBytes: blockSizeInMb * 1024 * 1024, }, } handle, err := CreateVirtualDisk(path, VirtualDiskAccessNone, CreateVirtualDiskFlagNone, &params) if err != nil { return err } return syscall.CloseHandle(handle) } // DetachVirtualDisk detaches a virtual hard disk by handle. func DetachVirtualDisk(handle syscall.Handle) (err error) { if err := detachVirtualDisk(handle, 0, 0); err != nil { return fmt.Errorf("failed to detach virtual disk: %w", err) } return nil } // DetachVhd detaches a vhd found at `path`. func DetachVhd(path string) error { handle, err := OpenVirtualDisk( path, VirtualDiskAccessNone, OpenVirtualDiskFlagCachedIO|OpenVirtualDiskFlagIgnoreRelativeParentLocator, ) if err != nil { return err } defer syscall.CloseHandle(handle) return DetachVirtualDisk(handle) } // AttachVirtualDisk attaches a virtual hard disk for use. func AttachVirtualDisk(handle syscall.Handle, attachVirtualDiskFlag AttachVirtualDiskFlag, parameters *AttachVirtualDiskParameters) (err error) { // Supports both version 1 and 2 of the attach parameters as version 2 wasn't present in RS5. if err := attachVirtualDisk( handle, nil, uint32(attachVirtualDiskFlag), 0, parameters, nil, ); err != nil { return fmt.Errorf("failed to attach virtual disk: %w", err) } return nil } // AttachVhd attaches a virtual hard disk at `path` for use. Attaches using version 2 // of the ATTACH_VIRTUAL_DISK_PARAMETERS. func AttachVhd(path string) (err error) { handle, err := OpenVirtualDisk( path, VirtualDiskAccessNone, OpenVirtualDiskFlagCachedIO|OpenVirtualDiskFlagIgnoreRelativeParentLocator, ) if err != nil { return err } defer syscall.CloseHandle(handle) params := AttachVirtualDiskParameters{Version: 2} if err := AttachVirtualDisk( handle, AttachVirtualDiskFlagNone, &params, ); err != nil { return fmt.Errorf("failed to attach virtual disk: %w", err) } return nil } // OpenVirtualDisk obtains a handle to a VHD opened with supplied access mask and flags. func OpenVirtualDisk(vhdPath string, virtualDiskAccessMask VirtualDiskAccessMask, openVirtualDiskFlags VirtualDiskFlag) (syscall.Handle, error) { parameters := OpenVirtualDiskParameters{Version: 2} handle, err := OpenVirtualDiskWithParameters( vhdPath, virtualDiskAccessMask, openVirtualDiskFlags, &parameters, ) if err != nil { return 0, err } return handle, nil } // OpenVirtualDiskWithParameters obtains a handle to a VHD opened with supplied access mask, flags and parameters. func OpenVirtualDiskWithParameters(vhdPath string, virtualDiskAccessMask VirtualDiskAccessMask, openVirtualDiskFlags VirtualDiskFlag, parameters *OpenVirtualDiskParameters) (syscall.Handle, error) { var ( handle syscall.Handle defaultType VirtualStorageType getInfoOnly int32 readOnly int32 ) if parameters.Version != 2 { return handle, fmt.Errorf("only version 2 VHDs are supported, found version: %d", parameters.Version) } if parameters.Version2.GetInfoOnly { getInfoOnly = 1 } if parameters.Version2.ReadOnly { readOnly = 1 } params := &openVirtualDiskParameters{ version: parameters.Version, version2: openVersion2{ getInfoOnly, readOnly, parameters.Version2.ResiliencyGUID, }, } if err := openVirtualDisk( &defaultType, vhdPath, uint32(virtualDiskAccessMask), uint32(openVirtualDiskFlags), params, &handle, ); err != nil { return 0, fmt.Errorf("failed to open virtual disk: %w", err) } return handle, nil } // CreateVirtualDisk creates a virtual harddisk and returns a handle to the disk. func CreateVirtualDisk(path string, virtualDiskAccessMask VirtualDiskAccessMask, createVirtualDiskFlags CreateVirtualDiskFlag, parameters *CreateVirtualDiskParameters) (syscall.Handle, error) { var ( handle syscall.Handle defaultType VirtualStorageType ) if parameters.Version != 2 { return handle, fmt.Errorf("only version 2 VHDs are supported, found version: %d", parameters.Version) } if err := createVirtualDisk( &defaultType, path, uint32(virtualDiskAccessMask), nil, uint32(createVirtualDiskFlags), 0, parameters, nil, &handle, ); err != nil { return handle, fmt.Errorf("failed to create virtual disk: %w", err) } return handle, nil } // GetVirtualDiskPhysicalPath takes a handle to a virtual hard disk and returns the physical // path of the disk on the machine. This path is in the form \\.\PhysicalDriveX where X is an integer // that represents the particular enumeration of the physical disk on the caller's system. func GetVirtualDiskPhysicalPath(handle syscall.Handle) (_ string, err error) { var ( diskPathSizeInBytes uint32 = 256 * 2 // max path length 256 wide chars diskPhysicalPathBuf [256]uint16 ) if err := getVirtualDiskPhysicalPath( handle, &diskPathSizeInBytes, &diskPhysicalPathBuf[0], ); err != nil { return "", fmt.Errorf("failed to get disk physical path: %w", err) } return windows.UTF16ToString(diskPhysicalPathBuf[:]), nil } // CreateDiffVhd is a helper function to create a differencing virtual disk. func CreateDiffVhd(diffVhdPath, baseVhdPath string, blockSizeInMB uint32) error { // Setting `ParentPath` is how to signal to create a differencing disk. createParams := &CreateVirtualDiskParameters{ Version: 2, Version2: CreateVersion2{ ParentPath: windows.StringToUTF16Ptr(baseVhdPath), BlockSizeInBytes: blockSizeInMB * 1024 * 1024, OpenFlags: uint32(OpenVirtualDiskFlagCachedIO), }, } vhdHandle, err := CreateVirtualDisk( diffVhdPath, VirtualDiskAccessNone, CreateVirtualDiskFlagNone, createParams, ) if err != nil { return fmt.Errorf("failed to create differencing vhd: %w", err) } if err := syscall.CloseHandle(vhdHandle); err != nil { return fmt.Errorf("failed to close differencing vhd handle: %w", err) } return nil }
microsoft/go-winio
vhd/vhd.go
GO
mit
12,856
35.731429
339
0.768202
false
<?php defined('BX_DOL') or die('hack attempt'); /** * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/ * CC-BY License - http://creativecommons.org/licenses/by/3.0/ * * @defgroup Timeline Timeline * @ingroup TridentModules * * @{ */ bx_import('BxTemplMenu'); /** * 'Item' menu. */ class BxTimelineMenuItemManage extends BxTemplMenu { protected $_aEvent; protected $_oModule; public function __construct($aObject, $oTemplate = false) { parent::__construct($aObject, $oTemplate); $this->_oModule = BxDolModule::getInstance('bx_timeline'); $this->addMarkers(array( 'js_object_view' => $this->_oModule->_oConfig->getJsObject('view'), )); } public function setEvent($aEvent) { if(empty($aEvent) || !is_array($aEvent)) return; $this->_aEvent = $aEvent; $this->addMarkers(array( 'content_id' => $aEvent['id'], )); } public function isVisible() { if(!isset($this->_aObject['menu_items'])) $this->_aObject['menu_items'] = $this->_oQuery->getMenuItems(); $bVisible = false; foreach ($this->_aObject['menu_items'] as $a) { if((isset($a['active']) && !$a['active']) || (isset($a['visible_for_levels']) && !$this->_isVisible($a))) continue; $bVisible = true; break; } return $bVisible; } /** * Check if menu items is visible. * @param $a menu item array * @return boolean */ protected function _isVisible ($a) { if(!parent::_isVisible($a)) return false; $sCheckFuncName = ''; $aCheckFuncParams = array(); switch ($a['name']) { case 'item-delete': $sCheckFuncName = 'isAllowedDelete'; if(!empty($this->_aEvent)) $aCheckFuncParams = array($this->_aEvent); break; } if(!$sCheckFuncName || !method_exists($this->_oModule, $sCheckFuncName)) return true; return call_user_func_array(array($this->_oModule, $sCheckFuncName), $aCheckFuncParams) === true; } } /** @} */
camperjz/trident
modules/boonex/timeline/updates/8.0.5_8.0.6/source/classes/BxTimelineMenuItemManage.php
PHP
mit
2,178
23.47191
111
0.543618
false
var shelljs = require('shelljs') var is = require('is') var o = console.log var casing = require(__dirname + '/shotshell.json') var methods = ['sh'] fire(casing) function fire(casing) { for (var alias in casing) { var casing2 = casing[alias] if (is.object(casing2)) { if (methods.indexOf(alias) == -1) { o('Fire '+alias+"'s shot:") var sh = casing2.sh shelljs.exec(sh) o('Fired!: ' + sh) o('Fire subshot.') fire(casing2) } } } }
gavinengel/brawl
shotshellv.js
JavaScript
mit
517
15.15625
51
0.541586
false
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @generated SignedSource<<6905645a65399c0f3da574d400e7c7f2>> * @flow * @lightSyntaxTransform * @nogrep */ /* eslint-disable */ 'use strict'; /*:: import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type ActorChangeWithStreamTestFragment$fragmentType: FragmentType; export type ActorChangeWithStreamTestFragment$data = {| +id: string, +message: ?{| +text: ?string, |}, +feedback: ?{| +id: string, +actors: ?$ReadOnlyArray<?{| +name: ?string, |}>, |}, +$fragmentType: ActorChangeWithStreamTestFragment$fragmentType, |}; export type ActorChangeWithStreamTestFragment$key = { +$data?: ActorChangeWithStreamTestFragment$data, +$fragmentSpreads: ActorChangeWithStreamTestFragment$fragmentType, ... }; */ var node/*: ReaderFragment*/ = (function(){ var v0 = { "alias": null, "args": null, "kind": "ScalarField", "name": "id", "storageKey": null }; return { "argumentDefinitions": [], "kind": "Fragment", "metadata": null, "name": "ActorChangeWithStreamTestFragment", "selections": [ (v0/*: any*/), { "alias": null, "args": null, "concreteType": "Text", "kind": "LinkedField", "name": "message", "plural": false, "selections": [ { "alias": null, "args": null, "kind": "ScalarField", "name": "text", "storageKey": null } ], "storageKey": null }, { "alias": null, "args": null, "concreteType": "Feedback", "kind": "LinkedField", "name": "feedback", "plural": false, "selections": [ (v0/*: any*/), { "kind": "Stream", "selections": [ { "alias": null, "args": null, "concreteType": null, "kind": "LinkedField", "name": "actors", "plural": true, "selections": [ { "alias": null, "args": null, "kind": "ScalarField", "name": "name", "storageKey": null } ], "storageKey": null } ] } ], "storageKey": null } ], "type": "FeedUnit", "abstractKey": "__isFeedUnit" }; })(); if (__DEV__) { (node/*: any*/).hash = "f6caca148f49ab0721890ee040c47e77"; } module.exports = ((node/*: any*/)/*: Fragment< ActorChangeWithStreamTestFragment$fragmentType, ActorChangeWithStreamTestFragment$data, >*/);
facebook/relay
packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithStreamTestFragment.graphql.js
JavaScript
mit
2,850
22.360656
88
0.534737
false
#!/bin/bash # This script can be run with "git bisect run" to determine which JRuby commit broke the tests. # Change the test run at the bottom to narrow down the test and make it faster. # cd ../jruby # git bisect start # git bisect good `git rev-list -n 1 --before="2011-10-27 13:37" master` # git bisect bad HEAD # git bisect run ../ruboto/test_jruby.sh # When you are finished run # git bisect reset JRUBY_HOME=`pwd` RUBOTO_HOME=`dirname $0` if [ ! -e "LICENSE.RUBY" ] ; then echo "You must cd to the jruby working copy before running this script." exit 1 fi echo Remaining suspects: `git bisect view | grep "Date:" | wc -l` ant clean-all dist-gem build_status=$? # Only needed to bisect source older than JRuby 1.7.0.rc1 if [ $build_status -ne 0 ] ; then echo Build failed. Trying older ANT target. ant clean-all dist-jar-complete if [ $? -eq 0 ] ; then bin/rake gem fi build_status=$? fi rm lib/native/Darwin/libjruby-cext.jnilib git checkout . git checkout lib/native/Darwin/libjruby-cext.jnilib if [ $build_status -eq 0 ] ; then echo Build OK. else echo "Build failed, skipping revision" exit 125 fi set -e cd $RUBOTO_HOME export GEM_HOME=$RUBOTO_HOME/tmp/gems export GEM_PATH=$GEM_HOME unset JRUBY_JARS_VERSION # The version may vary across revisions export RUBOTO_PLATFORM=FROM_GEM # Avoid the CURRENT setting since it ignores our GEM bundle install gem uninstall jruby-jars --all gem install -l $JRUBY_HOME/dist/jruby-jars-*.gem rm -rf tmp/Ruboto* set +e ./matrix_tests.sh # ./run_tests.sh # ruby test/broadcast_receiver_test.rb -n test_generated_broadcast_receiver # ACTIVITY_TEST_PATTERN=subclass ruby test/ruboto_gen_test.rb -n test_activity_tests # ruby test/ruboto_gen_test.rb -n test_block_def_activity_tests test_status=$? echo echo "********************************************************************************" if [ $test_status -eq 0 ] ; then echo Bisect GOOD. else echo Bisect BAD. fi echo "********************************************************************************" echo exit $test_status
lucasallan/ruboto
test_jruby.sh
Shell
mit
2,076
24.012048
95
0.66185
false
<?php namespace Knp\FriendlyContexts\Guesser; class BooleanGuesser extends AbstractGuesser implements GuesserInterface { public function supports(array $mapping) { $mapping = array_merge([ 'type' => null ], $mapping); return $mapping['type'] === 'boolean'; } public function transform($str, array $mapping = null) { $str = strtolower($str); $formats = [ 'active' => true, 'activated' => true, 'disabled' => false, 'true' => true, 'false' => false, 'yes' => true, 'no' => false, '1' => true, '0' => false, ]; if (false === array_key_exists($str, $formats)) { throw new \Exception( sprintf( '"%s" is not a supported format. Supported format : [%s].', $str, implode(', ', array_keys($formats)) ) ); } return $formats[$str]; } public function fake(array $mapping) { return true; } public function getName() { return 'boolean'; } }
lenybernard/FriendlyContexts
src/Knp/FriendlyContexts/Guesser/BooleanGuesser.php
PHP
mit
1,230
22.653846
79
0.445528
false
#!/bin/bash FN="ceu1kgv_0.28.0.tar.gz" URLS=( "https://bioconductor.org/packages/3.10/data/experiment/src/contrib/ceu1kgv_0.28.0.tar.gz" "https://bioarchive.galaxyproject.org/ceu1kgv_0.28.0.tar.gz" "https://depot.galaxyproject.org/software/bioconductor-ceu1kgv/bioconductor-ceu1kgv_0.28.0_src_all.tar.gz" ) MD5="8a683b99ebde3995fae97e0ebc76bbdd" # Use a staging area in the conda dir rather than temp dirs, both to avoid # permission issues as well as to have things downloaded in a predictable # manner. STAGING=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM mkdir -p $STAGING TARBALL=$STAGING/$FN SUCCESS=0 for URL in ${URLS[@]}; do curl $URL > $TARBALL [[ $? == 0 ]] || continue # Platform-specific md5sum checks. if [[ $(uname -s) == "Linux" ]]; then if md5sum -c <<<"$MD5 $TARBALL"; then SUCCESS=1 break fi else if [[ $(uname -s) == "Darwin" ]]; then if [[ $(md5 $TARBALL | cut -f4 -d " ") == "$MD5" ]]; then SUCCESS=1 break fi fi fi done if [[ $SUCCESS != 1 ]]; then echo "ERROR: post-link.sh was unable to download any of the following URLs with the md5sum $MD5:" printf '%s\n' "${URLS[@]}" exit 1 fi # Install and clean up R CMD INSTALL --library=$PREFIX/lib/R/library $TARBALL rm $TARBALL rmdir $STAGING
Luobiny/bioconda-recipes
recipes/bioconductor-ceu1kgv/post-link.sh
Shell
mit
1,287
26.978261
108
0.662782
false
<?php /** * Copyright 2014 Facebook, Inc. * * You are hereby granted a non-exclusive, worldwide, royalty-free license to * use, copy, modify, and distribute this software in source code or binary * form for use in connection with the web services and APIs provided by * Facebook. * * As with any software that integrates with the Facebook platform, your use * of this software is subject to the Facebook Developer Principles and * Policies [http://developers.facebook.com/policy/]. This copyright notice * shall be included in all copies or substantial portions of the software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * */ namespace Facebook\GraphNodes; /** * Class GraphList * @package Facebook */ class GraphList extends Collection { /** * @var array $metaData An array of Graph meta data like pagination, etc. */ protected $metaData = []; /** * Init this collection of GraphObject's. * * @param array $data An array of GraphObject's. * @param array $metaData An array of Graph meta data like pagination, etc. */ public function __construct(array $data = [], array $metaData = []) { $this->metaData = $metaData; parent::__construct($data); } /** * Get the next page of results of this list of Graph objects. * * @TODO */ public function next() { } /** * Get the previous page of results of this list of Graph objects. * * @TODO */ public function previous() { } }
GeoffreyOliver/SchoolManager
application/libraries/facebook/GraphNodes/GraphList.php
PHP
mit
1,916
26.768116
77
0.69572
false
<?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @category Zend * @package Zend_Filter * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ /** * @namespace */ namespace Zend\Filter; /** * Compresses a given string * * @uses Zend\Filter\Exception * @uses Zend\Filter\AbstractFilter * @uses Zend\Loader * @category Zend * @package Zend_Filter * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Compress extends AbstractFilter { /** * Compression adapter */ protected $_adapter = 'Gz'; /** * Compression adapter constructor options */ protected $_adapterOptions = array(); /** * Class constructor * * @param string|array $options (Optional) Options to set */ public function __construct($options = null) { if ($options instanceof \Zend\Config\Config) { $options = $options->toArray(); } if (is_string($options)) { $this->setAdapter($options); } elseif ($options instanceof Compress\CompressionAlgorithm) { $this->setAdapter($options); } elseif (is_array($options)) { $this->setOptions($options); } } /** * Set filter setate * * @param array $options * @return \Zend\Filter\Compress */ public function setOptions(array $options) { foreach ($options as $key => $value) { if ($key == 'options') { $key = 'adapterOptions'; } $method = 'set' . ucfirst($key); if (method_exists($this, $method)) { $this->$method($value); } } return $this; } /** * Returns the current adapter, instantiating it if necessary * * @return string */ public function getAdapter() { if ($this->_adapter instanceof Compress\CompressionAlgorithm) { return $this->_adapter; } $adapter = $this->_adapter; $options = $this->getAdapterOptions(); if (!class_exists($adapter)) { $adapter = 'Zend\\Filter\\Compress\\' . ucfirst($adapter); if (!class_exists($adapter)) { throw new Exception\RuntimeException(sprintf( '%s unable to load adapter; class "%s" not found', __METHOD__, $this->_adapter )); } } $this->_adapter = new $adapter($options); if (!$this->_adapter instanceof Compress\CompressionAlgorithm) { throw new Exception\InvalidArgumentException("Compression adapter '" . $adapter . "' does not implement Zend\\Filter\\Compress\\CompressionAlgorithm"); } return $this->_adapter; } /** * Retrieve adapter name * * @return string */ public function getAdapterName() { return $this->getAdapter()->toString(); } /** * Sets compression adapter * * @param string|\Zend\Filter\Compress\CompressInterface $adapter Adapter to use * @return \Zend\Filter\Compress\Compress */ public function setAdapter($adapter) { if ($adapter instanceof Compress\CompressionAlgorithm) { $this->_adapter = $adapter; return $this; } if (!is_string($adapter)) { throw new Exception\InvalidArgumentException('Invalid adapter provided; must be string or instance of Zend\\Filter\\Compress\\CompressionAlgorithm'); } $this->_adapter = $adapter; return $this; } /** * Retrieve adapter options * * @return array */ public function getAdapterOptions() { return $this->_adapterOptions; } /** * Set adapter options * * @param array $options * @return void */ public function setAdapterOptions(array $options) { $this->_adapterOptions = $options; return $this; } /** * Calls adapter methods * * @param string $method Method to call * @param string|array $options Options for this method */ public function __call($method, $options) { $adapter = $this->getAdapter(); if (!method_exists($adapter, $method)) { throw new Exception\BadMethodCallException("Unknown method '{$method}'"); } return call_user_func_array(array($adapter, $method), $options); } /** * Defined by Zend_Filter_Filter * * Compresses the content $value with the defined settings * * @param string $value Content to compress * @return string The compressed content */ public function filter($value) { return $this->getAdapter()->compress($value); } }
buzzengine/buzzengine
vendor/zend-framework/library/Zend/Filter/Compress.php
PHP
mit
5,476
26.517588
163
0.572498
false
foo :: Monad m => Functor m => MonadIO m -> Int foo x = x
ruchee/vimrc
vimfiles/bundle/vim-haskell/tests/indent/test014/expected.hs
Haskell
mit
70
13
16
0.471429
false
'use strict'; module.exports = function(validator) { validator.string('mystring') .required(); };
ernestoalejo/grunt-laravel-validator
test/fixtures/subfolder/example.js
JavaScript
mit
106
14.142857
38
0.660377
false
--- layout: pattern title: Guarded Suspension folder: guarded-suspension permalink: /patterns/guarded-suspension/ categories: Concurrency tags: - Java - Difficulty-Beginner --- ## Intent Use Guarded suspension pattern to handle a situation when you want to execute a method on object which is not in a proper state. ![Guarded Suspension diagram](./etc/guarded-suspension.png) ## Applicability Use Guarded Suspension pattern when the developer knows that the method execution will be blocked for a finite period of time ## Related patterns * Balking
italoag/java-design-patterns
guarded-suspension/README.md
Markdown
mit
556
25.47619
128
0.784173
false
<?php class ProfileController extends Controller { public $defaultAction = 'profile'; public $layout='//layouts/member'; /** * @var CActiveRecord the currently loaded data model instance. */ private $_model; /** * Shows a particular model. */ public function actionProfile() { $model = $this->loadUser(); $this->render('profile',array( 'model'=>$model, 'profile'=>$model->profile, )); } /** * Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page. */ public function actionEdit() { $model = $this->loadUser(); $profile=$model->profile; // ajax validator if(isset($_POST['ajax']) && $_POST['ajax']==='profile-form') { echo UActiveForm::validate(array($model,$profile)); Yii::app()->end(); } if(isset($_POST['User'])) { $model->attributes=$_POST['User']; $profile->attributes=$_POST['Profile']; if($model->validate()&&$profile->validate()) { $model->save(); $profile->save(); Yii::app()->user->setFlash('profileMessage',UserModule::t("Changes is saved.")); $this->redirect(array('/member')); } else $profile->validate(); } $this->render('edit',array( 'model'=>$model, 'profile'=>$profile, )); } /** * Change password */ public function actionChangepassword() { $model = new UserChangePassword; if (Yii::app()->user->id) { // ajax validator if(isset($_POST['ajax']) && $_POST['ajax']==='changepassword-form') { echo UActiveForm::validate($model); Yii::app()->end(); } if(isset($_POST['UserChangePassword'])) { $model->attributes=$_POST['UserChangePassword']; if($model->validate()) { $new_password = User::model()->notsafe()->findbyPk(Yii::app()->user->id); $new_password->password = UserModule::encrypting($model->password); $new_password->activkey=UserModule::encrypting(microtime().$model->password); $new_password->save(); Yii::app()->user->setFlash('profileMessage',UserModule::t("New password is saved.")); $this->redirect(array("edit")); } } $this->render('changepassword',array('model'=>$model)); } } /** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the primary key value. Defaults to null, meaning using the 'id' GET variable */ public function loadUser() { if($this->_model===null) { if(Yii::app()->user->id) $this->_model=Yii::app()->controller->module->user(); if($this->_model===null) $this->redirect(Yii::app()->controller->module->loginUrl); } return $this->_model; } }
allengaller/zenx-tmall
web/public_html/protected/modules/user/controllers/ProfileController.php
PHP
mit
2,714
24.857143
95
0.613486
false
package cruise.associations; import org.junit.*; import cruise.associations.MentorAL; import cruise.associations.ProgramAL; import cruise.associations.StudentAL; public class UnidirectionalMStarTest { @Test(expected=RuntimeException.class) public void constructorTooFew() { StudentAL s = new StudentAL(99); StudentAL s2 = new StudentAL(98); new MentorAL("blah",s,s2); } @Test public void constructorRequiresMinimum() { StudentAL s = new StudentAL(99); StudentAL s2 = new StudentAL(98); StudentAL s3 = new StudentAL(97); MentorAL m = new MentorAL("blah",s,s2,s3); Assert.assertEquals(3,m.numberOfStudents()); } @Test public void addRemoveWithinLimits() { StudentAL s = new StudentAL(99); StudentAL s2 = new StudentAL(98); StudentAL s3 = new StudentAL(97); StudentAL s4 = new StudentAL(96); StudentAL s5 = new StudentAL(95); StudentAL s6 = new StudentAL(94); MentorAL m = new MentorAL("blah",s,s2,s3); Assert.assertEquals(3,m.numberOfStudents()); Assert.assertEquals(true,m.addStudent(s4)); Assert.assertEquals(true,m.addStudent(s5)); Assert.assertEquals(5,m.numberOfStudents()); Assert.assertEquals(false,m.removeStudent(s6)); Assert.assertEquals(true,m.removeStudent(s3)); Assert.assertEquals(true,m.removeStudent(s4)); Assert.assertEquals(false,m.removeStudent(s)); Assert.assertEquals(3,m.numberOfStudents()); } @Test public void deleteDoesNotChangeStudent() { StudentAL s = new StudentAL(99); StudentAL s2 = new StudentAL(98); StudentAL s3 = new StudentAL(98); ProgramAL p = new ProgramAL(); s.setProgram(p); MentorAL m = new MentorAL("blah",s,s2,s3); m.delete(); Assert.assertEquals(0,m.numberOfStudents()); Assert.assertEquals(p,s.getProgram()); } }
runqingz/umple
testbed/test/cruise/associations/UnidirectionalMStarTest.java
Java
mit
1,936
24.888889
51
0.656508
false
package printer_test import ( "io/ioutil" "reflect" "testing" "github.com/graphql-go/graphql/language/ast" "github.com/graphql-go/graphql/language/parser" "github.com/graphql-go/graphql/language/printer" "github.com/graphql-go/graphql/testutil" ) func parse(t *testing.T, query string) *ast.Document { astDoc, err := parser.Parse(parser.ParseParams{ Source: query, Options: parser.ParseOptions{ NoLocation: true, }, }) if err != nil { t.Fatalf("Parse failed: %v", err) } return astDoc } func TestPrinter_DoesNotAlterAST(t *testing.T) { b, err := ioutil.ReadFile("../../kitchen-sink.graphql") if err != nil { t.Fatalf("unable to load kitchen-sink.graphql") } query := string(b) astDoc := parse(t, query) astDocBefore := testutil.ASTToJSON(t, astDoc) _ = printer.Print(astDoc) astDocAfter := testutil.ASTToJSON(t, astDoc) _ = testutil.ASTToJSON(t, astDoc) if !reflect.DeepEqual(astDocAfter, astDocBefore) { t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(astDocAfter, astDocBefore)) } } func TestPrinter_PrintsMinimalAST(t *testing.T) { astDoc := ast.NewField(&ast.Field{ Name: ast.NewName(&ast.Name{ Value: "foo", }), }) results := printer.Print(astDoc) expected := "foo" if !reflect.DeepEqual(results, expected) { t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, results)) } } func TestPrinter_PrintsKitchenSink(t *testing.T) { b, err := ioutil.ReadFile("../../kitchen-sink.graphql") if err != nil { t.Fatalf("unable to load kitchen-sink.graphql") } query := string(b) astDoc := parse(t, query) expected := `query namedQuery($foo: ComplexFooType, $bar: Bar = DefaultBarValue) { customUser: user(id: [987, 654]) { id ... on User @defer { field2 { id alias: field1(first: 10, after: $foo) @include(if: $foo) { id ...frag } } } } } mutation favPost { fav(post: 123) @defer { post { id } } } fragment frag on Follower { foo(size: $size, bar: $b, obj: {key: "value"}) } { unnamed(truthyVal: true, falseyVal: false) query } ` results := printer.Print(astDoc) if !reflect.DeepEqual(expected, results) { t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(results, expected)) } }
sogko/graphql
language/printer/printer_test.go
GO
mit
2,274
20.252336
83
0.651715
false
<?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Test\Repository; use Composer\Repository\ComposerRepository; use Composer\IO\NullIO; use Composer\Test\Mock\FactoryMock; use Composer\Test\TestCase; use Composer\Package\Loader\ArrayLoader; use Composer\Package\Version\VersionParser; class ComposerRepositoryTest extends TestCase { /** * @dataProvider loadDataProvider */ public function testLoadData(array $expected, array $repoPackages) { $repoConfig = array( 'url' => 'http://example.org', ); $repository = $this->getMock( 'Composer\Repository\ComposerRepository', array( 'loadRootServerFile', 'createPackage', ), array( $repoConfig, new NullIO, FactoryMock::createConfig(), ) ); $repository ->expects($this->exactly(2)) ->method('loadRootServerFile') ->will($this->returnValue($repoPackages)); foreach ($expected as $at => $arg) { $stubPackage = $this->getPackage('stub/stub', '1.0.0'); $repository ->expects($this->at($at + 2)) ->method('createPackage') ->with($this->identicalTo($arg), $this->equalTo('Composer\Package\CompletePackage')) ->will($this->returnValue($stubPackage)); } // Triggers initialization $packages = $repository->getPackages(); // Final sanity check, ensure the correct number of packages were added. $this->assertCount(count($expected), $packages); } public function loadDataProvider() { return array( // Old repository format array( array( array('name' => 'foo/bar', 'version' => '1.0.0'), ), array('foo/bar' => array( 'name' => 'foo/bar', 'versions' => array( '1.0.0' => array('name' => 'foo/bar', 'version' => '1.0.0') ) )), ), // New repository format array( array( array('name' => 'bar/foo', 'version' => '3.14'), array('name' => 'bar/foo', 'version' => '3.145'), ), array('packages' => array( 'bar/foo' => array( '3.14' => array('name' => 'bar/foo', 'version' => '3.14'), '3.145' => array('name' => 'bar/foo', 'version' => '3.145'), ), )), ), ); } public function testWhatProvides() { $repo = $this->getMockBuilder('Composer\Repository\ComposerRepository') ->disableOriginalConstructor() ->setMethods(array('fetchFile')) ->getMock(); $cache = $this->getMockBuilder('Composer\Cache')->disableOriginalConstructor()->getMock(); $cache->expects($this->any()) ->method('sha256') ->will($this->returnValue(false)); $properties = array( 'cache' => $cache, 'loader' => new ArrayLoader(), 'providerListing' => array('p/a.json' => array('sha256' => 'xxx')) ); foreach ($properties as $property => $value) { $ref = new \ReflectionProperty($repo, $property); $ref->setAccessible(true); $ref->setValue($repo, $value); } $repo->expects($this->any()) ->method('fetchFile') ->will($this->returnValue(array( 'packages' => array( array(array( 'uid' => 1, 'name' => 'a', 'version' => 'dev-master', 'extra' => array('branch-alias' => array('dev-master' => '1.0.x-dev')), )), array(array( 'uid' => 2, 'name' => 'a', 'version' => 'dev-develop', 'extra' => array('branch-alias' => array('dev-develop' => '1.1.x-dev')), )), array(array( 'uid' => 3, 'name' => 'a', 'version' => '0.6', )), ) ))); $pool = $this->getMock('Composer\DependencyResolver\Pool'); $pool->expects($this->any()) ->method('isPackageAcceptable') ->will($this->returnValue(true)); $versionParser = new VersionParser(); $repo->setRootAliases(array( 'a' => array( $versionParser->normalize('0.6') => array('alias' => 'dev-feature', 'alias_normalized' => $versionParser->normalize('dev-feature')), $versionParser->normalize('1.1.x-dev') => array('alias' => '1.0', 'alias_normalized' => $versionParser->normalize('1.0')), ), )); $packages = $repo->whatProvides($pool, 'a'); $this->assertCount(7, $packages); $this->assertEquals(array('1', '1-alias', '2', '2-alias', '2-root', '3', '3-root'), array_keys($packages)); $this->assertInstanceOf('Composer\Package\AliasPackage', $packages['2-root']); $this->assertSame($packages['2'], $packages['2-root']->getAliasOf()); $this->assertSame($packages['2'], $packages['2-alias']->getAliasOf()); } }
greg0ire/composer
tests/Composer/Test/Repository/ComposerRepositoryTest.php
PHP
mit
5,850
33.821429
148
0.474188
false
// Package customer provides the /customes APIs package customer import ( "net/url" "strconv" stripe "github.com/stripe/stripe-go" ) // Client is used to invoke /customers APIs. type Client struct { B stripe.Backend Key string } // New POSTs new customers. // For more details see https://stripe.com/docs/api#create_customer. func New(params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().New(params) } func (c Client) New(params *stripe.CustomerParams) (*stripe.Customer, error) { var body *url.Values var commonParams *stripe.Params if params != nil { body = &url.Values{} if params.Balance != 0 { body.Add("account_balance", strconv.FormatInt(params.Balance, 10)) } if params.Source != nil { params.Source.AppendDetails(body, true) } if len(params.Desc) > 0 { body.Add("description", params.Desc) } if len(params.Coupon) > 0 { body.Add("coupon", params.Coupon) } if len(params.Email) > 0 { body.Add("email", params.Email) } if len(params.Plan) > 0 { body.Add("plan", params.Plan) if params.Quantity > 0 { body.Add("quantity", strconv.FormatUint(params.Quantity, 10)) } if params.TrialEnd > 0 { body.Add("trial_end", strconv.FormatInt(params.TrialEnd, 10)) } } commonParams = &params.Params params.AppendTo(body) } cust := &stripe.Customer{} err := c.B.Call("POST", "/customers", c.Key, body, commonParams, cust) return cust, err } // Get returns the details of a customer. // For more details see https://stripe.com/docs/api#retrieve_customer. func Get(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().Get(id, params) } func (c Client) Get(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { var body *url.Values var commonParams *stripe.Params if params != nil { body = &url.Values{} commonParams = &params.Params params.AppendTo(body) } cust := &stripe.Customer{} err := c.B.Call("GET", "/customers/"+id, c.Key, body, commonParams, cust) return cust, err } // Update updates a customer's properties. // For more details see https://stripe.com/docs/api#update_customer. func Update(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().Update(id, params) } func (c Client) Update(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { var body *url.Values var commonParams *stripe.Params if params != nil { commonParams = &params.Params body = &url.Values{} if params.Balance != 0 { body.Add("account_balance", strconv.FormatInt(params.Balance, 10)) } if params.Source != nil { params.Source.AppendDetails(body, true) } if len(params.Desc) > 0 { body.Add("description", params.Desc) } if len(params.Coupon) > 0 { body.Add("coupon", params.Coupon) } if len(params.Email) > 0 { body.Add("email", params.Email) } if len(params.DefaultSource) > 0 { body.Add("default_source", params.DefaultSource) } params.AppendTo(body) } cust := &stripe.Customer{} err := c.B.Call("POST", "/customers/"+id, c.Key, body, commonParams, cust) return cust, err } // Del removes a customer. // For more details see https://stripe.com/docs/api#delete_customer. func Del(id string) error { return getC().Del(id) } func (c Client) Del(id string) error { return c.B.Call("DELETE", "/customers/"+id, c.Key, nil, nil, nil) } // List returns a list of customers. // For more details see https://stripe.com/docs/api#list_customers. func List(params *stripe.CustomerListParams) *Iter { return getC().List(params) } func (c Client) List(params *stripe.CustomerListParams) *Iter { type customerList struct { stripe.ListMeta Values []*stripe.Customer `json:"data"` } var body *url.Values var lp *stripe.ListParams if params != nil { body = &url.Values{} if params.Created > 0 { body.Add("created", strconv.FormatInt(params.Created, 10)) } params.AppendTo(body) lp = &params.ListParams } return &Iter{stripe.GetIter(lp, body, func(b url.Values) ([]interface{}, stripe.ListMeta, error) { list := &customerList{} err := c.B.Call("GET", "/customers", c.Key, &b, nil, list) ret := make([]interface{}, len(list.Values)) for i, v := range list.Values { ret[i] = v } return ret, list.ListMeta, err })} } // Iter is an iterator for lists of Customers. // The embedded Iter carries methods with it; // see its documentation for details. type Iter struct { *stripe.Iter } // Customer returns the most recent Customer // visited by a call to Next. func (i *Iter) Customer() *stripe.Customer { return i.Current().(*stripe.Customer) } func getC() Client { return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} }
ryanlower/stripe-go
customer/client.go
GO
mit
4,739
22.344828
99
0.679468
false
# encoding: utf-8 require 'rubocop' rubocop_path = File.join(File.dirname(__FILE__), '../vendor/rubocop') unless File.directory?(rubocop_path) fail "Can't run specs without a local RuboCop checkout. Look in the README." end Dir["#{rubocop_path}/spec/support/**/*.rb"].each { |f| require f } RSpec.configure do |config| config.order = :random config.expect_with :rspec do |expectations| expectations.syntax = :expect # Disable `should` end config.mock_with :rspec do |mocks| mocks.syntax = :expect # Disable `should_receive` and `stub` end end $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'rubocop-rspec'
geniou/rubocop-rspec
spec/spec_helper.rb
Ruby
mit
703
27.12
78
0.6899
false
/** * * Performs a specific touch action. The action object need to contain the action * name (longPress, press, tap, wait, moveTo, release) and additional information * about either the element, x/y coordinates or touch counts. * * <example> :touchPerformPress.js browser.touchPerform({ action: 'press', type: { x: 100, y: 250 } }); :touchPerformTap.js browser.touchPerform({ action: 'tap', options: { el: '1', // json web element was queried before x: 10, // x offset y: 20, // y offset count: 1 // number of touches } }); * </example> * * @param {Object} actions touch action as object or object[] with attributes like touchCount, x, y, duration * * @see https://github.com/appium/node-mobile-json-wire-protocol/blob/master/docs/protocol-methods.md#mobile-json-wire-protocol-endpoints * @type mobile * @for android, ios * */ let touchPerform = function (actions) { return this.requestHandler.create({ path: '/session/:sessionId/touch/perform', method: 'POST' }, { actions }) } export default touchPerform
Risto-Stevcev/webdriverio
lib/protocol/touchPerform.js
JavaScript
mit
1,200
26.272727
138
0.605
false
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule NavigationTransitioner * @flow */ 'use strict'; const Animated = require('Animated'); const Easing = require('Easing'); const NavigationPropTypes = require('NavigationPropTypes'); const NavigationScenesReducer = require('NavigationScenesReducer'); const React = require('React'); const StyleSheet = require('StyleSheet'); const View = require('View'); import type { NavigationAnimatedValue, NavigationLayout, NavigationScene, NavigationState, NavigationTransitionProps, NavigationTransitionSpec, } from 'NavigationTypeDefinition'; type Props = { configureTransition: ( a: NavigationTransitionProps, b: ?NavigationTransitionProps, ) => NavigationTransitionSpec, navigationState: NavigationState, onTransitionEnd: () => void, onTransitionStart: () => void, render: (a: NavigationTransitionProps, b: ?NavigationTransitionProps) => any, style: any, }; type State = { layout: NavigationLayout, position: NavigationAnimatedValue, progress: NavigationAnimatedValue, scenes: Array<NavigationScene>, }; const {PropTypes} = React; const DefaultTransitionSpec = { duration: 250, easing: Easing.inOut(Easing.ease), timing: Animated.timing, }; class NavigationTransitioner extends React.Component<any, Props, State> { _onLayout: (event: any) => void; _onTransitionEnd: () => void; _prevTransitionProps: ?NavigationTransitionProps; _transitionProps: NavigationTransitionProps; _isMounted: boolean; props: Props; state: State; static propTypes = { configureTransition: PropTypes.func, navigationState: NavigationPropTypes.navigationState.isRequired, onTransitionEnd: PropTypes.func, onTransitionStart: PropTypes.func, render: PropTypes.func.isRequired, }; constructor(props: Props, context: any) { super(props, context); // The initial layout isn't measured. Measured layout will be only available // when the component is mounted. const layout = { height: new Animated.Value(0), initHeight: 0, initWidth: 0, isMeasured: false, width: new Animated.Value(0), }; this.state = { layout, position: new Animated.Value(this.props.navigationState.index), progress: new Animated.Value(1), scenes: NavigationScenesReducer([], this.props.navigationState), }; this._prevTransitionProps = null; this._transitionProps = buildTransitionProps(props, this.state); this._isMounted = false; } componentWillMount(): void { this._onLayout = this._onLayout.bind(this); this._onTransitionEnd = this._onTransitionEnd.bind(this); } componentDidMount(): void { this._isMounted = true; } componentWillUnmount(): void { this._isMounted = false; } componentWillReceiveProps(nextProps: Props): void { const nextScenes = NavigationScenesReducer( this.state.scenes, nextProps.navigationState, this.props.navigationState ); if (nextScenes === this.state.scenes) { return; } const nextState = { ...this.state, scenes: nextScenes, }; this._prevTransitionProps = this._transitionProps; this._transitionProps = buildTransitionProps(nextProps, nextState); const { position, progress, } = nextState; // get the transition spec. const transitionUserSpec = nextProps.configureTransition ? nextProps.configureTransition( this._transitionProps, this._prevTransitionProps, ) : null; const transitionSpec = { ...DefaultTransitionSpec, ...transitionUserSpec, }; const {timing} = transitionSpec; delete transitionSpec.timing; progress.setValue(0); const animations = [ timing( progress, { ...transitionSpec, toValue: 1, }, ), ]; if (nextProps.navigationState.index !== this.props.navigationState.index) { animations.push( timing( position, { ...transitionSpec, toValue: nextProps.navigationState.index, }, ), ); } // update scenes and play the transition this.setState(nextState, () => { nextProps.onTransitionStart && nextProps.onTransitionStart( this._transitionProps, this._prevTransitionProps, ); Animated.parallel(animations).start(this._onTransitionEnd); }); } render(): React.Element<any> { return ( <View onLayout={this._onLayout} style={[styles.main, this.props.style]}> {this.props.render(this._transitionProps, this._prevTransitionProps)} </View> ); } _onLayout(event: any): void { const {height, width} = event.nativeEvent.layout; if (this.state.layout.initWidth === width && this.state.layout.initHeight === height) { return; } const layout = { ...this.state.layout, initHeight: height, initWidth: width, isMeasured: true, }; layout.height.setValue(height); layout.width.setValue(width); const nextState = { ...this.state, layout, }; this._transitionProps = buildTransitionProps(this.props, nextState); this.setState(nextState); } _onTransitionEnd(): void { if (!this._isMounted) { return; } const prevTransitionProps = this._prevTransitionProps; this._prevTransitionProps = null; const nextState = { ...this.state, scenes: this.state.scenes.filter(isSceneNotStale), }; this._transitionProps = buildTransitionProps(this.props, nextState); this.setState(nextState, () => { this.props.onTransitionEnd && this.props.onTransitionEnd( this._transitionProps, prevTransitionProps, ); }); } } function buildTransitionProps( props: Props, state: State, ): NavigationTransitionProps { const { navigationState, } = props; const { layout, position, progress, scenes, } = state; return { layout, navigationState, position, progress, scenes, // $FlowFixMe(>=0.32.0) - find can return undefined scene: scenes.find(isSceneActive), }; } function isSceneNotStale(scene: NavigationScene): boolean { return !scene.isStale; } function isSceneActive(scene: NavigationScene): boolean { return scene.isActive; } const styles = StyleSheet.create({ main: { flex: 1, }, }); module.exports = NavigationTransitioner;
HarrisLee/React-Native-Express
SmartDemo/ReactComponent/node_modules/react-native/Libraries/NavigationExperimental/NavigationTransitioner.js
JavaScript
mit
6,798
22.686411
80
0.6599
false
/* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include <string.h> #include "src/core/ext/filters/http/client/http_client_filter.h" #include "src/core/ext/filters/http/message_compress/message_compress_filter.h" #include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/lib/channel/channel_stack_builder.h" #include "src/core/lib/surface/call.h" #include "src/core/lib/surface/channel_init.h" #include "src/core/lib/transport/transport_impl.h" typedef struct { const grpc_channel_filter* filter; const char* control_channel_arg; } optional_filter; static optional_filter compress_filter = { &grpc_message_compress_filter, GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION}; static bool is_building_http_like_transport( grpc_channel_stack_builder* builder) { grpc_transport* t = grpc_channel_stack_builder_get_transport(builder); return t != nullptr && strstr(t->vtable->name, "http"); } static bool maybe_add_optional_filter(grpc_channel_stack_builder* builder, void* arg) { if (!is_building_http_like_transport(builder)) return true; optional_filter* filtarg = static_cast<optional_filter*>(arg); const grpc_channel_args* channel_args = grpc_channel_stack_builder_get_channel_arguments(builder); bool enable = grpc_channel_arg_get_bool( grpc_channel_args_find(channel_args, filtarg->control_channel_arg), !grpc_channel_args_want_minimal_stack(channel_args)); return enable ? grpc_channel_stack_builder_prepend_filter( builder, filtarg->filter, nullptr, nullptr) : true; } static bool maybe_add_required_filter(grpc_channel_stack_builder* builder, void* arg) { return is_building_http_like_transport(builder) ? grpc_channel_stack_builder_prepend_filter( builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr) : true; } void grpc_http_filters_init(void) { grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, maybe_add_optional_filter, &compress_filter); grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, maybe_add_optional_filter, &compress_filter); grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, maybe_add_optional_filter, &compress_filter); grpc_channel_init_register_stage( GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, maybe_add_required_filter, (void*)&grpc_http_client_filter); grpc_channel_init_register_stage( GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, maybe_add_required_filter, (void*)&grpc_http_client_filter); grpc_channel_init_register_stage( GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, maybe_add_required_filter, (void*)&grpc_http_server_filter); } void grpc_http_filters_shutdown(void) {}
tipographo/tipographo.github.io
node_modules/grpc/deps/grpc/src/core/ext/filters/http/http_filters_plugin.cc
C++
mit
3,763
42.252874
80
0.673665
false
/** * DB setup * */ "use strict"; var fs = require('fs'); var config = JSON.parse(fs.readFileSync("./config/db-dev.json", 'utf8')); var knex = require('knex')({ client : 'mysql', connection: config }); var bookshelf = require('bookshelf')(knex); module.exports = bookshelf;
butterscotchstallion/guacbot-salsa
models/index.js
JavaScript
mit
309
18.375
77
0.582524
false
<head> <title>struct TagDBtable</title> <link rel=stylesheet href=../../../../css/doc.css type=text/css> </head> <body> <div id="root"> <div id="banner"> </div> <div id="location"> <table width=100% class="location"><tr> <td><a href=../../../../base/index.html>base</a></td> <td>|</td><td><a href=../../../../base/src.lib/index.html>src.lib</a></td><td>|</td><td><a href=../../../../base/src.lib/xml/index.html>xml</a></td><td>|</td><td><a href=../../../../base/src.lib/xml/tagdb/index.html>tagdb</a></td><td>|</td> <td>TagDBtable</td> <td width=100% align=right><a href=../../../../base/src.lib/indexdoc.html>Index</a></td> </tr> </table> </div> <div id="main"> <h2 class="doctitle">TagDBtable</h2> <table> <tr><td class="docsubtitle" valign=top>Header</td></tr> <tr><td></td><td class="docbox" style="font-family: courier;">base/tagdb.h</td></tr> <tr><td class="docsubtitle">Library</td></tr> <tr><td></td><td style="font-family: courier;"><a href="index.html">tagdb</a></tr> <tr><td class="docsubtitle" valign=top>Members</td></tr> <tr><td></td><td width=80% class="docbox"><table> <tr> <td valign="top"><font size=-1 face="courier">int num;</font></td> <td valign="top">None.</td> </tr> <tr> <td valign="top"><font size=-1 face="courier"><a href="structTagDBtag.html"><code>struct TagDBtag</code></a> **tag;</font></td> <td valign="top">None.</td> </tr> </table></td></tr> <tr><td class="docsubtitle">Description</td></tr> <tr><td></td><td>None</tr> </table> <br><br> </div> <div id="tail"> <center><p> &copy; Johns Hopkins Applied Physics Laboratory 2010 </p></center> </div> </div> </body>
jspaleta/SuperDARN_MSI_ROS
linux/home/radar/ros.3.6/doc/html/base/src.lib/xml/tagdb/structTagDBtable.html
HTML
mit
1,662
27.169492
240
0.592058
false
import { moduleForComponent, test } from 'ember-qunit'; moduleForComponent('md-icon', { // Specify the other units that are required for this test // needs: ['component:foo', 'helper:bar'] unit: true }); test('it renders', function(assert) { assert.expect(2); // Creates the component instance var component = this.subject(); assert.equal(component._state, 'preRender'); // Renders the component to the page this.render(); assert.equal(component._state, 'inDOM'); });
jhr007/ember-material-design
tests/unit/components/md-icon-test.js
JavaScript
mit
496
21.545455
60
0.681452
false
<?xml version="1.0" ?><!DOCTYPE TS><TS language="nb" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Moneta</source> <translation>Om Moneta</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Moneta&lt;/b&gt; version</source> <translation>&lt;b&gt;Moneta&lt;/b&gt; versjon</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> Dette er eksperimentell programvare. Distribuert under MIT/X11 programvarelisensen, se medfølgende fil COPYING eller http://www.opensource.org/licenses/mit-license.php. Dette produktet inneholder programvare utviklet av OpenSSL prosjektet for bruk i OpenSSL Toolkit (http://www.openssl.org/) og kryptografisk programvare skrevet av Eric Young (eay@cryptsoft.com) og UPnP programvare skrevet av Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The Moneta developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Adressebok</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Dobbeltklikk for å redigere adresse eller merkelapp</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Lag en ny adresse</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopier den valgte adressen til systemets utklippstavle</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Ny Adresse</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Moneta 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>Dette er dine Moneta-adresser for mottak av betalinger. Du kan gi forskjellige adresser til alle som skal betale deg for å holde bedre oversikt.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Kopier Adresse</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Vis &amp;QR Kode</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Moneta address</source> <translation>Signer en melding for å bevise at du eier en Moneta-adresse</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Signér &amp;Melding</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Slett den valgte adressen fra listen.</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Eksporter data fra nåværende fane til fil</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 Moneta address</source> <translation>Verifiser en melding for å være sikker på at den ble signert av en angitt Moneta-adresse</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Verifiser Melding</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Slett</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Moneta 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>Kopier &amp;Merkelapp</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Rediger</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Send &amp;Coins</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Eksporter adressebok</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Kommaseparert fil (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Feil ved eksportering</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Kunne ikke skrive til filen %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Merkelapp</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(ingen merkelapp)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Dialog for Adgangsfrase</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Angi adgangsfrase</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Ny adgangsfrase</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Gjenta ny adgangsfrase</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>Skriv inn den nye adgangsfrasen for lommeboken.&lt;br/&gt;Vennligst bruk en adgangsfrase med &lt;b&gt;10 eller flere tilfeldige tegn&lt;/b&gt;, eller &lt;b&gt;åtte eller flere ord&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Krypter lommebok</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Denne operasjonen krever adgangsfrasen til lommeboken for å låse den opp.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Lås opp lommebok</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Denne operasjonen krever adgangsfrasen til lommeboken for å dekryptere den.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Dekrypter lommebok</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Endre adgangsfrase</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Skriv inn gammel og ny adgangsfrase for lommeboken.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Bekreft kryptering av lommebok</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 MONETAS&lt;/b&gt;!</source> <translation>Advarsel: Hvis du krypterer lommeboken og mister adgangsfrasen, så vil du &lt;b&gt;MISTE ALLE DINE MONETAS&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Er du sikker på at du vil kryptere lommeboken?</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>VIKTIG: Tidligere sikkerhetskopier av din lommebok-fil, bør erstattes med den nylig genererte, krypterte filen, da de blir ugyldiggjort av sikkerhetshensyn så snart du begynner å bruke den nye krypterte lommeboken.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Advarsel: Caps Lock er på !</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Lommebok kryptert</translation> </message> <message> <location line="-56"/> <source>Moneta will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your monetas from being stolen by malware infecting your computer.</source> <translation>Moneta vil nå lukkes for å fullføre krypteringsprosessen. Husk at kryptering av lommeboken ikke fullt ut kan beskytte dine monetas fra å bli stjålet om skadevare infiserer datamaskinen.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Kryptering av lommebok feilet</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Kryptering av lommebok feilet på grunn av en intern feil. Din lommebok ble ikke kryptert.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>De angitte adgangsfrasene er ulike.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Opplåsing av lommebok feilet</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Adgangsfrasen angitt for dekryptering av lommeboken var feil.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Dekryptering av lommebok feilet</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Adgangsfrase for lommebok endret.</translation> </message> </context> <context> <name>MonetaGUI</name> <message> <location filename="../monetagui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>Signer &amp;melding...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Synkroniserer med nettverk...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;Oversikt</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Vis generell oversikt over lommeboken</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transaksjoner</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Vis transaksjonshistorikk</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Rediger listen over adresser og deres merkelapper</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Vis listen over adresser for mottak av betalinger</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>&amp;Avslutt</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Avslutt applikasjonen</translation> </message> <message> <location line="+4"/> <source>Show information about Moneta</source> <translation>Vis informasjon om Moneta</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Om &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Vis informasjon om Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Innstillinger...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Krypter Lommebok...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>Lag &amp;Sikkerhetskopi av Lommebok...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Endre Adgangsfrase...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Importere blokker...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Re-indekserer blokker på disk...</translation> </message> <message> <location line="-347"/> <source>Send coins to a Moneta address</source> <translation>Send til en Moneta-adresse</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Moneta</source> <translation>Endre oppsett for Moneta</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Sikkerhetskopiér lommebok til annet sted</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Endre adgangsfrasen brukt for kryptering av lommebok</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>&amp;Feilsøkingsvindu</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Åpne konsoll for feilsøk og diagnostikk</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Verifiser melding...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Moneta</source> <translation>Moneta</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Lommebok</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Send</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Motta</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Adressebok</translation> </message> <message> <location line="+22"/> <source>&amp;About Moneta</source> <translation>&amp;Om Moneta</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Gjem / vis</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Vis eller skjul hovedvinduet</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Krypter de private nøklene som tilhører lommeboken din</translation> </message> <message> <location line="+7"/> <source>Sign messages with your Moneta addresses to prove you own them</source> <translation>Signér en melding for å bevise at du eier denne adressen</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Moneta addresses</source> <translation>Bekreft meldinger for å være sikker på at de ble signert av en angitt Moneta-adresse</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Fil</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Innstillinger</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Hjelp</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Verktøylinje for faner</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnett]</translation> </message> <message> <location line="+47"/> <source>Moneta client</source> <translation>Monetaklient</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Moneta network</source> <translation><numerusform>%n aktiv forbindelse til Moneta-nettverket</numerusform><numerusform>%n aktive forbindelser til Moneta-nettverket</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>Lastet %1 blokker med transaksjonshistorikk.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></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 type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Transaksjoner etter dette vil ikke være synlige enda.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>Denne transaksjonen overstiger størrelsesbegrensningen. Du kan likevel sende den med et gebyr på %1, som går til nodene som prosesserer transaksjonen din og støtter nettverket. Vil du betale gebyret?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Ajour</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Kommer ajour...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Bekreft transaksjonsgebyr</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Sendt transaksjon</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Innkommende transaksjon</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Dato: %1 Beløp: %2 Type: %3 Adresse: %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>URI håndtering</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Moneta address or malformed URI parameters.</source> <translation>URI kunne ikke tolkes! Dette kan forårsakes av en ugyldig Moneta-adresse eller feil i URI-parametere.</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>Lommeboken er &lt;b&gt;kryptert&lt;/b&gt; og for tiden &lt;b&gt;ulåst&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>Lommeboken er &lt;b&gt;kryptert&lt;/b&gt; og for tiden &lt;b&gt;låst&lt;/b&gt;</translation> </message> <message> <location filename="../moneta.cpp" line="+111"/> <source>A fatal error occurred. Moneta can no longer continue safely and will quit.</source> <translation>En fatal feil har inntruffet. Det er ikke trygt å fortsette og Moneta må derfor avslutte.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Nettverksvarsel</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Rediger adresse</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Merkelapp</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Merkelappen koblet til denne adressen i adresseboken</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Adresse</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>Adressen til denne oppføringen i adresseboken. Denne kan kun endres for utsendingsadresser.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Ny mottaksadresse</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Ny utsendingsadresse</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Rediger mottaksadresse</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Rediger utsendingsadresse</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Den oppgitte adressen &quot;%1&quot; er allerede i adresseboken.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Moneta address.</source> <translation>Den angitte adressed &quot;%1&quot; er ikke en gyldig Moneta-adresse.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Kunne ikke låse opp lommeboken.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Generering av ny nøkkel feilet.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Moneta-Qt</source> <translation>Moneta-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>versjon</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Bruk:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>kommandolinjevalg</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>valg i brukergrensesnitt</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Sett språk, for eksempel &quot;nb_NO&quot; (standardverdi: fra operativsystem)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Start minimert </translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Vis splashskjerm ved oppstart (standardverdi: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Innstillinger</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Hoved</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>Betal transaksjons&amp;gebyr</translation> </message> <message> <location line="+31"/> <source>Automatically start Moneta after logging in to the system.</source> <translation>Start Moneta automatisk etter innlogging.</translation> </message> <message> <location line="+3"/> <source>&amp;Start Moneta on system login</source> <translation>&amp;Start Moneta ved systeminnlogging</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;Nettverk</translation> </message> <message> <location line="+6"/> <source>Automatically open the Moneta client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Åpne automatisk Moneta klientporten på ruteren. Dette virker kun om din ruter støtter UPnP og dette er påslått.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Sett opp port vha. &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Moneta network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Koble til Moneta-nettverket gjennom en SOCKS proxy (f.eks. ved tilkobling gjennom Tor).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Koble til gjenom SOCKS proxy:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>Proxy &amp;IP:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>IP-adresse for mellomtjener (f.eks. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Port:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Proxyens port (f.eks. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;Versjon:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Proxyens SOCKS versjon (f.eks. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Vindu</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Vis kun ikon i systemkurv etter minimering av vinduet.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimer til systemkurv istedenfor oppgavelinjen</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>Minimerer vinduet istedenfor å avslutte applikasjonen når vinduet lukkes. Når dette er slått på avsluttes applikasjonen kun ved å velge avslutt i menyen.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimer ved lukking</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Visning</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Språk for brukergrensesnitt</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Moneta.</source> <translation>Språket for brukergrensesnittet kan settes her. Innstillingen trer i kraft ved omstart av Moneta.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Enhet for visning av beløper:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Velg standard delt enhet for visning i grensesnittet og for sending av monetas.</translation> </message> <message> <location line="+9"/> <source>Whether to show Moneta addresses in the transaction list or not.</source> <translation>Om Moneta-adresser skal vises i transaksjonslisten eller ikke.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Vis adresser i transaksjonslisten</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;Avbryt</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Bruk</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>standardverdi</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>Advarsel</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Moneta.</source> <translation>Denne innstillingen trer i kraft etter omstart av Moneta.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Angitt proxyadresse er ugyldig.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Skjema</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Moneta network after a connection is established, but this process has not completed yet.</source> <translation>Informasjonen som vises kan være foreldet. Din lommebok synkroniseres automatisk med Moneta-nettverket etter at tilkobling er opprettet, men denne prosessen er ikke ferdig enda.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Ubekreftet</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Lommebok</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Umoden:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Minet saldo har ikke modnet enda</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Siste transaksjoner&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Din nåværende saldo</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>Totalt antall ubekreftede transaksjoner som ikke telles med i saldo enda</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>ute av synk</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start moneta: click-to-pay handler</source> <translation>Kan ikke starte moneta: klikk-og-betal håndterer</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Dialog for QR Kode</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Etterspør Betaling</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Beløp:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Merkelapp:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Melding:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Lagre Som...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Feil ved koding av URI i QR kode.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Angitt beløp er ugyldig.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>Resulterende URI for lang, prøv å redusere teksten for merkelapp / melding.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Lagre QR Kode</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG bilder (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Klientnavn</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>-</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Klientversjon</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informasjon</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Bruker OpenSSL versjon</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Oppstartstidspunkt</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Nettverk</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Antall tilkoblinger</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>På testnett</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Blokkjeden</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Nåværende antall blokker</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Estimert totalt antall blokker</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Tidspunkt for siste blokk</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Åpne</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Kommandolinjevalg</translation> </message> <message> <location line="+7"/> <source>Show the Moneta-Qt help message to get a list with possible Moneta command-line options.</source> <translation>Vis Moneta-Qt hjelpemelding for å få en liste med mulige kommandolinjevalg.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Vis</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Konsoll</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Byggedato</translation> </message> <message> <location line="-104"/> <source>Moneta - Debug window</source> <translation>Moneta - vindu for feilsøk</translation> </message> <message> <location line="+25"/> <source>Moneta Core</source> <translation>Moneta Kjerne</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Loggfil for feilsøk</translation> </message> <message> <location line="+7"/> <source>Open the Moneta debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Åpne Moneta loggfil for feilsøk fra datamappen. Dette kan ta noen sekunder for store loggfiler.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Tøm konsoll</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Moneta RPC console.</source> <translation>Velkommen til Moneta RPC konsoll.</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>Bruk opp og ned pil for å navigere historikken, og &lt;b&gt;Ctrl-L&lt;/b&gt; for å tømme skjermen.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Skriv &lt;b&gt;help&lt;/b&gt; for en oversikt over kommandoer.</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>Send Monetas</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Send til flere enn én mottaker</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>&amp;Legg til Mottaker</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Fjern alle transaksjonsfelter</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Fjern &amp;Alt</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+10"/> <source>123.456 MONET</source> <translation>123.456 MONET</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Bekreft sending</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>S&amp;end</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; til %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Bekreft sending av monetas</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Er du sikker på at du vil sende %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> og </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>Adresse for mottaker er ugyldig.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Beløpen som skal betales må være over 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Beløpet overstiger saldo.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Totalbeløpet overstiger saldo etter at %1 transaksjonsgebyr er lagt til.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Duplikate adresser funnet. Kan bare sende én gang til hver adresse per operasjon.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Feil: Opprettelse av transaksjon feilet </translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Feil: Transaksjonen ble avvist. Dette kan skje om noe av beløpet allerede var brukt, f.eks. hvis du kopierte wallet.dat og noen monetas ble brukt i kopien men ikke ble markert som brukt her.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Skjema</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Beløp:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Betal &amp;Til:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</source> <translation>Adressen betalingen skal sendes til (f.eks. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Skriv inn en merkelapp for denne adressen for å legge den til i din adressebok</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Merkelapp:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Velg adresse fra adresseboken</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>Lim inn adresse fra utklippstavlen</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>Fjern denne mottakeren</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Moneta address (e.g. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</source> <translation>Skriv inn en Moneta adresse (f.eks. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Signaturer - Signer / Verifiser en melding</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;Signér Melding</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>Du kan signere meldinger med dine adresser for å bevise at du eier dem. Ikke signér vage meldinger da phishing-angrep kan prøve å lure deg til å signere din identitet over til andre. Signér kun fullt detaljerte utsagn som du er enig i.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</source> <translation>Adressen for signering av meldingen (f.eks. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Velg en adresse fra adresseboken</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>Lim inn adresse fra utklippstavlen</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>Skriv inn meldingen du vil signere her</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Kopier valgt signatur til utklippstavle</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Moneta address</source> <translation>Signer meldingen for å bevise at du eier denne Moneta-adressen</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Tilbakestill alle felter for meldingssignering</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Fjern &amp;Alt</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Verifiser Melding</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>Angi adresse for signering, melding (vær sikker på at du kopierer linjeskift, mellomrom, tab, etc. helt nøyaktig) og signatur under for å verifisere meldingen. Vær forsiktig med at du ikke gir signaturen mer betydning enn det som faktisk står i meldingen, for å unngå å bli lurt av såkalte &quot;man-in-the-middle&quot; angrep.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</source> <translation>Adressen meldingen var signert med (f.eks. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Moneta address</source> <translation>Verifiser meldingen for å være sikker på at den ble signert av den angitte Moneta-adressen</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>Tilbakestill alle felter for meldingsverifikasjon</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Moneta address (e.g. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</source> <translation>Skriv inn en Moneta adresse (f.eks. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Klikk &quot;Signer Melding&quot; for å generere signatur</translation> </message> <message> <location line="+3"/> <source>Enter Moneta signature</source> <translation>Angi Moneta signatur</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Angitt adresse er ugyldig.</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>Vennligst sjekk adressen og prøv igjen.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Angitt adresse refererer ikke til en nøkkel.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Opplåsing av lommebok ble avbrutt.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Privat nøkkel for den angitte adressen er ikke tilgjengelig.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Signering av melding feilet.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Melding signert.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Signaturen kunne ikke dekodes.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Vennligst sjekk signaturen og prøv igjen.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Signaturen passer ikke til meldingen.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Verifikasjon av melding feilet.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Melding verifisert.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Moneta developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnett]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Åpen til %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/frakoblet</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/ubekreftet</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 bekreftelser</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, kringkast gjennom %n node</numerusform><numerusform>, kringkast gjennom %n noder</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Dato</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Kilde</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Generert</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Fra</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Til</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>egen adresse</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>merkelapp</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Kredit</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>blir moden om %n blokk</numerusform><numerusform>blir moden om %n blokker</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>ikke akseptert</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Debet</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Transaksjonsgebyr</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Nettobeløp</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Melding</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Kommentar</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>Transaksjons-ID</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Genererte monetas må modnes 120 blokker før de kan brukes. Da du genererte denne blokken ble den kringkastet til nettverket for å legges til i blokkjeden. Hvis den ikke kommer inn i kjeden får den tilstanden &quot;ikke akseptert&quot; og vil ikke kunne brukes. Dette skjer noen ganger hvis en annen node genererer en blokk noen sekunder fra din.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informasjon for feilsøk</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transaksjon</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Inndata</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Beløp</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>sann</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>usann</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, har ikke blitt kringkastet uten problemer enda.</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>ukjent</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Transaksjonsdetaljer</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Her vises en detaljert beskrivelse av transaksjonen</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Dato</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Beløp</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>Åpen til %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Frakoblet (%1 bekreftelser)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Ubekreftet (%1 av %2 bekreftelser)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Bekreftet (%1 bekreftelser)</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>Minet saldo blir tilgjengelig når den modner om %n blokk</numerusform><numerusform>Minet saldo blir tilgjengelig når den modner om %n blokker</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>Denne blokken har ikke blitt mottatt av noen andre noder og vil sannsynligvis ikke bli akseptert!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Generert men ikke akseptert</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Mottatt med</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Mottatt fra</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Sendt til</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Betaling til deg selv</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Utvunnet</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>-</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Transaksjonsstatus. Hold muspekeren over dette feltet for å se antall bekreftelser.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Dato og tid for da transaksjonen ble mottat.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Type transaksjon.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Mottaksadresse for transaksjonen</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Beløp fjernet eller lagt til saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Alle</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>I dag</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Denne uken</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Denne måneden</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Forrige måned</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Dette året</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Intervall...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Mottatt med</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Sendt til</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Til deg selv</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Utvunnet</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Andre</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Skriv inn adresse eller merkelapp for søk</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Minimumsbeløp</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Kopier adresse</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopier merkelapp</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopiér beløp</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Kopier transaksjons-ID</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Rediger merkelapp</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Vis transaksjonsdetaljer</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Eksporter transaksjonsdata</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Kommaseparert fil (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Bekreftet</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Dato</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Merkelapp</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Beløp</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Feil ved eksport</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Kunne ikke skrive til filen %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Intervall:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>til</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Send Monetas</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>Eksporter data fra nåværende fane til fil</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Sikkerhetskopier lommebok</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Lommebokdata (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Sikkerhetskopiering feilet</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>En feil oppstod under lagringen av lommeboken til den nye plasseringen.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Sikkerhetskopiering fullført</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Lommebokdata ble lagret til den nye plasseringen. </translation> </message> </context> <context> <name>moneta-core</name> <message> <location filename="../monetastrings.cpp" line="+94"/> <source>Moneta version</source> <translation>Moneta versjon</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Bruk:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or monetad</source> <translation>Send kommando til -server eller monetad</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>List opp kommandoer</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Vis hjelpetekst for en kommando</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Innstillinger:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: moneta.conf)</source> <translation>Angi konfigurasjonsfil (standardverdi: moneta.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: monetad.pid)</source> <translation>Angi pid-fil (standardverdi: monetad.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Angi mappe for datafiler</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Sett størrelse på mellomlager for database i megabytes (standardverdi: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 10333 or testnet: 11333)</source> <translation>Lytt etter tilkoblinger på &lt;port&gt; (standardverdi: 10333 eller testnet: 11333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Hold maks &lt;n&gt; koblinger åpne til andre noder (standardverdi: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Koble til node for å hente adresser til andre noder, koble så fra igjen</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Angi din egen offentlige adresse</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Grenseverdi for å koble fra noder med dårlig oppførsel (standardverdi: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Antall sekunder noder med dårlig oppførsel hindres fra å koble til på nytt (standardverdi: 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>En feil oppstod ved opprettelse av RPC port %u for lytting: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 10332 or testnet: 11332)</source> <translation>Lytt etter JSON-RPC tilkoblinger på &lt;port&gt; (standardverdi: 10332 or testnet: 11332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Ta imot kommandolinje- og JSON-RPC-kommandoer</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Kjør i bakgrunnen som daemon og ta imot kommandoer</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Bruk testnettverket</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Ta imot tilkoblinger fra utsiden (standardverdi: 1 hvis uten -proxy eller -connect)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=monetarpc 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;Moneta Alert&quot; admin@foo.com </source> <translation>%s, du må angi rpcpassord i konfigurasjonsfilen. %s Det anbefales at du bruker det følgende tilfeldige passordet: rpcbruker=monetarpc rpcpassord=%s (du behøver ikke å huske passordet) Brukernavnet og passordet MÅ IKKE være like. Om filen ikke eksisterer, opprett den nå med eier-kun-les filrettigheter. Det er også anbefalt at å sette varselsmelding slik du får melding om problemer. For eksempel: varselmelding=echo %%s | mail -s &quot;Moneta varsel&quot; admin@foo.com</translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>En feil oppstod under oppsettet av RPC port %u for IPv6, tilbakestilles til IPv4: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Bind til angitt adresse. Bruk [vertsmaskin]:port notasjon for IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Moneta 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>Kjør kommando når relevant varsel blir mottatt (%s i cmd er erstattet med TxID)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Kjør kommando når en lommeboktransaksjon endres (%s i cmd er erstattet med TxID)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Sett maks størrelse for transaksjoner med høy prioritet / lavt gebyr, i bytes (standardverdi: 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>Advarsel: -paytxfee er satt veldig høyt! Dette er transaksjonsgebyret du betaler når du sender transaksjoner.</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>Advarsel: Viste transaksjoner kan være feil! Du, eller andre noder, kan trenge en oppgradering.</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 Moneta will not work properly.</source> <translation>Advarsel: Vennligst undersøk at din datamaskin har riktig dato og klokkeslett! Hvis klokken er stilt feil vil ikke Moneta fungere riktig.</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>Valg for opprettelse av blokker:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Koble kun til angitt(e) node(r)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>Oppdaget korrupt blokkdatabase</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Oppdag egen IP-adresse (standardverdi: 1 ved lytting og uten -externalip)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Ønsker du å gjenopprette blokkdatabasen nå?</translation> </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>Feil under oppstart av lommebokdatabasemiljø %s!</translation> </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>Feil under åpning av blokkdatabase</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Kunne ikke lytte på noen port. Bruk -listen=0 hvis det er dette du vil.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Finn andre noder gjennom DNS-oppslag (standardverdi: 1 med mindre -connect er oppgit)</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>Gjenopprett blokkjedeindex fra blk000??.dat filer</translation> </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>Verifiserer blokker...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Verifiserer lommebok...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Ugyldig -tor adresse: &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>Maks mottaksbuffer per forbindelse, &lt;n&gt;*1000 bytes (standardverdi: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Maks sendebuffer per forbindelse, &lt;n&gt;*1000 bytes (standardverdi: 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>Koble kun til noder i nettverket &lt;nett&gt; (IPv4, IPv6 eller Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Skriv ekstra informasjon for feilsøk. Medfører at alle -debug* valg tas med</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Skriv ekstra informasjon for feilsøk av nettverk</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Sett tidsstempel på debugmeldinger</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Moneta Wiki for SSL setup instructions)</source> <translation>SSL valg: (se Moneta Wiki for instruksjoner for oppsett av SSL)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Velg versjon av socks proxy (4-5, standardverdi 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Send spor/debug informasjon til konsollet istedenfor debug.log filen</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Send spor/debug informasjon til debugger</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Sett maks blokkstørrelse i bytes (standardverdi: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Sett minimum blokkstørrelse i bytes (standardverdi: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Krymp debug.log filen når klienten starter (standardverdi: 1 hvis uten -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>Angi tidsavbrudd for forbindelse i millisekunder (standardverdi: 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Bruk UPnP for lytteport (standardverdi: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Bruk UPnP for lytteport (standardverdi: 1 ved lytting)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Bruk en proxy for å nå skjulte tor tjenester (standardverdi: samme som -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Brukernavn for JSON-RPC forbindelser</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Advarsel: Denne versjonen er foreldet, oppgradering kreves!</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>Passord for JSON-RPC forbindelser</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Tillat JSON-RPC tilkoblinger fra angitt IP-adresse</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Send kommandoer til node på &lt;ip&gt; (standardverdi: 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>Eksekvér kommando når beste blokk endrer seg (%s i kommandoen erstattes med blokkens hash)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Oppgradér lommebok til nyeste format</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Angi størrelse på nøkkel-lager til &lt;n&gt; (standardverdi: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Se gjennom blokk-kjeden etter manglende lommeboktransaksjoner</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Bruk OpenSSL (https) for JSON-RPC forbindelser</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Servers sertifikat (standardverdi: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Servers private nøkkel (standardverdi: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Akseptable krypteringsmetoder (standardverdi: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Denne hjelpemeldingen</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Kan ikke binde til %s på denne datamaskinen (bind returnerte feil %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Koble til gjennom socks proxy</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Tillat DNS oppslag for -addnode, -seednode og -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Laster adresser...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Feil ved lasting av wallet.dat: Lommeboken er skadet</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Moneta</source> <translation>Feil ved lasting av wallet.dat: Lommeboken krever en nyere versjon av Moneta</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Moneta to complete</source> <translation>Lommeboken måtte skrives om: start Moneta på nytt for å fullføre</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Feil ved lasting av wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Ugyldig -proxy adresse: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Ukjent nettverk angitt i -onlynet &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Ukjent -socks proxy versjon angitt: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Kunne ikke slå opp -bind adresse: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Kunne ikke slå opp -externalip adresse: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Ugyldig beløp for -paytxfee=&lt;beløp&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Ugyldig beløp</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Utilstrekkelige midler</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Laster blokkindeks...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Legg til node for tilkobling og hold forbindelsen åpen</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Moneta is probably already running.</source> <translation>Kan ikke binde til %s på denne datamaskinen. Sannsynligvis kjører Moneta allerede.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Gebyr per KB for transaksjoner du sender</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Laster lommebok...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Kan ikke nedgradere lommebok</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Kan ikke skrive standardadresse</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Leser gjennom...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Ferdig med lasting</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>For å bruke %s opsjonen</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Feil</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>Du må sette rpcpassword=&lt;passord&gt; i konfigurasjonsfilen: %s Hvis filen ikke finnes, opprett den med leserettighet kun for eier av filen.</translation> </message> </context> </TS>
habibmasuro/moneta-1.0.1.0
src/qt/locale/moneta_nb.ts
TypeScript
mit
113,043
37.39789
395
0.625885
false
package com.rhoelementsext; import java.io.File; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.content.BroadcastReceiver; import android.content.Context; import android.content.IntentFilter; import android.app.Dialog; import android.content.res.Configuration; import android.nfc.NfcAdapter; import com.rho.rhoelements.Common; import com.rho.rhoelements.ElementsCore; import com.rhomobile.rhodes.Logger; import com.rhomobile.rhodes.RhoConf; import com.rhomobile.rhodes.RhodesActivity; import com.rhomobile.rhodes.extmanager.IRhoExtManager; import com.rhomobile.rhodes.extmanager.AbstractRhoListener; import com.rhomobile.rhodes.extmanager.RhoExtManager; import android.util.Log; import android.view.KeyEvent; public class RhoElementsProxy extends AbstractRhoListener { public static final String RHOCONFIG = "rhoelementsext"; public static int RECEIVER_REGISTER_STATUS = 0; private static final String TAG = RhoElementsProxy.class.getSimpleName(); private BroadcastReceiver mNavigateReceiver; private static ElementsCore elementsCore; private static Activity mActivity; private static RhoElementsProxy instance; @Override public void onCreate(RhodesActivity activity, Intent intent) { Logger.D(TAG, "onCreate -- START"); elementsCore = new ElementsCore(); //Create a bundle to send some relevant information to ElementsCore at init time Bundle bundle = new Bundle(); bundle.putString("source", "rhodes"); IRhoExtManager extManager = RhoExtManager.getInstance(); elementsCore.onCreate(activity, extManager.getTopView(), bundle); Logger.D(TAG, "onCreate -- intent: " + intent); if ((intent != null) && (intent.getAction() != null) && (intent.getAction().compareTo(ElementsCore.RHOELEMENTS_SHORTCUT_ACTION) == 0) ) RhoElementsExt.isFromIntent = true; mActivity = activity; initializeNavigateIntentReceiver(); Logger.D(TAG, "onCreate -- END"); } @Override public void onStart(RhodesActivity activity) { Logger.D(TAG, "onStart -- START"); elementsCore.configureWebKit(); elementsCore.onStart(activity); initializeNavigateIntentReceiver(); RhoElementsConfiguration reConfiguration = RhoElementsConfiguration.getInstance(); reConfiguration.setConfig(Common.config); RhoExtManager.getInstance().setConfig(RHOCONFIG, reConfiguration); } @Override public void onResume(RhodesActivity activity) { Logger.D(TAG, "onResume -- START"); elementsCore.onResume(activity); } @Override public void onPause(RhodesActivity activity) { Logger.D(TAG, "onPause -- START"); elementsCore.onPause(activity); } @Override public void onStop(RhodesActivity activity) { Logger.D(TAG, "onStop -- START"); elementsCore.onStop(activity); } @Override public void onDestroy(RhodesActivity activity) { Logger.D(TAG, "onDestroy -- START"); try { if (mNavigateReceiver != null) activity.unregisterReceiver(mNavigateReceiver); } catch (IllegalArgumentException e) { Logger.D(TAG, "onStop -- broadcastReceiver not registered"); } elementsCore.onDestroy(activity); elementsCore.unRegisterCustomReceiver(); } @Override public void onNewIntent(RhodesActivity activity, Intent intent) { Logger.D(TAG, "onNewIntent -- START"); RhoElementsExt.isFromIntent = true; String action = intent.getAction(); if (!(NfcAdapter.ACTION_TAG_DISCOVERED.equals(action) || NfcAdapter.ACTION_TECH_DISCOVERED.equals(action) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action))) { if (RhoExtManager.getInstance().onStartNewConfig()) //If this is true, let ElementsCore examine the intent to see whether the user is trying to load from a shortcut { elementsCore.onNewIntent(intent, true); File configXmlFile = null; File rhoconfigTxtFile = null; try { configXmlFile = new File(Common.parseAndroidURI(intent.getDataString())); if (configXmlFile != null && configXmlFile.exists()) { rhoconfigTxtFile = new File(configXmlFile.getParent() + "/rhoconfig.txt"); } if (rhoconfigTxtFile != null && rhoconfigTxtFile.exists()) { RhoConf.setPath(rhoconfigTxtFile.getParent()); RhoExtManager.getInstance().setConfig("rhoconfig", new RhoConf.RhoConfig()); } } catch (Throwable e) { Logger.E(TAG, e); } RhoElementsConfiguration reConfiguration = RhoElementsConfiguration.getInstance(); reConfiguration.setConfig(Common.config); RhoExtManager.getInstance().setConfig(RHOCONFIG, reConfiguration); } } } @Override public void onActivityResult(RhodesActivity activity, int reqCode, int resCode, Intent intent) { Logger.D(TAG, "onActivityResult -- START"); if (reqCode == elementsCore.RESULT_VIDEO_CODE) { if (resCode == android.app.Activity.RESULT_OK) { elementsCore.writeVideoCapture(intent.getData()); } } else { Generic.getInstance().onActivityResult(reqCode, resCode); } Logger.D(TAG, "onActivityResult -- END"); } @Override public Dialog onCreateDialog(RhodesActivity activity, int id/*, Bundle args*/) { Logger.D(TAG, "onCreateDialog -- START"); Logger.D(TAG, "Dialog id: " + id); return elementsCore.onCreateDialog(id); } @Override public void onCreateApplication(IRhoExtManager extManager) { Logger.T(TAG, "onCreateApplication -- START"); instance = this; extManager.addRhoListener(this); extManager.startKeyEventUpdates(this,true); //Make important, makes KeyCapture get key events first. extManager.registerExtension("rhoelements", new RhoElementsExt()); } @Override public void onConfigurationChanged(RhodesActivity activity, Configuration newConfig) { Logger.T(TAG, "onConfigurationChanged -- START"); elementsCore.onConfigurationChanged(newConfig); } @Override public boolean onKey(int keyCode, KeyEvent event) { return elementsCore.onKeyDispatchFromActivity(keyCode,event); } public static ElementsCore getElementsCoreInstance() { return elementsCore; } public static Activity getActivity() { return mActivity; } public static RhoElementsProxy getInstance() { return instance; } /** * This initializes the intent receiver for intents coming from ElementsCore */ private void initializeNavigateIntentReceiver() { Logger.D(TAG, "initializeNavigateIntentReceiver -- START"); if (mNavigateReceiver != null) return; Logger.D(TAG, "Navigate receiver not yet initialized...creating it..."); mNavigateReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Logger.D("RhoElementsExt", "onReceive"); Logger.D("RhoElementsExt", "intent: " + intent); Logger.D("RhoElementsExt", "current process_id: " + android.os.Process.myPid()); Logger.D("RhoElementsExt", "intent process_id: " + intent.getIntExtra("process_id", android.os.Process.myPid())); if ( (intent == null) || (intent.getIntExtra("process_id", android.os.Process.myPid()) != android.os.Process.myPid()) ) return; if (intent.getAction().equals(ElementsCore.RHOMOBILE_NAVIGATE_ACTION)) { if (intent.getStringExtra("url") != null) { String url = intent.getStringExtra("url"); Logger.D("RhoElementsProxy", "url: " + url); if (url.startsWith("/app")) { String callbackUrl = url; String callbackData = null; Logger.D(TAG, "NavigateReceiver -- onReceive() -- Execute ruby callback"); if (url.indexOf('{') >= 0) //contains json data { callbackUrl = url.substring(0, url.indexOf('{') ); callbackData = url.substring(callbackUrl.length()); int base64PlaceHolderPos = callbackData.lastIndexOf("<base64_placeholder>"); int base64PlaceHolderLength = "<base64_placeholder>".length(); if ( (base64PlaceHolderPos > 0) && (elementsCore.base64Data != null) ) { String suffix = url.substring(base64PlaceHolderPos + base64PlaceHolderLength, url.length()); callbackData = callbackData.substring(0, base64PlaceHolderPos) + elementsCore.base64Data + suffix; } RhoExtManager.getInstance().executeRubyCallbackWithJsonBody(callbackUrl, callbackData, "", false); elementsCore.base64Data = null; } else { RhoExtManager.getInstance().executeRubyCallback(callbackUrl, callbackData, "", false); } } else { Logger.D(TAG, "NavigateReceiver -- onReceive() -- navigate to url: " + url); int base64PlaceHolderPos = url.lastIndexOf("<base64_placeholder>"); int base64PlaceHolderLength = "<base64_placeholder>".length(); if ( (base64PlaceHolderPos > 0) && (elementsCore.base64Data != null) ) { String suffix = url.substring(base64PlaceHolderPos + base64PlaceHolderLength, url.length()); url = url.substring(0, base64PlaceHolderPos) + elementsCore.base64Data + suffix; } RhoExtManager.getInstance().navigate(url); elementsCore.base64Data = null; } } } else if (intent.getAction().equals(ElementsCore.RHOMOBILE_QUIT_ACTION)) { Logger.D(TAG, "NavigateReceiver -- onReceive() -- quit"); RhoExtManager.getInstance().quitApp(); } } }; IntentFilter intentFilter = new IntentFilter(ElementsCore.RHOMOBILE_NAVIGATE_ACTION); intentFilter.addAction(ElementsCore.RHOMOBILE_QUIT_ACTION); mActivity.registerReceiver(mNavigateReceiver, intentFilter); Logger.D(TAG, "Navigate receiver now registered"); } }
tauplatform/tau
extensions/rhoelementsext/ext/rhoelementsext/platform/android/src/com/rhoelementsext/RhoElementsProxy.java
Java
mit
10,353
34.823529
173
0.658843
false
require "refile" Refile.cache = Refile::Backend::FileSystem.new(Dir.tmpdir) Refile.store = Refile::Backend::FileSystem.new(Dir.tmpdir)
uberous/refile-nobrainer
spec/support/refile.rb
Ruby
mit
136
33
58
0.772059
false
/* * Vega Strike * Copyright (C) 2003 Mike Byron * * http://vegastrike.sourceforge.net/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SLIDER_H__ #define __SLIDER_H__ #include "gui/groupcontrol.h" //See cpp file for detailed descriptions of classes, functions, etc. //The Slider class controls the setting for a simple integer range. class Slider : public Control { public: //Range represented by the slider. void setMaxMin( int max, int min = 0 ); //"Thumb" length. 1.0 = Entire range. void setThumbLength( float len ); //Set size of a "page" - used when clicked outside the thumb. void setPageSize( int s ) { m_pageSize = s; } //Position. //This is some value between min and max. int position( void ) { return m_position; } void setPosition( int pos ); //Color of thumb. void setThumbColor( const GFXColor &color, const GFXColor &outline ) { m_thumbColor = color; m_thumbOutlineColor = outline; } void setThumbColorBasedOnColor( const GFXColor &c ); //OVERRIDES virtual void draw( void ); virtual void setRect( const Rect &r ); virtual void setColor( const GFXColor &c ); virtual bool processMouseDown( const InputEvent &event ); virtual bool processMouseUp( const InputEvent &event ); virtual bool processMouseDrag( const InputEvent &event ); //CONSTRUCTION public: Slider( void ); virtual ~Slider( void ) {} protected: //INTERNAL IMPLEMENTATION //Mouse states enum MouseState { MOUSE_NONE, //Nothing interesting going on. MOUSE_PAGE_UP, //In the middle of a Page Up click. MOUSE_PAGE_DOWN, //In the middle of a Page Down click. MOUSE_THUMB_DRAG //In the middle of dragging the thumb. }; //VARIABLES protected: int m_minValue; //The minimum value in the scrolling range. int m_maxValue; //The maximum value in the scrolling range. float m_thumbLength; //The size of the thumb relative to height/width of slider. float m_originalThumbLength; //Original setting for thumb length. int m_pageSize; //The number of units in a "page". GFXColor m_thumbColor; //Color to paint the thumb. GFXColor m_thumbOutlineColor; //Color of outline for thumb. int m_position; //The current position. bool m_vertical; //True = Vertical, false = horizontal. MouseState m_mouseState; //Which state we are in while the mouse button is pressed. float m_buttonDownMouse; //Location where the mouse button was pressed down. int m_buttonDownPosition; //Position of slider when mouse button was pressed down. Rect m_thumbRect; //Remembered position of the thumb. }; #endif //__SLIDER_H__
Ezeer/VegaStrike_win32FR
vegastrike/src/gui/slider.h
C
mit
3,472
31.448598
93
0.677707
false
import React, {PureComponent} from 'react' import uuid from 'uuid' import {ClickOutside} from 'src/shared/components/ClickOutside' import {ErrorHandling} from 'src/shared/decorators/errors' interface Props { items: Item[] onChoose: (item: Item) => void } interface Item { text?: string name?: string } interface State { open: boolean } @ErrorHandling class TagsAddButton extends PureComponent<Props, State> { constructor(props) { super(props) this.state = {open: false} } public render() { const {open} = this.state const {items} = this.props const classname = `tags-add${open ? ' open' : ''}` return ( <ClickOutside onClickOutside={this.handleClickOutside}> <div className={classname} onClick={this.handleButtonClick}> <span className="icon plus" /> <div className="tags-add--menu"> {items.map(item => ( <div key={uuid.v4()} className="tags-add--menu-item" onClick={this.handleMenuClick(item)} > {item.text} </div> ))} </div> </div> </ClickOutside> ) } private handleButtonClick = () => { this.setState({open: !this.state.open}) } private handleMenuClick = item => () => { this.setState({open: false}) this.props.onChoose(item) } private handleClickOutside = () => { this.setState({open: false}) } } export default TagsAddButton
nooproblem/influxdb
ui/src/shared/components/TagsAddButton.tsx
TypeScript
mit
1,504
21.117647
68
0.587101
false
var Service = require('../').Service; // Create a new service object var svc = new Service({ name:'Hello World', description: 'The nodejs.org example web server.', script: require('path').join(__dirname,'helloworld.js'), env:{ name: "NODE_ENV", value: "production" }, user:"vagrant", group:"vagrant" }); // Listen for the "install" event, which indicates the // process is available as a service. svc.on('install',function(){ console.log('\nInstallation Complete\n---------------------'); //svc.start(); }); // Just in case this file is run twice. svc.on('alreadyinstalled',function(){ console.log('This service is already installed.'); console.log('Attempting to start it.'); svc.start(); }); // Listen for the "start" event and let us know when the // process has actually started working. svc.on('start',function(){ console.log(svc.name+' started!\nVisit http://127.0.0.1:3000 to see it in action.\n'); }); // Install the script as a service. svc.install();
RazZziel/node-linux
example/install.js
JavaScript
mit
999
26.027027
88
0.657658
false
<?php /* SVN FILE: $Id$ */ /** * Test Suite TestPlugin AppController * * Long description for file * * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs * @since CakePHP(tm) v 1.2.0.5432 * @version $Rev$ * @modifiedby $LastChangedBy$ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ class TestPluginAppController extends AppController { } ?>
fiuwebteam/Calendar
vendors/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php
PHP
mit
981
34.071429
101
0.695209
false
<!DOCTYPE html> <html> <head> <meta charset='UTF-8'> <title>Atom-Beautify Documentation</title> <script src='../../../javascript/application.js'></script> <script src='../../../javascript/search.js'></script> <link rel='stylesheet' href='../../../stylesheets/application.css' type='text/css'> </head> <body> <div id='base' data-path='../../../'></div> <div id='header'> <div id='menu'> <a href='../../../extra/README.md.html' title='Atom-Beautify'> Atom-Beautify </a> &raquo; <a href='../../../alphabetical_index.html' title='Index'> Index </a> &raquo; <span class='title'>src</span> &raquo; <span class='title'>beautifiers</span> &raquo; <span class='title'>puppet-fix.coffee</span> </div> </div> <div id='content'> <h1> File: puppet-fix.coffee </h1> <table class='box'> <tr> <td>Defined in:</td> <td>src&#47;beautifiers</td> </tr> <tr> <td> Classes: </td> <td> <a href='../../../class/PuppetFix.html'> PuppetFix </a> </td> </tr> </table> </div> <div id='footer'> By <a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'> Codo </a> 2.1.2 &#10034; Press H to see the keyboard shortcuts &#10034; <a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a> &#10034; <a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a> </div> <iframe id='search_frame'></iframe> <div id='fuzzySearch'> <input type='text'> <ol></ol> </div> <div id='help'> <p> Quickly fuzzy find classes, mixins, methods, file: </p> <ul> <li> <span>T</span> Open fuzzy finder dialog </li> </ul> <p> Control the navigation frame: </p> <ul> <li> <span>L</span> Toggle list view </li> <li> <span>C</span> Show class list </li> <li> <span>I</span> Show mixin list </li> <li> <span>F</span> Show file list </li> <li> <span>M</span> Show method list </li> <li> <span>E</span> Show extras list </li> </ul> <p> You can focus and blur the search input: </p> <ul> <li> <span>S</span> Focus search input </li> <li> <span>Esc</span> Blur search input </li> </ul> </div> </body> </html>
adammenges/atomconfig
packages/atom-beautify/docs/code/file/src/beautifiers/puppet-fix.coffee.html
HTML
mit
2,530
19.577236
95
0.509881
false
<?php return [ [ 'Introduction', 'Requirements', 'Installation and setup', 'Lumen', 'Questions and issues', 'Changelog', ], 'Basic usage' => [ 'Creating a module', 'Custom namespaces', 'Configuration', 'Helpers', 'Compiling Assets', ], 'Advanced Tools' => [ 'Artisan Commands', 'Facade methods', 'Module methods', 'Publishing modules', 'Module Resources', 'Module Console Commands', 'Registering Module Events', ], ];
nWidart/nwidart-docs
app/Http/Navigation/laravel-modules-v6.php
PHP
mit
587
19.964286
36
0.495741
false
<!DOCTYPE html> <html> <head> <title>HyperBoarder</title> <meta http-equiv="REFRESH" content="0;url=/showcase/games/HyperBoarder"> </head> <body> This page has moved. You will be automatically redirected to its new location. If you aren't forwarded to the new page, <a href="/showcase/games/HyperBoarder">click here</a>. </body> </html>
whilesoftware/haxeflixel.com
out/showcase/games/HyperBoarder.md/index.html
HTML
mit
346
33.7
176
0.716763
false
<?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @category Zend * @package Zend_PDF * @subpackage Zend_PDF_Fonts * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** * @namespace */ namespace Zend\Pdf\Resource\Font\Simple\Standard; use Zend\Pdf; use Zend\Pdf\Cmap; /** * Implementation for the standard PDF font Helvetica-BoldOblique. * * This class was generated automatically using the font information and metric * data contained in the Adobe Font Metric (AFM) files, available here: * {@link http://partners.adobe.com/public/developer/en/pdf/Core14_AFMs.zip} * * The PHP script used to generate this class can be found in the /tools * directory of the framework distribution. If you need to make modifications to * this class, chances are the same modifications are needed for the rest of the * standard fonts. You should modify the script and regenerate the classes * instead of changing this class file by hand. * * @uses \Zend\Pdf\Cmap\AbstractCmap * @uses \Zend\Pdf\InternalType\NameObject * @uses \Zend\Pdf\Font * @uses \Zend\Pdf\Resource\Font\Simple\Standard\AbstractStandard * @package Zend_PDF * @subpackage Zend_PDF_Fonts * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class HelveticaBoldOblique extends AbstractStandard { /**** Public Interface ****/ /* Object Lifecycle */ /** * Object constructor */ public function __construct() { parent::__construct(); /* Object properties */ /* The font names are stored internally as Unicode UTF-16BE-encoded * strings. Since this information is static, save unnecessary trips * through iconv() and just use pre-encoded hexidecimal strings. */ $this->_fontNames[Pdf\Font::NAME_COPYRIGHT]['en'] = "\x00\x43\x00\x6f\x00\x70\x00\x79\x00\x72\x00\x69\x00\x67\x00\x68\x00" . "\x74\x00\x20\x00\x28\x00\x63\x00\x29\x00\x20\x00\x31\x00\x39\x00" . "\x38\x00\x35\x00\x2c\x00\x20\x00\x31\x00\x39\x00\x38\x00\x37\x00" . "\x2c\x00\x20\x00\x31\x00\x39\x00\x38\x00\x39\x00\x2c\x00\x20\x00" . "\x31\x00\x39\x00\x39\x00\x30\x00\x2c\x00\x20\x00\x31\x00\x39\x00" . "\x39\x00\x37\x00\x20\x00\x41\x00\x64\x00\x6f\x00\x62\x00\x65\x00" . "\x20\x00\x53\x00\x79\x00\x73\x00\x74\x00\x65\x00\x6d\x00\x73\x00" . "\x20\x00\x49\x00\x6e\x00\x63\x00\x6f\x00\x72\x00\x70\x00\x6f\x00" . "\x72\x00\x61\x00\x74\x00\x65\x00\x64\x00\x2e\x00\x20\x00\x20\x00" . "\x41\x00\x6c\x00\x6c\x00\x20\x00\x52\x00\x69\x00\x67\x00\x68\x00" . "\x74\x00\x73\x00\x20\x00\x52\x00\x65\x00\x73\x00\x65\x00\x72\x00" . "\x76\x00\x65\x00\x64\x00\x2e\x00\x48\x00\x65\x00\x6c\x00\x76\x00" . "\x65\x00\x74\x00\x69\x00\x63\x00\x61\x00\x20\x00\x69\x00\x73\x00" . "\x20\x00\x61\x00\x20\x00\x74\x00\x72\x00\x61\x00\x64\x00\x65\x00" . "\x6d\x00\x61\x00\x72\x00\x6b\x00\x20\x00\x6f\x00\x66\x00\x20\x00" . "\x4c\x00\x69\x00\x6e\x00\x6f\x00\x74\x00\x79\x00\x70\x00\x65\x00" . "\x2d\x00\x48\x00\x65\x00\x6c\x00\x6c\x00\x20\x00\x41\x00\x47\x00" . "\x20\x00\x61\x00\x6e\x00\x64\x00\x2f\x00\x6f\x00\x72\x00\x20\x00" . "\x69\x00\x74\x00\x73\x00\x20\x00\x73\x00\x75\x00\x62\x00\x73\x00" . "\x69\x00\x64\x00\x69\x00\x61\x00\x72\x00\x69\x00\x65\x00\x73\x00" . "\x2e"; $this->_fontNames[Pdf\Font::NAME_FAMILY]['en'] = "\x00\x48\x00\x65\x00\x6c\x00\x76\x00\x65\x00\x74\x00\x69\x00\x63\x00" . "\x61"; $this->_fontNames[Pdf\Font::NAME_STYLE]['en'] = "\x00\x42\x00\x6f\x00\x6c\x00\x64"; $this->_fontNames[Pdf\Font::NAME_ID]['en'] = "\x00\x34\x00\x33\x00\x30\x00\x35\x00\x33"; $this->_fontNames[Pdf\Font::NAME_FULL]['en'] = "\x00\x48\x00\x65\x00\x6c\x00\x76\x00\x65\x00\x74\x00\x69\x00\x63\x00" . "\x61\x00\x2d\x00\x42\x00\x6f\x00\x6c\x00\x64\x00\x4f\x00\x62\x00" . "\x6c\x00\x69\x00\x71\x00\x75\x00\x65\x00\x20\x00\x42\x00\x6f\x00" . "\x6c\x00\x64"; $this->_fontNames[Pdf\Font::NAME_VERSION]['en'] = "\x00\x30\x00\x30\x00\x32\x00\x2e\x00\x30\x00\x30\x00\x30"; $this->_fontNames[Pdf\Font::NAME_POSTSCRIPT]['en'] = "\x00\x48\x00\x65\x00\x6c\x00\x76\x00\x65\x00\x74\x00\x69\x00\x63\x00" . "\x61\x00\x2d\x00\x42\x00\x6f\x00\x6c\x00\x64\x00\x4f\x00\x62\x00" . "\x6c\x00\x69\x00\x71\x00\x75\x00\x65"; $this->_isBold = true; $this->_isItalic = true; $this->_isMonospaced = false; $this->_underlinePosition = -100; $this->_underlineThickness = 50; $this->_strikePosition = 225; $this->_strikeThickness = 50; $this->_unitsPerEm = 1000; $this->_ascent = 718; $this->_descent = -207; $this->_lineGap = 275; /* The glyph numbers assigned here are synthetic; they do not match the * actual glyph numbers used by the font. This is not a big deal though * since this data never makes it to the PDF file. It is only used * internally for layout calculations. */ $this->_glyphWidths = array( 0x00 => 0x01f4, 0x01 => 0x0116, 0x02 => 0x014d, 0x03 => 0x01da, 0x04 => 0x022c, 0x05 => 0x022c, 0x06 => 0x0379, 0x07 => 0x02d2, 0x08 => 0x0116, 0x09 => 0x014d, 0x0a => 0x014d, 0x0b => 0x0185, 0x0c => 0x0248, 0x0d => 0x0116, 0x0e => 0x014d, 0x0f => 0x0116, 0x10 => 0x0116, 0x11 => 0x022c, 0x12 => 0x022c, 0x13 => 0x022c, 0x14 => 0x022c, 0x15 => 0x022c, 0x16 => 0x022c, 0x17 => 0x022c, 0x18 => 0x022c, 0x19 => 0x022c, 0x1a => 0x022c, 0x1b => 0x014d, 0x1c => 0x014d, 0x1d => 0x0248, 0x1e => 0x0248, 0x1f => 0x0248, 0x20 => 0x0263, 0x21 => 0x03cf, 0x22 => 0x02d2, 0x23 => 0x02d2, 0x24 => 0x02d2, 0x25 => 0x02d2, 0x26 => 0x029b, 0x27 => 0x0263, 0x28 => 0x030a, 0x29 => 0x02d2, 0x2a => 0x0116, 0x2b => 0x022c, 0x2c => 0x02d2, 0x2d => 0x0263, 0x2e => 0x0341, 0x2f => 0x02d2, 0x30 => 0x030a, 0x31 => 0x029b, 0x32 => 0x030a, 0x33 => 0x02d2, 0x34 => 0x029b, 0x35 => 0x0263, 0x36 => 0x02d2, 0x37 => 0x029b, 0x38 => 0x03b0, 0x39 => 0x029b, 0x3a => 0x029b, 0x3b => 0x0263, 0x3c => 0x014d, 0x3d => 0x0116, 0x3e => 0x014d, 0x3f => 0x0248, 0x40 => 0x022c, 0x41 => 0x0116, 0x42 => 0x022c, 0x43 => 0x0263, 0x44 => 0x022c, 0x45 => 0x0263, 0x46 => 0x022c, 0x47 => 0x014d, 0x48 => 0x0263, 0x49 => 0x0263, 0x4a => 0x0116, 0x4b => 0x0116, 0x4c => 0x022c, 0x4d => 0x0116, 0x4e => 0x0379, 0x4f => 0x0263, 0x50 => 0x0263, 0x51 => 0x0263, 0x52 => 0x0263, 0x53 => 0x0185, 0x54 => 0x022c, 0x55 => 0x014d, 0x56 => 0x0263, 0x57 => 0x022c, 0x58 => 0x030a, 0x59 => 0x022c, 0x5a => 0x022c, 0x5b => 0x01f4, 0x5c => 0x0185, 0x5d => 0x0118, 0x5e => 0x0185, 0x5f => 0x0248, 0x60 => 0x014d, 0x61 => 0x022c, 0x62 => 0x022c, 0x63 => 0xa7, 0x64 => 0x022c, 0x65 => 0x022c, 0x66 => 0x022c, 0x67 => 0x022c, 0x68 => 0xee, 0x69 => 0x01f4, 0x6a => 0x022c, 0x6b => 0x014d, 0x6c => 0x014d, 0x6d => 0x0263, 0x6e => 0x0263, 0x6f => 0x022c, 0x70 => 0x022c, 0x71 => 0x022c, 0x72 => 0x0116, 0x73 => 0x022c, 0x74 => 0x015e, 0x75 => 0x0116, 0x76 => 0x01f4, 0x77 => 0x01f4, 0x78 => 0x022c, 0x79 => 0x03e8, 0x7a => 0x03e8, 0x7b => 0x0263, 0x7c => 0x014d, 0x7d => 0x014d, 0x7e => 0x014d, 0x7f => 0x014d, 0x80 => 0x014d, 0x81 => 0x014d, 0x82 => 0x014d, 0x83 => 0x014d, 0x84 => 0x014d, 0x85 => 0x014d, 0x86 => 0x014d, 0x87 => 0x014d, 0x88 => 0x014d, 0x89 => 0x03e8, 0x8a => 0x03e8, 0x8b => 0x0172, 0x8c => 0x0263, 0x8d => 0x030a, 0x8e => 0x03e8, 0x8f => 0x016d, 0x90 => 0x0379, 0x91 => 0x0116, 0x92 => 0x0116, 0x93 => 0x0263, 0x94 => 0x03b0, 0x95 => 0x0263, 0x96 => 0x0116, 0x97 => 0x022c, 0x98 => 0x022c, 0x99 => 0x0263, 0x9a => 0x022c, 0x9b => 0x029b, 0x9c => 0x0248, 0x9d => 0x029b, 0x9e => 0x02d2, 0x9f => 0x022c, 0xa0 => 0x02d2, 0xa1 => 0x022c, 0xa2 => 0x022c, 0xa3 => 0x022c, 0xa4 => 0x02d2, 0xa5 => 0x02d2, 0xa6 => 0x022c, 0xa7 => 0x02d2, 0xa8 => 0x0263, 0xa9 => 0x029b, 0xaa => 0x02d2, 0xab => 0xfa, 0xac => 0x02e1, 0xad => 0x029b, 0xae => 0x022c, 0xaf => 0x022c, 0xb0 => 0x02d2, 0xb1 => 0x0116, 0xb2 => 0x022c, 0xb3 => 0x0263, 0xb4 => 0x02d2, 0xb5 => 0x022c, 0xb6 => 0x029b, 0xb7 => 0x022c, 0xb8 => 0x022c, 0xb9 => 0x0116, 0xba => 0x01ee, 0xbb => 0x02d2, 0xbc => 0x030a, 0xbd => 0x0263, 0xbe => 0x022c, 0xbf => 0x02d2, 0xc0 => 0x0185, 0xc1 => 0x022c, 0xc2 => 0x0263, 0xc3 => 0x029b, 0xc4 => 0x030a, 0xc5 => 0x02d2, 0xc6 => 0x029b, 0xc7 => 0x02e7, 0xc8 => 0x02d2, 0xc9 => 0x0263, 0xca => 0x014d, 0xcb => 0x030a, 0xcc => 0x02d2, 0xcd => 0x02d2, 0xce => 0x0248, 0xcf => 0x0263, 0xd0 => 0x0263, 0xd1 => 0x01ee, 0xd2 => 0x022c, 0xd3 => 0x02d2, 0xd4 => 0x0116, 0xd5 => 0x029b, 0xd6 => 0x022c, 0xd7 => 0x022c, 0xd8 => 0x022c, 0xd9 => 0x0263, 0xda => 0x0263, 0xdb => 0x02d2, 0xdc => 0x0116, 0xdd => 0x0248, 0xde => 0x0118, 0xdf => 0x02e1, 0xe0 => 0x030a, 0xe1 => 0x0116, 0xe2 => 0x0258, 0xe3 => 0x029b, 0xe4 => 0x0185, 0xe5 => 0x0263, 0xe6 => 0x0263, 0xe7 => 0x0263, 0xe8 => 0x0225, 0xe9 => 0x02d2, 0xea => 0x02d2, 0xeb => 0x0116, 0xec => 0x0185, 0xed => 0x022c, 0xee => 0x02d2, 0xef => 0x02d2, 0xf0 => 0x02d2, 0xf1 => 0x022c, 0xf2 => 0x01f4, 0xf3 => 0x0116, 0xf4 => 0x030a, 0xf5 => 0x0263, 0xf6 => 0x022c, 0xf7 => 0x022c, 0xf8 => 0x0116, 0xf9 => 0x030a, 0xfa => 0x02d2, 0xfb => 0x0264, 0xfc => 0x0263, 0xfd => 0x014d, 0xfe => 0x030a, 0xff => 0x0263, 0x0100 => 0x0116, 0x0101 => 0x0263, 0x0102 => 0x029b, 0x0103 => 0x0263, 0x0104 => 0x0342, 0x0105 => 0x029b, 0x0106 => 0x0190, 0x0107 => 0x02d2, 0x0108 => 0x0263, 0x0109 => 0x03e8, 0x010a => 0x022c, 0x010b => 0x0116, 0x010c => 0x0116, 0x010d => 0x0263, 0x010e => 0x0342, 0x010f => 0x0225, 0x0110 => 0x0263, 0x0111 => 0x0263, 0x0112 => 0x02d2, 0x0113 => 0x029b, 0x0114 => 0x022c, 0x0115 => 0x0263, 0x0116 => 0x0342, 0x0117 => 0x029b, 0x0118 => 0x029b, 0x0119 => 0x030a, 0x011a => 0x0190, 0x011b => 0x0263, 0x011c => 0x02d2, 0x011d => 0x0263, 0x011e => 0x0225, 0x011f => 0x02d2, 0x0120 => 0x0185, 0x0121 => 0x02d2, 0x0122 => 0x0263, 0x0123 => 0x02d2, 0x0124 => 0x0263, 0x0125 => 0x02d2, 0x0126 => 0x02d2, 0x0127 => 0x02d2, 0x0128 => 0x030a, 0x0129 => 0x01f4, 0x012a => 0x029b, 0x012b => 0x0116, 0x012c => 0x022c, 0x012d => 0x0248, 0x012e => 0x0116, 0x012f => 0x0263, 0x0130 => 0x014d, 0x0131 => 0x0248, 0x0132 => 0x0263, 0x0133 => 0x0263, 0x0134 => 0x0225, 0x0135 => 0x0263, 0x0136 => 0x0263, 0x0137 => 0x01f4, 0x0138 => 0x0263, 0x0139 => 0x014d, 0x013a => 0x0116, 0x013b => 0x022c, ); /* The cmap table is similarly synthesized. */ $cmapData = array( 0x20 => 0x01, 0x21 => 0x02, 0x22 => 0x03, 0x23 => 0x04, 0x24 => 0x05, 0x25 => 0x06, 0x26 => 0x07, 0x2019 => 0x08, 0x28 => 0x09, 0x29 => 0x0a, 0x2a => 0x0b, 0x2b => 0x0c, 0x2c => 0x0d, 0x2d => 0x0e, 0x2e => 0x0f, 0x2f => 0x10, 0x30 => 0x11, 0x31 => 0x12, 0x32 => 0x13, 0x33 => 0x14, 0x34 => 0x15, 0x35 => 0x16, 0x36 => 0x17, 0x37 => 0x18, 0x38 => 0x19, 0x39 => 0x1a, 0x3a => 0x1b, 0x3b => 0x1c, 0x3c => 0x1d, 0x3d => 0x1e, 0x3e => 0x1f, 0x3f => 0x20, 0x40 => 0x21, 0x41 => 0x22, 0x42 => 0x23, 0x43 => 0x24, 0x44 => 0x25, 0x45 => 0x26, 0x46 => 0x27, 0x47 => 0x28, 0x48 => 0x29, 0x49 => 0x2a, 0x4a => 0x2b, 0x4b => 0x2c, 0x4c => 0x2d, 0x4d => 0x2e, 0x4e => 0x2f, 0x4f => 0x30, 0x50 => 0x31, 0x51 => 0x32, 0x52 => 0x33, 0x53 => 0x34, 0x54 => 0x35, 0x55 => 0x36, 0x56 => 0x37, 0x57 => 0x38, 0x58 => 0x39, 0x59 => 0x3a, 0x5a => 0x3b, 0x5b => 0x3c, 0x5c => 0x3d, 0x5d => 0x3e, 0x5e => 0x3f, 0x5f => 0x40, 0x2018 => 0x41, 0x61 => 0x42, 0x62 => 0x43, 0x63 => 0x44, 0x64 => 0x45, 0x65 => 0x46, 0x66 => 0x47, 0x67 => 0x48, 0x68 => 0x49, 0x69 => 0x4a, 0x6a => 0x4b, 0x6b => 0x4c, 0x6c => 0x4d, 0x6d => 0x4e, 0x6e => 0x4f, 0x6f => 0x50, 0x70 => 0x51, 0x71 => 0x52, 0x72 => 0x53, 0x73 => 0x54, 0x74 => 0x55, 0x75 => 0x56, 0x76 => 0x57, 0x77 => 0x58, 0x78 => 0x59, 0x79 => 0x5a, 0x7a => 0x5b, 0x7b => 0x5c, 0x7c => 0x5d, 0x7d => 0x5e, 0x7e => 0x5f, 0xa1 => 0x60, 0xa2 => 0x61, 0xa3 => 0x62, 0x2044 => 0x63, 0xa5 => 0x64, 0x0192 => 0x65, 0xa7 => 0x66, 0xa4 => 0x67, 0x27 => 0x68, 0x201c => 0x69, 0xab => 0x6a, 0x2039 => 0x6b, 0x203a => 0x6c, 0xfb01 => 0x6d, 0xfb02 => 0x6e, 0x2013 => 0x6f, 0x2020 => 0x70, 0x2021 => 0x71, 0xb7 => 0x72, 0xb6 => 0x73, 0x2022 => 0x74, 0x201a => 0x75, 0x201e => 0x76, 0x201d => 0x77, 0xbb => 0x78, 0x2026 => 0x79, 0x2030 => 0x7a, 0xbf => 0x7b, 0x60 => 0x7c, 0xb4 => 0x7d, 0x02c6 => 0x7e, 0x02dc => 0x7f, 0xaf => 0x80, 0x02d8 => 0x81, 0x02d9 => 0x82, 0xa8 => 0x83, 0x02da => 0x84, 0xb8 => 0x85, 0x02dd => 0x86, 0x02db => 0x87, 0x02c7 => 0x88, 0x2014 => 0x89, 0xc6 => 0x8a, 0xaa => 0x8b, 0x0141 => 0x8c, 0xd8 => 0x8d, 0x0152 => 0x8e, 0xba => 0x8f, 0xe6 => 0x90, 0x0131 => 0x91, 0x0142 => 0x92, 0xf8 => 0x93, 0x0153 => 0x94, 0xdf => 0x95, 0xcf => 0x96, 0xe9 => 0x97, 0x0103 => 0x98, 0x0171 => 0x99, 0x011b => 0x9a, 0x0178 => 0x9b, 0xf7 => 0x9c, 0xdd => 0x9d, 0xc2 => 0x9e, 0xe1 => 0x9f, 0xdb => 0xa0, 0xfd => 0xa1, 0x0219 => 0xa2, 0xea => 0xa3, 0x016e => 0xa4, 0xdc => 0xa5, 0x0105 => 0xa6, 0xda => 0xa7, 0x0173 => 0xa8, 0xcb => 0xa9, 0x0110 => 0xaa, 0xf6c3 => 0xab, 0xa9 => 0xac, 0x0112 => 0xad, 0x010d => 0xae, 0xe5 => 0xaf, 0x0145 => 0xb0, 0x013a => 0xb1, 0xe0 => 0xb2, 0x0162 => 0xb3, 0x0106 => 0xb4, 0xe3 => 0xb5, 0x0116 => 0xb6, 0x0161 => 0xb7, 0x015f => 0xb8, 0xed => 0xb9, 0x25ca => 0xba, 0x0158 => 0xbb, 0x0122 => 0xbc, 0xfb => 0xbd, 0xe2 => 0xbe, 0x0100 => 0xbf, 0x0159 => 0xc0, 0xe7 => 0xc1, 0x017b => 0xc2, 0xde => 0xc3, 0x014c => 0xc4, 0x0154 => 0xc5, 0x015a => 0xc6, 0x010f => 0xc7, 0x016a => 0xc8, 0x016f => 0xc9, 0xb3 => 0xca, 0xd2 => 0xcb, 0xc0 => 0xcc, 0x0102 => 0xcd, 0xd7 => 0xce, 0xfa => 0xcf, 0x0164 => 0xd0, 0x2202 => 0xd1, 0xff => 0xd2, 0x0143 => 0xd3, 0xee => 0xd4, 0xca => 0xd5, 0xe4 => 0xd6, 0xeb => 0xd7, 0x0107 => 0xd8, 0x0144 => 0xd9, 0x016b => 0xda, 0x0147 => 0xdb, 0xcd => 0xdc, 0xb1 => 0xdd, 0xa6 => 0xde, 0xae => 0xdf, 0x011e => 0xe0, 0x0130 => 0xe1, 0x2211 => 0xe2, 0xc8 => 0xe3, 0x0155 => 0xe4, 0x014d => 0xe5, 0x0179 => 0xe6, 0x017d => 0xe7, 0x2265 => 0xe8, 0xd0 => 0xe9, 0xc7 => 0xea, 0x013c => 0xeb, 0x0165 => 0xec, 0x0119 => 0xed, 0x0172 => 0xee, 0xc1 => 0xef, 0xc4 => 0xf0, 0xe8 => 0xf1, 0x017a => 0xf2, 0x012f => 0xf3, 0xd3 => 0xf4, 0xf3 => 0xf5, 0x0101 => 0xf6, 0x015b => 0xf7, 0xef => 0xf8, 0xd4 => 0xf9, 0xd9 => 0xfa, 0x2206 => 0xfb, 0xfe => 0xfc, 0xb2 => 0xfd, 0xd6 => 0xfe, 0xb5 => 0xff, 0xec => 0x0100, 0x0151 => 0x0101, 0x0118 => 0x0102, 0x0111 => 0x0103, 0xbe => 0x0104, 0x015e => 0x0105, 0x013e => 0x0106, 0x0136 => 0x0107, 0x0139 => 0x0108, 0x2122 => 0x0109, 0x0117 => 0x010a, 0xcc => 0x010b, 0x012a => 0x010c, 0x013d => 0x010d, 0xbd => 0x010e, 0x2264 => 0x010f, 0xf4 => 0x0110, 0xf1 => 0x0111, 0x0170 => 0x0112, 0xc9 => 0x0113, 0x0113 => 0x0114, 0x011f => 0x0115, 0xbc => 0x0116, 0x0160 => 0x0117, 0x0218 => 0x0118, 0x0150 => 0x0119, 0xb0 => 0x011a, 0xf2 => 0x011b, 0x010c => 0x011c, 0xf9 => 0x011d, 0x221a => 0x011e, 0x010e => 0x011f, 0x0157 => 0x0120, 0xd1 => 0x0121, 0xf5 => 0x0122, 0x0156 => 0x0123, 0x013b => 0x0124, 0xc3 => 0x0125, 0x0104 => 0x0126, 0xc5 => 0x0127, 0xd5 => 0x0128, 0x017c => 0x0129, 0x011a => 0x012a, 0x012e => 0x012b, 0x0137 => 0x012c, 0x2212 => 0x012d, 0xce => 0x012e, 0x0148 => 0x012f, 0x0163 => 0x0130, 0xac => 0x0131, 0xf6 => 0x0132, 0xfc => 0x0133, 0x2260 => 0x0134, 0x0123 => 0x0135, 0xf0 => 0x0136, 0x017e => 0x0137, 0x0146 => 0x0138, 0xb9 => 0x0139, 0x012b => 0x013a, 0x20ac => 0x013b); $this->_cmap = Cmap\AbstractCmap::cmapWithTypeData( Cmap\AbstractCmap::TYPE_BYTE_ENCODING_STATIC, $cmapData); /* Resource dictionary */ /* The resource dictionary for the standard fonts is sparse because PDF * viewers already have all of the metrics data. We only need to provide * the font name and encoding method. */ $this->_resource->BaseFont = new Pdf\InternalType\NameObject('Helvetica-BoldOblique'); } }
dynamicguy/gpweb
src/vendor/zend/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaBoldOblique.php
PHP
mit
19,429
61.674194
94
0.527099
false
# -*- coding: utf-8 -*- # =au携帯電話 module Jpmobile::Mobile # ==au携帯電話 # CDMA 1X, CDMA 1X WINを含む。 class Au < AbstractMobile # 対応するUser-Agentの正規表現 # User-Agent文字列中に "UP.Browser" を含むVodafoneの端末があるので注意が必要 USER_AGENT_REGEXP = /^(?:KDDI|UP.Browser\/.+?)-(.+?) / # 対応するメールアドレスの正規表現 MAIL_ADDRESS_REGEXP = /.+@ezweb\.ne\.jp/ # 簡易位置情報取得に対応していないデバイスID # http://www.au.kddi.com/ezfactory/tec/spec/eznavi.html LOCATION_UNSUPPORTED_DEVICE_ID = ["PT21", "TS25", "KCTE", "TST9", "KCU1", "SYT5", "KCTD", "TST8", "TST7", "KCTC", "SYT4", "KCTB", "KCTA", "TST6", "KCT9", "TST5", "TST4", "KCT8", "SYT3", "KCT7", "MIT1", "MAT3", "KCT6", "TST3", "KCT5", "KCT4", "SYT2", "MAT1", "MAT2", "TST2", "KCT3", "KCT2", "KCT1", "TST1", "SYT1"] # GPS取得に対応していないデバイスID GPS_UNSUPPORTED_DEVICE_ID = ["PT21", "KC26", "SN28", "SN26", "KC23", "SA28", "TS25", "SA25", "SA24", "SN23", "ST14", "KC15", "SN22", "KC14", "ST13", "SN17", "SY15", "CA14", "HI14", "TS14", "KC13", "SN15", "SN16", "SY14", "ST12", "TS13", "CA13", "MA13", "HI13", "SN13", "SY13", "SN12", "SN14", "ST11", "DN11", "SY12", "KCTE", "TST9", "KCU1", "SYT5", "KCTD", "TST8", "TST7", "KCTC", "SYT4", "KCTB", "KCTA", "TST6", "KCT9", "TST5", "TST4", "KCT8", "SYT3", "KCT7", "MIT1", "MAT3", "KCT6", "TST3", "KCT5", "KCT4", "SYT2", "MAT1", "MAT2", "TST2", "KCT3", "KCT2", "KCT1", "TST1", "SYT1"] # EZ番号(サブスクライバID)があれば返す。無ければ +nil+ を返す。 def subno @request.env["HTTP_X_UP_SUBNO"] end alias :ident_subscriber :subno # 位置情報があれば Position のインスタンスを返す。無ければ +nil+ を返す。 def position return @__posotion if defined? @__posotion return @__posotion = nil if ( params["lat"].nil? || params['lat'] == '' || params["lon"].nil? || params["lon"] == '' ) l = Jpmobile::Position.new l.options = params.reject {|x,v| !["ver", "datum", "unit", "lat", "lon", "alt", "time", "smaj", "smin", "vert", "majaa", "fm"].include?(x) } case params["unit"] when "1" l.lat = params["lat"].to_f l.lon = params["lon"].to_f when "0", "dms" raise "Invalid dms form" unless params["lat"] =~ /^([+-]?\d+)\.(\d+)\.(\d+\.\d+)$/ l.lat = Jpmobile::Position.dms2deg($1,$2,$3) raise "Invalid dms form" unless params["lon"] =~ /^([+-]?\d+)\.(\d+)\.(\d+\.\d+)$/ l.lon = Jpmobile::Position.dms2deg($1,$2,$3) else return @__posotion = nil end if params["datum"] == "1" # ただし、params["datum"]=="tokyo"のとき(簡易位置情報)のときは、 # 実際にはWGS84系のデータが渡ってくる # http://www.au.kddi.com/ezfactory/tec/spec/eznavi.html l.tokyo2wgs84! end return @__posotion = l end # デバイスIDを返す def device_id if @request.env['HTTP_USER_AGENT'] =~ USER_AGENT_REGEXP return $1 else nil end end # 簡易位置情報取得に対応している場合は +true+ を返す。 def supports_location? ! LOCATION_UNSUPPORTED_DEVICE_ID.include?(device_id) end # GPS位置情報取得に対応している場合は +true+ を返す。 def supports_gps? ! GPS_UNSUPPORTED_DEVICE_ID.include?(device_id) end # cookieに対応しているか? def supports_cookie? protocol = @request.respond_to?(:scheme) ? @request.scheme : @request.protocol rescue "none" if protocol =~ /\Ahttps/ false else true end end # 文字コード変換 def to_internal(str) # 絵文字を数値参照に変換 str = Jpmobile::Emoticon.external_to_unicodecr_au(Jpmobile::Util.sjis(str)) # 文字コードを UTF-8 に変換 str = Jpmobile::Util.sjis_to_utf8(str) # 数値参照を UTF-8 に変換 Jpmobile::Emoticon::unicodecr_to_utf8(str) end def to_external(str, content_type, charset) # UTF-8を数値参照に str = Jpmobile::Emoticon.utf8_to_unicodecr(str) # 文字コードを Shift_JIS に変換 if [nil, "text/html", "application/xhtml+xml"].include?(content_type) str = Jpmobile::Util.utf8_to_sjis(str) charset = default_charset unless str.empty? end # 数値参照を絵文字コードに変換 str = Jpmobile::Emoticon.unicodecr_to_external(str, Jpmobile::Emoticon::CONVERSION_TABLE_TO_AU, true) [str, charset] end def default_charset "Shift_JIS" end # メール送信用 def to_mail_body(str) to_mail_encoding(str) end def to_mail_internal(str, charset) if Jpmobile::Util.jis?(str) or Jpmobile::Util.ascii_8bit?(str) or charset == mail_charset # 絵文字を数値参照に変換 str = Jpmobile::Emoticon.external_to_unicodecr_au_mail(Jpmobile::Util.jis(str)) str = Jpmobile::Util.jis_to_utf8(Jpmobile::Util.jis_win(str)) end str end def decoratable? true end private def to_mail_encoding(str) str = Jpmobile::Emoticon.utf8_to_unicodecr(str) str = Jpmobile::Util.utf8_to_jis(str) Jpmobile::Util.jis(Jpmobile::Emoticon.unicodecr_to_au_email(str)) end end end
yui-knk/jpmobile
lib/jpmobile/mobile/au.rb
Ruby
mit
5,457
35.568182
584
0.578827
false
// // ViewController.h // _objc_msgForward // // Created by 郭伟林 on 17/1/20. // Copyright © 2017年 SR. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
guowilling/iOSExamples
ObjC/Others/RuntimeMsgForward/_objc_msgForward/ViewController.h
C
mit
217
12.866667
46
0.673077
false
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_17) on Sun Nov 03 15:35:47 CET 2013 --> <title>Uses of Class com.badlogic.gdx.maps.objects.RectangleMapObject (libgdx API)</title> <meta name="date" content="2013-11-03"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.badlogic.gdx.maps.objects.RectangleMapObject (libgdx API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../com/badlogic/gdx/maps/objects/RectangleMapObject.html" title="class in com.badlogic.gdx.maps.objects">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em> libgdx API <style> body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt } pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif } h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold } .TableHeadingColor { background:#EEEEFF; } a { text-decoration:none } a:hover { text-decoration:underline } a:link, a:visited { color:blue } table { border:0px } .TableRowColor td:first-child { border-left:1px solid black } .TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black } hr { border:0px; border-bottom:1px solid #333366; } </style> </em></div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?com/badlogic/gdx/maps/objects/class-use/RectangleMapObject.html" target="_top">Frames</a></li> <li><a href="RectangleMapObject.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class com.badlogic.gdx.maps.objects.RectangleMapObject" class="title">Uses of Class<br>com.badlogic.gdx.maps.objects.RectangleMapObject</h2> </div> <div class="classUseContainer">No usage of com.badlogic.gdx.maps.objects.RectangleMapObject</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../com/badlogic/gdx/maps/objects/RectangleMapObject.html" title="class in com.badlogic.gdx.maps.objects">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em>libgdx API</em></div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?com/badlogic/gdx/maps/objects/class-use/RectangleMapObject.html" target="_top">Frames</a></li> <li><a href="RectangleMapObject.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <div style="font-size:9pt"><i> Copyright &copy; 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com) </i></div> </small></p> </body> </html>
emeryduh/TeamJones_Project
libgdx/docs/api/com/badlogic/gdx/maps/objects/class-use/RectangleMapObject.html
HTML
mit
5,398
38.40146
159
0.622638
false
"use strict"; /** * @module opcua.datamodel */ require("requirish")._(module); var factories = require("lib/misc/factories"); var assert = require("better-assert"); var _ = require("underscore"); var QualifiedName = require("_generated_/_auto_generated_QualifiedName").QualifiedName; exports.QualifiedName = QualifiedName; exports.QualifiedName.prototype.toString = function () { if (this.namespaceIndex) { return this.namespaceIndex + ":" + this.name; } return this.name; }; /** * @method stringToQualifiedName * @param browsePathElemen {String} * @return {{namespaceIndex: Number, name: String}} * * @example * * stringToQualifiedName("Hello") => {namespaceIndex: 0, name: "Hello"} * stringToQualifiedName("3:Hello") => {namespaceIndex: 3, name: "Hello"} */ function stringToQualifiedName(value) { var split_array = value.split(":"); var namespaceIndex = 0; if (split_array.length === 2) { namespaceIndex = parseInt(split_array[0]); value = split_array[1]; } return new QualifiedName({namespaceIndex: namespaceIndex, name: value}); } exports.stringToQualifiedName = stringToQualifiedName; function coerceQualifyName(value) { if (!value) { return null; } else if (value instanceof QualifiedName) { return value; } else if (_.isString(value)) { return stringToQualifiedName(value); } else { assert(value.hasOwnProperty("namespaceIndex")); assert(value.hasOwnProperty("name")); return new exports.QualifiedName(value); } } exports.coerceQualifyName = coerceQualifyName;
rodp82/node-opcua
lib/datamodel/qualified_name.js
JavaScript
mit
1,614
27.821429
87
0.674102
false
/* * loggly-test.js: Tests for instances of the Loggly transport * * (C) 2010 Charlie Robbins * MIT LICENSE * */ var path = require('path'), vows = require('vows'), assert = require('assert'), winston = require('../lib/winston'), helpers = require('./helpers'); var config = helpers.loadConfig(), tokenTransport = new (winston.transports.Loggly)({ subdomain: config.transports.loggly.subdomain, inputToken: config.transports.loggly.inputToken }), nameTransport = new (winston.transports.Loggly)({ subdomain: config.transports.loggly.subdomain, inputName: config.transports.loggly.inputName, auth: config.transports.loggly.auth }); vows.describe('winston/transports/loggly').addBatch({ "An instance of the Loggly Transport": { "when passed an input token": { "should have the proper methods defined": function () { helpers.assertLoggly(tokenTransport); }, "the log() method": helpers.testNpmLevels(tokenTransport, "should log messages to loggly", function (ign, err, logged) { assert.isNull(err); assert.isTrue(logged); }) }, "when passed an input name": { "should have the proper methods defined": function () { helpers.assertLoggly(nameTransport); }, "the log() method": helpers.testNpmLevels(nameTransport, "should log messages to loggly", function (ign, err, result) { assert.isNull(err); assert.isTrue(result === true || result.response === 'ok'); }) } } }).export(module);
espena/terminal
test/node_modules/testem/node_modules/winston/test/loggly-test.js
JavaScript
mit
1,566
32.340426
126
0.64751
false
#!/usr/bin/env _coffee console.log "waiting 1 second" setTimeout _, 1000 console.log "done!"
mllim3/graphgist-cms-api
node_modules/neo4j/node_modules/streamline/examples/misc/shebang-coffee.sh
Shell
mit
94
22.5
30
0.712766
false
require "active_support/lazy_load_hooks" require "active_record/explain_registry" module ActiveRecord module Explain # Executes the block with the collect flag enabled. Queries are collected # asynchronously by the subscriber and returned. def collecting_queries_for_explain # :nodoc: ExplainRegistry.collect = true yield ExplainRegistry.queries ensure ExplainRegistry.reset end # Makes the adapter execute EXPLAIN for the tuples of queries and bindings. # Returns a formatted string ready to be logged. def exec_explain(queries) # :nodoc: str = queries.map do |sql, binds| msg = "EXPLAIN for: #{sql}" unless binds.empty? msg << " " msg << binds.map { |attr| render_bind(attr) }.inspect end msg << "\n" msg << connection.explain(sql, binds) end.join("\n") # Overriding inspect to be more human readable, especially in the console. def str.inspect self end str end private def render_bind(attr) value = if attr.type.binary? && attr.value "<#{attr.value_for_database.to_s.bytesize} bytes of binary data>" else connection.type_cast(attr.value_for_database) end [attr.name, value] end end end
arjes/rails
activerecord/lib/active_record/explain.rb
Ruby
mit
1,332
26.183673
80
0.624625
false
/* Header file for gimple statement walk support. Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #ifndef GCC_GIMPLE_WALK_H #define GCC_GIMPLE_WALK_H /* Convenience routines to walk all statements of a gimple function. Note that this is useful exclusively before the code is converted into SSA form. Once the program is in SSA form, the standard operand interface should be used to analyze/modify statements. */ struct walk_stmt_info { /* Points to the current statement being walked. */ gimple_stmt_iterator gsi; gimple *stmt; /* Additional data that the callback functions may want to carry through the recursion. */ void *info; /* Pointer map used to mark visited tree nodes when calling walk_tree on each operand. If set to NULL, duplicate tree nodes will be visited more than once. */ hash_set<tree> *pset; /* Operand returned by the callbacks. This is set when calling walk_gimple_seq. If the walk_stmt_fn or walk_tree_fn callback returns non-NULL, this field will contain the tree returned by the last callback. */ tree callback_result; /* Indicates whether the operand being examined may be replaced with something that matches is_gimple_val (if true) or something slightly more complicated (if false). "Something" technically means the common subset of is_gimple_lvalue and is_gimple_rhs, but we never try to form anything more complicated than that, so we don't bother checking. Also note that CALLBACK should update this flag while walking the sub-expressions of a statement. For instance, when walking the statement 'foo (&var)', the flag VAL_ONLY will initially be set to true, however, when walking &var, the operand of that ADDR_EXPR does not need to be a GIMPLE value. */ BOOL_BITFIELD val_only : 1; /* True if we are currently walking the LHS of an assignment. */ BOOL_BITFIELD is_lhs : 1; /* Optional. Set to true by the callback functions if they made any changes. */ BOOL_BITFIELD changed : 1; /* True if we're interested in location information. */ BOOL_BITFIELD want_locations : 1; /* True if we've removed the statement that was processed. */ BOOL_BITFIELD removed_stmt : 1; }; /* Callback for walk_gimple_stmt. Called for every statement found during traversal. The first argument points to the statement to walk. The second argument is a flag that the callback sets to 'true' if it the callback handled all the operands and sub-statements of the statement (the default value of this flag is 'false'). The third argument is an anonymous pointer to data to be used by the callback. */ typedef tree (*walk_stmt_fn) (gimple_stmt_iterator *, bool *, struct walk_stmt_info *); extern gimple *walk_gimple_seq_mod (gimple_seq *, walk_stmt_fn, walk_tree_fn, struct walk_stmt_info *); extern gimple *walk_gimple_seq (gimple_seq, walk_stmt_fn, walk_tree_fn, struct walk_stmt_info *); extern tree walk_gimple_op (gimple *, walk_tree_fn, struct walk_stmt_info *); extern tree walk_gimple_stmt (gimple_stmt_iterator *, walk_stmt_fn, walk_tree_fn, struct walk_stmt_info *); typedef bool (*walk_stmt_load_store_addr_fn) (gimple *, tree, tree, void *); extern bool walk_stmt_load_store_addr_ops (gimple *, void *, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn); extern bool walk_stmt_load_store_ops (gimple *, void *, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn); #endif /* GCC_GIMPLE_WALK_H */
s-macke/jor1k-sysroot
fs/usr/lib/gcc/or1k-linux-musl/10.2.0/plugin/include/gimple-walk.h
C
mit
4,260
41.178218
77
0.714554
false
# frozen_string_literal: true module Projects::ErrorTrackingHelper def error_tracking_data(current_user, project) error_tracking_enabled = !!project.error_tracking_setting&.enabled? { 'index-path' => project_error_tracking_index_path(project, format: :json), 'user-can-enable-error-tracking' => can?(current_user, :admin_operations, project).to_s, 'enable-error-tracking-link' => project_settings_operations_path(project), 'error-tracking-enabled' => error_tracking_enabled.to_s, 'project-path' => project.full_path, 'list-path' => project_error_tracking_index_path(project), 'illustration-path' => image_path('illustrations/cluster_popover.svg') } end def error_details_data(project, issue_id) opts = [project, issue_id, { format: :json }] { 'issue-id' => issue_id, 'project-path' => project.full_path, 'issue-update-path' => update_project_error_tracking_index_path(*opts), 'project-issues-path' => project_issues_path(project), 'issue-stack-trace-path' => stack_trace_project_error_tracking_index_path(*opts) } end end
mmkassem/gitlabhq
app/helpers/projects/error_tracking_helper.rb
Ruby
mit
1,186
38.533333
94
0.642496
false
<div style="height: 100%" ng-controller="Umbraco.Drawers.Help as vm"> <umb-drawer-view> <umb-drawer-header title="{{vm.title}}" description="{{vm.subtitle}}"> </umb-drawer-header> <umb-drawer-content> <!-- Doctype Tours --> <div class="umb-help-section" ng-if="vm.showDocTypeTour" data-element="doctype-tour"> <h5>Need help editing current item '{{vm.nodeName}}' ?</h5> <div class="umb-help-list"> <div ng-repeat="tour in vm.docTypeTours | orderBy:'groupOrder'"> <div data-element="tour-{{tour.alias}}" class="umb-help-list-item"> <div class="umb-help-list-item__content justify-between"> <div class="flex items-center"> <span class="umb-help-list-item__title">{{ tour.name }}</span> </div> <div> <umb-button button-style="primary" size="xxs" type="button" label="Start" action="vm.startTour(tour)"></umb-button> </div> </div> </div> </div> </div> </div> <!-- Tours --> <div class="umb-help-section" ng-if="vm.tours.length > 0" data-element="help-tours"> <h5 class="umb-help-section__title"> <localize key="help_tours">Tours</localize> </h5> <div ng-repeat="tourGroup in vm.tours | orderBy:'groupOrder'"> <div class="umb-help-list"> <button type="button" class="umb-help-list-item umb-help-list-item__content flex items-center justify-between" ng-click="tourGroup.open = !tourGroup.open" aria-expanded="{{tourGroup.open === undefined ? false : tourGroup.open }}"> <span class="umb-help-list-item__group-title bold"> <umb-icon icon="{{tourGroup.open ? 'icon-navigation-down' : 'icon-navigation-right'}}"></umb-icon> <span ng-if="tourGroup.group !== 'undefined'">{{tourGroup.group}}</span> <span ng-if="tourGroup.group === 'undefined'"> <localize key="general_other">Other</localize> </span> </span> <umb-progress-circle percentage="{{tourGroup.completedPercentage}}" size="40"> </umb-progress-circle> </button> <div ng-if="tourGroup.open"> <div data-element="tour-{{tour.alias}}" class="umb-help-list-item" ng-repeat="tour in tourGroup.tours"> <div class="umb-help-list-item__content justify-between"> <div class="flex items-center"> <div ng-if="!tour.completed" class="umb-number-badge umb-number-badge--xs umb-help-list-item__icon">{{ $index + 1 }}</div> <umb-checkmark ng-if="tour.completed" size="xs" checked="tour.completed" class="umb-help-list-item__icon"></umb-checkmark> <span ng-class="{'strike': tour.completed}" class="umb-help-list-item__title">{{ tour.name }}</span> </div> <div> <umb-button ng-if="!tour.completed && vm.showTourButton($index, tourGroup)" button-style="primary" type="button" label="Start" action="vm.startTour(tour)"></umb-button> <umb-button ng-if="tour.completed" type="button" label="Rerun" action="vm.startTour(tour)"></umb-button> </div> </div> </div> </div> </div> </div> </div> <!-- Show in custom help dashboard --> <div class="umb-help-section" data-element="help-custom-dashboard" ng-if="vm.customDashboard.length > 0"> <div ng-repeat="dashboard in vm.customDashboard"> <h5 ng-show="dashboard.label">{{dashboard.label}}</h5> <div ng-repeat="property in dashboard.properties"> <div> <div ng-include="property.view"></div> </div> </div> </div> </div> <!-- Help Content --> <div class="umb-help-section" data-element="help-articles" ng-if="vm.topics.length > 0"> <h5 class="umb-help-section__title"> <localize key="general_articles">Articles</localize> </h5> <ul class="umb-help-list"> <li class="umb-help-list-item" ng-repeat="topic in vm.topics track by $index"> <a class="umb-help-list-item__content" data-element="help-article-{{topic.name}}" href="#" ng-href="{{topic.url}}?utm_source=core&utm_medium=help&utm_content=link&utm_campaign=tv" target="_blank" rel="noopener"> <span> <span class="umb-help-list-item__title"> <span class="bold">{{topic.name}}</span> <umb-icon icon="icon-out" class="umb-help-list-item__open-icon"></umb-icon> </span> <span class="umb-help-list-item__description">{{topic.description}}</span> </span> </a> </li> </ul> </div> <!-- Umbraco tv content --> <div class="umb-help-section" data-element="help-videos" ng-if="vm.hasAccessToSettings"> <h5 class="umb-help-section__title" ng-if="vm.videos.length > 0"> <localize key="general_videos">Videos</localize> </h5> <ul class="umb-help-list"> <li class="umb-help-list-item" ng-repeat="video in vm.videos track by $index"> <a class="umb-help-list-item__content" data-element="help-article-{{video.title}}" href="#" ng-href="{{video.link}}?utm_source=core&utm_medium=help&utm_content=link&utm_campaign=tv" target="_blank" rel="noopener"> <umb-icon icon="icon-tv-old" class="umb-help-list-item__icon"></umb-icon> <span class="umb-help-list-item__title">{{video.title}}</span> <umb-icon icon="icon-out" class="umb-help-list-item__open-icon"></umb-icon> </a> </li> </ul> </div> <!-- Links --> <div class="umb-help-section" data-element="help-links" ng-if="vm.hasAccessToSettings"> <a data-element="help-link-umbraco-tv" class="umb-help-badge" href="https://umbraco.tv?utm_source=core&utm_medium=help&utm_content=link&utm_campaign=tv" target="_blank" rel="noopener"> <umb-icon icon="icon-tv-old" class="umb-help-badge__icon"></umb-icon> <div class="umb-help-badge__title"> <localize key="help_umbracoTv">Visit umbraco.tv</localize> </div> <small> <localize key="help_theBestUmbracoVideoTutorials">The best Umbraco video tutorials</localize> </small> </a> <a data-element="help-link-our-umbraco" class="umb-help-badge" href="https://our.umbraco.com?utm_source=core&utm_medium=help&utm_content=link&utm_campaign=our" target="_blank" rel="noopener"> <umb-icon icon="icon-favorite" class="umb-help-badge__icon"></umb-icon> <div class="umb-help-badge__title"> <localize key="help_umbracoForum">Visit our.umbraco.com</localize> </div> <small> <localize key="defaultdialogs_theFriendliestCommunity">The friendliest community</localize> </small> </a> </div> <!-- System info --> <div class="umb-help-section"> <h5 class="umb-help-section__title">System Information</h5> <div class="umb-help-list"> <div class="umb-help-list-item__title-wrapper"> <button type="button" class="umb-help-list-item umb-help-list-item__content" ng-click="vm.systemInfoDisplay = !vm.systemInfoDisplay" aria-expanded="{{vm.systemInfoDisplay === true}}"> <umb-icon class="mr1" icon="{{vm.systemInfoDisplay ? 'icon-navigation-down' : 'icon-navigation-right'}}"></umb-icon> <span class="flex-column items-start flex"> <span class="umb-help-list-item__group-title bold">System Information</span> <span class="umb-help-list-item__description mt0">View your system information</span> </span> </button> <button ng-click="vm.copyInformation()" class="btn-reset" type="button" size="30"> <span class=""> <umb-icon icon="icon-documents" class="umb-help-list-item__icon"></umb-icon> </span> </button> </div> <div ng-if="vm.systemInfoDisplay === true"> <table class="table table-striped"> <tr> <th>Category</th> <th>Data</th> </tr> <tr ng-repeat="info in vm.systemInfo"> <td>{{info.name}}</td> <td>{{info.data}}</td> </tr> </table> </div> </div> </div> </umb-drawer-content> <umb-drawer-footer> <div class="flex justify-end"> <umb-button alias="close" type="button" shortcut="esc" button-style="link" label-key="general_close" action="vm.closeDrawer()"> </umb-button> </div> </umb-drawer-footer> </umb-drawer-view> </div>
umbraco/Umbraco-CMS
src/Umbraco.Web.UI.Client/src/views/common/drawers/help/help.html
HTML
mit
11,097
51.34434
237
0.455709
false
/********************************************************************* * * Software License Agreement (BSD License) * * Copyright (c) 2008, 2013, Willow Garage, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Willow Garage, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Author: Eitan Marder-Eppstein * David V. Lu!! *********************************************************************/ #include<global_planner/dijkstra.h> #include <algorithm> namespace global_planner { DijkstraExpansion::DijkstraExpansion(PotentialCalculator* p_calc, int nx, int ny) : Expander(p_calc, nx, ny), pending_(NULL), precise_(false) { // priority buffers buffer1_ = new int[PRIORITYBUFSIZE]; buffer2_ = new int[PRIORITYBUFSIZE]; buffer3_ = new int[PRIORITYBUFSIZE]; priorityIncrement_ = 2 * neutral_cost_; } DijkstraExpansion::~DijkstraExpansion() { delete[] buffer1_; delete[] buffer2_; delete[] buffer3_; if (pending_) delete[] pending_; } // // Set/Reset map size // void DijkstraExpansion::setSize(int xs, int ys) { Expander::setSize(xs, ys); if (pending_) delete[] pending_; pending_ = new bool[ns_]; memset(pending_, 0, ns_ * sizeof(bool)); } // // main propagation function // Dijkstra method, breadth-first // runs for a specified number of cycles, // or until it runs out of cells to update, // or until the Start cell is found (atStart = true) // bool DijkstraExpansion::calculatePotentials(unsigned char* costs, double start_x, double start_y, double end_x, double end_y, int cycles, float* potential) { cells_visited_ = 0; // priority buffers threshold_ = lethal_cost_; currentBuffer_ = buffer1_; currentEnd_ = 0; nextBuffer_ = buffer2_; nextEnd_ = 0; overBuffer_ = buffer3_; overEnd_ = 0; memset(pending_, 0, ns_ * sizeof(bool)); std::fill(potential, potential + ns_, POT_HIGH); // set goal int k = toIndex(start_x, start_y); if(precise_) { double dx = start_x - (int)start_x, dy = start_y - (int)start_y; dx = floorf(dx * 100 + 0.5) / 100; dy = floorf(dy * 100 + 0.5) / 100; potential[k] = neutral_cost_ * 2 * dx * dy; potential[k+1] = neutral_cost_ * 2 * (1-dx)*dy; potential[k+nx_] = neutral_cost_*2*dx*(1-dy); potential[k+nx_+1] = neutral_cost_*2*(1-dx)*(1-dy);//*/ push_cur(k+2); push_cur(k-1); push_cur(k+nx_-1); push_cur(k+nx_+2); push_cur(k-nx_); push_cur(k-nx_+1); push_cur(k+nx_*2); push_cur(k+nx_*2+1); }else{ potential[k] = 0; push_cur(k+1); push_cur(k-1); push_cur(k-nx_); push_cur(k+nx_); } int nwv = 0; // max priority block size int nc = 0; // number of cells put into priority blocks int cycle = 0; // which cycle we're on // set up start cell int startCell = toIndex(end_x, end_y); for (; cycle < cycles; cycle++) // go for this many cycles, unless interrupted { // if (currentEnd_ == 0 && nextEnd_ == 0) // priority blocks empty return false; // stats nc += currentEnd_; if (currentEnd_ > nwv) nwv = currentEnd_; // reset pending_ flags on current priority buffer int *pb = currentBuffer_; int i = currentEnd_; while (i-- > 0) pending_[*(pb++)] = false; // process current priority buffer pb = currentBuffer_; i = currentEnd_; while (i-- > 0) updateCell(costs, potential, *pb++); // swap priority blocks currentBuffer_ <=> nextBuffer_ currentEnd_ = nextEnd_; nextEnd_ = 0; pb = currentBuffer_; // swap buffers currentBuffer_ = nextBuffer_; nextBuffer_ = pb; // see if we're done with this priority level if (currentEnd_ == 0) { threshold_ += priorityIncrement_; // increment priority threshold currentEnd_ = overEnd_; // set current to overflow block overEnd_ = 0; pb = currentBuffer_; // swap buffers currentBuffer_ = overBuffer_; overBuffer_ = pb; } // check if we've hit the Start cell if (potential[startCell] < POT_HIGH) break; } //ROS_INFO("CYCLES %d/%d ", cycle, cycles); if (cycle < cycles) return true; // finished up here else return false; } // // Critical function: calculate updated potential value of a cell, // given its neighbors' values // Planar-wave update calculation from two lowest neighbors in a 4-grid // Quadratic approximation to the interpolated value // No checking of bounds here, this function should be fast // #define INVSQRT2 0.707106781 inline void DijkstraExpansion::updateCell(unsigned char* costs, float* potential, int n) { cells_visited_++; // do planar wave update float c = getCost(costs, n); if (c >= lethal_cost_) // don't propagate into obstacles return; float pot = p_calc_->calculatePotential(potential, c, n); // now add affected neighbors to priority blocks if (pot < potential[n]) { float le = INVSQRT2 * (float)getCost(costs, n - 1); float re = INVSQRT2 * (float)getCost(costs, n + 1); float ue = INVSQRT2 * (float)getCost(costs, n - nx_); float de = INVSQRT2 * (float)getCost(costs, n + nx_); potential[n] = pot; //ROS_INFO("UPDATE %d %d %d %f", n, n%nx, n/nx, potential[n]); if (pot < threshold_) // low-cost buffer block { if (potential[n - 1] > pot + le) push_next(n-1); if (potential[n + 1] > pot + re) push_next(n+1); if (potential[n - nx_] > pot + ue) push_next(n-nx_); if (potential[n + nx_] > pot + de) push_next(n+nx_); } else // overflow block { if (potential[n - 1] > pot + le) push_over(n-1); if (potential[n + 1] > pot + re) push_over(n+1); if (potential[n - nx_] > pot + ue) push_over(n-nx_); if (potential[n + nx_] > pot + de) push_over(n+nx_); } } } } //end namespace global_planner
atkvo/masters-bot
src/navigation/global_planner/src/dijkstra.cpp
C++
mit
7,938
32.923077
125
0.576594
false
'use strict'; var assign = require('lodash/object/assign'); var path = require('path'); var Command = require('../models/command'); var Promise = require('../ext/promise'); var SilentError = require('../errors/silent'); module.exports = Command.extend({ name: 'serve', description: 'Builds and serves your app, rebuilding on file changes.', aliases: ['server', 's'], availableOptions: [ { name: 'port', type: Number, default: process.env.PORT || 4200, aliases: ['p'] }, { name: 'host', type: String, default: '0.0.0.0', aliases: ['H'] }, { name: 'proxy', type: String, aliases: ['pr','pxy'] }, { name: 'insecure-proxy', type: Boolean, default: false, description: 'Set false to proxy self-signed SSL certificates', aliases: ['inspr'] }, { name: 'watcher', type: String, default: 'events', aliases: ['w'] }, { name: 'live-reload', type: Boolean, default: true, aliases: ['lr'] }, { name: 'live-reload-port', type: Number, description: '(Defaults to port number + 31529)', aliases: ['lrp']}, { name: 'environment', type: String, default: 'development', aliases: ['e', {'dev' : 'development'}, {'prod' : 'production'}] }, { name: 'output-path', type: path, default: 'dist/', aliases: ['op', 'out'] } ], run: function(commandOptions) { commandOptions = assign({}, commandOptions, { liveReloadPort: commandOptions.liveReloadPort || (parseInt(commandOptions.port, 10) + 31529), baseURL: this.project.config(commandOptions.environment).baseURL || '/' }); if (commandOptions.proxy) { if (!commandOptions.proxy.match(/^(http:|https:)/)) { var message = 'You need to include a protocol with the proxy URL.\nTry --proxy http://' + commandOptions.proxy; return Promise.reject(new SilentError(message)); } } var ServeTask = this.tasks.Serve; var serve = new ServeTask({ ui: this.ui, analytics: this.analytics, project: this.project }); return serve.run(commandOptions); } });
zanemayo/ember-cli
lib/commands/serve.js
JavaScript
mit
2,035
40.530612
146
0.623587
false
'use strict'; const expect = require('chai').expect; const chords = require(__dirname + '/../public/scripts/chords'); const fs = require('fs'); describe('Check to see if all paths to audio work from chord object', () => { var ch = Object.keys(chords); for (let i = 0; i < ch.length; i++) { it(ch[i] + ' should have a real filepath to its audio', () => { let key = ch[i]; let path = chords[key].audio; let f = fs.readFileSync(__dirname + '/../public' + path); expect(f instanceof Buffer).to.eql(true); }); } });
SoloAlong/SoloAlong
test/test.sndRoutes.spec.js
JavaScript
mit
551
31.411765
77
0.589837
false
/** * \file * * \brief SAM D11 TCC Features Example Application * Refer following application note for details. * AT42357 - Using the Timer Counter for Control Applications (TCC). * * Copyright (C) 2014 Atmel Corporation. All rights reserved. * * \license * \asf_license_start * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * \asf_license_stop * */ /* * Include header files for all drivers that have been imported from * Atmel Software Framework (ASF). */ /** * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #include <asf.h> #include "conf_example.h" struct tcc_module tcc_instance; enum status_code stat = STATUS_OK; #ifdef TCC_MODE_PATTERN_GENERATION /* Generic Pattern for half size Bipolar Stepper Motor */ uint8_t sm_pattern[4] = {8, 2, 4, 1}; uint8_t i = 0; #endif /* Description: This example project helps you to configure the TCC Module for different Features/Modes available in TCC module of SAMD11 */ /* Configure the TCC module as per the application requirement */ /* Example - 1. Circular Buffer 2. Oneshot Operation 3. Pattern Generation 4. PWM with OTMX(Output Matrix) and DTI(Dead Time Insertion) 5. RAMP2 Operation 6. SWAP Operation */ void configure_tcc(void) { /* Structure used to store the TCC configuration parameters */ struct tcc_config config_tcc; /* Fill the Structure with the default values */ tcc_get_config_defaults(&config_tcc, TCC0); /* Configure the single slope PWM waveform generation for waveform output */ config_tcc.compare.wave_generation = TCC_WAVE_GENERATION_SINGLE_SLOPE_PWM; /* Configure the TCC clock source and its divider value */ config_tcc.counter.clock_source = GLCK_SOURCE; config_tcc.counter.clock_prescaler = TCC_CLOCK_DIVIDER; /* Configure the value for TOP value */ config_tcc.counter.period = TCC_PERIOD_VALUE; #ifdef TCC_MODE_CIRCULAR_BUFFER /* Configure the TCC Waveform Output pins for waveform generation output */ config_tcc.pins.enable_wave_out_pin[0] = true; config_tcc.pins.wave_out_pin[0] = PIN_PA04F_TCC0_WO0; /* Configure the Alternate function of GPIO pins for TCC functionality */ config_tcc.pins.wave_out_pin_mux[0] = MUX_PA04F_TCC0_WO0; #endif #ifdef TCC_MODE_ONESHOT /* Configure the TCC Waveform Output pins for waveform generation output */ config_tcc.pins.enable_wave_out_pin[6] = true; config_tcc.pins.wave_out_pin[6] = PIN_PA16F_TCC0_WO6; /* Configure the alternate function of GPIO pins for TCC functionality */ config_tcc.pins.wave_out_pin_mux[6] = MUX_PA16F_TCC0_WO6; /* Configure the Match value for the compare channel 2 for LED0 ON time*/ config_tcc.compare.match[2] = 31250; /* Invert the Waveform output[6] channel to drive LED0 */ config_tcc.wave_ext.invert[6] = true; /* Enable the One shot Feature */ config_tcc.counter.oneshot = true; #endif #ifdef TCC_MODE_OTMX_DTI /* Configure the TCC Waveform Output pins for waveform generation output */ config_tcc.pins.enable_wave_out_pin[0] = true; config_tcc.pins.enable_wave_out_pin[1] = true; config_tcc.pins.enable_wave_out_pin[2] = true; config_tcc.pins.enable_wave_out_pin[6] = true; config_tcc.pins.wave_out_pin[0] = PIN_PA04F_TCC0_WO0; config_tcc.pins.wave_out_pin[1] = PIN_PA05F_TCC0_WO1; config_tcc.pins.wave_out_pin[2] = PIN_PA06F_TCC0_WO2; config_tcc.pins.wave_out_pin[6] = PIN_PA16F_TCC0_WO6; /* Configure the Alternate function of GPIO pins for TCC functionality */ config_tcc.pins.wave_out_pin_mux[0] = MUX_PA04F_TCC0_WO0; config_tcc.pins.wave_out_pin_mux[1] = MUX_PA05F_TCC0_WO1; config_tcc.pins.wave_out_pin_mux[2] = MUX_PA06F_TCC0_WO2; config_tcc.pins.wave_out_pin_mux[6] = MUX_PA16F_TCC0_WO6; /* Configure the compare channel values for the duty cycle control */ /* Load the 0x80 value for 50% duty cycle */ config_tcc.compare.match[0] = 0x80; config_tcc.compare.match[1] = 0x80; config_tcc.compare.match[2] = 0x80; /* Invert the Waveform output[1] channel to view the DTI effect */ config_tcc.wave_ext.invert[1] = true; #endif #ifdef TCC_MODE_SWAP /* Configure the TCC Waveform Output pins for waveform generation output */ config_tcc.pins.enable_wave_out_pin[0] = true; config_tcc.pins.enable_wave_out_pin[4] = true; config_tcc.pins.wave_out_pin[0] = PIN_PA04F_TCC0_WO0; config_tcc.pins.wave_out_pin[4] = PIN_PA22F_TCC0_WO4; /* Configure the alternate function of GPIO pins for TCC functionality */ config_tcc.pins.wave_out_pin_mux[0] = MUX_PA04F_TCC0_WO0; config_tcc.pins.wave_out_pin_mux[4] = MUX_PA22F_TCC0_WO4; /* Configure the compare channel values for the duty cycle control */ /* Load the 0x80 value for 50% duty cycle */ config_tcc.compare.match[0] = 0x80; #endif #ifdef TCC_MODE_PATTERN_GENERATION /* Configure the TCC Waveform Output pins for waveform generation output */ config_tcc.pins.enable_wave_out_pin[0] = true; config_tcc.pins.enable_wave_out_pin[1] = true; config_tcc.pins.enable_wave_out_pin[2] = true; config_tcc.pins.enable_wave_out_pin[3] = true; config_tcc.pins.wave_out_pin[0] = PIN_PA04F_TCC0_WO0; config_tcc.pins.wave_out_pin[1] = PIN_PA05F_TCC0_WO1; config_tcc.pins.wave_out_pin[2] = PIN_PA06F_TCC0_WO2; config_tcc.pins.wave_out_pin[3] = PIN_PA07F_TCC0_WO3; /* Configure the Alternate function of GPIO pins for TCC functionality */ config_tcc.pins.wave_out_pin_mux[0] = MUX_PA04F_TCC0_WO0; config_tcc.pins.wave_out_pin_mux[1] = MUX_PA05F_TCC0_WO1; config_tcc.pins.wave_out_pin_mux[2] = MUX_PA06F_TCC0_WO2; config_tcc.pins.wave_out_pin_mux[3] = MUX_PA07F_TCC0_WO3; config_tcc.double_buffering_enabled = true; /* Configure the compare channel values for the duty cycle control */ /* Load the 0x7FFF value for 50% duty cycle */ config_tcc.compare.match[0] = 0x7FFF; #endif #ifdef TCC_MODE_RAMP2 /* Configure the TCC Waveform Output pins for waveform generation output */ config_tcc.pins.enable_wave_out_pin[0] = true; config_tcc.pins.enable_wave_out_pin[1] = true; config_tcc.pins.wave_out_pin[0] = PIN_PA04F_TCC0_WO0; config_tcc.pins.wave_out_pin[1] = PIN_PA05F_TCC0_WO1; /* Configure the Alternate function of GPIO pins for TCC functionality */ config_tcc.pins.wave_out_pin_mux[0] = MUX_PA04F_TCC0_WO0; config_tcc.pins.wave_out_pin_mux[1] = MUX_PA05F_TCC0_WO1; /* Configure the RAMP mode operation as RAMP2 mode */ config_tcc.compare.wave_ramp = TCC_RAMP_RAMP2; /* Configure the compare channel values for the duty cycle control */ /* Load the 0xB333 value for 70% duty cycle */ config_tcc.compare.match[0] = 0xB333; /* Load the 0x4CCC value for 30% duty cycle */ config_tcc.compare.match[1] = 0x4CCC; #endif /* Initialize the TCC0 channel and define the its registers with configuration defined in the config_tcc */ stat = tcc_init(&tcc_instance, TCC0, &config_tcc); #ifdef TCC_MODE_CIRCULAR_BUFFER /* Load the CC0 and CCB0 values respectively for the circular buffer operation */ stat = tcc_set_double_buffer_compare_values(&tcc_instance, TCC_MATCH_CAPTURE_CHANNEL_0, CC0_Value, CCB0_Value); /* Enable the Circular Buffer feature for the Compare Channel 0 */ stat = tcc_enable_circular_buffer_compare(&tcc_instance, TCC_MATCH_CAPTURE_CHANNEL_0); #endif #ifdef TCC_MODE_OTMX_DTI /* Enable the Dead Time Insertion Generator for the channel 2 (CC2) */ TCC0->WEXCTRL.reg |= TCC_WEXCTRL_DTIEN2; /* Define the High side time and Low side time for Dead Time generation */ TCC0->WEXCTRL.reg |= TCC_WEXCTRL_DTLS(0x40) | TCC_WEXCTRL_DTHS(0x10); #endif #ifdef TCC_MODE_PATTERN_GENERATION /* Configure the Output Matrix Channel for Pattern Generation of Stepper Motor */ TCC0->WEXCTRL.reg |= TCC_WEXCTRL_OTMX(2); /* Enable the Pattern Generator Output for 4 Waveform Outputs and Load the PATT and PATTB register values respectively for Stepper Motor Pattern Generation */ TCC0->PATT.reg = TCC_PATT_PGE(0x0F) | TCC_PATT_PGV(sm_pattern[i++]); while (TCC0->SYNCBUSY.bit.PATT) { } TCC0->PATTB.reg = TCC_PATTB_PGEB(0x0F) | TCC_PATTB_PGVB(sm_pattern[i++]); while (TCC0->SYNCBUSY.bit.PATTB) { } #endif #ifdef TCC_MODE_SWAP /* Enable the Dead Time Insertion Generator for the channel 0 (CC0) */ TCC0->WEXCTRL.reg |= TCC_WEXCTRL_DTIEN0; /* Define the High side time and Low side time for Dead Time generation */ TCC0->WEXCTRL.reg |= TCC_WEXCTRL_DTLS(0x20) | TCC_WEXCTRL_DTHS(0x60); #endif /* Enable the TCC module */ tcc_enable(&tcc_instance); } /* This Function loads the Stepper Motor Pattern into the Pattern Buffer register respectively in the PGVB continuously. Please note that here we have not added any delay between the pattern on the wave output pin. Hence please add the appropriate delay before load the pattern into Pattern Generation Value Buffer (PGVB register) as mentioned in the stepper motor datasheet */ #ifdef TCC_MODE_PATTERN_GENERATION void pattern_generation(void) { if (i == 4) { i = 0; } while (!TCC0->INTFLAG.bit.MC0) { } TCC0->INTFLAG.bit.MC0 = 1; TCC0->PATTB.reg = TCC_PATTB_PGEB(0x0F) | TCC_PATTB_PGVB(sm_pattern[i++]); while (TCC0->SYNCBUSY.bit.PATTB) { } } #endif /* This function Waits for the user input(Button Press) BUTTON_0_PIN then clears the counter value and restart the counter for the Oneshot Operation */ #ifdef TCC_MODE_ONESHOT void oneshot_operation(void) { while (port_pin_get_input_level(BUTTON_0_PIN)) { } while (!port_pin_get_input_level(BUTTON_0_PIN)) { } tcc_set_count_value(&tcc_instance, 0); tcc_restart_counter(&tcc_instance); } #endif /* This function waits for the user input(Button Press) BUTTON_0_PIN then toggles the SWAP bit for the SWAP continuously */ #ifdef TCC_MODE_SWAP void swap_operation(void) { while (port_pin_get_input_level(BUTTON_0_PIN)) { } while (!port_pin_get_input_level(BUTTON_0_PIN)) { } TCC0->WAVE.reg ^= TCC_WAVE_SWAP0; while (TCC0->SYNCBUSY.bit.WAVE) { } } #endif int main (void) { system_init(); configure_tcc(); while (1) { #ifdef TCC_MODE_ONESHOT oneshot_operation(); #endif #ifdef TCC_MODE_PATTERN_GENERATION pattern_generation(); #endif #ifdef TCC_MODE_SWAP swap_operation(); #endif } }
femtoio/femto-usb-blink-example
blinky/sam0/applications/tcc_features_example/main.c
C
mit
11,685
32.388571
115
0.720839
false
# Copyright (c) 2008-2013 Michael Dvorkin and contributors. # # Fat Free CRM is freely distributable under the terms of MIT license. # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php #------------------------------------------------------------------------------ class DatePairInput < SimpleForm::Inputs::Base # Output two date fields: start and end #------------------------------------------------------------------------------ def input add_autocomplete! out = "<br />".html_safe field1, field2 = get_fields [field1, field2].compact.each do |field| out << '<div>'.html_safe label = field==field1 ? I18n.t('pair.start') : I18n.t('pair.end') [:required, :disabled].each {|k| input_html_options.delete(k)} # ensure these come from field not default options input_html_options.merge!(field.input_options) input_html_options.merge!(:value => value(field)) out << "<label#{' class="req"' if input_html_options[:required]}>#{label}</label>".html_safe text = @builder.text_field(field.name, input_html_options) out << text << '</div>'.html_safe end out end private # Returns true if either field is required? #------------------------------------------------------------------------------ def required_field? get_fields.map(&:required).any? end # Turns autocomplete off unless told otherwise. #------------------------------------------------------------------------------ def add_autocomplete! input_html_options[:autocomplete] ||= 'off' end # Datepicker latches onto the 'date' class. #------------------------------------------------------------------------------ def input_html_classes super.push('date') end # Returns the pair as [field1, field2] #------------------------------------------------------------------------------ def get_fields @field1 ||= Field.where(:name => attribute_name).first @field2 ||= @field1.try(:paired_with) [@field1, @field2] end # Serialize into a value recognised by datepicker #------------------------------------------------------------------------------ def value(field) val = object.send(field.name) val.present? ? val.strftime('%Y-%m-%d') : nil end end
WoolenWang/Free_Crm
app/inputs/date_pair_input.rb
Ruby
mit
2,281
34.092308
119
0.49715
false
<?php namespace Platformsh\Cli\Util; use Platformsh\Cli\Helper\PlatformQuestionHelper; use Platformsh\Cli\Helper\ShellHelper; use Platformsh\Cli\Helper\ShellHelperInterface; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class RelationshipsUtil { protected $output; protected $shellHelper; /** * @param OutputInterface $output * @param ShellHelperInterface $shellHelper */ public function __construct(OutputInterface $output, ShellHelperInterface $shellHelper = null) { $this->output = $output; $this->shellHelper = $shellHelper ?: new ShellHelper($output); } /** * @param string $sshUrl * @param InputInterface $input * * @return array|false */ public function chooseDatabase($sshUrl, InputInterface $input) { $relationships = $this->getRelationships($sshUrl); if (empty($relationships['database'])) { $this->output->writeln("No databases found"); return false; } elseif (count($relationships['database']) > 1) { $questionHelper = new PlatformQuestionHelper(); $choices = array(); foreach ($relationships['database'] as $key => $database) { $choices[$key] = $database['host'] . '/' . $database['path']; } $key = $questionHelper->choose($choices, 'Enter a number to choose a database', $input, $this->output); $database = $relationships['database'][$key]; } else { $database = reset($relationships['database']); } return $database; } /** * @param string $sshUrl * * @return array */ public function getRelationships($sshUrl) { $args = array('ssh', $sshUrl, 'echo $PLATFORM_RELATIONSHIPS'); $result = $this->shellHelper->execute($args, null, true); return json_decode(base64_decode($result), true); } }
OriPekelman/platformsh-cli
src/Util/RelationshipsUtil.php
PHP
mit
2,024
28.764706
115
0.604249
false
#!/bin/bash TWEET_FILE=$1 # e.g. id|tweet|es|created_at IDOL_FILE=$2 # e.g. either 'id|neutral|score', blank line or 'id|sentiment|topic|score' AGGREGATE_REGEX="(^[0-9]+\|[^|]+\|[^|]+$)|^\s*$" # e.g. id|neutral|score or blank line grep -vE $AGGREGATE_REGEX $IDOL_FILE > sentiment.tbl # id|sentiment|topic|score TMP_FILE=`mktemp topcoder.XXXXXX` grep -E $AGGREGATE_REGEX $IDOL_FILE | cut -d'|' -f2,3 > $TMP_FILE paste -d'|' $TWEET_FILE $TMP_FILE | sed 's/\|$//' > tweet.tbl rm $TMP_FILE
lagunex/HPSentimentAnalysis
VerticaConnection/scripts/extract_tbl_files.bash
Shell
mit
490
36.692308
87
0.644898
false
import { get } from 'ember-metal/property_get'; import run from 'ember-metal/run_loop'; import { dasherize } from 'ember-runtime/system/string'; import Namespace from 'ember-runtime/system/namespace'; import EmberObject from 'ember-runtime/system/object'; import { A as emberA } from 'ember-runtime/system/native_array'; import Application from 'ember-application/system/application'; import { getOwner } from 'container/owner'; import { addArrayObserver, removeArrayObserver, objectAt } from 'ember-runtime/mixins/array'; /** @module ember @submodule ember-extension-support */ /** The `DataAdapter` helps a data persistence library interface with tools that debug Ember such as the [Ember Extension](https://github.com/tildeio/ember-extension) for Chrome and Firefox. This class will be extended by a persistence library which will override some of the methods with library-specific code. The methods likely to be overridden are: * `getFilters` * `detect` * `columnsForType` * `getRecords` * `getRecordColumnValues` * `getRecordKeywords` * `getRecordFilterValues` * `getRecordColor` * `observeRecord` The adapter will need to be registered in the application's container as `dataAdapter:main`. Example: ```javascript Application.initializer({ name: "data-adapter", initialize: function(application) { application.register('data-adapter:main', DS.DataAdapter); } }); ``` @class DataAdapter @namespace Ember @extends EmberObject @public */ export default EmberObject.extend({ init() { this._super(...arguments); this.releaseMethods = emberA(); }, /** The container-debug-adapter which is used to list all models. @property containerDebugAdapter @default undefined @since 1.5.0 @public **/ containerDebugAdapter: undefined, /** The number of attributes to send as columns. (Enough to make the record identifiable). @private @property attributeLimit @default 3 @since 1.3.0 */ attributeLimit: 3, /** Ember Data > v1.0.0-beta.18 requires string model names to be passed around instead of the actual factories. This is a stamp for the Ember Inspector to differentiate between the versions to be able to support older versions too. @public @property acceptsModelName */ acceptsModelName: true, /** Stores all methods that clear observers. These methods will be called on destruction. @private @property releaseMethods @since 1.3.0 */ releaseMethods: emberA(), /** Specifies how records can be filtered. Records returned will need to have a `filterValues` property with a key for every name in the returned array. @public @method getFilters @return {Array} List of objects defining filters. The object should have a `name` and `desc` property. */ getFilters() { return emberA(); }, /** Fetch the model types and observe them for changes. @public @method watchModelTypes @param {Function} typesAdded Callback to call to add types. Takes an array of objects containing wrapped types (returned from `wrapModelType`). @param {Function} typesUpdated Callback to call when a type has changed. Takes an array of objects containing wrapped types. @return {Function} Method to call to remove all observers */ watchModelTypes(typesAdded, typesUpdated) { let modelTypes = this.getModelTypes(); let releaseMethods = emberA(); let typesToSend; typesToSend = modelTypes.map(type => { let klass = type.klass; let wrapped = this.wrapModelType(klass, type.name); releaseMethods.push(this.observeModelType(type.name, typesUpdated)); return wrapped; }); typesAdded(typesToSend); let release = () => { releaseMethods.forEach((fn) => fn() ); this.releaseMethods.removeObject(release); }; this.releaseMethods.pushObject(release); return release; }, _nameToClass(type) { if (typeof type === 'string') { type = getOwner(this)._lookupFactory(`model:${type}`); } return type; }, /** Fetch the records of a given type and observe them for changes. @public @method watchRecords @param {String} modelName The model name. @param {Function} recordsAdded Callback to call to add records. Takes an array of objects containing wrapped records. The object should have the following properties: columnValues: {Object} The key and value of a table cell. object: {Object} The actual record object. @param {Function} recordsUpdated Callback to call when a record has changed. Takes an array of objects containing wrapped records. @param {Function} recordsRemoved Callback to call when a record has removed. Takes the following parameters: index: The array index where the records were removed. count: The number of records removed. @return {Function} Method to call to remove all observers. */ watchRecords(modelName, recordsAdded, recordsUpdated, recordsRemoved) { let releaseMethods = emberA(); let klass = this._nameToClass(modelName); let records = this.getRecords(klass, modelName); let release; function recordUpdated(updatedRecord) { recordsUpdated([updatedRecord]); } let recordsToSend = records.map((record) => { releaseMethods.push(this.observeRecord(record, recordUpdated)); return this.wrapRecord(record); }); let contentDidChange = (array, idx, removedCount, addedCount) => { for (let i = idx; i < idx + addedCount; i++) { let record = objectAt(array, i); let wrapped = this.wrapRecord(record); releaseMethods.push(this.observeRecord(record, recordUpdated)); recordsAdded([wrapped]); } if (removedCount) { recordsRemoved(idx, removedCount); } }; let observer = { didChange: contentDidChange, willChange() { return this; } }; addArrayObserver(records, this, observer); release = () => { releaseMethods.forEach(fn => fn()); removeArrayObserver(records, this, observer); this.releaseMethods.removeObject(release); }; recordsAdded(recordsToSend); this.releaseMethods.pushObject(release); return release; }, /** Clear all observers before destruction @private @method willDestroy */ willDestroy() { this._super(...arguments); this.releaseMethods.forEach(fn => fn()); }, /** Detect whether a class is a model. Test that against the model class of your persistence library. @private @method detect @param {Class} klass The class to test. @return boolean Whether the class is a model class or not. */ detect(klass) { return false; }, /** Get the columns for a given model type. @private @method columnsForType @param {Class} type The model type. @return {Array} An array of columns of the following format: name: {String} The name of the column. desc: {String} Humanized description (what would show in a table column name). */ columnsForType(type) { return emberA(); }, /** Adds observers to a model type class. @private @method observeModelType @param {String} modelName The model type name. @param {Function} typesUpdated Called when a type is modified. @return {Function} The function to call to remove observers. */ observeModelType(modelName, typesUpdated) { let klass = this._nameToClass(modelName); let records = this.getRecords(klass, modelName); function onChange() { typesUpdated([this.wrapModelType(klass, modelName)]); } let observer = { didChange() { run.scheduleOnce('actions', this, onChange); }, willChange() { return this; } }; addArrayObserver(records, this, observer); let release = () => removeArrayObserver(records, this, observer); return release; }, /** Wraps a given model type and observes changes to it. @private @method wrapModelType @param {Class} klass A model class. @param {String} modelName Name of the class. @return {Object} Contains the wrapped type and the function to remove observers Format: type: {Object} The wrapped type. The wrapped type has the following format: name: {String} The name of the type. count: {Integer} The number of records available. columns: {Columns} An array of columns to describe the record. object: {Class} The actual Model type class. release: {Function} The function to remove observers. */ wrapModelType(klass, name) { let records = this.getRecords(klass, name); let typeToSend; typeToSend = { name, count: get(records, 'length'), columns: this.columnsForType(klass), object: klass }; return typeToSend; }, /** Fetches all models defined in the application. @private @method getModelTypes @return {Array} Array of model types. */ getModelTypes() { let containerDebugAdapter = this.get('containerDebugAdapter'); let types; if (containerDebugAdapter.canCatalogEntriesByType('model')) { types = containerDebugAdapter.catalogEntriesByType('model'); } else { types = this._getObjectsOnNamespaces(); } // New adapters return strings instead of classes. types = emberA(types).map((name) => { return { klass: this._nameToClass(name), name: name }; }); types = emberA(types).filter(type => this.detect(type.klass)); return emberA(types); }, /** Loops over all namespaces and all objects attached to them. @private @method _getObjectsOnNamespaces @return {Array} Array of model type strings. */ _getObjectsOnNamespaces() { let namespaces = emberA(Namespace.NAMESPACES); let types = emberA(); namespaces.forEach(namespace => { for (let key in namespace) { if (!namespace.hasOwnProperty(key)) { continue; } // Even though we will filter again in `getModelTypes`, // we should not call `lookupFactory` on non-models // (especially when `EmberENV.MODEL_FACTORY_INJECTIONS` is `true`) if (!this.detect(namespace[key])) { continue; } let name = dasherize(key); if (!(namespace instanceof Application) && namespace.toString()) { name = `${namespace}/${name}`; } types.push(name); } }); return types; }, /** Fetches all loaded records for a given type. @private @method getRecords @return {Array} An array of records. This array will be observed for changes, so it should update when new records are added/removed. */ getRecords(type) { return emberA(); }, /** Wraps a record and observers changes to it. @private @method wrapRecord @param {Object} record The record instance. @return {Object} The wrapped record. Format: columnValues: {Array} searchKeywords: {Array} */ wrapRecord(record) { let recordToSend = { object: record }; recordToSend.columnValues = this.getRecordColumnValues(record); recordToSend.searchKeywords = this.getRecordKeywords(record); recordToSend.filterValues = this.getRecordFilterValues(record); recordToSend.color = this.getRecordColor(record); return recordToSend; }, /** Gets the values for each column. @private @method getRecordColumnValues @return {Object} Keys should match column names defined by the model type. */ getRecordColumnValues(record) { return {}; }, /** Returns keywords to match when searching records. @private @method getRecordKeywords @return {Array} Relevant keywords for search. */ getRecordKeywords(record) { return emberA(); }, /** Returns the values of filters defined by `getFilters`. @private @method getRecordFilterValues @param {Object} record The record instance. @return {Object} The filter values. */ getRecordFilterValues(record) { return {}; }, /** Each record can have a color that represents its state. @private @method getRecordColor @param {Object} record The record instance @return {String} The records color. Possible options: black, red, blue, green. */ getRecordColor(record) { return null; }, /** Observes all relevant properties and re-sends the wrapped record when a change occurs. @private @method observerRecord @param {Object} record The record instance. @param {Function} recordUpdated The callback to call when a record is updated. @return {Function} The function to call to remove all observers. */ observeRecord(record, recordUpdated) { return function() {}; } });
NLincoln/ember.js
packages/ember-extension-support/lib/data_adapter.js
JavaScript
mit
12,967
25.143145
87
0.667078
false
# -*- coding: utf-8 -*- # # frozen_string_literal: true module Rouge module Lexers # Direct port of pygments Lexer. # See: https://bitbucket.org/birkenfeld/pygments-main/src/7304e4759ae65343d89a51359ca538912519cc31/pygments/lexers/functional.py?at=default#cl-2362 class Elixir < RegexLexer title "Elixir" desc "Elixir language (elixir-lang.org)" tag 'elixir' aliases 'elixir', 'exs' filenames '*.ex', '*.exs' mimetypes 'text/x-elixir', 'application/x-elixir' state :root do rule %r/\s+/m, Text rule %r/#.*$/, Comment::Single rule %r{\b(case|cond|end|bc|lc|if|unless|try|loop|receive|fn|defmodule| defp?|defprotocol|defimpl|defrecord|defmacrop?|defdelegate| defexception|defguardp?|defstruct|exit|raise|throw|after|rescue|catch|else)\b(?![?!])| (?<!\.)\b(do|\-\>)\b}x, Keyword rule %r/\b(import|require|use|recur|quote|unquote|super|refer)\b(?![?!])/, Keyword::Namespace rule %r/(?<!\.)\b(and|not|or|when|xor|in)\b/, Operator::Word rule %r{%=|\*=|\*\*=|\+=|\-=|\^=|\|\|=| <=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?=[\s])\?| (?<=[\s])!+|&(&&?|(?!\d))|\|\||\^|\*|\+|\-|/| \||\+\+|\-\-|\*\*|\/\/|\<\-|\<\>|<<|>>|=|\.|~~~}x, Operator rule %r{(?<!:)(:)([a-zA-Z_]\w*([?!]|=(?![>=]))?|\<\>|===?|>=?|<=?| <=>|&&?|%\(\)|%\[\]|%\{\}|\+\+?|\-\-?|\|\|?|\!|//|[%&`/\|]| \*\*?|=?~|<\-)|([a-zA-Z_]\w*([?!])?)(:)(?!:)}, Str::Symbol rule %r/:"/, Str::Symbol, :interpoling_symbol rule %r/\b(nil|true|false)\b(?![?!])|\b[A-Z]\w*\b/, Name::Constant rule %r/\b(__(FILE|LINE|MODULE|MAIN|FUNCTION)__)\b(?![?!])/, Name::Builtin::Pseudo rule %r/[a-zA-Z_!]\w*[!\?]?/, Name rule %r{::|[%(){};,/\|:\\\[\]]}, Punctuation rule %r/@[a-zA-Z_]\w*|&\d/, Name::Variable rule %r{\b\d(_?\d)*(\.(?![^\d\s])(_?\d)+)([eE][-+]?\d(_?\d)*)?\b}, Num::Float rule %r{\b0x[0-9A-Fa-f](_?[0-9A-Fa-f])*\b}, Num::Hex rule %r{\b0o[0-7](_?[0-7])*\b}, Num::Oct rule %r{\b0b[01](_?[01])*\b}, Num::Bin rule %r{\b\d(_?\d)*\b}, Num::Integer mixin :strings mixin :sigil_strings end state :strings do rule %r/(%[A-Ba-z])?"""(?:.|\n)*?"""/, Str::Doc rule %r/'''(?:.|\n)*?'''/, Str::Doc rule %r/"/, Str::Doc, :dqs rule %r/'.*?'/, Str::Single rule %r{(?<!\w)\?(\\(x\d{1,2}|\h{1,2}(?!\h)\b|0[0-7]{0,2}(?![0-7])\b[^x0MC])|(\\[MC]-)+\w|[^\s\\])}, Str::Other end state :dqs do rule %r/"/, Str::Double, :pop! mixin :enddoublestr end state :interpoling do rule %r/#\{/, Str::Interpol, :interpoling_string end state :interpoling_string do rule %r/\}/, Str::Interpol, :pop! mixin :root end state :interpoling_symbol do rule %r/"/, Str::Symbol, :pop! mixin :interpoling rule %r/[^#"]+/, Str::Symbol end state :enddoublestr do mixin :interpoling rule %r/[^#"]+/, Str::Double end state :sigil_strings do # ~-sigiled strings # ~(abc), ~[abc], ~<abc>, ~|abc|, ~r/abc/, etc # Cribbed and adjusted from Ruby lexer delimiter_map = { '{' => '}', '[' => ']', '(' => ')', '<' => '>' } # Match a-z for custom sigils too sigil_opens = Regexp.union(delimiter_map.keys + %w(| / ' ")) rule %r/~([A-Za-z])?(#{sigil_opens})/ do |m| open = Regexp.escape(m[2]) close = Regexp.escape(delimiter_map[m[2]] || m[2]) interp = /[SRCW]/ === m[1] toktype = Str::Other puts " open: #{open.inspect}" if @debug puts " close: #{close.inspect}" if @debug # regexes if 'Rr'.include? m[1] toktype = Str::Regex push :regex_flags end if 'Ww'.include? m[1] push :list_flags end token toktype push do rule %r/#{close}/, toktype, :pop! if interp mixin :interpoling rule %r/#/, toktype else rule %r/[\\#]/, toktype end uniq_chars = "#{open}#{close}".squeeze rule %r/[^##{uniq_chars}\\]+/m, toktype end end end state :regex_flags do rule %r/[fgimrsux]*/, Str::Regex, :pop! end state :list_flags do rule %r/[csa]?/, Str::Other, :pop! end end end end
msaintemarie/msaintemarie.github.io
vendor/cache/ruby/2.6.0/gems/rouge-3.8.0/lib/rouge/lexers/elixir.rb
Ruby
mit
4,600
32.333333
151
0.445435
false
--- layout: pattern title: Strategy folder: strategy permalink: /patterns/strategy/ categories: Behavioral tags: - Java - Difficulty-Beginner - Gang Of Four --- **Also known as:** Policy **Intent:** Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. ![alt text](./etc/strategy_1.png "Strategy") **Applicability:** Use the Strategy pattern when * many related classes differ only in their behavior. Strategies provide a way to configure a class either one of many behaviors * you need different variants of an algorithm. for example, you might define algorithms reflecting different space/time trade-offs. Strategies can be used when these variants are implemented as a class hierarchy of algorithms * an algorithm uses data that clients shouldn't know about. Use the Strategy pattern to avoid exposing complex, algorithm-specific data structures * a class defines many behaviors, and these appear as multiple conditional statements in its operations. Instead of many conditionals, move related conditional branches into their own Strategy class **Credits** * [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612)
ouyangxiangshao/java-design-patterns
strategy/index.md
Markdown
mit
1,327
43.233333
225
0.794273
false
<?xml version="1.0" encoding="ascii"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>lxml.html.diff.DEL_START</title> <link rel="stylesheet" href="epydoc.css" type="text/css" /> <script type="text/javascript" src="epydoc.js"></script> </head> <body bgcolor="white" text="black" link="blue" vlink="#204080" alink="#204080"> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Home link --> <th>&nbsp;&nbsp;&nbsp;<a href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th> <!-- Tree link --> <th>&nbsp;&nbsp;&nbsp;<a href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th> <!-- Index link --> <th>&nbsp;&nbsp;&nbsp;<a href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th> <!-- Help link --> <th>&nbsp;&nbsp;&nbsp;<a href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th> <!-- Project homepage --> <th class="navbar" align="right" width="100%"> <table border="0" cellpadding="0" cellspacing="0"> <tr><th class="navbar" align="center" ><a class="navbar" target="_top" href="/">lxml API</a></th> </tr></table></th> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"> <span class="breadcrumbs"> <a href="lxml-module.html">Package&nbsp;lxml</a> :: <a href="lxml.html-module.html">Package&nbsp;html</a> :: <a href="lxml.html.diff-module.html">Module&nbsp;diff</a> :: Class&nbsp;DEL_START </span> </td> <td> <table cellpadding="0" cellspacing="0"> <!-- hide/show private --> <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr> <tr><td align="right"><span class="options" >[<a href="frames.html" target="_top">frames</a >]&nbsp;|&nbsp;<a href="lxml.html.diff.DEL_START-class.html" target="_top">no&nbsp;frames</a>]</span></td></tr> </table> </td> </tr> </table> <!-- ==================== CLASS DESCRIPTION ==================== --> <h1 class="epydoc">Class DEL_START</h1><p class="nomargin-top"><span class="codelink"><a href="lxml.html.diff-pysrc.html#DEL_START">source&nbsp;code</a></span></p> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Home link --> <th>&nbsp;&nbsp;&nbsp;<a href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th> <!-- Tree link --> <th>&nbsp;&nbsp;&nbsp;<a href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th> <!-- Index link --> <th>&nbsp;&nbsp;&nbsp;<a href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th> <!-- Help link --> <th>&nbsp;&nbsp;&nbsp;<a href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th> <!-- Project homepage --> <th class="navbar" align="right" width="100%"> <table border="0" cellpadding="0" cellspacing="0"> <tr><th class="navbar" align="center" ><a class="navbar" target="_top" href="/">lxml API</a></th> </tr></table></th> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%%"> <tr> <td align="left" class="footer"> Generated by Epydoc 3.0.1 on Sat Apr 25 16:24:36 2015 </td> <td align="right" class="footer"> <a target="mainFrame" href="http://epydoc.sourceforge.net" >http://epydoc.sourceforge.net</a> </td> </tr> </table> <script type="text/javascript"> <!-- // Private objects are initially displayed (because if // javascript is turned off then we want them to be // visible); but by default, we want to hide them. So hide // them unless we have a cookie that says to show them. checkCookie(); // --> </script> </body> </html>
bertucho/epic-movie-quotes-quiz
dialogos/build/lxml/doc/html/api/lxml.html.diff.DEL_START-class.html
HTML
mit
4,252
35.655172
163
0.561148
false
# require "rails_helper" # feature "User signs in" do # scenario "successfully" do # user = create(:user, username: 'exampleuser') # sign_in user # expect(page).to have_content 'Sign out' # expect(current_path).to eq(root_path) # end # scenario "admin user cannot go to log in page" do # admin = Admin.create!(email: "admin@email.com", password: "password") # # Log in as an Admin first. # visit new_admin_session_path # fill_in "Email", with: admin.email # fill_in "Password", with: admin.password # click_on "Log in" # visit new_user_session_path # expect(current_path).to eq(admin_dashboard_path) # expect(page).to have_content "Please sign out of admin session" # end # end
aamin005/Firdowsspace
spec/features/user_signin_spec.rb
Ruby
mit
741
31.217391
75
0.650472
false
// Package sox is for file I/O via go-sox package package sox import ( "github.com/go-mix/mix/bind/sample" "github.com/go-mix/mix/bind/spec" sox "github.com/krig/go-sox" ) const ChunkSize = 2048 // Load sound file into memory func Load(path string) (out []sample.Sample, specs *spec.AudioSpec) { file := sox.OpenRead(path) if file == nil { panic("Sox can't open file: " + path) } defer file.Release() info := file.Signal() specs = &spec.AudioSpec{ Freq: info.Rate(), Format: spec.AudioS32, Channels: int(info.Channels()), } buffer := make([]sox.Sample, ChunkSize*specs.Channels) for { size := file.Read(buffer, uint(len(buffer))) if size == 0 || size == sox.EOF { break } outBuffer := make([]sample.Value, size) for offset := 0; offset < int(size); offset += specs.Channels { values := outBuffer[offset : offset+specs.Channels] for c := 0; c < specs.Channels; c++ { values[c] = sample.Value(sox.SampleToFloat64(buffer[offset+c])) } out = append(out, sample.New(values)) } } return }
go-ontomix/ontomix
bind/sox/sox.go
GO
mit
1,045
24.487805
69
0.649761
false
module Ant where type Ants = Int anteater :: Int -> Int anteater x = x+1 aardvark = anteater
CarmineM74/haskell_craft3e
Chapter15/Ant.hs
Haskell
mit
97
9.777778
22
0.680412
false
body { margin:0px; background-image:none; position:static; left:auto; width:350px; margin-left:0; margin-right:0; text-align:left; } #base { position:absolute; z-index:0; } #u3 { position:absolute; left:30px; top:30px; width:320px; height:568px; font-size:28px; } #u3_img { position:absolute; left:0px; top:0px; width:320px; height:568px; } #u4 { position:absolute; left:2px; top:276px; width:316px; visibility:hidden; word-wrap:break-word; } #u5 { position:absolute; left:30px; top:30px; width:320px; height:65px; } #u5_img { position:absolute; left:0px; top:0px; width:320px; height:65px; } #u6 { position:absolute; left:2px; top:24px; width:316px; visibility:hidden; word-wrap:break-word; } #u8 { position:absolute; left:30px; top:94px; width:320px; height:45px; font-family:'PingFangSC-Regular', 'PingFang SC'; font-weight:400; font-style:normal; font-size:36px; color:#FFFFFF; } #u8_img { position:absolute; left:0px; top:0px; width:320px; height:45px; } #u9 { position:absolute; left:2px; top:14px; width:316px; visibility:hidden; word-wrap:break-word; } #u10 { position:absolute; left:310px; top:100px; width:32px; height:32px; } #u10_img { position:absolute; left:0px; top:0px; width:32px; height:32px; } #u11 { position:absolute; left:2px; top:8px; width:28px; visibility:hidden; word-wrap:break-word; } #u12 { position:absolute; left:38px; top:96px; width:40px; height:40px; font-family:'PingFangSC-Regular', 'PingFang SC'; font-weight:400; font-style:normal; font-size:18px; color:#FFFFFF; } #u12_img { position:absolute; left:0px; top:0px; width:40px; height:40px; } #u13 { position:absolute; left:0px; top:8px; width:40px; word-wrap:break-word; } #u14 { position:absolute; left:105px; top:105px; width:170px; height:25px; font-family:'Courier', 'Courier'; font-weight:400; font-style:normal; font-size:18px; color:#FFFFFF; text-align:center; } #u14_img { position:absolute; left:0px; top:0px; width:170px; height:25px; } #u15 { position:absolute; left:0px; top:0px; width:170px; word-wrap:break-word; }
Nibatech/homepage
fupinbao/V20160102/files/logistics/styles.css
CSS
mit
2,261
13.031056
50
0.651616
false
/*++ Copyright (c) 2012 Microsoft Corporation Module Name: api_quant.cpp Abstract: API for models Author: Leonardo de Moura (leonardo) 2012-02-29. Revision History: --*/ #include<iostream> #include"z3.h" #include"api_log_macros.h" #include"api_context.h" #include"api_model.h" #include"api_ast_vector.h" #include"array_decl_plugin.h" #include"model.h" #include"model_v2_pp.h" #include"model_smt2_pp.h" #include"model_params.hpp" #include"model_evaluator_params.hpp" extern "C" { void Z3_API Z3_model_inc_ref(Z3_context c, Z3_model m) { Z3_TRY; LOG_Z3_model_inc_ref(c, m); RESET_ERROR_CODE(); if (m) { to_model(m)->inc_ref(); } Z3_CATCH; } void Z3_API Z3_model_dec_ref(Z3_context c, Z3_model m) { Z3_TRY; LOG_Z3_model_dec_ref(c, m); RESET_ERROR_CODE(); if (m) { to_model(m)->dec_ref(); } Z3_CATCH; } Z3_ast Z3_API Z3_model_get_const_interp(Z3_context c, Z3_model m, Z3_func_decl a) { Z3_TRY; LOG_Z3_model_get_const_interp(c, m, a); RESET_ERROR_CODE(); CHECK_NON_NULL(m, 0); expr * r = to_model_ref(m)->get_const_interp(to_func_decl(a)); if (!r) { SET_ERROR_CODE(Z3_INVALID_ARG); RETURN_Z3(0); } mk_c(c)->save_ast_trail(r); RETURN_Z3(of_expr(r)); Z3_CATCH_RETURN(0); } Z3_bool Z3_API Z3_model_has_interp(Z3_context c, Z3_model m, Z3_func_decl a) { Z3_TRY; LOG_Z3_model_has_interp(c, m, a); CHECK_NON_NULL(m, 0); if (to_model_ref(m)->has_interpretation(to_func_decl(a))) { return Z3_TRUE; } else { return Z3_FALSE; } Z3_CATCH_RETURN(Z3_FALSE); } Z3_func_interp Z3_API Z3_model_get_func_interp(Z3_context c, Z3_model m, Z3_func_decl f) { Z3_TRY; LOG_Z3_model_get_func_interp(c, m, f); RESET_ERROR_CODE(); CHECK_NON_NULL(m, 0); func_interp * _fi = to_model_ref(m)->get_func_interp(to_func_decl(f)); if (!_fi) { SET_ERROR_CODE(Z3_INVALID_ARG); RETURN_Z3(0); } Z3_func_interp_ref * fi = alloc(Z3_func_interp_ref, to_model_ref(m)); fi->m_func_interp = _fi; mk_c(c)->save_object(fi); RETURN_Z3(of_func_interp(fi)); Z3_CATCH_RETURN(0); } unsigned Z3_API Z3_model_get_num_consts(Z3_context c, Z3_model m) { Z3_TRY; LOG_Z3_model_get_num_consts(c, m); RESET_ERROR_CODE(); CHECK_NON_NULL(m, 0); return to_model_ref(m)->get_num_constants(); Z3_CATCH_RETURN(0); } Z3_func_decl Z3_API Z3_model_get_const_decl(Z3_context c, Z3_model m, unsigned i) { Z3_TRY; LOG_Z3_model_get_const_decl(c, m, i); RESET_ERROR_CODE(); CHECK_NON_NULL(m, 0); model * _m = to_model_ref(m); if (i < _m->get_num_constants()) { RETURN_Z3(of_func_decl(_m->get_constant(i))); } else { SET_ERROR_CODE(Z3_IOB); RETURN_Z3(0); } Z3_CATCH_RETURN(0); } unsigned Z3_API Z3_model_get_num_funcs(Z3_context c, Z3_model m) { Z3_TRY; LOG_Z3_model_get_num_funcs(c, m); RESET_ERROR_CODE(); CHECK_NON_NULL(m, 0); return to_model_ref(m)->get_num_functions(); Z3_CATCH_RETURN(0); } Z3_func_decl get_model_func_decl_core(Z3_context c, Z3_model m, unsigned i) { CHECK_NON_NULL(m, 0); model * _m = to_model_ref(m); if (i >= _m->get_num_functions()) { SET_ERROR_CODE(Z3_IOB); return 0; } return of_func_decl(_m->get_function(i)); } Z3_func_decl Z3_API Z3_model_get_func_decl(Z3_context c, Z3_model m, unsigned i) { Z3_TRY; LOG_Z3_get_model_func_decl(c, m, i); RESET_ERROR_CODE(); Z3_func_decl r = get_model_func_decl_core(c, m, i); RETURN_Z3(r); Z3_CATCH_RETURN(0); } Z3_bool Z3_API Z3_model_eval(Z3_context c, Z3_model m, Z3_ast t, Z3_bool model_completion, Z3_ast * v) { Z3_TRY; LOG_Z3_model_eval(c, m, t, model_completion, v); if (v) *v = 0; RESET_ERROR_CODE(); CHECK_NON_NULL(m, Z3_FALSE); model * _m = to_model_ref(m); expr_ref result(mk_c(c)->m()); _m->eval(to_expr(t), result, model_completion == Z3_TRUE); mk_c(c)->save_ast_trail(result.get()); *v = of_ast(result.get()); RETURN_Z3_model_eval Z3_TRUE; Z3_CATCH_RETURN(0); } unsigned Z3_API Z3_model_get_num_sorts(Z3_context c, Z3_model m) { Z3_TRY; LOG_Z3_model_get_num_sorts(c, m); RESET_ERROR_CODE(); return to_model_ref(m)->get_num_uninterpreted_sorts(); Z3_CATCH_RETURN(0); } Z3_sort Z3_API Z3_model_get_sort(Z3_context c, Z3_model m, unsigned i) { Z3_TRY; LOG_Z3_model_get_sort(c, m, i); RESET_ERROR_CODE(); if (i >= to_model_ref(m)->get_num_uninterpreted_sorts()) { SET_ERROR_CODE(Z3_IOB); RETURN_Z3(0); } sort * s = to_model_ref(m)->get_uninterpreted_sort(i); RETURN_Z3(of_sort(s)); Z3_CATCH_RETURN(0); } Z3_ast_vector Z3_API Z3_model_get_sort_universe(Z3_context c, Z3_model m, Z3_sort s) { Z3_TRY; LOG_Z3_model_get_sort_universe(c, m, s); RESET_ERROR_CODE(); if (!to_model_ref(m)->has_uninterpreted_sort(to_sort(s))) { SET_ERROR_CODE(Z3_INVALID_ARG); RETURN_Z3(0); } ptr_vector<expr> const & universe = to_model_ref(m)->get_universe(to_sort(s)); Z3_ast_vector_ref * v = alloc(Z3_ast_vector_ref, mk_c(c)->m()); mk_c(c)->save_object(v); unsigned sz = universe.size(); for (unsigned i = 0; i < sz; i++) { v->m_ast_vector.push_back(universe[i]); } RETURN_Z3(of_ast_vector(v)); Z3_CATCH_RETURN(0); } Z3_bool Z3_API Z3_is_as_array(Z3_context c, Z3_ast a) { Z3_TRY; LOG_Z3_is_as_array(c, a); RESET_ERROR_CODE(); return is_expr(to_ast(a)) && is_app_of(to_expr(a), mk_c(c)->get_array_fid(), OP_AS_ARRAY); Z3_CATCH_RETURN(Z3_FALSE); } Z3_func_decl Z3_API Z3_get_as_array_func_decl(Z3_context c, Z3_ast a) { Z3_TRY; LOG_Z3_get_as_array_func_decl(c, a); RESET_ERROR_CODE(); if (is_expr(to_ast(a)) && is_app_of(to_expr(a), mk_c(c)->get_array_fid(), OP_AS_ARRAY)) { RETURN_Z3(of_func_decl(to_func_decl(to_app(a)->get_decl()->get_parameter(0).get_ast()))); } else { SET_ERROR_CODE(Z3_INVALID_ARG); RETURN_Z3(0); } Z3_CATCH_RETURN(0); } void Z3_API Z3_func_interp_inc_ref(Z3_context c, Z3_func_interp f) { Z3_TRY; LOG_Z3_func_interp_inc_ref(c, f); RESET_ERROR_CODE(); if (f) { to_func_interp(f)->inc_ref(); } Z3_CATCH; } void Z3_API Z3_func_interp_dec_ref(Z3_context c, Z3_func_interp f) { Z3_TRY; LOG_Z3_func_interp_dec_ref(c, f); RESET_ERROR_CODE(); if (f) { to_func_interp(f)->dec_ref(); } Z3_CATCH; } unsigned Z3_API Z3_func_interp_get_num_entries(Z3_context c, Z3_func_interp f) { Z3_TRY; LOG_Z3_func_interp_get_num_entries(c, f); RESET_ERROR_CODE(); CHECK_NON_NULL(f, 0); return to_func_interp_ref(f)->num_entries(); Z3_CATCH_RETURN(0); } Z3_func_entry Z3_API Z3_func_interp_get_entry(Z3_context c, Z3_func_interp f, unsigned i) { Z3_TRY; LOG_Z3_func_interp_get_entry(c, f, i); RESET_ERROR_CODE(); CHECK_NON_NULL(f, 0); if (i >= to_func_interp_ref(f)->num_entries()) { SET_ERROR_CODE(Z3_IOB); RETURN_Z3(0); } Z3_func_entry_ref * e = alloc(Z3_func_entry_ref, to_func_interp(f)->m_model.get()); e->m_func_interp = to_func_interp_ref(f); e->m_func_entry = to_func_interp_ref(f)->get_entry(i); mk_c(c)->save_object(e); RETURN_Z3(of_func_entry(e)); Z3_CATCH_RETURN(0); } Z3_ast Z3_API Z3_func_interp_get_else(Z3_context c, Z3_func_interp f) { Z3_TRY; LOG_Z3_func_interp_get_else(c, f); RESET_ERROR_CODE(); CHECK_NON_NULL(f, 0); expr * e = to_func_interp_ref(f)->get_else(); mk_c(c)->save_ast_trail(e); RETURN_Z3(of_expr(e)); Z3_CATCH_RETURN(0); } unsigned Z3_API Z3_func_interp_get_arity(Z3_context c, Z3_func_interp f) { Z3_TRY; LOG_Z3_func_interp_get_arity(c, f); RESET_ERROR_CODE(); CHECK_NON_NULL(f, 0); return to_func_interp_ref(f)->get_arity(); Z3_CATCH_RETURN(0); } void Z3_API Z3_func_entry_inc_ref(Z3_context c, Z3_func_entry e) { Z3_TRY; LOG_Z3_func_entry_inc_ref(c, e); RESET_ERROR_CODE(); if (e) { to_func_entry(e)->inc_ref(); } Z3_CATCH; } void Z3_API Z3_func_entry_dec_ref(Z3_context c, Z3_func_entry e) { Z3_TRY; LOG_Z3_func_entry_dec_ref(c, e); RESET_ERROR_CODE(); if (e) { to_func_entry(e)->dec_ref(); } Z3_CATCH; } Z3_ast Z3_API Z3_func_entry_get_value(Z3_context c, Z3_func_entry e) { Z3_TRY; LOG_Z3_func_entry_get_value(c, e); RESET_ERROR_CODE(); expr * v = to_func_entry_ref(e)->get_result(); mk_c(c)->save_ast_trail(v); RETURN_Z3(of_expr(v)); Z3_CATCH_RETURN(0); } unsigned Z3_API Z3_func_entry_get_num_args(Z3_context c, Z3_func_entry e) { Z3_TRY; LOG_Z3_func_entry_get_num_args(c, e); RESET_ERROR_CODE(); return to_func_entry(e)->m_func_interp->get_arity(); Z3_CATCH_RETURN(0); } Z3_ast Z3_API Z3_func_entry_get_arg(Z3_context c, Z3_func_entry e, unsigned i) { Z3_TRY; LOG_Z3_func_entry_get_arg(c, e, i); RESET_ERROR_CODE(); if (i >= to_func_entry(e)->m_func_interp->get_arity()) { SET_ERROR_CODE(Z3_IOB); RETURN_Z3(0); } expr * r = to_func_entry(e)->m_func_entry->get_arg(i); RETURN_Z3(of_expr(r)); Z3_CATCH_RETURN(0); } // ---------------------------- // // DEPRECATED API // // ---------------------------- void Z3_API Z3_del_model(Z3_context c, Z3_model m) { Z3_model_dec_ref(c, m); } unsigned Z3_API Z3_get_model_num_constants(Z3_context c, Z3_model m) { return Z3_model_get_num_consts(c, m); } Z3_func_decl Z3_API Z3_get_model_constant(Z3_context c, Z3_model m, unsigned i) { return Z3_model_get_const_decl(c, m, i); } unsigned Z3_API Z3_get_model_num_funcs(Z3_context c, Z3_model m) { return Z3_model_get_num_funcs(c, m); } Z3_func_decl Z3_API Z3_get_model_func_decl(Z3_context c, Z3_model m, unsigned i) { return Z3_model_get_func_decl(c, m, i); } Z3_ast Z3_API Z3_get_model_func_else(Z3_context c, Z3_model m, unsigned i) { Z3_TRY; LOG_Z3_get_model_func_else(c, m, i); RESET_ERROR_CODE(); CHECK_NON_NULL(m, 0); Z3_func_decl d = get_model_func_decl_core(c, m, i); if (d) { model * _m = to_model_ref(m); func_interp * g = _m->get_func_interp(to_func_decl(d)); if (g) { expr * e = g->get_else(); mk_c(c)->save_ast_trail(e); RETURN_Z3(of_ast(e)); } SET_ERROR_CODE(Z3_IOB); RETURN_Z3(0); } RETURN_Z3(0); Z3_CATCH_RETURN(0); } unsigned get_model_func_num_entries_core(Z3_context c, Z3_model m, unsigned i) { RESET_ERROR_CODE(); CHECK_NON_NULL(m, 0); Z3_func_decl d = get_model_func_decl_core(c, m, i); if (d) { model * _m = to_model_ref(m); func_interp * g = _m->get_func_interp(to_func_decl(d)); if (g) { return g->num_entries(); } SET_ERROR_CODE(Z3_IOB); return 0; } return 0; } unsigned Z3_API Z3_get_model_func_num_entries(Z3_context c, Z3_model m, unsigned i) { Z3_TRY; LOG_Z3_get_model_func_num_entries(c, m, i); return get_model_func_num_entries_core(c, m, i); Z3_CATCH_RETURN(0); } unsigned get_model_func_entry_num_args_core(Z3_context c, Z3_model m, unsigned i, unsigned j) { RESET_ERROR_CODE(); CHECK_NON_NULL(m, 0); if (j >= get_model_func_num_entries_core(c, m, i)) { SET_ERROR_CODE(Z3_IOB); return 0; } Z3_func_decl d = get_model_func_decl_core(c, m, i); if (d) { model * _m = to_model_ref(m); func_interp * g = _m->get_func_interp(to_func_decl(d)); return g->get_arity(); } return 0; } unsigned Z3_API Z3_get_model_func_entry_num_args(Z3_context c, Z3_model m, unsigned i, unsigned j) { Z3_TRY; LOG_Z3_get_model_func_entry_num_args(c, m, i, j); return get_model_func_entry_num_args_core(c, m, i, j); Z3_CATCH_RETURN(0); } Z3_ast Z3_API Z3_get_model_func_entry_arg(Z3_context c, Z3_model m, unsigned i, unsigned j, unsigned k) { Z3_TRY; LOG_Z3_get_model_func_entry_arg(c, m, i, j, k); RESET_ERROR_CODE(); CHECK_NON_NULL(m, 0); if (j >= get_model_func_num_entries_core(c, m, i) || k >= get_model_func_entry_num_args_core(c, m, i, j)) { SET_ERROR_CODE(Z3_IOB); RETURN_Z3(0); } Z3_func_decl d = get_model_func_decl_core(c, m, i); if (d) { model * _m = to_model_ref(m); func_interp * g = _m->get_func_interp(to_func_decl(d)); if (g && j < g->num_entries()) { func_entry const * e = g->get_entry(j); if (k < g->get_arity()) { expr * a = e->get_arg(k); mk_c(c)->save_ast_trail(a); RETURN_Z3(of_ast(a)); } } SET_ERROR_CODE(Z3_IOB); RETURN_Z3(0); } RETURN_Z3(0); Z3_CATCH_RETURN(0); } Z3_ast Z3_API Z3_get_model_func_entry_value(Z3_context c, Z3_model m, unsigned i, unsigned j) { Z3_TRY; LOG_Z3_get_model_func_entry_value(c, m, i, j); RESET_ERROR_CODE(); CHECK_NON_NULL(m, 0); if (j >= get_model_func_num_entries_core(c, m, i)) { SET_ERROR_CODE(Z3_IOB); RETURN_Z3(0); } Z3_func_decl d = get_model_func_decl_core(c, m, i); if (d) { model * _m = to_model_ref(m); func_interp * g = _m->get_func_interp(to_func_decl(d)); if (g && j < g->num_entries()) { func_entry const* e = g->get_entry(j); expr* a = e->get_result(); mk_c(c)->save_ast_trail(a); RETURN_Z3(of_ast(a)); } SET_ERROR_CODE(Z3_IOB); RETURN_Z3(0); } RETURN_Z3(0); Z3_CATCH_RETURN(0); } Z3_bool Z3_API Z3_eval(Z3_context c, Z3_model m, Z3_ast t, Z3_ast * v) { model_evaluator_params p; return Z3_model_eval(c, m, t, p.completion(), v); } Z3_bool Z3_API Z3_eval_func_decl(Z3_context c, Z3_model m, Z3_func_decl decl, Z3_ast* v) { Z3_TRY; LOG_Z3_eval_func_decl(c, m, decl, v); RESET_ERROR_CODE(); CHECK_NON_NULL(m, Z3_FALSE); ast_manager & mgr = mk_c(c)->m(); model * _m = to_model_ref(m); expr_ref result(mgr); if( _m->eval(to_func_decl(decl), result)) { mk_c(c)->save_ast_trail(result.get()); *v = of_ast(result.get()); RETURN_Z3_eval_func_decl Z3_TRUE; } else { return Z3_FALSE; } Z3_CATCH_RETURN(Z3_FALSE); } Z3_bool Z3_API Z3_is_array_value(Z3_context c, Z3_model _m, Z3_ast _v, unsigned* size) { Z3_TRY; LOG_Z3_is_array_value(c, _m, _v, size); RESET_ERROR_CODE(); CHECK_NON_NULL(_v, Z3_FALSE); CHECK_NON_NULL(_m, Z3_FALSE); model * m = to_model_ref(_m); expr * v = to_expr(_v); ast_manager& mgr = mk_c(c)->m(); family_id afid = mk_c(c)->get_array_fid(); unsigned sz = 0; array_util pl(mgr); if (pl.is_as_array(v)) { func_decl* f = pl.get_as_array_func_decl(to_app(v)); func_interp* g = m->get_func_interp(f); sz = g->num_entries(); if (sz > 0 && g->get_arity() != 1) { return Z3_FALSE; } } else { while (pl.is_store(v)) { if (to_app(v)->get_num_args() != 3) { return Z3_FALSE; } v = to_app(v)->get_arg(0); ++sz; } if (!is_app_of(v, afid, OP_CONST_ARRAY)) { return Z3_FALSE; } } if (size) { *size = sz; } return Z3_TRUE; Z3_CATCH_RETURN(Z3_FALSE); } void Z3_API Z3_get_array_value(Z3_context c, Z3_model _m, Z3_ast _v, unsigned num_entries, Z3_ast indices[], Z3_ast values[], Z3_ast* else_value) { Z3_TRY; LOG_Z3_get_array_value(c, _m, _v, num_entries, indices, values, else_value); RESET_ERROR_CODE(); CHECK_NON_NULL(_m, ); model * m = to_model_ref(_m); expr* v = to_expr(_v); family_id afid = mk_c(c)->get_array_fid(); ast_manager& mgr = mk_c(c)->m(); array_util pl(mgr); // // note: _v is already reference counted. // saving the trail for the returned values // is redundant. // unsigned sz = 0; if (pl.is_as_array(v)) { func_decl* f = pl.get_as_array_func_decl(to_app(v)); func_interp* g = m->get_func_interp(f); sz = g->num_entries(); if (g->get_arity() != 1) { SET_ERROR_CODE(Z3_INVALID_ARG); return; } for (unsigned i = 0; i < sz && i < num_entries; ++i) { indices[i] = of_ast(g->get_entry(i)->get_arg(0)); values[i] = of_ast(g->get_entry(i)->get_result()); } if (else_value) { *else_value = of_ast(g->get_else()); } } else { while (sz <= num_entries && is_app_of(v, afid, OP_STORE)) { app* a = to_app(v); if (a->get_num_args() != 3) { SET_ERROR_CODE(Z3_INVALID_ARG); return; } expr* idx = a->get_arg(1); expr* val = a->get_arg(2); indices[sz] = of_ast(idx); values[sz] = of_ast(val); v = to_app(v)->get_arg(0); ++sz; } if (is_app_of(v, afid, OP_CONST_ARRAY)) { if (else_value) { *else_value = of_ast(to_app(v)->get_arg(0)); } } else { SET_ERROR_CODE(Z3_INVALID_ARG); return; } } RETURN_Z3_get_array_value; Z3_CATCH; } Z3_bool Z3_API Z3_eval_decl(Z3_context c, Z3_model m, Z3_func_decl d, unsigned num_args, Z3_ast const args[], Z3_ast* v) { Z3_TRY; LOG_Z3_eval_decl(c, m, d, num_args, args, v); RESET_ERROR_CODE(); CHECK_NON_NULL(m, Z3_FALSE); ast_manager & mgr = mk_c(c)->m(); model * _m = to_model_ref(m); app_ref app(mgr); app = mgr.mk_app(to_func_decl(d), num_args, to_exprs(args)); expr_ref result(mgr); _m->eval(app.get(), result); mk_c(c)->save_ast_trail(result.get()); *v = of_ast(result.get()); RETURN_Z3_eval_decl Z3_TRUE; Z3_CATCH_RETURN(Z3_FALSE); } char const * Z3_API Z3_model_to_string(Z3_context c, Z3_model m) { Z3_TRY; LOG_Z3_model_to_string(c, m); RESET_ERROR_CODE(); CHECK_NON_NULL(m, 0); std::ostringstream buffer; std::string result; if (mk_c(c)->get_print_mode() == Z3_PRINT_SMTLIB2_COMPLIANT) { model_smt2_pp(buffer, mk_c(c)->m(), *(to_model_ref(m)), 0); // Hack for removing the trailing '\n' result = buffer.str(); if (result.size() != 0) result.resize(result.size()-1); } else { model_params p; model_v2_pp(buffer, *(to_model_ref(m)), p.partial()); result = buffer.str(); } return mk_c(c)->mk_external_string(result); Z3_CATCH_RETURN(0); } };
Drup/z3
src/api/api_model.cpp
C++
mit
22,497
31.651669
115
0.466151
false
""" Slack platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.slack/ """ import logging from homeassistant.components.notify import DOMAIN, BaseNotificationService from homeassistant.const import CONF_API_KEY from homeassistant.helpers import validate_config REQUIREMENTS = ['slacker==0.6.8'] _LOGGER = logging.getLogger(__name__) # pylint: disable=unused-variable def get_service(hass, config): """Get the Slack notification service.""" import slacker if not validate_config({DOMAIN: config}, {DOMAIN: ['default_channel', CONF_API_KEY]}, _LOGGER): return None try: return SlackNotificationService( config['default_channel'], config[CONF_API_KEY]) except slacker.Error: _LOGGER.exception( "Slack authentication failed") return None # pylint: disable=too-few-public-methods class SlackNotificationService(BaseNotificationService): """Implement the notification service for Slack.""" def __init__(self, default_channel, api_token): """Initialize the service.""" from slacker import Slacker self._default_channel = default_channel self._api_token = api_token self.slack = Slacker(self._api_token) self.slack.auth.test() def send_message(self, message="", **kwargs): """Send a message to a user.""" import slacker channel = kwargs.get('channel', self._default_channel) try: self.slack.chat.post_message(channel, message) except slacker.Error: _LOGGER.exception("Could not send slack notification")
instantchow/home-assistant
homeassistant/components/notify/slack.py
Python
mit
1,771
29.534483
75
0.652739
false
import Component from '@ember/component'; import { computed } from '@ember/object'; import { oneWay } from '@ember/object/computed'; import { htmlSafe } from '@ember/string'; import { on } from '@ember/object/evented'; import UsesSettings from '../mixins/uses-settings'; import layout from '../templates/components/md-modal'; import { EKMixin, keyUp } from 'ember-keyboard'; export default Component.extend(EKMixin, UsesSettings, { layout, attributeBindings: ['style:inlineStyle'], concatenatedProperties: ['modalClassNames'], inlineStyle: computed(function() { return htmlSafe('z-index: 1000;'); }), isFooterFixed: oneWay('_mdSettings.modalIsFooterFixed'), modalClassNames: ['modal', 'show'], _modalClassString: computed('modalClassNames.[]', 'isFooterFixed', function() { const names = this.get('modalClassNames'); if (this.get('isFooterFixed')) { names.push('modal-fixed-footer'); } return names.join(' '); }), init() { this._super(...arguments); this.set('keyboardActivated', true); }, _onEsc: on(keyUp('Escape'), function() { this.cancel(); }), cancel() { this.sendAction('close'); }, actions: { closeModal() { this.sendAction('close'); } } });
sgasser/ember-cli-materialize
addon/components/md-modal.js
JavaScript
mit
1,249
24.489796
81
0.655725
false