text
stringlengths
4
5.48M
meta
stringlengths
14
6.54k
- [Mirana](https://wwww.miranaco.com) - [Latest Version](https://packagist.org/packages/mirana/tracker) - [License](LICENSE) ## Index - [Installation](#installation) - [Update & Changelog](#update--changelog) - [Usage](#usage) - [Resources](#resources) ## Installation #### Require the `tracker` package by **executing** the following command in your command line: composer require mirana/tracker #### Add the service provider to your `config/app.php` file: Mirana\Tracker\Laravel\TrackerServiceProvider::class, #### Add the alias to the facade on your `config/app.php` file: 'Tracker' => Mirana\Tracker\Laravel\TrackerFacade::class, #### Publish tracker configuration: php artisan vendor:publish #### Add the Middleware to Laravel Kernel Open the file `app/Http/Kernel.php` and add the following to your web middlewares: \Mirana\Tracker\Laravel\TrackerMiddleware::class, #### Migrate it If you have set the default connection to `mongodb` as it's said in [jenssegers/mongodb](https://github.com/jenssegers/laravel-mongodb), you can php artisan migrate ## Update & Changelog ### from v0.2.0 to v1.0.0 : ##### Database 1. MySql database is not supported anymore & MongoDB will be used instead.* 2. All migrations changed into a compatible version with MongoDB driver. 3. session database column `uuid` changed into `session_id`.* ##### Facade 1. `Tracker` will be used instead of `Mtrack`.* ##### Tracker Session 1. tracker session now in synced with laravel session through `session_id` column. ## Usage #### You can get all the `Sessions` data as an `array` by **executing** the following function in your code: Tracker::session() Or in `*.blade.php`: {{ Tracker::session() }} #### All `Tracker` functions: session() geoip() device() referrer() cookie() visits() # Resources - [Laravel Documentation](https://laravel.com/docs/5.4) - [Laravel MongoDB](https://github.com/jenssegers/laravel-mongodb) - [Detect Device](http://detectdevice.com/) - [Uuid](https://github.com/ramsey/uuid) - [Geoip2](https://github.com/maxmind/GeoIP2-php) - [Carbon](https://github.com/briannesbitt/Carbon)
{'content_hash': '3b199dd5eac9767d1f93f99be5536a06', 'timestamp': '', 'source': 'github', 'line_count': 83, 'max_line_length': 144, 'avg_line_length': 25.903614457831324, 'alnum_prop': 0.7116279069767442, 'repo_name': 'MiranaCo/Tracker', 'id': '0e71187d4359cc514caf04923abc5919956c9a37', 'size': '2169', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '123180'}]}
require 'spec_helper' describe "/invitations/new.html.haml" do before(:each) do assigns[:exclude_ids] = @exclude_ids = "1,2" end it "renders the friend select form" do render response.body.should have_multi_friend_selector_with(:action => "invitations", :url_for_invite => "http://apps.facebook.com/gametheorygamedev/cards", :invite? => true, :max => '.*', :exclude_ids => @exclude_ids) end end
{'content_hash': '4e698a0e15ae3811bd8504e39b5f1523', 'timestamp': '', 'source': 'github', 'line_count': 20, 'max_line_length': 82, 'avg_line_length': 22.65, 'alnum_prop': 0.6247240618101545, 'repo_name': 'schouery/gametheorygame', 'id': '8d5d1657eaa37289d6233c5c69412ad31994219f', 'size': '453', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spec/views/invitations/new.html.haml_spec.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '310100'}, {'name': 'Ruby', 'bytes': '272846'}]}
describe('mdListItem directive', function() { beforeEach(module('material.components.list', 'material.components.checkbox', 'material.components.switch')); function setup(html) { var el; inject(function($compile, $rootScope) { el = $compile(html)($rootScope); $rootScope.$apply(); }); return el; } it('forwards click events for md-checkbox', inject(function($rootScope) { var listItem = setup('<md-list-item><md-checkbox ng-model="modelVal"></md-checkbox></md-list-item>'); listItem[0].querySelector('div').click(); expect($rootScope.modelVal).toBe(true); })); it('forwards click events for md-switch', inject(function($rootScope) { var listItem = setup('<md-list-item><md-switch ng-model="modelVal"></md-switch></md-list-item>'); listItem[0].querySelector('div').click(); expect($rootScope.modelVal).toBe(true); })); it('creates buttons when used with ng-click', function() { var listItem = setup('<md-list-item ng-click="sayHello()"><p>Hello world</p></md-list-item>'); var firstChild = listItem.children()[0]; expect(firstChild.nodeName).toBe('BUTTON'); expect(firstChild.childNodes[0].nodeName).toBe('DIV'); expect(firstChild.childNodes[0].childNodes[0].nodeName).toBe('P'); }); it('moves md-secondary items outside of the button', function() { var listItem = setup('<md-list-item ng-click="sayHello()"><p>Hello World</p><md-icon class="md-secondary" ng-click="goWild()"></md-icon></md-list-item>'); var firstChild = listItem.children()[0]; expect(firstChild.nodeName).toBe('BUTTON'); expect(firstChild.childNodes.length).toBe(1); var secondChild = listItem.children()[1]; expect(secondChild.nodeName).toBe('MD-BUTTON'); }); });
{'content_hash': '3558fc63156635adf319966cb68f9c8f', 'timestamp': '', 'source': 'github', 'line_count': 42, 'max_line_length': 158, 'avg_line_length': 41.833333333333336, 'alnum_prop': 0.6693227091633466, 'repo_name': 'rschmukler/material', 'id': 'cc9066a2597966a506a257e32b28fa85084e395d', 'size': '1757', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/components/list/list.spec.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '129802'}, {'name': 'HTML', 'bytes': '64284'}, {'name': 'JavaScript', 'bytes': '739612'}, {'name': 'Shell', 'bytes': '2776'}]}
<?php class EngineBlock_Dispatcher { protected $_routers = array(); protected $_useErrorHandling = true; public function __construct() { $this->_addDefaultRouter(); } protected function _addDefaultRouter() { $this->_routers[] = new EngineBlock_Router_Default(); } public function getRouters() { return $this->_routers; } public function setRouters($routers) { $this->_routers = $routers; return $this; } public function setUseErrorHandling($bool) { $this->_useErrorHandling = $bool; return $this; } public function dispatch($uri = "") { try { $application = EngineBlock_ApplicationSingleton::getInstance(); if (!$uri) { $uri = $application->getHttpRequest()->getUri(); } if (!$this->_dispatch($uri)) { EngineBlock_ApplicationSingleton::getLog()->notice("[404]Unroutable URI: '$uri'"); $this->_getControllerInstance('default', 'error')->handleAction('NotFound'); } } catch(Exception $e) { $this->_handleDispatchException($e); } } protected function _dispatch($uri) { $router = $this->_getFirstRoutableRouterFor($uri); $module = $router->getModuleName(); $controllerName = $router->getControllerName(); $action = $router->getActionName(); $attributeArguments = $router->getActionArguments(); $controllerInstance = $this->_getControllerInstance($module, $controllerName); if (!$controllerInstance || !$controllerInstance->hasAction($action)) { return false; } $controllerInstance->handleAction($action, $attributeArguments); return true; } protected function _handleDispatchException(Exception $e) { $application = EngineBlock_ApplicationSingleton::getInstance(); if ($e instanceof EngineBlock_Exception) { $application->reportError($e); } else { $application->reportError( new EngineBlock_Exception($e->getMessage(), EngineBlock_Exception::CODE_ERROR, $e) ); } if (!$this->_useErrorHandling) { throw $e; } else { $errorConfiguration = $application->getConfiguration()->error; $module = $errorConfiguration->module; $controllerName = $errorConfiguration->controller; $action = $errorConfiguration->action; $controllerInstance = $this->_getControllerInstance($module, $controllerName); $controllerInstance->handleAction($action, array($e)); } } /** * @param $module * @param $controllerName * @return EngineBlock_Controller_Abstract|bool * @throws EngineBlock_Exception */ protected function _getControllerInstance($module, $controllerName) { $className = $this->_getControllerClassName($module, $controllerName); if (!class_exists($className)) { return false; } $controllerInstance = new $className($module, $controllerName); if (!($controllerInstance instanceof EngineBlock_Controller_Abstract)) { throw new EngineBlock_Exception( "Controller $className is not an EngineBlock controller (does not extend EngineBlock_Controller_Abstract)!", EngineBlock_Exception::CODE_CRITICAL ); } return $controllerInstance; } /** * Returns the first router that is capable of routing the given URI * * @param string $uri * @return EngineBlock_Router_Abstract */ protected function _getFirstRoutableRouterFor($uri) { /** * @var EngineBlock_Router_Interface $router */ foreach ($this->_routers as $router) { $routable = $router->route($uri); if ($routable) { break; } } return $router; } protected function _getControllerClassName($module, $controller) { return ucfirst($module) . '_Controller_' . ucfirst($controller); } }
{'content_hash': '3c1a23e2b24afd5a51292d798806ac3e', 'timestamp': '', 'source': 'github', 'line_count': 146, 'max_line_length': 124, 'avg_line_length': 29.486301369863014, 'alnum_prop': 0.5725900116144018, 'repo_name': 'remold/OpenConext-engineblock', 'id': '8d6d8fe9fbcb4da5710424ab67839ed68fc22632', 'size': '4305', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'library/EngineBlock/Dispatcher.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '55121'}, {'name': 'HTML', 'bytes': '70716'}, {'name': 'JavaScript', 'bytes': '37193'}, {'name': 'PHP', 'bytes': '959427'}, {'name': 'Shell', 'bytes': '10201'}, {'name': 'XSLT', 'bytes': '3812'}]}
#include "third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.h" #include "base/macros.h" #include "third_party/blink/renderer/core/css/css_property_value_set.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/dom/text.h" #include "third_party/blink/renderer/core/editing/editing_style.h" #include "third_party/blink/renderer/core/editing/editing_style_utilities.h" #include "third_party/blink/renderer/core/editing/editing_utilities.h" #include "third_party/blink/renderer/core/editing/ephemeral_range.h" #include "third_party/blink/renderer/core/editing/selection_template.h" #include "third_party/blink/renderer/core/editing/serializers/serialization.h" #include "third_party/blink/renderer/core/editing/visible_position.h" #include "third_party/blink/renderer/core/editing/visible_selection.h" #include "third_party/blink/renderer/core/editing/visible_units.h" #include "third_party/blink/renderer/core/html/forms/html_text_area_element.h" #include "third_party/blink/renderer/core/html/html_body_element.h" #include "third_party/blink/renderer/core/html/html_element.h" #include "third_party/blink/renderer/platform/wtf/text/string_builder.h" namespace blink { namespace { template <typename Strategy> TextOffset ToTextOffset(const PositionTemplate<Strategy>& position) { if (position.IsNull()) return TextOffset(); auto* text_node = DynamicTo<Text>(position.ComputeContainerNode()); if (!text_node) return TextOffset(); return TextOffset(text_node, position.OffsetInContainerNode()); } template <typename EditingStrategy> static bool HandleSelectionBoundary(const Node&); template <> bool HandleSelectionBoundary<EditingStrategy>(const Node&) { return false; } template <> bool HandleSelectionBoundary<EditingInFlatTreeStrategy>(const Node& node) { ShadowRoot* root = node.GetShadowRoot(); return root && root->IsUserAgent(); } } // namespace template <typename Strategy> class StyledMarkupTraverser { STACK_ALLOCATED(); public: StyledMarkupTraverser(); StyledMarkupTraverser(StyledMarkupAccumulator*, Node*); Node* Traverse(Node*, Node*); void WrapWithNode(ContainerNode&, EditingStyle*); EditingStyle* CreateInlineStyleIfNeeded(Node&); private: bool ShouldAnnotate() const; bool ShouldConvertBlocksToInlines() const; bool IsForMarkupSanitization() const; void AppendStartMarkup(Node&); void AppendEndMarkup(Node&); EditingStyle* CreateInlineStyle(Element&); bool NeedsInlineStyle(const Element&); bool ShouldApplyWrappingStyle(const Node&) const; bool ContainsOnlyBRElement(const Element&) const; bool ShouldSerializeUnrenderedElement(const Node&) const; StyledMarkupAccumulator* accumulator_; Node* last_closed_; EditingStyle* wrapping_style_; DISALLOW_COPY_AND_ASSIGN(StyledMarkupTraverser); }; template <typename Strategy> bool StyledMarkupTraverser<Strategy>::ShouldAnnotate() const { return accumulator_->ShouldAnnotate(); } template <typename Strategy> bool StyledMarkupTraverser<Strategy>::IsForMarkupSanitization() const { return accumulator_ && accumulator_->IsForMarkupSanitization(); } template <typename Strategy> bool StyledMarkupTraverser<Strategy>::ShouldConvertBlocksToInlines() const { return accumulator_->ShouldConvertBlocksToInlines(); } template <typename Strategy> StyledMarkupSerializer<Strategy>::StyledMarkupSerializer( const PositionTemplate<Strategy>& start, const PositionTemplate<Strategy>& end, Node* highest_node_to_be_serialized, const CreateMarkupOptions& options) : start_(start), end_(end), highest_node_to_be_serialized_(highest_node_to_be_serialized), options_(options), last_closed_(highest_node_to_be_serialized), wrapping_style_(nullptr) {} template <typename Strategy> static bool NeedInterchangeNewlineAfter( const VisiblePositionTemplate<Strategy>& v) { const VisiblePositionTemplate<Strategy> next = NextPositionOf(v); Node* upstream_node = MostBackwardCaretPosition(next.DeepEquivalent()).AnchorNode(); Node* downstream_node = MostForwardCaretPosition(v.DeepEquivalent()).AnchorNode(); // Add an interchange newline if a paragraph break is selected and a br won't // already be added to the markup to represent it. return IsEndOfParagraph(v) && IsStartOfParagraph(next) && !(IsA<HTMLBRElement>(*upstream_node) && upstream_node == downstream_node); } template <typename Strategy> static bool NeedInterchangeNewlineAt( const VisiblePositionTemplate<Strategy>& v) { return NeedInterchangeNewlineAfter(PreviousPositionOf(v)); } template <typename Strategy> static bool AreSameRanges(Node* node, const PositionTemplate<Strategy>& start_position, const PositionTemplate<Strategy>& end_position) { DCHECK(node); const EphemeralRange range = CreateVisibleSelection( SelectionInDOMTree::Builder().SelectAllChildren(*node).Build()) .ToNormalizedEphemeralRange(); return ToPositionInDOMTree(start_position) == range.StartPosition() && ToPositionInDOMTree(end_position) == range.EndPosition(); } static EditingStyle* StyleFromMatchedRulesAndInlineDecl( const HTMLElement* element) { EditingStyle* style = MakeGarbageCollected<EditingStyle>(element->InlineStyle()); // FIXME: Having to const_cast here is ugly, but it is quite a bit of work to // untangle the non-const-ness of styleFromMatchedRulesForElement. style->MergeStyleFromRules(const_cast<HTMLElement*>(element)); return style; } template <typename Strategy> String StyledMarkupSerializer<Strategy>::CreateMarkup() { StyledMarkupAccumulator markup_accumulator( ToTextOffset(start_.ParentAnchoredEquivalent()), ToTextOffset(end_.ParentAnchoredEquivalent()), start_.GetDocument(), options_); Node* past_end = end_.NodeAsRangePastLastNode(); Node* first_node = start_.NodeAsRangeFirstNode(); const VisiblePositionTemplate<Strategy> visible_start = CreateVisiblePosition(start_); const VisiblePositionTemplate<Strategy> visible_end = CreateVisiblePosition(end_); if (ShouldAnnotate() && NeedInterchangeNewlineAfter(visible_start)) { markup_accumulator.AppendInterchangeNewline(); if (visible_start.DeepEquivalent() == PreviousPositionOf(visible_end).DeepEquivalent()) return markup_accumulator.TakeResults(); first_node = NextPositionOf(visible_start).DeepEquivalent().AnchorNode(); if (past_end && PositionTemplate<Strategy>::BeforeNode(*first_node) .CompareTo(PositionTemplate<Strategy>::BeforeNode( *past_end)) >= 0) { // This condition hits in editing/pasteboard/copy-display-none.html. return markup_accumulator.TakeResults(); } } // If there is no the highest node in the selected nodes, |last_closed_| can // be #text when its parent is a formatting tag. In this case, #text is // wrapped by <span> tag, but this text should be wrapped by the formatting // tag. See http://crbug.com/634482 bool should_append_parent_tag = false; if (!last_closed_) { last_closed_ = StyledMarkupTraverser<Strategy>().Traverse(first_node, past_end); if (last_closed_ && last_closed_->IsTextNode() && IsPresentationalHTMLElement(last_closed_->parentNode())) { last_closed_ = last_closed_->parentElement(); should_append_parent_tag = true; } } StyledMarkupTraverser<Strategy> traverser(&markup_accumulator, last_closed_); Node* last_closed = traverser.Traverse(first_node, past_end); if (highest_node_to_be_serialized_ && last_closed) { // TODO(hajimehoshi): This is calculated at createMarkupInternal too. Node* common_ancestor = Strategy::CommonAncestor( *start_.ComputeContainerNode(), *end_.ComputeContainerNode()); DCHECK(common_ancestor); auto* body = To<HTMLBodyElement>(EnclosingElementWithTag( Position::FirstPositionInNode(*common_ancestor), html_names::kBodyTag)); HTMLBodyElement* fully_selected_root = nullptr; // FIXME: Do this for all fully selected blocks, not just the body. if (body && AreSameRanges(body, start_, end_)) fully_selected_root = body; // Also include all of the ancestors of lastClosed up to this special // ancestor. // FIXME: What is ancestor? for (ContainerNode* ancestor = Strategy::Parent(*last_closed); ancestor; ancestor = Strategy::Parent(*ancestor)) { if (ancestor == fully_selected_root && !markup_accumulator.ShouldConvertBlocksToInlines()) { EditingStyle* fully_selected_root_style = StyleFromMatchedRulesAndInlineDecl(fully_selected_root); // Bring the background attribute over, but not as an attribute because // a background attribute on a div appears to have no effect. if ((!fully_selected_root_style || !fully_selected_root_style->Style() || !fully_selected_root_style->Style()->GetPropertyCSSValue( CSSPropertyID::kBackgroundImage)) && fully_selected_root->FastHasAttribute( html_names::kBackgroundAttr)) { fully_selected_root_style->Style()->SetProperty( CSSPropertyID::kBackgroundImage, "url('" + fully_selected_root->getAttribute( html_names::kBackgroundAttr) + "')", /* important */ false, fully_selected_root->GetDocument().GetSecureContextMode()); } if (fully_selected_root_style->Style()) { // Reset the CSS properties to avoid an assertion error in // addStyleMarkup(). This assertion is caused at least when we select // all text of a <body> element whose 'text-decoration' property is // "inherit", and copy it. if (!PropertyMissingOrEqualToNone(fully_selected_root_style->Style(), CSSPropertyID::kTextDecoration)) { fully_selected_root_style->Style()->SetProperty( CSSPropertyID::kTextDecoration, CSSValueID::kNone); } if (!PropertyMissingOrEqualToNone( fully_selected_root_style->Style(), CSSPropertyID::kWebkitTextDecorationsInEffect)) { fully_selected_root_style->Style()->SetProperty( CSSPropertyID::kWebkitTextDecorationsInEffect, CSSValueID::kNone); } markup_accumulator.WrapWithStyleNode( fully_selected_root_style->Style()); } } else { EditingStyle* style = traverser.CreateInlineStyleIfNeeded(*ancestor); // Since this node and all the other ancestors are not in the selection // we want styles that affect the exterior of the node not to be not // included. If the node is not fully selected by the range, then we // don't want to keep styles that affect its relationship to the nodes // around it only the ones that affect it and the nodes within it. if (style && style->Style()) style->Style()->RemoveProperty(CSSPropertyID::kFloat); traverser.WrapWithNode(*ancestor, style); } if (ancestor == highest_node_to_be_serialized_) break; } } else if (should_append_parent_tag) { EditingStyle* style = traverser.CreateInlineStyleIfNeeded(*last_closed_); traverser.WrapWithNode(To<ContainerNode>(*last_closed_), style); } // FIXME: The interchange newline should be placed in the block that it's in, // not after all of the content, unconditionally. if (!(last_closed && IsA<HTMLBRElement>(*last_closed)) && ShouldAnnotate() && NeedInterchangeNewlineAt(visible_end)) markup_accumulator.AppendInterchangeNewline(); return markup_accumulator.TakeResults(); } template <typename Strategy> StyledMarkupTraverser<Strategy>::StyledMarkupTraverser() : StyledMarkupTraverser(nullptr, nullptr) {} template <typename Strategy> StyledMarkupTraverser<Strategy>::StyledMarkupTraverser( StyledMarkupAccumulator* accumulator, Node* last_closed) : accumulator_(accumulator), last_closed_(last_closed), wrapping_style_(nullptr) { if (!accumulator_) { DCHECK_EQ(last_closed_, static_cast<decltype(last_closed_)>(nullptr)); return; } if (!last_closed_) return; ContainerNode* parent = Strategy::Parent(*last_closed_); if (!parent) return; if (ShouldAnnotate()) { wrapping_style_ = EditingStyleUtilities::CreateWrappingStyleForAnnotatedSerialization( parent); return; } wrapping_style_ = EditingStyleUtilities::CreateWrappingStyleForSerialization(parent); } template <typename Strategy> Node* StyledMarkupTraverser<Strategy>::Traverse(Node* start_node, Node* past_end) { HeapVector<Member<ContainerNode>> ancestors_to_close; Node* next; Node* last_closed = nullptr; for (Node* n = start_node; n && n != past_end; n = next) { // If |n| is a selection boundary such as <input>, traverse the child // nodes in the DOM tree instead of the flat tree. if (HandleSelectionBoundary<Strategy>(*n)) { last_closed = StyledMarkupTraverser<EditingStrategy>(accumulator_, last_closed_) .Traverse(n, EditingStrategy::NextSkippingChildren(*n)); next = EditingInFlatTreeStrategy::NextSkippingChildren(*n); } else { next = Strategy::Next(*n); if (IsEnclosingBlock(n) && CanHaveChildrenForEditing(n) && next == past_end && !ContainsOnlyBRElement(To<Element>(*n))) { // Don't write out empty block containers that aren't fully selected // unless the block container only contains br element. continue; } auto* element = DynamicTo<Element>(n); if (n->GetLayoutObject() || ShouldSerializeUnrenderedElement(*n)) { // Add the node to the markup if we're not skipping the descendants AppendStartMarkup(*n); // If node has no children, close the tag now. if (Strategy::HasChildren(*n)) { if (next == past_end && ContainsOnlyBRElement(*element)) { // node is not fully selected and node contains only one br element // as child. Close the br tag now. AppendStartMarkup(*next); AppendEndMarkup(*next); last_closed = next; } else { ancestors_to_close.push_back(To<ContainerNode>(n)); } continue; } AppendEndMarkup(*n); last_closed = n; } else { next = Strategy::NextSkippingChildren(*n); // Don't skip over pastEnd. if (past_end && Strategy::IsDescendantOf(*past_end, *n)) next = past_end; } } // If we didn't insert open tag and there's no more siblings or we're at the // end of the traversal, take care of ancestors. // FIXME: What happens if we just inserted open tag and reached the end? if (Strategy::NextSibling(*n) && next != past_end) continue; // Close up the ancestors. while (!ancestors_to_close.IsEmpty()) { ContainerNode* ancestor = ancestors_to_close.back(); DCHECK(ancestor); if (next && next != past_end && Strategy::IsDescendantOf(*next, *ancestor)) break; // Not at the end of the range, close ancestors up to sibling of next // node. AppendEndMarkup(*ancestor); last_closed = ancestor; ancestors_to_close.pop_back(); } // Surround the currently accumulated markup with markup for ancestors we // never opened as we leave the subtree(s) rooted at those ancestors. ContainerNode* next_parent = next ? Strategy::Parent(*next) : nullptr; if (next == past_end || n == next_parent) continue; DCHECK(n); Node* last_ancestor_closed_or_self = (last_closed && Strategy::IsDescendantOf(*n, *last_closed)) ? last_closed : n; for (ContainerNode* parent = Strategy::Parent(*last_ancestor_closed_or_self); parent && parent != next_parent; parent = Strategy::Parent(*parent)) { // All ancestors that aren't in the ancestorsToClose list should either be // a) unrendered: if (!parent->GetLayoutObject()) continue; // or b) ancestors that we never encountered during a pre-order traversal // starting at startNode: DCHECK(start_node); DCHECK(Strategy::IsDescendantOf(*start_node, *parent)); EditingStyle* style = CreateInlineStyleIfNeeded(*parent); WrapWithNode(*parent, style); last_closed = parent; } } return last_closed; } template <typename Strategy> bool StyledMarkupTraverser<Strategy>::NeedsInlineStyle(const Element& element) { if (!element.IsHTMLElement()) return false; if (ShouldAnnotate()) return true; return ShouldConvertBlocksToInlines() && IsEnclosingBlock(&element); } template <typename Strategy> void StyledMarkupTraverser<Strategy>::WrapWithNode(ContainerNode& node, EditingStyle* style) { if (!accumulator_) return; StringBuilder markup; if (auto* document = DynamicTo<Document>(node)) { MarkupFormatter::AppendXMLDeclaration(markup, *document); accumulator_->PushMarkup(markup.ToString()); return; } auto* element = DynamicTo<Element>(node); if (!element) return; if (ShouldApplyWrappingStyle(*element) || NeedsInlineStyle(*element)) accumulator_->AppendElementWithInlineStyle(markup, *element, style); else accumulator_->AppendElement(markup, *element); accumulator_->PushMarkup(markup.ToString()); accumulator_->AppendEndTag(*element); } template <typename Strategy> EditingStyle* StyledMarkupTraverser<Strategy>::CreateInlineStyleIfNeeded( Node& node) { if (!accumulator_) return nullptr; auto* element = DynamicTo<Element>(node); if (!element) return nullptr; EditingStyle* inline_style = CreateInlineStyle(*element); if (ShouldConvertBlocksToInlines() && IsEnclosingBlock(&node)) inline_style->ForceInline(); return inline_style; } template <typename Strategy> void StyledMarkupTraverser<Strategy>::AppendStartMarkup(Node& node) { if (!accumulator_) return; switch (node.getNodeType()) { case Node::kTextNode: { auto& text = To<Text>(node); if (IsA<HTMLTextAreaElement>(text.parentElement())) { accumulator_->AppendText(text); break; } EditingStyle* inline_style = nullptr; if (ShouldApplyWrappingStyle(text)) { inline_style = wrapping_style_->Copy(); // FIXME: <rdar://problem/5371536> Style rules that match pasted content // can change its appearance. // Make sure spans are inline style in paste side e.g. span { display: // block }. inline_style->ForceInline(); // FIXME: Should this be included in forceInline? inline_style->Style()->SetProperty(CSSPropertyID::kFloat, CSSValueID::kNone); if (IsForMarkupSanitization()) { EditingStyleUtilities::StripUAStyleRulesForMarkupSanitization( inline_style); } } accumulator_->AppendTextWithInlineStyle(text, inline_style); break; } case Node::kElementNode: { auto& element = To<Element>(node); if ((element.IsHTMLElement() && ShouldAnnotate()) || ShouldApplyWrappingStyle(element)) { EditingStyle* inline_style = CreateInlineStyle(element); accumulator_->AppendElementWithInlineStyle(element, inline_style); break; } accumulator_->AppendElement(element); break; } default: accumulator_->AppendStartMarkup(node); break; } } template <typename Strategy> void StyledMarkupTraverser<Strategy>::AppendEndMarkup(Node& node) { auto* element = DynamicTo<Element>(node); if (!accumulator_ || !element) return; accumulator_->AppendEndTag(*element); } template <typename Strategy> bool StyledMarkupTraverser<Strategy>::ShouldApplyWrappingStyle( const Node& node) const { return last_closed_ && Strategy::Parent(*last_closed_) == Strategy::Parent(node) && wrapping_style_ && wrapping_style_->Style(); } template <typename Strategy> EditingStyle* StyledMarkupTraverser<Strategy>::CreateInlineStyle( Element& element) { EditingStyle* inline_style = nullptr; if (ShouldApplyWrappingStyle(element)) { inline_style = wrapping_style_->Copy(); inline_style->RemovePropertiesInElementDefaultStyle(&element); inline_style->RemoveStyleConflictingWithStyleOfElement(&element); } else { inline_style = MakeGarbageCollected<EditingStyle>(); } if (element.IsStyledElement() && element.InlineStyle()) inline_style->OverrideWithStyle(element.InlineStyle()); auto* html_element = DynamicTo<HTMLElement>(element); if (html_element && ShouldAnnotate()) { inline_style->MergeStyleFromRulesForSerialization(html_element); } if (IsForMarkupSanitization()) EditingStyleUtilities::StripUAStyleRulesForMarkupSanitization(inline_style); return inline_style; } template <typename Strategy> bool StyledMarkupTraverser<Strategy>::ContainsOnlyBRElement( const Element& element) const { auto* const first_child = element.firstChild(); if (!first_child) return false; return IsA<HTMLBRElement>(first_child) && first_child == element.lastChild(); } template <typename Strategy> bool StyledMarkupTraverser<Strategy>::ShouldSerializeUnrenderedElement( const Node& node) const { DCHECK(!node.GetLayoutObject()); if (node.IsElementNode() && To<Element>(node).HasDisplayContentsStyle()) return true; if (EnclosingElementWithTag(FirstPositionInOrBeforeNode(node), html_names::kSelectTag)) { return true; } if (IsForMarkupSanitization()) { // During sanitization, iframes in the staging document haven't loaded and // are hence not rendered. They should still be serialized. if (IsA<HTMLIFrameElement>(node)) return true; } return false; } template class StyledMarkupSerializer<EditingStrategy>; template class StyledMarkupSerializer<EditingInFlatTreeStrategy>; } // namespace blink
{'content_hash': 'b4e5e4756fb1fd99c592f980e1f68c2c', 'timestamp': '', 'source': 'github', 'line_count': 595, 'max_line_length': 89, 'avg_line_length': 37.87394957983193, 'alnum_prop': 0.6856445529176836, 'repo_name': 'endlessm/chromium-browser', 'id': 'd150e8ca3316bc8fa836df689ffefa865e951d24', 'size': '24087', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []}
describe('NewsController', () => { it('should transform the pubDate of RSS items from a string to a Date'); it('should have a passing test', () => { expect(true).toBeTruthy(); }); xit('should have a failing test', () => { throw new Error(); }); });
{'content_hash': '2714aa56fdce9a3e9a5ed0565a67c4ee', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 74, 'avg_line_length': 29.555555555555557, 'alnum_prop': 0.5977443609022557, 'repo_name': 'joeskeen/ngExamples', 'id': 'd8efc37e4e8c8b91dc329daa001a89cc94fa16ab', 'size': '333', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'mars-ts/app/news/newsController.spec.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1920'}, {'name': 'HTML', 'bytes': '14367'}, {'name': 'JavaScript', 'bytes': '10275'}, {'name': 'TypeScript', 'bytes': '44633'}]}
<section id="contact"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> <h2 class="section-heading">Contact Us</h2> <h3 class="section-subheading text-muted">Whether you're looking for answers, would like to solve a problem.</h3> </div> </div> <div class="row"> <div class="col-lg-12"> <form name="sentMessage" id="contactForm" novalidate> <div class="row"> <div class="col-md-6"> <div class="control-group form-group"> <input type="text" class="form-control" placeholder="Your Name *" id="name" required data-validation-required-message="Please enter your name."> <p class="help-block text-danger"></p> </div> <div class="control-group form-group"> <input type="email" class="form-control" placeholder="Your Email *" id="email" required data-validation-required-message="Please enter your email address."> <p class="help-block text-danger"></p> </div> <div class="control-group form-group"> <input type="tel" class="form-control" placeholder="Your Phone *" id="phone" required data-validation-required-message="Please enter your phone number."> <p class="help-block text-danger"></p> </div> </div> <div class="col-md-6"> <div class="control-group form-group"> <textarea class="form-control" placeholder="Your Message *" id="message" required data-validation-required-message="Please enter a message."></textarea> <p class="help-block text-danger"></p> </div> </div> <div class="clearfix"></div> <div class="col-lg-12 text-center"> <div id="success"></div> <button type="submit" class="btn btn-xl">Send Message</button> </div> </div> </form> </div> </div> </div> </section>
{'content_hash': '584f78f8fb03b5ba7d8b252612ce75d3', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 192, 'avg_line_length': 62.02325581395349, 'alnum_prop': 0.427071616047994, 'repo_name': 'beans-studio/beans-studio.github.io', 'id': 'e1bb1aa3adee9ad15e12e4c14b5ddc26d4a9389c', 'size': '2667', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_includes/contact.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '17957'}, {'name': 'HTML', 'bytes': '22320'}, {'name': 'JavaScript', 'bytes': '42756'}, {'name': 'PHP', 'bytes': '962'}, {'name': 'Ruby', 'bytes': '715'}]}
<!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_65) on Wed Sep 03 20:05:58 PDT 2014 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Class org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.MultiUserAuthorizations (HBase 0.98.6-hadoop2 API)</title> <meta name="date" content="2014-09-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 org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.MultiUserAuthorizations (HBase 0.98.6-hadoop2 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="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-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> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/apache/hadoop/hbase/protobuf/generated/class-use/VisibilityLabelsProtos.MultiUserAuthorizations.html" target="_top">Frames</a></li> <li><a href="VisibilityLabelsProtos.MultiUserAuthorizations.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 org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.MultiUserAuthorizations" class="title">Uses of Class<br>org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.MultiUserAuthorizations</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.apache.hadoop.hbase.protobuf.generated">org.apache.hadoop.hbase.protobuf.generated</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.apache.hadoop.hbase.security.visibility">org.apache.hadoop.hbase.security.visibility</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.hadoop.hbase.protobuf.generated"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a> in <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/package-summary.html">org.apache.hadoop.hbase.protobuf.generated</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/package-summary.html">org.apache.hadoop.hbase.protobuf.generated</a> with type parameters of type <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static com.google.protobuf.Parser&lt;<a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a>&gt;</code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#PARSER">PARSER</a></strong></code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/package-summary.html">org.apache.hadoop.hbase.protobuf.generated</a> that return <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.Builder.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.Builder.html#build()">build</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.Builder.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.Builder.html#buildPartial()">buildPartial</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#getDefaultInstance()">getDefaultInstance</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#getDefaultInstanceForType()">getDefaultInstanceForType</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.Builder.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.Builder.html#getDefaultInstanceForType()">getDefaultInstanceForType</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#parseDelimitedFrom(java.io.InputStream)">parseDelimitedFrom</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#parseDelimitedFrom(java.io.InputStream,%20com.google.protobuf.ExtensionRegistryLite)">parseDelimitedFrom</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input, com.google.protobuf.ExtensionRegistryLite&nbsp;extensionRegistry)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#parseFrom(byte[])">parseFrom</a></strong>(byte[]&nbsp;data)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#parseFrom(byte[],%20com.google.protobuf.ExtensionRegistryLite)">parseFrom</a></strong>(byte[]&nbsp;data, com.google.protobuf.ExtensionRegistryLite&nbsp;extensionRegistry)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#parseFrom(com.google.protobuf.ByteString)">parseFrom</a></strong>(com.google.protobuf.ByteString&nbsp;data)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#parseFrom(com.google.protobuf.ByteString,%20com.google.protobuf.ExtensionRegistryLite)">parseFrom</a></strong>(com.google.protobuf.ByteString&nbsp;data, com.google.protobuf.ExtensionRegistryLite&nbsp;extensionRegistry)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#parseFrom(com.google.protobuf.CodedInputStream)">parseFrom</a></strong>(com.google.protobuf.CodedInputStream&nbsp;input)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#parseFrom(com.google.protobuf.CodedInputStream,%20com.google.protobuf.ExtensionRegistryLite)">parseFrom</a></strong>(com.google.protobuf.CodedInputStream&nbsp;input, com.google.protobuf.ExtensionRegistryLite&nbsp;extensionRegistry)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#parseFrom(java.io.InputStream)">parseFrom</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#parseFrom(java.io.InputStream,%20com.google.protobuf.ExtensionRegistryLite)">parseFrom</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input, com.google.protobuf.ExtensionRegistryLite&nbsp;extensionRegistry)</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/package-summary.html">org.apache.hadoop.hbase.protobuf.generated</a> that return types with arguments of type <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>com.google.protobuf.Parser&lt;<a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a>&gt;</code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#getParserForType()">getParserForType</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/package-summary.html">org.apache.hadoop.hbase.protobuf.generated</a> with parameters of type <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.Builder.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations.Builder</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.Builder.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.Builder.html#mergeFrom(org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.MultiUserAuthorizations)">mergeFrom</a></strong>(<a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a>&nbsp;other)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.Builder.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations.Builder</a></code></td> <td class="colLast"><span class="strong">VisibilityLabelsProtos.MultiUserAuthorizations.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html#newBuilder(org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.MultiUserAuthorizations)">newBuilder</a></strong>(<a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a>&nbsp;prototype)</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.apache.hadoop.hbase.security.visibility"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a> in <a href="../../../../../../../org/apache/hadoop/hbase/security/visibility/package-summary.html">org.apache.hadoop.hbase.security.visibility</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/hadoop/hbase/security/visibility/package-summary.html">org.apache.hadoop.hbase.security.visibility</a> that return <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">VisibilityLabelsProtos.MultiUserAuthorizations</a></code></td> <td class="colLast"><span class="strong">VisibilityUtils.</span><code><strong><a href="../../../../../../../org/apache/hadoop/hbase/security/visibility/VisibilityUtils.html#readUserAuthsFromZKData(byte[])">readUserAuthsFromZKData</a></strong>(byte[]&nbsp;data)</code> <div class="block">Reads back User auth data written to zookeeper.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </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="../../../../../../../org/apache/hadoop/hbase/protobuf/generated/VisibilityLabelsProtos.MultiUserAuthorizations.html" title="class in org.apache.hadoop.hbase.protobuf.generated">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-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> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/apache/hadoop/hbase/protobuf/generated/class-use/VisibilityLabelsProtos.MultiUserAuthorizations.html" target="_top">Frames</a></li> <li><a href="VisibilityLabelsProtos.MultiUserAuthorizations.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>Copyright &#169; 2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> </body> </html>
{'content_hash': '6b5bcdd65ad2b629651e4304f171246b', 'timestamp': '', 'source': 'github', 'line_count': 285, 'max_line_length': 641, 'avg_line_length': 89.05964912280702, 'alnum_prop': 0.7283507997793712, 'repo_name': 'lshain/hbase-0.98.6-hadoop2', 'id': '34ecdae349822eae676f985300f3478e5a8cdf4a', 'size': '25382', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/devapidocs/org/apache/hadoop/hbase/protobuf/generated/class-use/VisibilityLabelsProtos.MultiUserAuthorizations.html', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '39965'}, {'name': 'JavaScript', 'bytes': '1347'}, {'name': 'Ruby', 'bytes': '260273'}, {'name': 'Shell', 'bytes': '97997'}]}
package com.alibaba.otter.canal.common; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.apache.commons.lang.math.RandomUtils; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import com.alibaba.otter.canal.common.zookeeper.ZkClientx; import com.alibaba.otter.canal.common.zookeeper.ZookeeperPathUtils; import com.alibaba.otter.canal.common.zookeeper.running.ServerRunningData; import com.alibaba.otter.canal.common.zookeeper.running.ServerRunningListener; import com.alibaba.otter.canal.common.zookeeper.running.ServerRunningMonitor; @Ignore public class ServerRunningTest extends AbstractZkTest { private ZkClientx zkclientx = new ZkClientx(cluster1 + ";" + cluster2); @Before public void setUp() { String path = ZookeeperPathUtils.getDestinationPath(destination); zkclientx.deleteRecursive(path); zkclientx.createPersistent(ZookeeperPathUtils.getDestinationPath(destination), true); } @After public void tearDown() { String path = ZookeeperPathUtils.getDestinationPath(destination); zkclientx.deleteRecursive(path); } @Test public void testOneServer() { final CountDownLatch countLatch = new CountDownLatch(2); ServerRunningMonitor runningMonitor = buildServerRunning(countLatch, "127.0.0.1", 2088); runningMonitor.start(); sleep(2000L); runningMonitor.stop(); sleep(2000L); if (countLatch.getCount() != 0) { Assert.fail(); } } @Test public void testMultiServer() { final CountDownLatch countLatch = new CountDownLatch(30); final ServerRunningMonitor runningMonitor1 = buildServerRunning(countLatch, "127.0.0.1", 2088); final ServerRunningMonitor runningMonitor2 = buildServerRunning(countLatch, "127.0.0.1", 2089); final ServerRunningMonitor runningMonitor3 = buildServerRunning(countLatch, "127.0.0.1", 2090); final ExecutorService executor = Executors.newFixedThreadPool(3); executor.submit(() -> { for (int i = 0; i < 10; i++) { if (!runningMonitor1.isStart()) { runningMonitor1.start(); } sleep(2000L + RandomUtils.nextInt(500)); if (runningMonitor1.check()) { runningMonitor1.stop(); } sleep(2000L + RandomUtils.nextInt(500)); } }); executor.submit(() -> { for (int i = 0; i < 10; i++) { if (!runningMonitor2.isStart()) { runningMonitor2.start(); } sleep(2000L + RandomUtils.nextInt(500)); if (runningMonitor2.check()) { runningMonitor2.stop(); } sleep(2000L + RandomUtils.nextInt(500)); } }); executor.submit(() -> { for (int i = 0; i < 10; i++) { if (!runningMonitor3.isStart()) { runningMonitor3.start(); } sleep(2000L + RandomUtils.nextInt(500)); if (runningMonitor3.check()) { runningMonitor3.stop(); } sleep(2000L + RandomUtils.nextInt(500)); } }); sleep(30000L); } private ServerRunningMonitor buildServerRunning(final CountDownLatch countLatch, final String ip, final int port) { ServerRunningData serverData = new ServerRunningData(ip + ":" + port); ServerRunningMonitor runningMonitor = new ServerRunningMonitor(serverData); runningMonitor.setDestination(destination); runningMonitor.setListener(new ServerRunningListener() { public void processActiveEnter() { System.out.println(String.format("ip:%s:%s has start", ip, port)); countLatch.countDown(); } public void processActiveExit() { System.out.println(String.format("ip:%s:%s has stop", ip, port)); countLatch.countDown(); } public void processStart() { System.out.println(String.format("ip:%s:%s processStart", ip, port)); } public void processStop() { System.out.println(String.format("ip:%s:%s processStop", ip, port)); } }); runningMonitor.setZkClient(zkclientx); runningMonitor.setDelayTime(1); return runningMonitor; } }
{'content_hash': '39eb86983f3d13d31d4d25943289127f', 'timestamp': '', 'source': 'github', 'line_count': 132, 'max_line_length': 119, 'avg_line_length': 35.553030303030305, 'alnum_prop': 0.6040911996590667, 'repo_name': 'alibaba/canal', 'id': 'ae0af9cc4e3b20f1626ad2e51274c761138e972d', 'size': '4693', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'common/src/test/java/com/alibaba/otter/canal/common/ServerRunningTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '3909'}, {'name': 'CSS', 'bytes': '328'}, {'name': 'Dockerfile', 'bytes': '3522'}, {'name': 'HTML', 'bytes': '5438'}, {'name': 'Java', 'bytes': '3274573'}, {'name': 'JavaScript', 'bytes': '49052'}, {'name': 'PLpgSQL', 'bytes': '7796'}, {'name': 'Python', 'bytes': '1807'}, {'name': 'SCSS', 'bytes': '7071'}, {'name': 'Shell', 'bytes': '40583'}, {'name': 'Vue', 'bytes': '74354'}]}
package org.frc4931.robot.command.autonomous; import org.frc4931.robot.command.CommandBase; import org.frc4931.robot.command.drive.PIDTurnInterface; import org.frc4931.vision.Blob; import org.frc4931.vision.Camera; import edu.wpi.first.wpilibj.PIDController; /** * Tracks a blob to the center of a camera by changing the turn speed. * @author Zach Anderson * */ public class TrackBlob extends CommandBase{ private final PIDController pid; /** * Constructs the command with the given blob. * @param blob the blob to track. */ public TrackBlob(Blob blob) { pid = new PIDController(0,0,0,blob,new PIDTurnInterface()); pid.setInputRange(0, Camera.XRES); pid.setOutputRange(-1, 1); } /** * Sets up and starts the PID loop. */ protected void initialize() { pid.setSetpoint(Camera.XRES/2); pid.enable(); super.initialize(); } protected void doExecute(){ } protected boolean isFinished() { return pid.onTarget(); } /** * Closes the PID Loop. */ protected void end() { pid.disable(); super.end(); } }
{'content_hash': 'b87757ca4d76a052f092c80e757757d7', 'timestamp': '', 'source': 'github', 'line_count': 53, 'max_line_length': 70, 'avg_line_length': 19.92452830188679, 'alnum_prop': 0.7007575757575758, 'repo_name': 'frc-4931/2014-Robot', 'id': 'b3a2cb72379f93cbdce3b43027c0f56e0a651a36', 'size': '1056', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'CompetitionRobot/src/org/frc4931/robot/command/autonomous/TrackBlob.java', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Java', 'bytes': '266840'}, {'name': 'Ruby', 'bytes': '17631'}, {'name': 'Shell', 'bytes': '3590'}]}
<!doctype html> <html class="no-js" lang=""> <head> <title>Zabuun - Learn Egyptian Arabic for English speakers</title> <meta name="description" content=""> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/head.php';?> </head> <body> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/ie8.php';?> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/header.php';?> <div class="content"> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/side.php';?> <div class="main"> <div class="location"> <p class="breadcrumbs">Essays > The Drugs Keep Coming</p> <p class="expandcollapse"> <a href="">Expand All</a> | <a href="">Collapse All</a> </p> </div> <!-- begin essay --> <h1>The Drugs Keep Coming</h1> <p> Reportedly, drug lords have also purchased a Russian cannon that can fire a 2-ton shell 500 miles. The cannon, now hidden in Mexico, will be used to fire 2-ton packages of cocaine, marijuana, and other drugs into southeast New Mexico, where drug lords have secretly bought thousands of acres of desert land. The packages will land in the desert, undetected by US radar. Once they land safely among the cactuses and scorpions, the packages will be stored underground. The drug lords are building a huge complex of tunnels and storage space under the New Mexico desert. The tunnels will connect to truck routes for transporting drugs to major cities. A DEA official said that even if the cannon and tunnels exist, it just proves that DEA is winning the war on drugs. </p> <!-- end essay --> </div> </div> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/footer.php';?> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/scripts.php';?> </body> </html>
{'content_hash': '06d9422cc587f94c8019579ef5ffb1fd', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 778, 'avg_line_length': 59.3448275862069, 'alnum_prop': 0.6873910517141197, 'repo_name': 'javanigus/zabuun', 'id': '2b8a7054ac07623cff82ed2bbc1dc459f0e7869d', 'size': '1721', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'essay/1957-the-drugs-keep-coming.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '11368'}, {'name': 'HTML', 'bytes': '1272'}, {'name': 'Hack', 'bytes': '352702'}, {'name': 'JavaScript', 'bytes': '5518'}, {'name': 'PHP', 'bytes': '6886277'}]}
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.reeuse.component.intent.IntentResultActivity"> <EditText android:id="@+id/intent_result_name_et" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:hint="@string/intent_result_enter_value" android:layout_margin="10dp" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/intent_submit_btn" android:id="@+id/intent_result_submit_btn" android:layout_below="@+id/intent_result_name_et" android:layout_centerHorizontal="true" /> </RelativeLayout>
{'content_hash': '4cdbaa251090640551c74a55f9802668', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 74, 'avg_line_length': 43.111111111111114, 'alnum_prop': 0.6984536082474226, 'repo_name': 'nataraj06/Components', 'id': 'df0c402f504be2c129bf8c6d074e49c22707b9b5', 'size': '1164', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'app/src/main/res/layout/activity_intent_result.xml', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '74807'}]}
package ui // import "miniflux.app/ui" import ( "net/http" "miniflux.app/http/request" "miniflux.app/http/response/html" "miniflux.app/http/response/xml" "miniflux.app/reader/opml" ) func (h *handler) exportFeeds(w http.ResponseWriter, r *http.Request) { opml, err := opml.NewHandler(h.store).Export(request.UserID(r)) if err != nil { html.ServerError(w, r, err) return } xml.Attachment(w, r, "feeds.opml", opml) }
{'content_hash': '2a811e0e3b8bffd0ab43953c587d4e24', 'timestamp': '', 'source': 'github', 'line_count': 20, 'max_line_length': 71, 'avg_line_length': 21.6, 'alnum_prop': 0.6944444444444444, 'repo_name': 'xqin/miniflux', 'id': '4eb6d2c9b849e9bddb281275b144710a5532b1bf', 'size': '599', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'ui/opml_export.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '51802'}, {'name': 'Dockerfile', 'bytes': '2153'}, {'name': 'Go', 'bytes': '1129940'}, {'name': 'HTML', 'bytes': '105237'}, {'name': 'JavaScript', 'bytes': '31252'}, {'name': 'Makefile', 'bytes': '5014'}, {'name': 'Procfile', 'bytes': '18'}, {'name': 'Roff', 'bytes': '9557'}, {'name': 'Shell', 'bytes': '1583'}]}
<polymer-element name="co-question" attributes="tags level reputation"> <template> <style> .co-component-question { display: flex; } ul.co-component-question-tags { list-style: none; margin: 0; padding: 0; } ul.co-component-question-tags > li { display: inline-block; margin-right: 0; padding: 0; } .co-component-question-text { line-height: 18px; padding-bottom: 5px; display: inline-block; } .co-component-question-level { display: inline-block; height: 38px; margin: 0 3px 0 0; color: #777; } .co-component-question-level a { color: #0779AB; text-decoration: none; } .co-component-question-level a:hover { color: #59a1e5; text-decoration: none; } .co-component-question-level-bound { width: 10%; } .co-component-question-reputation-bound { width: 10%; } .co-component-question-content { width: 80%; } .co-component-question-level-title { font-size: 22px; } .co-component-question-reputation-title { font-size: 22px; color: black; } .co-component-question-level-desc { font-size: 12px; } </style> <div class="co-component-question"> <div class="co-component-question-level-bound"> <div class="co-component-question-level"> <div class="co-component-question-level-title"> <a href="/questions/level/{{level}}">{{level}}</a> </div> <div class="co-component-question-level-desc">уровень</div> </div> </div> <div class="co-component-question-reputation-bound"> <div class="co-component-question-level"> <div class="co-component-question-reputation-title"> <span>{{reputation}}</span> </div> <div class="co-component-question-level-desc">репутация</div> </div> </div> <div class="co-component-question-content"> <div class="co-component-question-text"> <content></content> </div> <div> <template if="{{tags | hasTags}}"> <ul class="co-component-question-tags"> <template repeat="{{tag in tags | splitTags}}"> <li> <co-tag tag="{{tag}}">{{tag}}</co-tag> </li> </template> </ul> </template> </div> </div> </div> </template> <script> Polymer({ tags: '', level: '', reputation: '', hasTags: function(tags) { return !!tags; }, splitTags: function(tags) { return tags.split(','); } }); </script> </polymer-element>
{'content_hash': 'bdddd36791f3f48acc20d69b90dd6ee5', 'timestamp': '', 'source': 'github', 'line_count': 117, 'max_line_length': 81, 'avg_line_length': 31.11965811965812, 'alnum_prop': 0.4059324361439165, 'repo_name': 'Home-Java8/combiq', 'id': '4b21882cf3b3a88e88777c8de5f1a7b1e81d4b24', 'size': '3657', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'web/src/main/webapp/static/elements/co-question/co-question.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '126'}, {'name': 'CSS', 'bytes': '18016'}, {'name': 'HTML', 'bytes': '8046'}, {'name': 'Java', 'bytes': '145422'}, {'name': 'JavaScript', 'bytes': '18874'}, {'name': 'Shell', 'bytes': '116'}]}
module.exports = function (grunt) { require('jit-grunt')(grunt); grunt.initConfig({ nodemon: { development: { script: 'src/server', options: { env: { 'NODE_ENV': 'development' } } } }, mocha_istanbul: { server: { options: { reporter: 'spec', require: './test/helpers/spec-helper' }, src: ['test/server/**/*.spec.js'] } } }); grunt.registerTask('serve', ['nodemon:development']); grunt.registerTask('test', ['mocha_istanbul:server']) };
{'content_hash': 'bae100c93e6d5fd5f89d6868a4a83da9', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 57, 'avg_line_length': 25.482758620689655, 'alnum_prop': 0.38836265223274696, 'repo_name': 'sean3z/cncnet-api', 'id': 'd8d036a25826655bd4aeb786dd6f9030ed7ac837', 'size': '739', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Gruntfile.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '105276'}]}
<!DOCTYPE html> <html> <head> <title>SourceBuffer.mode == "sequence" test cases.</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="mediasource-util.js"></script> </head> <body> <div id="log"></div> <script> function mediasource_sequencemode_test(testFunction, description, options) { return mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData) { assert_greater_than(segmentInfo.media.length, 3, "at least 3 media segments for supported type"); mediaElement.addEventListener("error", test.unreached_func("Unexpected event 'error'")); sourceBuffer.mode = "sequence"; assert_equals(sourceBuffer.mode, "sequence", "mode after setting it to \"sequence\""); var initSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.init); test.expectEvent(sourceBuffer, "updatestart", "initSegment append started."); test.expectEvent(sourceBuffer, "update", "initSegment append success."); test.expectEvent(sourceBuffer, "updateend", "initSegment append ended."); sourceBuffer.appendBuffer(initSegment); test.waitForExpectedEvents(function() { assert_equals(sourceBuffer.timestampOffset, 0, "timestampOffset initially 0"); testFunction(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData); }); }, description, options); } function append_segment(test, sourceBuffer, mediaData, info, callback) { var mediaSegment = MediaSourceUtil.extractSegmentData(mediaData, info); test.expectEvent(sourceBuffer, "updatestart", "media segment append started."); test.expectEvent(sourceBuffer, "update", "media segment append success."); test.expectEvent(sourceBuffer, "updateend", "media segment append ended."); sourceBuffer.appendBuffer(mediaSegment); test.waitForExpectedEvents(callback); } function threeDecimalPlaces(number) { return Number(number.toFixed(3)); } // Verifies expected times to 3 decimal places before and after mediaSource.endOfStream(), // and calls |callback| on success. function verify_offset_and_buffered(test, mediaSource, sourceBuffer, expectedTimestampOffset, expectedBufferedRangeStartTime, expectedBufferedRangeMaxEndTimeBeforeEOS, expectedBufferedRangeEndTimeAfterEOS, callback) { assert_equals(threeDecimalPlaces(sourceBuffer.timestampOffset), threeDecimalPlaces(expectedTimestampOffset), "expectedTimestampOffset"); // Prior to EOS, the buffered range end time may not have fully reached the next media // segment's timecode (adjusted by any timestampOffset). It should not exceed it though. // Therefore, an exact assertBufferedEquals() will not work here. assert_equals(sourceBuffer.buffered.length, 1, "sourceBuffer.buffered has 1 range before EOS"); assert_equals(threeDecimalPlaces(sourceBuffer.buffered.start(0)), threeDecimalPlaces(expectedBufferedRangeStartTime), "sourceBuffer.buffered range begins where expected before EOS"); assert_less_than_equal(threeDecimalPlaces(sourceBuffer.buffered.end(0)), threeDecimalPlaces(expectedBufferedRangeMaxEndTimeBeforeEOS), "sourceBuffer.buffered range ends at or before expected upper bound before EOS"); test.expectEvent(mediaSource, "sourceended", "mediaSource endOfStream"); mediaSource.endOfStream(); test.waitForExpectedEvents(function() { assertBufferedEquals(sourceBuffer, "{ [" + expectedBufferedRangeStartTime.toFixed(3) + ", " + expectedBufferedRangeEndTimeAfterEOS.toFixed(3) + ") }", "sourceBuffer.buffered after EOS"); callback(); }); } mediasource_sequencemode_test(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData) { assert_equals(segmentInfo.media[0].timecode, 0, "segment starts at time 0"); append_segment(test, sourceBuffer, mediaData, segmentInfo.media[0], function() { verify_offset_and_buffered(test, mediaSource, sourceBuffer, 0, 0, segmentInfo.media[1].timecode + sourceBuffer.timestampOffset, segmentInfo.media[0].highest_end_time + sourceBuffer.timestampOffset, test.done); }); }, "Test sequence AppendMode appendBuffer(first media segment)"); mediasource_sequencemode_test(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData) { assert_greater_than(segmentInfo.media[1].timecode, 0, "segment starts after time 0"); append_segment(test, sourceBuffer, mediaData, segmentInfo.media[1], function() { verify_offset_and_buffered(test, mediaSource, sourceBuffer, -segmentInfo.media[1].timecode, 0, segmentInfo.media[2].timecode + sourceBuffer.timestampOffset, segmentInfo.media[1].highest_end_time + sourceBuffer.timestampOffset, test.done); }); }, "Test sequence AppendMode appendBuffer(second media segment)"); mediasource_sequencemode_test(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData) { assert_greater_than(segmentInfo.media[1].timecode, 0, "segment starts after time 0"); append_segment(test, sourceBuffer, mediaData, segmentInfo.media[1], function() { assert_equals(segmentInfo.media[0].timecode, 0, "segment starts at time 0"); append_segment(test, sourceBuffer, mediaData, segmentInfo.media[0], function() { // Current timestampOffset should reflect offset required to put media[0] // immediately after media[1]'s highest frame end timestamp (as was adjusted // by an earlier timestampOffset). verify_offset_and_buffered(test, mediaSource, sourceBuffer, segmentInfo.media[1].highest_end_time - segmentInfo.media[1].timecode, 0, segmentInfo.media[1].timecode + sourceBuffer.timestampOffset, segmentInfo.media[0].highest_end_time + sourceBuffer.timestampOffset, test.done); }) }); }, "Test sequence AppendMode appendBuffer(second media segment, then first media segment)"); </script> </body> </html>
{'content_hash': '287d9f88a406c17fd3924769d621fc44', 'timestamp': '', 'source': 'github', 'line_count': 129, 'max_line_length': 154, 'avg_line_length': 61.29457364341085, 'alnum_prop': 0.5677248008094093, 'repo_name': 'youtube/cobalt_sandbox', 'id': 'd2cfe351e671799b169c9420a8cd48c104620434', 'size': '7907', 'binary': False, 'copies': '117', 'ref': 'refs/heads/main', 'path': 'third_party/web_platform_tests/media-source/mediasource-sequencemode-append-buffer.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []}
package io.grpc; import static io.grpc.internal.GrpcUtil.TIMEOUT_KEY; import static io.grpc.internal.GrpcUtil.TIMER_SERVICE; import com.google.common.base.Preconditions; import com.google.common.base.Throwables; import com.google.common.util.concurrent.Futures; import io.grpc.internal.SerializingExecutor; import io.grpc.internal.ServerListener; import io.grpc.internal.ServerStream; import io.grpc.internal.ServerStreamListener; import io.grpc.internal.ServerTransport; import io.grpc.internal.ServerTransportListener; import io.grpc.internal.SharedResourceHolder; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; /** * Default implementation of {@link Server}, for creation by transports. * * <p>Expected usage (by a theoretical TCP transport): * <pre><code>public class TcpTransportServerFactory { * public static Server newServer(Executor executor, HandlerRegistry registry, * String configuration) { * return new ServerImpl(executor, registry, new TcpTransportServer(configuration)); * } * }</code></pre> * * <p>Starting the server starts the underlying transport for servicing requests. Stopping the * server stops servicing new requests and waits for all connections to terminate. */ public final class ServerImpl extends Server { private static final ServerStreamListener NOOP_LISTENER = new NoopListener(); private static final Future<?> DEFAULT_TIMEOUT_FUTURE = Futures.immediateCancelledFuture(); /** Executor for application processing. */ private Executor executor; private boolean usingSharedExecutor; private final HandlerRegistry registry; private boolean started; private boolean shutdown; private boolean terminated; private Runnable terminationRunnable; /** Service encapsulating something similar to an accept() socket. */ private final io.grpc.internal.Server transportServer; private final Object lock = new Object(); private boolean transportServerTerminated; /** {@code transportServer} and services encapsulating something similar to a TCP connection. */ private final Collection<ServerTransport> transports = new HashSet<ServerTransport>(); private final ScheduledExecutorService timeoutService = SharedResourceHolder.get(TIMER_SERVICE); /** * Construct a server. * * @param executor to call methods on behalf of remote clients * @param registry of methods to expose to remote clients. */ ServerImpl(Executor executor, HandlerRegistry registry, io.grpc.internal.Server transportServer) { this.executor = executor; this.registry = Preconditions.checkNotNull(registry, "registry"); this.transportServer = Preconditions.checkNotNull(transportServer, "transportServer"); } /** Hack to allow executors to auto-shutdown. Not for general use. */ // TODO(ejona86): Replace with a real API. void setTerminationRunnable(Runnable runnable) { synchronized (lock) { this.terminationRunnable = runnable; } } /** * Bind and start the server. * * @return {@code this} object * @throws IllegalStateException if already started * @throws IOException if unable to bind */ public ServerImpl start() throws IOException { synchronized (lock) { if (started) { throw new IllegalStateException("Already started"); } usingSharedExecutor = executor == null; if (usingSharedExecutor) { executor = SharedResourceHolder.get(ChannelImpl.SHARED_EXECUTOR); } // Start and wait for any port to actually be bound. transportServer.start(new ServerListenerImpl()); started = true; return this; } } /** * Initiates an orderly shutdown in which preexisting calls continue but new calls are rejected. */ public ServerImpl shutdown() { boolean shutdownTransportServer; synchronized (lock) { if (shutdown) { return this; } shutdown = true; shutdownTransportServer = started; if (!shutdownTransportServer) { transportServerTerminated = true; checkForTermination(); } } if (shutdownTransportServer) { transportServer.shutdown(); } SharedResourceHolder.release(TIMER_SERVICE, timeoutService); if (usingSharedExecutor) { SharedResourceHolder.release(ChannelImpl.SHARED_EXECUTOR, (ExecutorService) executor); } return this; } /** * Initiates a forceful shutdown in which preexisting and new calls are rejected. Although * forceful, the shutdown process is still not instantaneous; {@link #isTerminated()} will likely * return {@code false} immediately after this method returns. * * <p>NOT YET IMPLEMENTED. This method currently behaves identically to shutdown(). */ // TODO(ejona86): cancel preexisting calls. public ServerImpl shutdownNow() { shutdown(); return this; } /** * Returns whether the server is shutdown. Shutdown servers reject any new calls, but may still * have some calls being processed. * * @see #shutdown() * @see #isTerminated() */ public boolean isShutdown() { synchronized (lock) { return shutdown; } } /** * Waits for the server to become terminated, giving up if the timeout is reached. * * @return whether the server is terminated, as would be done by {@link #isTerminated()}. */ public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { synchronized (lock) { long timeoutNanos = unit.toNanos(timeout); long endTimeNanos = System.nanoTime() + timeoutNanos; while (!terminated && (timeoutNanos = endTimeNanos - System.nanoTime()) > 0) { TimeUnit.NANOSECONDS.timedWait(lock, timeoutNanos); } return terminated; } } /** * Waits for the server to become terminated. */ public void awaitTermination() throws InterruptedException { synchronized (lock) { while (!terminated) { lock.wait(); } } } /** * Returns whether the server is terminated. Terminated servers have no running calls and * relevant resources released (like TCP connections). * * @see #isShutdown() */ public boolean isTerminated() { synchronized (lock) { return terminated; } } /** * Remove transport service from accounting collection and notify of complete shutdown if * necessary. * * @param transport service to remove */ private void transportClosed(ServerTransport transport) { synchronized (lock) { if (!transports.remove(transport)) { throw new AssertionError("Transport already removed"); } checkForTermination(); } } /** Notify of complete shutdown if necessary. */ private void checkForTermination() { synchronized (lock) { if (shutdown && transports.isEmpty() && transportServerTerminated) { if (terminated) { throw new AssertionError("Server already terminated"); } terminated = true; // TODO(carl-mastrangelo): move this outside the synchronized block. lock.notifyAll(); if (terminationRunnable != null) { terminationRunnable.run(); } } } } private class ServerListenerImpl implements ServerListener { @Override public ServerTransportListener transportCreated(ServerTransport transport) { synchronized (lock) { transports.add(transport); } return new ServerTransportListenerImpl(transport); } @Override public void serverShutdown() { ArrayList<ServerTransport> copiedTransports; synchronized (lock) { // transports collection can be modified during shutdown(), even if we hold the lock, due // to reentrancy. copiedTransports = new ArrayList<ServerTransport>(transports); } for (ServerTransport transport : copiedTransports) { transport.shutdown(); } synchronized (lock) { transportServerTerminated = true; checkForTermination(); } } } private class ServerTransportListenerImpl implements ServerTransportListener { private final ServerTransport transport; public ServerTransportListenerImpl(ServerTransport transport) { this.transport = transport; } @Override public void transportTerminated() { transportClosed(transport); } @Override public ServerStreamListener streamCreated(final ServerStream stream, final String methodName, final Metadata headers) { final Future<?> timeout = scheduleTimeout(stream, headers); SerializingExecutor serializingExecutor = new SerializingExecutor(executor); final JumpToApplicationThreadServerStreamListener jumpListener = new JumpToApplicationThreadServerStreamListener(serializingExecutor, stream); // Run in serializingExecutor so jumpListener.setListener() is called before any callbacks // are delivered, including any errors. Callbacks can still be triggered, but they will be // queued. serializingExecutor.execute(new Runnable() { @Override public void run() { ServerStreamListener listener = NOOP_LISTENER; try { HandlerRegistry.Method method = registry.lookupMethod(methodName); if (method == null) { stream.close( Status.UNIMPLEMENTED.withDescription("Method not found: " + methodName), new Metadata()); timeout.cancel(true); return; } listener = startCall(stream, methodName, method.getMethodDefinition(), timeout, headers); } catch (Throwable t) { stream.close(Status.fromThrowable(t), new Metadata()); timeout.cancel(true); throw Throwables.propagate(t); } finally { jumpListener.setListener(listener); } } }); return jumpListener; } private Future<?> scheduleTimeout(final ServerStream stream, Metadata headers) { Long timeoutMicros = headers.get(TIMEOUT_KEY); if (timeoutMicros == null) { return DEFAULT_TIMEOUT_FUTURE; } return timeoutService.schedule(new Runnable() { @Override public void run() { // This should rarely get run, since the client will likely cancel the stream before // the timeout is reached. stream.cancel(Status.DEADLINE_EXCEEDED); } }, timeoutMicros, TimeUnit.MICROSECONDS); } /** Never returns {@code null}. */ private <ReqT, RespT> ServerStreamListener startCall(ServerStream stream, String fullMethodName, ServerMethodDefinition<ReqT, RespT> methodDef, Future<?> timeout, Metadata headers) { // TODO(ejona86): should we update fullMethodName to have the canonical path of the method? final ServerCallImpl<ReqT, RespT> call = new ServerCallImpl<ReqT, RespT>( stream, methodDef.getMethodDescriptor()); ServerCall.Listener<ReqT> listener = methodDef.getServerCallHandler() .startCall(methodDef.getMethodDescriptor(), call, headers); if (listener == null) { throw new NullPointerException( "startCall() returned a null listener for method " + fullMethodName); } return call.newServerStreamListener(listener, timeout); } } private static class NoopListener implements ServerStreamListener { @Override public void messageRead(InputStream value) { try { value.close(); } catch (IOException e) { throw new RuntimeException(e); } } @Override public void halfClosed() {} @Override public void closed(Status status) {} @Override public void onReady() {} } /** * Dispatches callbacks onto an application-provided executor and correctly propagates * exceptions. */ private static class JumpToApplicationThreadServerStreamListener implements ServerStreamListener { private final SerializingExecutor callExecutor; private final ServerStream stream; // Only accessed from callExecutor. private ServerStreamListener listener; public JumpToApplicationThreadServerStreamListener(SerializingExecutor executor, ServerStream stream) { this.callExecutor = executor; this.stream = stream; } private ServerStreamListener getListener() { if (listener == null) { throw new IllegalStateException("listener unset"); } return listener; } private void setListener(ServerStreamListener listener) { Preconditions.checkNotNull(listener, "listener must not be null"); Preconditions.checkState(this.listener == null, "Listener already set"); this.listener = listener; } /** * Like {@link ServerCall#close(Status, Metadata)}, but thread-safe for internal use. */ private void internalClose(Status status, Metadata trailers) { // TODO(ejona86): this is not thread-safe :) stream.close(status, trailers); } @Override public void messageRead(final InputStream message) { callExecutor.execute(new Runnable() { @Override public void run() { try { getListener().messageRead(message); } catch (Throwable t) { internalClose(Status.fromThrowable(t), new Metadata()); throw Throwables.propagate(t); } } }); } @Override public void halfClosed() { callExecutor.execute(new Runnable() { @Override public void run() { try { getListener().halfClosed(); } catch (Throwable t) { internalClose(Status.fromThrowable(t), new Metadata()); throw Throwables.propagate(t); } } }); } @Override public void closed(final Status status) { callExecutor.execute(new Runnable() { @Override public void run() { getListener().closed(status); } }); } @Override public void onReady() { callExecutor.execute(new Runnable() { @Override public void run() { getListener().onReady(); } }); } } private static class ServerCallImpl<ReqT, RespT> extends ServerCall<RespT> { private final ServerStream stream; private final MethodDescriptor<ReqT, RespT> method; private volatile boolean cancelled; private boolean sendHeadersCalled; private boolean closeCalled; private boolean sendMessageCalled; public ServerCallImpl(ServerStream stream, MethodDescriptor<ReqT, RespT> method) { this.stream = stream; this.method = method; } @Override public void request(int numMessages) { stream.request(numMessages); } @Override public void sendHeaders(Metadata headers) { Preconditions.checkState(!sendHeadersCalled, "sendHeaders has already been called"); Preconditions.checkState(!closeCalled, "call is closed"); Preconditions.checkState(!sendMessageCalled, "sendMessage has already been called"); sendHeadersCalled = true; stream.writeHeaders(headers); } @Override public void sendMessage(RespT message) { Preconditions.checkState(!closeCalled, "call is closed"); sendMessageCalled = true; try { InputStream resp = method.streamResponse(message); stream.writeMessage(resp); stream.flush(); } catch (Throwable t) { close(Status.fromThrowable(t), new Metadata()); throw Throwables.propagate(t); } } @Override public boolean isReady() { return stream.isReady(); } @Override public void close(Status status, Metadata trailers) { Preconditions.checkState(!closeCalled, "call already closed"); closeCalled = true; stream.close(status, trailers); } @Override public boolean isCancelled() { return cancelled; } private ServerStreamListenerImpl newServerStreamListener(ServerCall.Listener<ReqT> listener, Future<?> timeout) { return new ServerStreamListenerImpl(listener, timeout); } /** * All of these callbacks are assumed to called on an application thread, and the caller is * responsible for handling thrown exceptions. */ private class ServerStreamListenerImpl implements ServerStreamListener { private final ServerCall.Listener<ReqT> listener; private final Future<?> timeout; public ServerStreamListenerImpl(ServerCall.Listener<ReqT> listener, Future<?> timeout) { this.listener = Preconditions.checkNotNull(listener, "listener must not be null"); this.timeout = timeout; } @Override public void messageRead(final InputStream message) { try { if (cancelled) { return; } listener.onMessage(method.parseRequest(message)); } finally { try { message.close(); } catch (IOException e) { throw new RuntimeException(e); } } } @Override public void halfClosed() { if (cancelled) { return; } listener.onHalfClose(); } @Override public void closed(Status status) { timeout.cancel(true); if (status.isOk()) { listener.onComplete(); } else { cancelled = true; listener.onCancel(); } } @Override public void onReady() { if (cancelled) { return; } listener.onReady(); } } } }
{'content_hash': 'b2fb9dbd4e0593807e4d90ff9fbc16f5', 'timestamp': '', 'source': 'github', 'line_count': 574, 'max_line_length': 100, 'avg_line_length': 31.501742160278745, 'alnum_prop': 0.6622608118570954, 'repo_name': 'mingfly/grpc-java', 'id': 'edb12b30f6eaab6377211c496e2c22f7f750b278', 'size': '19641', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'core/src/main/java/io/grpc/ServerImpl.java', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C++', 'bytes': '25200'}, {'name': 'Java', 'bytes': '1428345'}, {'name': 'Protocol Buffer', 'bytes': '27167'}, {'name': 'Shell', 'bytes': '5673'}]}
@interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
{'content_hash': '737cd2ed902f8dfa39c948184dbbade2', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 60, 'avg_line_length': 23.2, 'alnum_prop': 0.7931034482758621, 'repo_name': 'romaonthego/RETrimControl', 'id': '350e3fe0b1714d37917d75e87c3868049d62484b', 'size': '292', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'RETrimControlExample/RETrimControlExample/AppDelegate.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Objective-C', 'bytes': '18744'}, {'name': 'Ruby', 'bytes': '605'}]}
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context="artispective.blogspot.com.ng.artispective.activities.HomeActivity"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_home2" /> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" android:src="@android:drawable/ic_input_add" /> </android.support.design.widget.CoordinatorLayout>
{'content_hash': 'dbcda7e5d38aac57a4a74c5ad38b7455', 'timestamp': '', 'source': 'github', 'line_count': 34, 'max_line_length': 107, 'avg_line_length': 42.0, 'alnum_prop': 0.6946778711484594, 'repo_name': 'andela-shassan/ArtiSpective', 'id': 'fe137a64d6347ef609f7271bb6274b44130640b1', 'size': '1428', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/res/layout/app_bar_home2.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '181970'}]}
<TS language="bg" version="2.1"> <context> <name>AddressBookPage</name> <message> <source>Right-click to edit address or label</source> <translation>Десен клик за промяна на адреса или името</translation> </message> <message> <source>Create a new address</source> <translation>Създаване на нов адрес</translation> </message> <message> <source>&amp;New</source> <translation>Нов</translation> </message> <message> <source>Copy the currently selected address to the system clipboard</source> <translation>Копиране на избрания адрес</translation> </message> <message> <source>&amp;Copy</source> <translation>Копирай</translation> </message> <message> <source>C&amp;lose</source> <translation>Затвори</translation> </message> <message> <source>&amp;Copy Address</source> <translation>&amp;Копирай</translation> </message> <message> <source>Delete the currently selected address from the list</source> <translation>Изтрий избрания адрес от списъка</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>Запишете данните от текущия раздел във файл</translation> </message> <message> <source>&amp;Export</source> <translation>Изнеси</translation> </message> <message> <source>&amp;Delete</source> <translation>&amp;Изтриване</translation> </message> <message> <source>Choose the address to send coins to</source> <translation>Изберете адрес, на който да се изпращат монети</translation> </message> <message> <source>Choose the address to receive coins with</source> <translation>Изберете адрес за получаване на монети</translation> </message> <message> <source>C&amp;hoose</source> <translation>Избери</translation> </message> <message> <source>Sending addresses</source> <translation>Адреси за изпращане</translation> </message> <message> <source>Receiving addresses</source> <translation>Адреси за получаване</translation> </message> <message> <source>These are your FacileCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Това са адресите на получателите на плащания. Винаги проверявайте размера на сумата и адреса на получателя, преди да изпратите монети.</translation> </message> <message> <source>These are your FacileCoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> <translation>Това са Вашите Биткойн адреси,благодарение на които ще получавате плащания.Препоръчително е да използвате нови адреси за получаване за всяка транзакция.</translation> </message> <message> <source>Copy &amp;Label</source> <translation>Копирай &amp;име</translation> </message> <message> <source>&amp;Edit</source> <translation>&amp;Редактирай</translation> </message> <message> <source>Export Address List</source> <translation>Изнасяне на списъка с адреси</translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>CSV файл (*.csv)</translation> </message> <message> <source>Exporting Failed</source> <translation>Грешка при изнасянето</translation> </message> <message> <source>There was an error trying to save the address list to %1. Please try again.</source> <translation>Възникна грешка при опита за запазване на списъка с адреси в %1.Моля опитайте отново.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <source>Label</source> <translation>Име</translation> </message> <message> <source>Address</source> <translation>Адрес</translation> </message> <message> <source>(no label)</source> <translation>(без име)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <source>Passphrase Dialog</source> <translation>Диалог за паролите</translation> </message> <message> <source>Enter passphrase</source> <translation>Въведи парола</translation> </message> <message> <source>New passphrase</source> <translation>Нова парола</translation> </message> <message> <source>Repeat new passphrase</source> <translation>Още веднъж</translation> </message> <message> <source>Encrypt wallet</source> <translation>Криптиране на портфейла</translation> </message> <message> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Тази операция изисква Вашата парола за отключване на портфейла.</translation> </message> <message> <source>Unlock wallet</source> <translation>Отключване на портфейла</translation> </message> <message> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Тази операция изисква Вашата парола за декриптиране на портфейла.</translation> </message> <message> <source>Decrypt wallet</source> <translation>Декриптиране на портфейла</translation> </message> <message> <source>Change passphrase</source> <translation>Смяна на паролата</translation> </message> <message> <source>Enter the old and new passphrase to the wallet.</source> <translation>Въведете текущата и новата парола за портфейла.</translation> </message> <message> <source>Confirm wallet encryption</source> <translation>Потвърждаване на криптирането</translation> </message> <message> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source> <translation>ВНИМАНИЕ: Ако защитите вашият портфейл и изгубите ключовата дума, вие ще &lt;b&gt;ИЗГУБИТЕ ВСИЧКИТЕ СИ БИТКОЙНОВЕ&lt;/b&gt;!</translation> </message> <message> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Наистина ли искате да шифрирате портфейла?</translation> </message> <message> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>ВАЖНО: Всякакви стари бекъп версии, които сте направили на вашият портфейл трябва да бъдат заменени със ново-генерирания, криптиран портфейл файл. От съображения за сигурност, предишните бекъпи на некриптираните портфейли ще станат неизползваеми веднага щом започнете да използвате новият криптиран портфейл.</translation> </message> <message> <source>Warning: The Caps Lock key is on!</source> <translation>Внимание: Caps Lock (главни букви) е включен.</translation> </message> <message> <source>Wallet encrypted</source> <translation>Портфейлът е криптиран</translation> </message> <message> <source>FacileCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your facilecoins from being stolen by malware infecting your computer.</source> <translation>Биткоин ще се затоври сега за да завърши процеса на криптиране. Запомнете, че криптирането на вашия портефейл не може напълно да предпази вашите Бит-монети от кражба чрез зловреден софтуер, инфектирал вашия компютър</translation> </message> <message> <source>Wallet encryption failed</source> <translation>Криптирането беше неуспешно</translation> </message> <message> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Криптирането на портфейла беше неуспешно поради неизвестен проблем. Портфейлът не е криптиран.</translation> </message> <message> <source>The supplied passphrases do not match.</source> <translation>Паролите не съвпадат</translation> </message> <message> <source>Wallet unlock failed</source> <translation>Отключването беше неуспешно</translation> </message> <message> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Паролата въведена за декриптиране на портфейла е грешна.</translation> </message> <message> <source>Wallet decryption failed</source> <translation>Декриптирането беше неуспешно</translation> </message> <message> <source>Wallet passphrase was successfully changed.</source> <translation>Паролата на портфейла беше променена успешно.</translation> </message> </context> <context> <name>FacileCoinGUI</name> <message> <source>Sign &amp;message...</source> <translation>Подписване на &amp;съобщение...</translation> </message> <message> <source>Synchronizing with network...</source> <translation>Синхронизиране с мрежата...</translation> </message> <message> <source>&amp;Overview</source> <translation>&amp;Баланс</translation> </message> <message> <source>Node</source> <translation>Сървър</translation> </message> <message> <source>Show general overview of wallet</source> <translation>Обобщена информация за портфейла</translation> </message> <message> <source>&amp;Transactions</source> <translation>&amp;Трансакции</translation> </message> <message> <source>Browse transaction history</source> <translation>История на трансакциите</translation> </message> <message> <source>E&amp;xit</source> <translation>Из&amp;ход</translation> </message> <message> <source>Quit application</source> <translation>Изход от приложението</translation> </message> <message> <source>About &amp;Qt</source> <translation>За &amp;Qt</translation> </message> <message> <source>Show information about Qt</source> <translation>Покажи информация за Qt</translation> </message> <message> <source>&amp;Options...</source> <translation>&amp;Опции...</translation> </message> <message> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Криптиране на портфейла...</translation> </message> <message> <source>&amp;Backup Wallet...</source> <translation>&amp;Запазване на портфейла...</translation> </message> <message> <source>&amp;Change Passphrase...</source> <translation>&amp;Смяна на паролата...</translation> </message> <message> <source>&amp;Sending addresses...</source> <translation>&amp;Изпращане на адресите...</translation> </message> <message> <source>&amp;Receiving addresses...</source> <translation>&amp;Получаване на адресите...</translation> </message> <message> <source>Open &amp;URI...</source> <translation>Отвори &amp;URI...</translation> </message> <message> <source>FacileCoin Core client</source> <translation>FacileCoin Core клиент</translation> </message> <message> <source>Send coins to a FacileCoin address</source> <translation>Изпращане към Биткоин адрес</translation> </message> <message> <source>Modify configuration options for FacileCoin</source> <translation>Променете настройките на Биткойн</translation> </message> <message> <source>Backup wallet to another location</source> <translation>Запазване на портфейла на друго място</translation> </message> <message> <source>Change the passphrase used for wallet encryption</source> <translation>Променя паролата за портфейла</translation> </message> <message> <source>&amp;Debug window</source> <translation>&amp;Прозорец за отстраняване на грешки</translation> </message> <message> <source>Open debugging and diagnostic console</source> <translation>Отворете конзолата за диагностика и отстраняване на грешки</translation> </message> <message> <source>&amp;Verify message...</source> <translation>&amp;Проверка на съобщение...</translation> </message> <message> <source>FacileCoin</source> <translation>Биткоин</translation> </message> <message> <source>Wallet</source> <translation>Портфейл</translation> </message> <message> <source>&amp;Send</source> <translation>&amp;Изпращане</translation> </message> <message> <source>&amp;Receive</source> <translation>&amp;Получаване</translation> </message> <message> <source>Show information about FacileCoin Core</source> <translation>Покажете информация за Биткойн ядрото</translation> </message> <message> <source>&amp;Show / Hide</source> <translation>&amp;Покажи / Скрий</translation> </message> <message> <source>Show or hide the main Window</source> <translation>Показване и скриване на основния прозорец</translation> </message> <message> <source>Encrypt the private keys that belong to your wallet</source> <translation>Шифроване на личните ключове,които принадлежат на портфейла Ви.</translation> </message> <message> <source>Sign messages with your FacileCoin addresses to prove you own them</source> <translation>Пишете съобщения със своя Биткойн адрес за да докажете,че е ваш.</translation> </message> <message> <source>Verify messages to ensure they were signed with specified FacileCoin addresses</source> <translation>Потвърждаване на съобщения за да се знае,че са написани с дадените Биткойн адреси.</translation> </message> <message> <source>&amp;File</source> <translation>&amp;Файл</translation> </message> <message> <source>&amp;Settings</source> <translation>&amp;Настройки</translation> </message> <message> <source>&amp;Help</source> <translation>&amp;Помощ</translation> </message> <message> <source>Tabs toolbar</source> <translation>Раздели</translation> </message> <message> <source>FacileCoin Core</source> <translation>Биткойн ядро</translation> </message> <message> <source>Request payments (generates QR codes and facilecoin: URIs)</source> <translation>Изискване на плащания(генерира QR кодове и биткойн: URIs)</translation> </message> <message> <source>&amp;About FacileCoin Core</source> <translation>&amp;Относно FacileCoin Core</translation> </message> <message> <source>Show the list of used sending addresses and labels</source> <translation>Показване на списъка с използвани адреси и имена</translation> </message> <message> <source>Show the list of used receiving addresses and labels</source> <translation>Покажи списък с използваните адреси и имена.</translation> </message> <message> <source>Open a facilecoin: URI or payment request</source> <translation>Отворете биткойн: URI или заявка за плащане</translation> </message> <message> <source>&amp;Command-line options</source> <translation>&amp;Налични команди</translation> </message> <message> <source>Show the FacileCoin Core help message to get a list with possible FacileCoin command-line options</source> <translation>Покажи помощните съобщения на Биткойн за да видиш наличните и валидни команди</translation> </message> <message numerus="yes"> <source>%n active connection(s) to FacileCoin network</source> <translation><numerusform>%n връзка към Биткоин мрежата</numerusform><numerusform>%n връзки към Биткоин мрежата</numerusform></translation> </message> <message> <source>No block source available...</source> <translation>Липсва източник на блоковете...</translation> </message> <message numerus="yes"> <source>%n hour(s)</source> <translation><numerusform>%n час</numerusform><numerusform>%n часа</numerusform></translation> </message> <message numerus="yes"> <source>%n day(s)</source> <translation><numerusform>%n ден</numerusform><numerusform>%n дни</numerusform></translation> </message> <message numerus="yes"> <source>%n week(s)</source> <translation><numerusform>%n седмица</numerusform><numerusform>%n седмици</numerusform></translation> </message> <message> <source>%1 and %2</source> <translation>%1 и %2</translation> </message> <message numerus="yes"> <source>%n year(s)</source> <translation><numerusform>%n година</numerusform><numerusform>%n години</numerusform></translation> </message> <message> <source>%1 behind</source> <translation>%1 зад</translation> </message> <message> <source>Transactions after this will not yet be visible.</source> <translation>Транзакции след това няма все още да бъдат видими.</translation> </message> <message> <source>Error</source> <translation>Грешка</translation> </message> <message> <source>Warning</source> <translation>Предупреждение</translation> </message> <message> <source>Information</source> <translation>Данни</translation> </message> <message> <source>Up to date</source> <translation>Синхронизиран</translation> </message> <message numerus="yes"> <source>Processed %n blocks of transaction history.</source> <translation><numerusform>Обслужени %n блокове от историята с транзакции.</numerusform><numerusform>Обслужени %n блокове от историята с транзакции.</numerusform></translation> </message> <message> <source>Catching up...</source> <translation>Зарежда блокове...</translation> </message> <message> <source>Sent transaction</source> <translation>Изходяща трансакция</translation> </message> <message> <source>Incoming transaction</source> <translation>Входяща трансакция</translation> </message> <message> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Дата: %1 Сума: %2 Вид: %3 Адрес: %4 </translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Портфейлът е &lt;b&gt;криптиран&lt;/b&gt; и &lt;b&gt;отключен&lt;/b&gt;</translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Портфейлът е &lt;b&gt;криптиран&lt;/b&gt; и &lt;b&gt;заключен&lt;/b&gt;</translation> </message> </context> <context> <name>ClientModel</name> <message> <source>Network Alert</source> <translation>Мрежови проблем</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <source>Coin Selection</source> <translation>Избор на монета</translation> </message> <message> <source>Quantity:</source> <translation>Количество:</translation> </message> <message> <source>Bytes:</source> <translation>Байтове:</translation> </message> <message> <source>Amount:</source> <translation>Сума:</translation> </message> <message> <source>Priority:</source> <translation>Приоритет:</translation> </message> <message> <source>Fee:</source> <translation>Такса:</translation> </message> <message> <source>Dust:</source> <translation>Прах:</translation> </message> <message> <source>After Fee:</source> <translation>След прилагане на ДДС</translation> </message> <message> <source>Change:</source> <translation>Ресто</translation> </message> <message> <source>(un)select all</source> <translation>(Пре)махни всички</translation> </message> <message> <source>Tree mode</source> <translation>Дървовиден режим</translation> </message> <message> <source>List mode</source> <translation>Списъчен режим</translation> </message> <message> <source>Amount</source> <translation>Сума</translation> </message> <message> <source>Received with label</source> <translation>Получени с име</translation> </message> <message> <source>Received with address</source> <translation>Получени с адрес</translation> </message> <message> <source>Date</source> <translation>Дата</translation> </message> <message> <source>Confirmations</source> <translation>Потвърждения</translation> </message> <message> <source>Confirmed</source> <translation>Потвърдени</translation> </message> <message> <source>Priority</source> <translation>Приоритет</translation> </message> <message> <source>Copy address</source> <translation>Копирай адрес</translation> </message> <message> <source>Copy label</source> <translation>Копирай име</translation> </message> <message> <source>Copy amount</source> <translation>Копирай сума</translation> </message> <message> <source>Copy transaction ID</source> <translation>Копирай транзакция с ID</translation> </message> <message> <source>Lock unspent</source> <translation>Заключване на неизхарченото</translation> </message> <message> <source>Unlock unspent</source> <translation>Отключване на неизхарченото</translation> </message> <message> <source>Copy quantity</source> <translation>Копиране на количеството</translation> </message> <message> <source>Copy fee</source> <translation>Копиране на данък добавена стойност</translation> </message> <message> <source>Copy after fee</source> <translation>Копиране след прилагане на данък добавена стойност</translation> </message> <message> <source>Copy bytes</source> <translation>Копиране на байтовете</translation> </message> <message> <source>Copy priority</source> <translation>Копиране на приоритет</translation> </message> <message> <source>Copy dust</source> <translation>Копирай прахта:</translation> </message> <message> <source>Copy change</source> <translation>Копирай рестото</translation> </message> <message> <source>highest</source> <translation>Най-висок</translation> </message> <message> <source>higher</source> <translation>По-висок</translation> </message> <message> <source>high</source> <translation>Висок</translation> </message> <message> <source>medium-high</source> <translation>Средно-висок</translation> </message> <message> <source>medium</source> <translation>Среден</translation> </message> <message> <source>low-medium</source> <translation>Ниско-среден</translation> </message> <message> <source>low</source> <translation>Нисък</translation> </message> <message> <source>lower</source> <translation>По-нисък</translation> </message> <message> <source>lowest</source> <translation>Най-нисък</translation> </message> <message> <source>(%1 locked)</source> <translation>(%1 заключен)</translation> </message> <message> <source>none</source> <translation>нищо</translation> </message> <message> <source>yes</source> <translation>да</translation> </message> <message> <source>no</source> <translation>не</translation> </message> <message> <source>This means a fee of at least %1 per kB is required.</source> <translation>Това означава че се изисква такса от поне %1 на килобайт.</translation> </message> <message> <source>Can vary +/- 1 byte per input.</source> <translation>Може да варира с +-1 байт</translation> </message> <message> <source>This label turns red, if any recipient receives an amount smaller than %1.</source> <translation>Това наименование се оцветява в червено, ако произволен получател получи сума по-малка от %1.</translation> </message> <message> <source>(no label)</source> <translation>(без име)</translation> </message> <message> <source>change from %1 (%2)</source> <translation>ресто от %1 (%2)</translation> </message> <message> <source>(change)</source> <translation>(промени)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <source>Edit Address</source> <translation>Редактиране на адрес</translation> </message> <message> <source>&amp;Label</source> <translation>&amp;Име</translation> </message> <message> <source>&amp;Address</source> <translation>&amp;Адрес</translation> </message> <message> <source>New receiving address</source> <translation>Нов адрес за получаване</translation> </message> <message> <source>New sending address</source> <translation>Нов адрес за изпращане</translation> </message> <message> <source>Edit receiving address</source> <translation>Редактиране на входящ адрес</translation> </message> <message> <source>Edit sending address</source> <translation>Редактиране на изходящ адрес</translation> </message> <message> <source>The entered address "%1" is already in the address book.</source> <translation>Вече има адрес "%1" в списъка с адреси.</translation> </message> <message> <source>The entered address "%1" is not a valid FacileCoin address.</source> <translation>"%1" не е валиден Биткоин адрес.</translation> </message> <message> <source>Could not unlock wallet.</source> <translation>Отключването на портфейла беше неуспешно.</translation> </message> <message> <source>New key generation failed.</source> <translation>Създаването на ключ беше неуспешно.</translation> </message> </context> <context> <name>FreespaceChecker</name> <message> <source>A new data directory will be created.</source> <translation>Ще се създаде нова папка за данни.</translation> </message> <message> <source>name</source> <translation>име</translation> </message> <message> <source>Directory already exists. Add %1 if you intend to create a new directory here.</source> <translation>Директорията вече съществува.Добавете %1 ако желаете да добавите нова директория тук.</translation> </message> <message> <source>Path already exists, and is not a directory.</source> <translation>Пътят вече съществува и не е папка.</translation> </message> <message> <source>Cannot create data directory here.</source> <translation>Не може да се създаде директория тук.</translation> </message> </context> <context> <name>HelpMessageDialog</name> <message> <source>FacileCoin Core</source> <translation>Биткойн ядро</translation> </message> <message> <source>version</source> <translation>версия</translation> </message> <message> <source>(%1-bit)</source> <translation>(%1-битов)</translation> </message> <message> <source>About FacileCoin Core</source> <translation>За FacileCoin Core</translation> </message> <message> <source>Command-line options</source> <translation>Списък с команди</translation> </message> <message> <source>Usage:</source> <translation>Използване:</translation> </message> <message> <source>command-line options</source> <translation>Списък с налични команди</translation> </message> <message> <source>UI options</source> <translation>UI Опции</translation> </message> <message> <source>Set language, for example "de_DE" (default: system locale)</source> <translation>Задаване на език,например "de_DE" (по подразбиране: system locale)</translation> </message> <message> <source>Start minimized</source> <translation>Стартирай минимизирано</translation> </message> <message> <source>Choose data directory on startup (default: 0)</source> <translation>Изберете директория при стартиране на програмата.( настройка по подразбиране:0)</translation> </message> </context> <context> <name>Intro</name> <message> <source>Welcome</source> <translation>Добре дошли</translation> </message> <message> <source>Welcome to FacileCoin Core.</source> <translation>Добре дошли в Биткойн ядрото.</translation> </message> <message> <source>As this is the first time the program is launched, you can choose where FacileCoin Core will store its data.</source> <translation>Тъй като това е първото стартиране на програмата можете да изберете къде Биткон ядрото да запази данните си.</translation> </message> <message> <source>Use the default data directory</source> <translation>Използване на директория по подразбиране</translation> </message> <message> <source>Use a custom data directory:</source> <translation>Използване на директория ръчно</translation> </message> <message> <source>FacileCoin Core</source> <translation>Биткойн ядро</translation> </message> <message> <source>Error</source> <translation>Грешка</translation> </message> </context> <context> <name>OpenURIDialog</name> <message> <source>Open URI</source> <translation>Отваряне на URI</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <source>Options</source> <translation>Опции</translation> </message> <message> <source>&amp;Main</source> <translation>&amp;Основни</translation> </message> <message> <source>Automatically start FacileCoin after logging in to the system.</source> <translation>Автоматично включване на Биткойн след влизане в системата.</translation> </message> <message> <source>&amp;Start FacileCoin on system login</source> <translation>&amp;Пускане на Биткоин при вход в системата</translation> </message> <message> <source>Size of &amp;database cache</source> <translation>Размер на кеша в &amp;базата данни</translation> </message> <message> <source>MB</source> <translation>Мегабайта</translation> </message> <message> <source>Accept connections from outside</source> <translation>Приемай връзки отвън</translation> </message> <message> <source>Allow incoming connections</source> <translation>Позволи входящите връзки</translation> </message> <message> <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source> <translation>IP адрес на прокси (напр. за IPv4: 127.0.0.1 / за IPv6: ::1)</translation> </message> <message> <source>Third party transaction URLs</source> <translation>URL адреси на трети страни</translation> </message> <message> <source>Reset all client options to default.</source> <translation>Възстановете всички настройки по подразбиране.</translation> </message> <message> <source>&amp;Reset Options</source> <translation>&amp;Нулирай настройките</translation> </message> <message> <source>&amp;Network</source> <translation>&amp;Мрежа</translation> </message> <message> <source>W&amp;allet</source> <translation>По&amp;ртфейл</translation> </message> <message> <source>Expert</source> <translation>Експерт</translation> </message> <message> <source>&amp;Spend unconfirmed change</source> <translation>&amp;Похарчете непотвърденото ресто</translation> </message> <message> <source>Automatically open the FacileCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Автоматично отваряне на входящия FacileCoin порт. Работи само с рутери поддържащи UPnP.</translation> </message> <message> <source>Map port using &amp;UPnP</source> <translation>Отваряне на входящия порт чрез &amp;UPnP</translation> </message> <message> <source>Connect to the FacileCoin network through a SOCKS5 proxy.</source> <translation>Свързване с Биткойн мрежата чрез SOCKS5 прокси.</translation> </message> <message> <source>&amp;Connect through SOCKS5 proxy (default proxy):</source> <translation>&amp;Свързване чрез SOCKS5 прокси (прокси по подразбиране):</translation> </message> <message> <source>Proxy &amp;IP:</source> <translation>Прокси &amp; АйПи:</translation> </message> <message> <source>&amp;Port:</source> <translation>&amp;Порт:</translation> </message> <message> <source>Port of the proxy (e.g. 9050)</source> <translation>Порт на прокси сървъра (пр. 9050)</translation> </message> <message> <source>&amp;Window</source> <translation>&amp;Прозорец</translation> </message> <message> <source>Show only a tray icon after minimizing the window.</source> <translation>След минимизиране ще е видима само иконата в системния трей.</translation> </message> <message> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Минимизиране в системния трей</translation> </message> <message> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>При затваряне на прозореца приложението остава минимизирано. Ако изберете тази опция, приложението може да се затвори само чрез Изход в менюто.</translation> </message> <message> <source>M&amp;inimize on close</source> <translation>М&amp;инимизиране при затваряне</translation> </message> <message> <source>&amp;Display</source> <translation>&amp;Интерфейс</translation> </message> <message> <source>User Interface &amp;language:</source> <translation>Език:</translation> </message> <message> <source>The user interface language can be set here. This setting will take effect after restarting FacileCoin.</source> <translation>Промяната на езика ще влезе в сила след рестартиране на Биткоин.</translation> </message> <message> <source>&amp;Unit to show amounts in:</source> <translation>Мерни единици:</translation> </message> <message> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Изберете единиците, показвани по подразбиране в интерфейса.</translation> </message> <message> <source>Whether to show coin control features or not.</source> <translation>Дали да покаже възможностите за контрол на монетите или не.</translation> </message> <message> <source>&amp;OK</source> <translation>ОК</translation> </message> <message> <source>&amp;Cancel</source> <translation>Отказ</translation> </message> <message> <source>default</source> <translation>подразбиране</translation> </message> <message> <source>none</source> <translation>нищо</translation> </message> <message> <source>Confirm options reset</source> <translation>Потвърдете отмяната на настройките.</translation> </message> <message> <source>Client restart required to activate changes.</source> <translation>Изисква се рестартиране на клиента за активиране на извършените промени.</translation> </message> <message> <source>Client will be shutdown, do you want to proceed?</source> <translation>Клиентът ще бъде изключен,искате ли да продължите?</translation> </message> <message> <source>This change would require a client restart.</source> <translation>Тази промяна изисква рестартиране на клиента Ви.</translation> </message> <message> <source>The supplied proxy address is invalid.</source> <translation>Прокси адресът е невалиден.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <source>Form</source> <translation>Форма</translation> </message> <message> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the FacileCoin network after a connection is established, but this process has not completed yet.</source> <translation>Текущата информация на екрана може да не е актуална. Вашият портфейл ще се синхронизира автоматично с мрежата на Биткоин, щом поне една връзката с нея се установи; този процес все още не е приключил.</translation> </message> <message> <source>Watch-only:</source> <translation>В наблюдателен режим:</translation> </message> <message> <source>Available:</source> <translation>Налично:</translation> </message> <message> <source>Your current spendable balance</source> <translation>Вашата текуща сметка за изразходване</translation> </message> <message> <source>Pending:</source> <translation>Изчакващо:</translation> </message> <message> <source>Immature:</source> <translation>Неразвит:</translation> </message> <message> <source>Mined balance that has not yet matured</source> <translation>Миниран баланс,който все още не се е развил</translation> </message> <message> <source>Balances</source> <translation>Баланс</translation> </message> <message> <source>Total:</source> <translation>Общо:</translation> </message> <message> <source>Your current total balance</source> <translation>Текущият ви общ баланс</translation> </message> <message> <source>Spendable:</source> <translation>За харчене:</translation> </message> <message> <source>Recent transactions</source> <translation>Скорошни транзакции</translation> </message> <message> <source>out of sync</source> <translation>несинхронизиран</translation> </message> </context> <context> <name>PaymentServer</name> <message> <source>URI handling</source> <translation>Справяне с URI</translation> </message> <message> <source>Invalid payment address %1</source> <translation>Невалиден адрес на плащане %1</translation> </message> <message> <source>Payment request rejected</source> <translation>Заявката за плащане беше отхвърлена</translation> </message> <message> <source>Payment request network doesn't match client network.</source> <translation>Мрежата от която се извършва заявката за плащане не съвпада с мрежата на клиента.</translation> </message> <message> <source>Payment request has expired.</source> <translation>Заявката за плащане е изтекла.</translation> </message> <message> <source>Requested payment amount of %1 is too small (considered dust).</source> <translation>Заявената сума за плащане: %1 е твърде малка (счита се за отпадък)</translation> </message> <message> <source>Payment request error</source> <translation>Възникна грешка по време назаявката за плащане</translation> </message> <message> <source>Cannot start facilecoin: click-to-pay handler</source> <translation>Биткойн не можe да се стартира: click-to-pay handler</translation> </message> <message> <source>Payment request file handling</source> <translation>Файл за справяне със заявки</translation> </message> <message> <source>Refund from %1</source> <translation>Възстановяване на сума от %1</translation> </message> <message> <source>Payment request DoS protection</source> <translation>Дос защита на заявката за плащане</translation> </message> <message> <source>Error communicating with %1: %2</source> <translation>Грешка при комуникацията с %1: %2</translation> </message> <message> <source>Bad response from server %1</source> <translation>Възникна проблем при свързването със сървър %1</translation> </message> <message> <source>Payment acknowledged</source> <translation>Плащането е прието</translation> </message> <message> <source>Network request error</source> <translation>Грешка в мрежата по време на заявката</translation> </message> </context> <context> <name>PeerTableModel</name> <message> <source>User Agent</source> <translation>Клиент на потребителя</translation> </message> <message> <source>Address/Hostname</source> <translation>Адрес в интернет</translation> </message> <message> <source>Ping Time</source> <translation>Време за отговор</translation> </message> </context> <context> <name>QObject</name> <message> <source>Amount</source> <translation>Сума</translation> </message> <message> <source>Enter a FacileCoin address (e.g. %1)</source> <translation>Въведете Биткойн адрес (например: %1)</translation> </message> <message> <source>%1 d</source> <translation>%1 ден</translation> </message> <message> <source>%1 h</source> <translation>%1 час</translation> </message> <message> <source>%1 m</source> <translation>%1 минута</translation> </message> <message> <source>%1 s</source> <translation>%1 секунда</translation> </message> <message> <source>NETWORK</source> <translation>Мрежа</translation> </message> <message> <source>UNKNOWN</source> <translation>Неизвестен</translation> </message> <message> <source>None</source> <translation>Неналичен</translation> </message> <message> <source>N/A</source> <translation>Несъществуващ</translation> </message> <message> <source>%1 ms</source> <translation>%1 милисекунда</translation> </message> </context> <context> <name>QRImageWidget</name> <message> <source>&amp;Save Image...</source> <translation>&amp;Запиши изображение...</translation> </message> <message> <source>&amp;Copy Image</source> <translation>&amp;Копирай изображение</translation> </message> <message> <source>Save QR Code</source> <translation>Запази QR Код</translation> </message> <message> <source>PNG Image (*.png)</source> <translation>PNG Изображение (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <source>Client name</source> <translation>Име на клиента</translation> </message> <message> <source>N/A</source> <translation>N/A</translation> </message> <message> <source>Client version</source> <translation>Версия на клиента</translation> </message> <message> <source>&amp;Information</source> <translation>Данни</translation> </message> <message> <source>Debug window</source> <translation>Прозорец с грешки</translation> </message> <message> <source>General</source> <translation>Основни</translation> </message> <message> <source>Using OpenSSL version</source> <translation>Използване на OpenSSL версия</translation> </message> <message> <source>Using BerkeleyDB version</source> <translation>Използване на база данни BerkeleyDB </translation> </message> <message> <source>Startup time</source> <translation>Време за стартиране</translation> </message> <message> <source>Network</source> <translation>Мрежа</translation> </message> <message> <source>Name</source> <translation>Име</translation> </message> <message> <source>Number of connections</source> <translation>Брой връзки</translation> </message> <message> <source>Current number of blocks</source> <translation>Текущ брой блокове</translation> </message> <message> <source>Received</source> <translation>Получени</translation> </message> <message> <source>Sent</source> <translation>Изпратени</translation> </message> <message> <source>&amp;Peers</source> <translation>&amp;Пиъри</translation> </message> <message> <source>Select a peer to view detailed information.</source> <translation>Избери пиър за детайлна информация.</translation> </message> <message> <source>Direction</source> <translation>Посока</translation> </message> <message> <source>Version</source> <translation>Версия</translation> </message> <message> <source>User Agent</source> <translation>Клиент на потребителя</translation> </message> <message> <source>Services</source> <translation>Услуги</translation> </message> <message> <source>Starting Height</source> <translation>Стартова височина</translation> </message> <message> <source>Connection Time</source> <translation>Продължителност на връзката</translation> </message> <message> <source>Last Send</source> <translation>Изпратени за последно</translation> </message> <message> <source>Last Receive</source> <translation>Получени за последно</translation> </message> <message> <source>Bytes Sent</source> <translation>Изпратени байтове</translation> </message> <message> <source>Bytes Received</source> <translation>Получени байтове</translation> </message> <message> <source>Ping Time</source> <translation>Време за отговор</translation> </message> <message> <source>Last block time</source> <translation>Време на последния блок</translation> </message> <message> <source>&amp;Open</source> <translation>&amp;Отвори</translation> </message> <message> <source>&amp;Console</source> <translation>&amp;Конзола</translation> </message> <message> <source>&amp;Network Traffic</source> <translation>&amp;Мрежов Трафик</translation> </message> <message> <source>&amp;Clear</source> <translation>&amp;Изчисти</translation> </message> <message> <source>Totals</source> <translation>Общо:</translation> </message> <message> <source>In:</source> <translation>Входящи:</translation> </message> <message> <source>Out:</source> <translation>Изходящи</translation> </message> <message> <source>Build date</source> <translation>Дата на създаване</translation> </message> <message> <source>Debug log file</source> <translation>Лог файл,съдържащ грешките</translation> </message> <message> <source>Open the FacileCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Отворете Биткой дебъг лог файла от настоящата Data папка. Може да отнеме няколко секунди при по - големи лог файлове.</translation> </message> <message> <source>Clear console</source> <translation>Изчисти конзолата</translation> </message> <message> <source>Welcome to the FacileCoin RPC console.</source> <translation>Добре дошли в Биткойн RPC конзолата.</translation> </message> <message> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Използвайте стрелки надолу и нагореза разглеждане на историятаот команди и &lt;b&gt;Ctrl-L&lt;/b&gt; за изчистване на конзолата.</translation> </message> <message> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Въведeте &lt;/b&gt;помощ&lt;/b&gt; за да видите наличните команди.</translation> </message> <message> <source>%1 B</source> <translation>%1 Байт</translation> </message> <message> <source>%1 KB</source> <translation>%1 Килобайт</translation> </message> <message> <source>%1 MB</source> <translation>%1 Мегабайт</translation> </message> <message> <source>%1 GB</source> <translation>%1 Гигабайт</translation> </message> <message> <source>via %1</source> <translation>посредством %1</translation> </message> <message> <source>never</source> <translation>Никога</translation> </message> <message> <source>Inbound</source> <translation>Входящи</translation> </message> <message> <source>Outbound</source> <translation>Изходящи</translation> </message> <message> <source>Unknown</source> <translation>Неизвестен</translation> </message> <message> <source>Fetching...</source> <translation>Прихващане...</translation> </message> </context> <context> <name>ReceiveCoinsDialog</name> <message> <source>&amp;Amount:</source> <translation>&amp;Сума</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;Име:</translation> </message> <message> <source>&amp;Message:</source> <translation>&amp;Съобщение:</translation> </message> <message> <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source> <translation>Използвате този формуляр за заявяване на плащания. Всички полета са &lt;b&gt;незадължителни&lt;/b&gt;.</translation> </message> <message> <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source> <translation>Незадължително заявяване на сума. Оставете полето празно или нулево, за да не заявите конкретна сума.</translation> </message> <message> <source>Clear all fields of the form.</source> <translation>Изчисти всички полета от формуляра.</translation> </message> <message> <source>Clear</source> <translation>Изчистване</translation> </message> <message> <source>Requested payments history</source> <translation>Изискана история на плащанията</translation> </message> <message> <source>&amp;Request payment</source> <translation>&amp;Изискване на плащане</translation> </message> <message> <source>Show</source> <translation>Показване</translation> </message> <message> <source>Remove</source> <translation>Премахване</translation> </message> <message> <source>Copy label</source> <translation>Копирай име</translation> </message> <message> <source>Copy message</source> <translation>Копиране на съобщението</translation> </message> <message> <source>Copy amount</source> <translation>Копирай сума</translation> </message> </context> <context> <name>ReceiveRequestDialog</name> <message> <source>QR Code</source> <translation>QR код</translation> </message> <message> <source>Copy &amp;URI</source> <translation>Копиране на &amp;URI</translation> </message> <message> <source>Copy &amp;Address</source> <translation>&amp;Копирай адрес</translation> </message> <message> <source>&amp;Save Image...</source> <translation>&amp;Запиши изображение...</translation> </message> <message> <source>Request payment to %1</source> <translation>Изискване на плащане от %1</translation> </message> <message> <source>Payment information</source> <translation>Данни за плащането</translation> </message> <message> <source>Address</source> <translation>Адрес</translation> </message> <message> <source>Amount</source> <translation>Сума</translation> </message> <message> <source>Label</source> <translation>Име</translation> </message> <message> <source>Message</source> <translation>Съобщение</translation> </message> <message> <source>Error encoding URI into QR Code.</source> <translation>Грешка при създаването на QR Code от URI.</translation> </message> </context> <context> <name>RecentRequestsTableModel</name> <message> <source>Date</source> <translation>Дата</translation> </message> <message> <source>Label</source> <translation>Име</translation> </message> <message> <source>Message</source> <translation>Съобщение</translation> </message> <message> <source>Amount</source> <translation>Сума</translation> </message> <message> <source>(no label)</source> <translation>(без име)</translation> </message> <message> <source>(no message)</source> <translation>(без съобщение)</translation> </message> <message> <source>(no amount)</source> <translation>(липсва сума)</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <source>Send Coins</source> <translation>Изпращане</translation> </message> <message> <source>Coin Control Features</source> <translation>Настройки за контрол на монетите</translation> </message> <message> <source>automatically selected</source> <translation>астоматично избран</translation> </message> <message> <source>Insufficient funds!</source> <translation>Нямате достатъчно налични пари!</translation> </message> <message> <source>Quantity:</source> <translation>Количество:</translation> </message> <message> <source>Bytes:</source> <translation>Байтове:</translation> </message> <message> <source>Amount:</source> <translation>Сума:</translation> </message> <message> <source>Priority:</source> <translation>Приоритет:</translation> </message> <message> <source>Fee:</source> <translation>Такса:</translation> </message> <message> <source>After Fee:</source> <translation>След прилагане на ДДС</translation> </message> <message> <source>Change:</source> <translation>Ресто</translation> </message> <message> <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source> <translation>Ако тази опция е активирана,но адресът на промяна е празен или невалиден,промяната ще бъде изпратена на новосъздаден адрес.</translation> </message> <message> <source>Transaction Fee:</source> <translation>Такса за транзакцията:</translation> </message> <message> <source>Choose...</source> <translation>Избери...</translation> </message> <message> <source>Minimize</source> <translation>Минимизирай</translation> </message> <message> <source>per kilobyte</source> <translation>за килобайт</translation> </message> <message> <source>total at least</source> <translation>Крайна сума поне</translation> </message> <message> <source>Recommended:</source> <translation>Препоръчителна:</translation> </message> <message> <source>Custom:</source> <translation>По избор:</translation> </message> <message> <source>Confirmation time:</source> <translation>Време за потвърждение:</translation> </message> <message> <source>normal</source> <translation>нормален</translation> </message> <message> <source>fast</source> <translation>бърз</translation> </message> <message> <source>Send to multiple recipients at once</source> <translation>Изпращане към повече от един получател</translation> </message> <message> <source>Add &amp;Recipient</source> <translation>Добави &amp;получател</translation> </message> <message> <source>Clear all fields of the form.</source> <translation>Изчисти всички полета от формуляра.</translation> </message> <message> <source>Dust:</source> <translation>Прах:</translation> </message> <message> <source>Clear &amp;All</source> <translation>&amp;Изчисти</translation> </message> <message> <source>Balance:</source> <translation>Баланс:</translation> </message> <message> <source>Confirm the send action</source> <translation>Потвърдете изпращането</translation> </message> <message> <source>S&amp;end</source> <translation>И&amp;зпрати</translation> </message> <message> <source>Confirm send coins</source> <translation>Потвърждаване</translation> </message> <message> <source>Copy quantity</source> <translation>Копиране на количеството</translation> </message> <message> <source>Copy amount</source> <translation>Копирай сума</translation> </message> <message> <source>Copy fee</source> <translation>Копиране на данък добавена стойност</translation> </message> <message> <source>Copy after fee</source> <translation>Копиране след прилагане на данък добавена стойност</translation> </message> <message> <source>Copy bytes</source> <translation>Копиране на байтовете</translation> </message> <message> <source>Copy priority</source> <translation>Копиране на приоритет</translation> </message> <message> <source>Copy change</source> <translation>Копирай рестото</translation> </message> <message> <source>Total Amount %1 (= %2)</source> <translation>Пълна сума %1 (= %2)</translation> </message> <message> <source>or</source> <translation>или</translation> </message> <message> <source>The recipient address is not valid, please recheck.</source> <translation>Невалиден адрес на получателя.</translation> </message> <message> <source>The amount to pay must be larger than 0.</source> <translation>Сумата трябва да е по-голяма от 0.</translation> </message> <message> <source>The amount exceeds your balance.</source> <translation>Сумата надвишава текущия баланс</translation> </message> <message> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Сумата при добавяне на данък добавена стойност по %1 транзакцията надвишава сумата по вашата сметка.</translation> </message> <message> <source>Transaction creation failed!</source> <translation>Грешка при създаването на транзакция!</translation> </message> <message> <source>A fee higher than %1 is considered an insanely high fee.</source> <translation>Такса по-висока от %1 се смята за извънредно висока.</translation> </message> <message> <source>Pay only the minimum fee of %1</source> <translation>Платете минималната такса от %1</translation> </message> <message> <source>Warning: Invalid FacileCoin address</source> <translation>Внимание: Невалиден Биткойн адрес</translation> </message> <message> <source>(no label)</source> <translation>(без име)</translation> </message> <message> <source>Warning: Unknown change address</source> <translation>Внимание:Неизвестен адрес за промяна</translation> </message> <message> <source>Copy dust</source> <translation>Копирай прахта:</translation> </message> <message> <source>Are you sure you want to send?</source> <translation>Наистина ли искате да изпратите?</translation> </message> <message> <source>added as transaction fee</source> <translation>добавено като такса за трансакция</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <source>A&amp;mount:</source> <translation>С&amp;ума:</translation> </message> <message> <source>Pay &amp;To:</source> <translation>Плати &amp;На:</translation> </message> <message> <source>Enter a label for this address to add it to your address book</source> <translation>Въведете име за този адрес, за да го добавите в списъка с адреси</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;Име:</translation> </message> <message> <source>Choose previously used address</source> <translation>Изберете използван преди адрес</translation> </message> <message> <source>This is a normal payment.</source> <translation>Това е нормално плащане.</translation> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Вмъкни от клипборда</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Remove this entry</source> <translation>Премахване на този запис</translation> </message> <message> <source>Message:</source> <translation>Съобщение:</translation> </message> <message> <source>This is a verified payment request.</source> <translation>Това е потвърдена транзакция.</translation> </message> <message> <source>This is an unverified payment request.</source> <translation>Това е непотвърдена заявка за плащане.</translation> </message> <message> <source>Pay To:</source> <translation>Плащане на:</translation> </message> <message> <source>Memo:</source> <translation>Бележка:</translation> </message> </context> <context> <name>ShutdownWindow</name> <message> <source>FacileCoin Core is shutting down...</source> <translation>Биткойн ядрото се изключва...</translation> </message> <message> <source>Do not shut down the computer until this window disappears.</source> <translation>Не изключвайте компютъра докато този прозорец не изчезне.</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <source>Signatures - Sign / Verify a Message</source> <translation>Подпиши / Провери съобщение</translation> </message> <message> <source>&amp;Sign Message</source> <translation>&amp;Подпиши</translation> </message> <message> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Можете да подпишете съобщение като доказателство, че притежавате определен адрес. Бъдете внимателни и не подписвайте съобщения, които биха разкрили лична информация без вашето съгласие.</translation> </message> <message> <source>Choose previously used address</source> <translation>Изберете използван преди адрес</translation> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Вмъкни от клипборда</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Enter the message you want to sign here</source> <translation>Въведете съобщението тук</translation> </message> <message> <source>Signature</source> <translation>Подпис</translation> </message> <message> <source>Copy the current signature to the system clipboard</source> <translation>Копиране на текущия подпис</translation> </message> <message> <source>Sign the message to prove you own this FacileCoin address</source> <translation>Подпишете съобщение като доказателство, че притежавате определен адрес</translation> </message> <message> <source>Sign &amp;Message</source> <translation>Подпиши &amp;съобщение</translation> </message> <message> <source>Clear &amp;All</source> <translation>&amp;Изчисти</translation> </message> <message> <source>&amp;Verify Message</source> <translation>&amp;Провери</translation> </message> <message> <source>Verify the message to ensure it was signed with the specified FacileCoin address</source> <translation>Проверете съобщение, за да сте сигурни че е подписано с определен Биткоин адрес</translation> </message> <message> <source>Verify &amp;Message</source> <translation>Потвърди &amp;съобщението</translation> </message> <message> <source>Click "Sign Message" to generate signature</source> <translation>Натиснете "Подписване на съобщение" за да създадете подпис</translation> </message> <message> <source>The entered address is invalid.</source> <translation>Въведеният адрес е невалиден.</translation> </message> <message> <source>Please check the address and try again.</source> <translation>Моля проверете адреса и опитайте отново.</translation> </message> <message> <source>The entered address does not refer to a key.</source> <translation>Въведеният адрес не може да се съпостави с валиден ключ.</translation> </message> <message> <source>Wallet unlock was cancelled.</source> <translation>Отключването на портфейла беше отменено.</translation> </message> <message> <source>Private key for the entered address is not available.</source> <translation>Не е наличен частният ключ за въведеният адрес.</translation> </message> <message> <source>Message signing failed.</source> <translation>Подписването на съобщение бе неуспешно.</translation> </message> <message> <source>Message signed.</source> <translation>Съобщението е подписано.</translation> </message> <message> <source>The signature could not be decoded.</source> <translation>Подписът не може да бъде декодиран.</translation> </message> <message> <source>Please check the signature and try again.</source> <translation>Проверете подписа и опитайте отново.</translation> </message> <message> <source>The signature did not match the message digest.</source> <translation>Подписът не отговаря на комбинацията от съобщение и адрес.</translation> </message> <message> <source>Message verification failed.</source> <translation>Проверката на съобщението беше неуспешна.</translation> </message> <message> <source>Message verified.</source> <translation>Съобщението е потвърдено.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <source>FacileCoin Core</source> <translation>Биткойн ядро</translation> </message> <message> <source>The FacileCoin Core developers</source> <translation>Разработчици на FacileCoin Core</translation> </message> <message> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TrafficGraphWidget</name> <message> <source>KB/s</source> <translation>Килобайта в секунда</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <source>Open until %1</source> <translation>Подлежи на промяна до %1</translation> </message> <message> <source>conflicted</source> <translation>припокриващ се</translation> </message> <message> <source>%1/offline</source> <translation>%1/офлайн</translation> </message> <message> <source>%1/unconfirmed</source> <translation>%1/непотвърдени</translation> </message> <message> <source>%1 confirmations</source> <translation>включена в %1 блока</translation> </message> <message> <source>Status</source> <translation>Статус</translation> </message> <message> <source>Date</source> <translation>Дата</translation> </message> <message> <source>Source</source> <translation>Източник</translation> </message> <message> <source>Generated</source> <translation>Издадени</translation> </message> <message> <source>From</source> <translation>От</translation> </message> <message> <source>To</source> <translation>За</translation> </message> <message> <source>own address</source> <translation>собствен адрес</translation> </message> <message> <source>label</source> <translation>име</translation> </message> <message> <source>Credit</source> <translation>Кредит</translation> </message> <message> <source>not accepted</source> <translation>не е приет</translation> </message> <message> <source>Debit</source> <translation>Дебит</translation> </message> <message> <source>Transaction fee</source> <translation>Такса</translation> </message> <message> <source>Net amount</source> <translation>Сума нето</translation> </message> <message> <source>Message</source> <translation>Съобщение</translation> </message> <message> <source>Comment</source> <translation>Коментар</translation> </message> <message> <source>Transaction ID</source> <translation>ID</translation> </message> <message> <source>Merchant</source> <translation>Търговец</translation> </message> <message> <source>Debug information</source> <translation>Информация за грешките</translation> </message> <message> <source>Transaction</source> <translation>Трансакция</translation> </message> <message> <source>Amount</source> <translation>Сума</translation> </message> <message> <source>true</source> <translation>true</translation> </message> <message> <source>false</source> <translation>false</translation> </message> <message> <source>, has not been successfully broadcast yet</source> <translation>, все още не е изпратено</translation> </message> <message> <source>unknown</source> <translation>неизвестен</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <source>Transaction details</source> <translation>Трансакция</translation> </message> <message> <source>This pane shows a detailed description of the transaction</source> <translation>Описание на трансакцията</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <source>Date</source> <translation>Дата</translation> </message> <message> <source>Type</source> <translation>Тип</translation> </message> <message> <source>Address</source> <translation>Адрес</translation> </message> <message> <source>Open until %1</source> <translation>Подлежи на промяна до %1</translation> </message> <message> <source>Confirmed (%1 confirmations)</source> <translation>Потвърдени (%1 потвърждения)</translation> </message> <message> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Блокът не е получен от останалите участници и най-вероятно няма да бъде одобрен.</translation> </message> <message> <source>Generated but not accepted</source> <translation>Генерирана, но отхвърлена от мрежата</translation> </message> <message> <source>Offline</source> <translation>Извън линия</translation> </message> <message> <source>Unconfirmed</source> <translation>Непотвърдено</translation> </message> <message> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation>Потвърждаване (%1 от %2 препоръчвани потвърждения)</translation> </message> <message> <source>Conflicted</source> <translation>Конфликтно</translation> </message> <message> <source>Received with</source> <translation>Получени с</translation> </message> <message> <source>Received from</source> <translation>Получен от</translation> </message> <message> <source>Sent to</source> <translation>Изпратени на</translation> </message> <message> <source>Payment to yourself</source> <translation>Плащане към себе си</translation> </message> <message> <source>Mined</source> <translation>Емитирани</translation> </message> <message> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Състояние на трансакцията. Задръжте върху това поле за брой потвърждения.</translation> </message> <message> <source>Date and time that the transaction was received.</source> <translation>Дата и час на получаване.</translation> </message> <message> <source>Type of transaction.</source> <translation>Вид трансакция.</translation> </message> <message> <source>Destination address of transaction.</source> <translation>Получател на трансакцията.</translation> </message> <message> <source>Amount removed from or added to balance.</source> <translation>Сума извадена или добавена към баланса.</translation> </message> </context> <context> <name>TransactionView</name> <message> <source>All</source> <translation>Всички</translation> </message> <message> <source>Today</source> <translation>Днес</translation> </message> <message> <source>This week</source> <translation>Тази седмица</translation> </message> <message> <source>This month</source> <translation>Този месец</translation> </message> <message> <source>Last month</source> <translation>Предния месец</translation> </message> <message> <source>This year</source> <translation>Тази година</translation> </message> <message> <source>Range...</source> <translation>От - до...</translation> </message> <message> <source>Received with</source> <translation>Получени</translation> </message> <message> <source>Sent to</source> <translation>Изпратени на</translation> </message> <message> <source>To yourself</source> <translation>Собствени</translation> </message> <message> <source>Mined</source> <translation>Емитирани</translation> </message> <message> <source>Other</source> <translation>Други</translation> </message> <message> <source>Enter address or label to search</source> <translation>Търсене по адрес или име</translation> </message> <message> <source>Min amount</source> <translation>Минимална сума</translation> </message> <message> <source>Copy address</source> <translation>Копирай адрес</translation> </message> <message> <source>Copy label</source> <translation>Копирай име</translation> </message> <message> <source>Copy amount</source> <translation>Копирай сума</translation> </message> <message> <source>Copy transaction ID</source> <translation>Копирай транзакция с ID</translation> </message> <message> <source>Edit label</source> <translation>Редактирай име</translation> </message> <message> <source>Show transaction details</source> <translation>Подробности за трансакцията</translation> </message> <message> <source>Export Transaction History</source> <translation>Изнасяне историята на трансакциите</translation> </message> <message> <source>Exporting Failed</source> <translation>Грешка при изнасянето</translation> </message> <message> <source>Exporting Successful</source> <translation>Изнасянето е успешна</translation> </message> <message> <source>The transaction history was successfully saved to %1.</source> <translation>Историята с транзакциите беше успешно запазена в %1.</translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>CSV файл (*.csv)</translation> </message> <message> <source>Confirmed</source> <translation>Потвърдени</translation> </message> <message> <source>Date</source> <translation>Дата</translation> </message> <message> <source>Type</source> <translation>Тип</translation> </message> <message> <source>Label</source> <translation>Име</translation> </message> <message> <source>Address</source> <translation>Адрес</translation> </message> <message> <source>ID</source> <translation>ИД</translation> </message> <message> <source>Range:</source> <translation>От:</translation> </message> <message> <source>to</source> <translation>до</translation> </message> </context> <context> <name>UnitDisplayStatusBarControl</name> </context> <context> <name>WalletFrame</name> <message> <source>No wallet has been loaded.</source> <translation>Няма зареден портфейл.</translation> </message> </context> <context> <name>WalletModel</name> <message> <source>Send Coins</source> <translation>Изпращане</translation> </message> </context> <context> <name>WalletView</name> <message> <source>&amp;Export</source> <translation>Изнеси</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>Запишете данните от текущия раздел във файл</translation> </message> <message> <source>Backup Wallet</source> <translation>Запазване на портфейла</translation> </message> <message> <source>Wallet Data (*.dat)</source> <translation>Информация за портфейла (*.dat)</translation> </message> <message> <source>Backup Failed</source> <translation>Неуспешно запазване на портфейла</translation> </message> <message> <source>There was an error trying to save the wallet data to %1.</source> <translation>Възникна грешка при запазването на информацията за портфейла в %1.</translation> </message> <message> <source>The wallet data was successfully saved to %1.</source> <translation>Информацията за портфейла беше успешно запазена в %1.</translation> </message> <message> <source>Backup Successful</source> <translation>Успешно запазване на портфейла</translation> </message> </context> <context> <name>facilecoin-core</name> <message> <source>Options:</source> <translation>Опции:</translation> </message> <message> <source>Specify data directory</source> <translation>Определете директория за данните</translation> </message> <message> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Свържете се към сървър за да можете да извлечете адресите на пиърите след което се разкачете.</translation> </message> <message> <source>Specify your own public address</source> <translation>Въведете Ваш публичен адрес</translation> </message> <message> <source>Use the test network</source> <translation>Използвайте тестовата мрежа</translation> </message> <message> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Приемайте връзки отвън.(по подразбиране:1 в противен случай -proxy или -connect)</translation> </message> <message> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Внимание: -paytxfee има голяма стойност! Това е таксата за транзакциите, която ще платите ако направите транзакция.</translation> </message> <message> <source>Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times.</source> <translation>Сложете в бял списък пиъри,свързващи се от дадената интернет маска или айпи адрес.Може да бъде заложено неколкократно.</translation> </message> <message> <source>(default: 1)</source> <translation>(по подразбиране 1)</translation> </message> <message> <source>&lt;category&gt; can be:</source> <translation>&lt;category&gt; може да бъде:</translation> </message> <message> <source>Connection options:</source> <translation>Настройки на връзката:</translation> </message> <message> <source>Do you want to rebuild the block database now?</source> <translation>Желаете ли да пресъздадете базата данни с блокове сега?</translation> </message> <message> <source>Error initializing block database</source> <translation>Грешка в пускането на базата данни с блокове</translation> </message> <message> <source>Error: Disk space is low!</source> <translation>Грешка: мястото на диска е малко!</translation> </message> <message> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Провалено "слушане" на всеки порт. Използвайте -listen=0 ако искате това.</translation> </message> <message> <source>Importing...</source> <translation>Внасяне...</translation> </message> <message> <source>Verifying blocks...</source> <translation>Проверка на блоковете...</translation> </message> <message> <source>Verifying wallet...</source> <translation>Проверка на портфейла...</translation> </message> <message> <source>Wallet options:</source> <translation>Настройки на портфейла:</translation> </message> <message> <source>Set the number of threads for coin generation if enabled (-1 = all cores, default: %d)</source> <translation>Заложете броя на нишки за генерация на монети ако е включено(-1 = всички ядра, по подразбиране: %d)</translation> </message> <message> <source>Warning: -maxtxfee is set very high! Fees this large could be paid on a single transaction.</source> <translation>Внимание: -maxtxfee има много висока стойност! Толкова високи такси могат да бъдат заплатени на една транзакция.</translation> </message> <message> <source>Connect through SOCKS5 proxy</source> <translation>Свързване чрез SOCKS5 прокси</translation> </message> <message> <source>Copyright (C) 2009-%i The FacileCoin Core Developers</source> <translation>Всички права запазени (C) 2009-%i Доставчиците на Биткойн</translation> </message> <message> <source>Information</source> <translation>Данни</translation> </message> <message> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: '%s'</source> <translation>Невалидна сума за -minrelaytxfee=&lt;amount&gt;: '%s'</translation> </message> <message> <source>Invalid amount for -mintxfee=&lt;amount&gt;: '%s'</source> <translation>Невалидна сума за -mintxfee=&lt;amount&gt;: '%s'</translation> </message> <message> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Изпрати локализиращата или дебъг информацията към конзолата, вместо файлът debug.log</translation> </message> <message> <source>This is experimental software.</source> <translation>Това е експериментален софтуер.</translation> </message> <message> <source>Transaction amount too small</source> <translation>Сумата на трансакцията е твърде малка</translation> </message> <message> <source>Transaction amounts must be positive</source> <translation>Сумите на трансакциите трябва да са положителни</translation> </message> <message> <source>Transaction too large</source> <translation>Трансакцията е твърде голяма</translation> </message> <message> <source>Username for JSON-RPC connections</source> <translation>Потребителско име за JSON-RPC връзките</translation> </message> <message> <source>Warning</source> <translation>Предупреждение</translation> </message> <message> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Внимание: Използвате остаряла версия, необходимо е обновление!</translation> </message> <message> <source>on startup</source> <translation>по време на стартирането</translation> </message> <message> <source>Password for JSON-RPC connections</source> <translation>Парола за JSON-RPC връзките</translation> </message> <message> <source>Upgrade wallet to latest format</source> <translation>Обновяване на портфейла до най-новия формат</translation> </message> <message> <source>Rescan the block chain for missing wallet transactions</source> <translation>Повторно сканиране на блок-връзка за липсващи портфейлни трансакции</translation> </message> <message> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Използвайте OpenSSL (https) за JSON-RPC връзките</translation> </message> <message> <source>This help message</source> <translation>Това помощно съобщение</translation> </message> <message> <source>Loading addresses...</source> <translation>Зареждане на адресите...</translation> </message> <message> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Грешка при зареждане на wallet.dat: портфейлът е повреден</translation> </message> <message> <source>Error loading wallet.dat</source> <translation>Грешка при зареждане на wallet.dat</translation> </message> <message> <source>Invalid -proxy address: '%s'</source> <translation>Невалиден -proxy address: '%s'</translation> </message> <message> <source>Specify configuration file (default: %s)</source> <translation>Назовете конфигурационен файл(по подразбиране %s)</translation> </message> <message> <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source> <translation>Задайте време на изключване при проблеми със свързването в милисекунди(минимум:1, по подразбиране %d)</translation> </message> <message> <source>Specify pid file (default: %s)</source> <translation>Задайте pid файл(по подразбиране: %s)</translation> </message> <message> <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s'</source> <translation>Невалидна сума за -paytxfee=&lt;amount&gt;: '%s'</translation> </message> <message> <source>Insufficient funds</source> <translation>Недостатъчно средства</translation> </message> <message> <source>Loading block index...</source> <translation>Зареждане на блок индекса...</translation> </message> <message> <source>Loading wallet...</source> <translation>Зареждане на портфейла...</translation> </message> <message> <source>Rescanning...</source> <translation>Преразглеждане на последовтелността от блокове...</translation> </message> <message> <source>Done loading</source> <translation>Зареждането е завършено</translation> </message> <message> <source>Error</source> <translation>Грешка</translation> </message> </context> </TS>
{'content_hash': 'e38e1ca196ad53174a3696b652725a77', 'timestamp': '', 'source': 'github', 'line_count': 2658, 'max_line_length': 343, 'avg_line_length': 34.89804364183597, 'alnum_prop': 0.6418676354855054, 'repo_name': 'facilecoin/facilecoin-core', 'id': '794bdf22ecd7507cffcb2bf69dec9e358808f088', 'size': '106370', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/qt/locale/facilecoin_bg.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '7639'}, {'name': 'C', 'bytes': '358032'}, {'name': 'C++', 'bytes': '3503353'}, {'name': 'CSS', 'bytes': '1127'}, {'name': 'HTML', 'bytes': '50621'}, {'name': 'M4', 'bytes': '141704'}, {'name': 'Makefile', 'bytes': '850930'}, {'name': 'Objective-C', 'bytes': '2023'}, {'name': 'Objective-C++', 'bytes': '7258'}, {'name': 'Protocol Buffer', 'bytes': '2317'}, {'name': 'Python', 'bytes': '149459'}, {'name': 'Shell', 'bytes': '694448'}]}
from __future__ import unicode_literals class MockRegion(object): def __init__(self, a, b): self.a = int(a) self.b = int(b) def begin(self): return self.a def empty(self): return self.a == self.b class MockRegionSet(object): def __init__(self): self.regions = [] def add(self, region): self.regions.append(region) def clear(self): self.regions = [] def __getitem__(self, key): return self.regions[key] class MockView(object): def __init__(self, buffer): self.buffer = buffer self.regions = MockRegionSet() def size(self): return len(self.buffer) def substr(self, region): return self.buffer[region.a:region.b] def replace(self, edit, region, string): self.buffer = string self.regions.clear() self.regions.add(MockRegion(len(self.buffer), len(self.buffer))) def sel(self): return self.regions class MockSublimePackage(object): Region = MockRegion
{'content_hash': '1792f0290d0922cee7bc7a19eb00255a', 'timestamp': '', 'source': 'github', 'line_count': 55, 'max_line_length': 68, 'avg_line_length': 17.418181818181818, 'alnum_prop': 0.6450939457202505, 'repo_name': 'waynemoore/sublime-gherkin-formatter', 'id': 'ffe1105e3d3fa4bf585899009f33653ccceb489c', 'size': '958', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/mocks.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '15276'}, {'name': 'Ruby', 'bytes': '1188'}]}
<div style="float: right"><img src="http://sunsetlakesoftware.com/sites/default/files/GPUImageLogo.png" /></div> <a href="https://zenodo.org/record/10416#.U5YGaF773Md"><img src="https://zenodo.org/badge/doi/10.5281/zenodo.10416.png" /></a> Brad Larson http://www.sunsetlakesoftware.com [@bradlarson](http://twitter.com/bradlarson) [email protected] ## Overview ## The GPUImage framework is a BSD-licensed iOS library that lets you apply GPU-accelerated filters and other effects to images, live camera video, and movies. In comparison to Core Image (part of iOS 5.0), GPUImage allows you to write your own custom filters, supports deployment to iOS 4.0, and has a simpler interface. However, it currently lacks some of the more advanced features of Core Image, such as facial detection. For massively parallel operations like processing images or live video frames, GPUs have some significant performance advantages over CPUs. On an iPhone 4, a simple image filter can be over 100 times faster to perform on the GPU than an equivalent CPU-based filter. However, running custom filters on the GPU requires a lot of code to set up and maintain an OpenGL ES 2.0 rendering target for these filters. I created a sample project to do this: http://www.sunsetlakesoftware.com/2010/10/22/gpu-accelerated-video-processing-mac-and-ios and found that there was a lot of boilerplate code I had to write in its creation. Therefore, I put together this framework that encapsulates a lot of the common tasks you'll encounter when processing images and video and made it so that you don't need to care about the OpenGL ES 2.0 underpinnings. This framework compares favorably to Core Image when handling video, taking only 2.5 ms on an iPhone 4 to upload a frame from the camera, apply a gamma filter, and display, versus 106 ms for the same operation using Core Image. CPU-based processing takes 460 ms, making GPUImage 40X faster than Core Image for this operation on this hardware, and 184X faster than CPU-bound processing. On an iPhone 4S, GPUImage is only 4X faster than Core Image for this case, and 102X faster than CPU-bound processing. However, for more complex operations like Gaussian blurs at larger radii, Core Image currently outpaces GPUImage. ## License ## BSD-style, with the full license available with the framework in License.txt. ## Technical requirements ## - OpenGL ES 2.0: Applications using this will not run on the original iPhone, iPhone 3G, and 1st and 2nd generation iPod touches - iOS 4.1 as a deployment target (4.0 didn't have some extensions needed for movie reading). iOS 4.3 is needed as a deployment target if you wish to show live video previews when taking a still photo. - iOS 5.0 SDK to build - Devices must have a camera to use camera-related functionality (obviously) - The framework uses automatic reference counting (ARC), but should support projects using both ARC and manual reference counting if added as a subproject as explained below. For manual reference counting applications targeting iOS 4.x, you'll need add -fobjc-arc to the Other Linker Flags for your application project. ## General architecture ## GPUImage uses OpenGL ES 2.0 shaders to perform image and video manipulation much faster than could be done in CPU-bound routines. However, it hides the complexity of interacting with the OpenGL ES API in a simplified Objective-C interface. This interface lets you define input sources for images and video, attach filters in a chain, and send the resulting processed image or video to the screen, to a UIImage, or to a movie on disk. Images or frames of video are uploaded from source objects, which are subclasses of GPUImageOutput. These include GPUImageVideoCamera (for live video from an iOS camera), GPUImageStillCamera (for taking photos with the camera), GPUImagePicture (for still images), and GPUImageMovie (for movies). Source objects upload still image frames to OpenGL ES as textures, then hand those textures off to the next objects in the processing chain. Filters and other subsequent elements in the chain conform to the GPUImageInput protocol, which lets them take in the supplied or processed texture from the previous link in the chain and do something with it. Objects one step further down the chain are considered targets, and processing can be branched by adding multiple targets to a single output or filter. For example, an application that takes in live video from the camera, converts that video to a sepia tone, then displays the video onscreen would set up a chain looking something like the following: GPUImageVideoCamera -> GPUImageSepiaFilter -> GPUImageView ## Adding the static library to your iOS project ## Note: if you want to use this in a Swift project, you need to use the steps in the "Adding this as a framework" section instead of the following. Swift needs modules for third-party code. Once you have the latest source code for the framework, it's fairly straightforward to add it to your application. Start by dragging the GPUImage.xcodeproj file into your application's Xcode project to embed the framework in your project. Next, go to your application's target and add GPUImage as a Target Dependency. Finally, you'll want to drag the libGPUImage.a library from the GPUImage framework's Products folder to the Link Binary With Libraries build phase in your application's target. GPUImage needs a few other frameworks to be linked into your application, so you'll need to add the following as linked libraries in your application target: - CoreMedia - CoreVideo - OpenGLES - AVFoundation - QuartzCore You'll also need to find the framework headers, so within your project's build settings set the Header Search Paths to the relative path from your application to the framework/ subdirectory within the GPUImage source directory. Make this header search path recursive. To use the GPUImage classes within your application, simply include the core framework header using the following: #import "GPUImage.h" As a note: if you run into the error "Unknown class GPUImageView in Interface Builder" or the like when trying to build an interface with Interface Builder, you may need to add -ObjC to your Other Linker Flags in your project's build settings. Also, if you need to deploy this to iOS 4.x, it appears that the current version of Xcode (4.3) requires that you weak-link the Core Video framework in your final application or you see crashes with the message "Symbol not found: _CVOpenGLESTextureCacheCreate" when you create an archive for upload to the App Store or for ad hoc distribution. To do this, go to your project's Build Phases tab, expand the Link Binary With Libraries group, and find CoreVideo.framework in the list. Change the setting for it in the far right of the list from Required to Optional. Additionally, this is an ARC-enabled framework, so if you want to use this within a manual reference counted application targeting iOS 4.x, you'll need to add -fobjc-arc to your Other Linker Flags as well. ### Building a static library at the command line ### If you don't want to include the project as a dependency in your application's Xcode project, you can build a universal static library for the iOS Simulator or device. To do this, run `build.sh` at the command line. The resulting library and header files will be located at `build/Release-iphone`. You may also change the version of the iOS SDK by changing the `IOSSDK_VER` variable in `build.sh` (all available versions can be found using `xcodebuild -showsdks`). ## Adding this as a framework (module) to your Mac or iOS project ## Xcode 6 and iOS 8 support the use of full frameworks, as does the Mac, which simplifies the process of adding this to your application. To add this to your application, I recommend dragging the .xcodeproj project file into your application's project (as you would in the static library target). For your application, go to its target build settings and choose the Build Phases tab. Under the Target Dependencies grouping, add GPUImageFramework on iOS (not GPUImage, which builds the static library) or GPUImage on the Mac. Under the Link Binary With Libraries section, add GPUImage.framework. This should cause GPUImage to build as a framework. Under Xcode 6, this will also build as a module, which will allow you to use this in Swift projects. When set up as above, you should just need to use import GPUImage to pull it in. You then need to add a new Copy Files build phase, set the Destination to Frameworks, and add the GPUImage.framework build product to that. This will allow the framework to be bundled with your application (otherwise, you'll see cryptic "dyld: Library not loaded: @rpath/GPUImage.framework/GPUImage" errors on execution). ### Documentation ### Documentation is generated from header comments using appledoc. To build the documentation, switch to the "Documentation" scheme in Xcode. You should ensure that "APPLEDOC_PATH" (a User-Defined build setting) points to an appledoc binary, available on <a href="https://github.com/tomaz/appledoc">Github</a> or through <a href="https://github.com/mxcl/homebrew">Homebrew</a>. It will also build and install a .docset file, which you can view with your favorite documentation tool. ## Performing common tasks ## ### Filtering live video ### To filter live video from an iOS device's camera, you can use code like the following: GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack]; videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; GPUImageFilter *customFilter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"CustomShader"]; GPUImageView *filteredVideoView = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, viewWidth, viewHeight)]; // Add the view somewhere so it's visible [videoCamera addTarget:customFilter]; [customFilter addTarget:filteredVideoView]; [videoCamera startCameraCapture]; This sets up a video source coming from the iOS device's back-facing camera, using a preset that tries to capture at 640x480. This video is captured with the interface being in portrait mode, where the landscape-left-mounted camera needs to have its video frames rotated before display. A custom filter, using code from the file CustomShader.fsh, is then set as the target for the video frames from the camera. These filtered video frames are finally displayed onscreen with the help of a UIView subclass that can present the filtered OpenGL ES texture that results from this pipeline. The fill mode of the GPUImageView can be altered by setting its fillMode property, so that if the aspect ratio of the source video is different from that of the view, the video will either be stretched, centered with black bars, or zoomed to fill. For blending filters and others that take in more than one image, you can create multiple outputs and add a single filter as a target for both of these outputs. The order with which the outputs are added as targets will affect the order in which the input images are blended or otherwise processed. Also, if you wish to enable microphone audio capture for recording to a movie, you'll need to set the audioEncodingTarget of the camera to be your movie writer, like for the following: videoCamera.audioEncodingTarget = movieWriter; ### Capturing and filtering a still photo ### To capture and filter still photos, you can use a process similar to the one for filtering video. Instead of a GPUImageVideoCamera, you use a GPUImageStillCamera: stillCamera = [[GPUImageStillCamera alloc] init]; stillCamera.outputImageOrientation = UIInterfaceOrientationPortrait; filter = [[GPUImageGammaFilter alloc] init]; [stillCamera addTarget:filter]; GPUImageView *filterView = (GPUImageView *)self.view; [filter addTarget:filterView]; [stillCamera startCameraCapture]; This will give you a live, filtered feed of the still camera's preview video. Note that this preview video is only provided on iOS 4.3 and higher, so you may need to set that as your deployment target if you wish to have this functionality. Once you want to capture a photo, you use a callback block like the following: [stillCamera capturePhotoProcessedUpToFilter:filter withCompletionHandler:^(UIImage *processedImage, NSError *error){ NSData *dataForJPEGFile = UIImageJPEGRepresentation(processedImage, 0.8); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSError *error2 = nil; if (![dataForJPEGFile writeToFile:[documentsDirectory stringByAppendingPathComponent:@"FilteredPhoto.jpg"] options:NSAtomicWrite error:&error2]) { return; } }]; The above code captures a full-size photo processed by the same filter chain used in the preview view and saves that photo to disk as a JPEG in the application's documents directory. Note that the framework currently can't handle images larger than 2048 pixels wide or high on older devices (those before the iPhone 4S, iPad 2, or Retina iPad) due to texture size limitations. This means that the iPhone 4, whose camera outputs still photos larger than this, won't be able to capture photos like this. A tiling mechanism is being implemented to work around this. All other devices should be able to capture and filter photos using this method. ### Processing a still image ### There are a couple of ways to process a still image and create a result. The first way you can do this is by creating a still image source object and manually creating a filter chain: UIImage *inputImage = [UIImage imageNamed:@"Lambeau.jpg"]; GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:inputImage]; GPUImageSepiaFilter *stillImageFilter = [[GPUImageSepiaFilter alloc] init]; [stillImageSource addTarget:stillImageFilter]; [stillImageFilter useNextFrameForImageCapture]; [stillImageSource processImage]; UIImage *currentFilteredVideoFrame = [stillImageFilter imageFromCurrentFramebuffer]; Note that for a manual capture of an image from a filter, you need to set -useNextFrameForImageCapture in order to tell the filter that you'll be needing to capture from it later. By default, GPUImage reuses framebuffers within filters to conserve memory, so if you need to hold on to a filter's framebuffer for manual image capture, you need to let it know ahead of time. For single filters that you wish to apply to an image, you can simply do the following: GPUImageSepiaFilter *stillImageFilter2 = [[GPUImageSepiaFilter alloc] init]; UIImage *quickFilteredImage = [stillImageFilter2 imageByFilteringImage:inputImage]; ### Writing a custom filter ### One significant advantage of this framework over Core Image on iOS (as of iOS 5.0) is the ability to write your own custom image and video processing filters. These filters are supplied as OpenGL ES 2.0 fragment shaders, written in the C-like OpenGL Shading Language. A custom filter is initialized with code like GPUImageFilter *customFilter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"CustomShader"]; where the extension used for the fragment shader is .fsh. Additionally, you can use the -initWithFragmentShaderFromString: initializer to provide the fragment shader as a string, if you would not like to ship your fragment shaders in your application bundle. Fragment shaders perform their calculations for each pixel to be rendered at that filter stage. They do this using the OpenGL Shading Language (GLSL), a C-like language with additions specific to 2-D and 3-D graphics. An example of a fragment shader is the following sepia-tone filter: varying highp vec2 textureCoordinate; uniform sampler2D inputImageTexture; void main() { lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); lowp vec4 outputColor; outputColor.r = (textureColor.r * 0.393) + (textureColor.g * 0.769) + (textureColor.b * 0.189); outputColor.g = (textureColor.r * 0.349) + (textureColor.g * 0.686) + (textureColor.b * 0.168); outputColor.b = (textureColor.r * 0.272) + (textureColor.g * 0.534) + (textureColor.b * 0.131); outputColor.a = 1.0; gl_FragColor = outputColor; } For an image filter to be usable within the GPUImage framework, the first two lines that take in the textureCoordinate varying (for the current coordinate within the texture, normalized to 1.0) and the inputImageTexture uniform (for the actual input image frame texture) are required. The remainder of the shader grabs the color of the pixel at this location in the passed-in texture, manipulates it in such a way as to produce a sepia tone, and writes that pixel color out to be used in the next stage of the processing pipeline. One thing to note when adding fragment shaders to your Xcode project is that Xcode thinks they are source code files. To work around this, you'll need to manually move your shader from the Compile Sources build phase to the Copy Bundle Resources one in order to get the shader to be included in your application bundle. ### Filtering and re-encoding a movie ### Movies can be loaded into the framework via the GPUImageMovie class, filtered, and then written out using a GPUImageMovieWriter. GPUImageMovieWriter is also fast enough to record video in realtime from an iPhone 4's camera at 640x480, so a direct filtered video source can be fed into it. Currently, GPUImageMovieWriter is fast enough to record live 720p video at up to 20 FPS on the iPhone 4, and both 720p and 1080p video at 30 FPS on the iPhone 4S (as well as on the new iPad). The following is an example of how you would load a sample movie, pass it through a pixellation filter, then record the result to disk as a 480 x 640 h.264 movie: movieFile = [[GPUImageMovie alloc] initWithURL:sampleURL]; pixellateFilter = [[GPUImagePixellateFilter alloc] init]; [movieFile addTarget:pixellateFilter]; NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Movie.m4v"]; unlink([pathToMovie UTF8String]); NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie]; movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(480.0, 640.0)]; [pixellateFilter addTarget:movieWriter]; movieWriter.shouldPassthroughAudio = YES; movieFile.audioEncodingTarget = movieWriter; [movieFile enableSynchronizedEncodingUsingMovieWriter:movieWriter]; [movieWriter startRecording]; [movieFile startProcessing]; Once recording is finished, you need to remove the movie recorder from the filter chain and close off the recording using code like the following: [pixellateFilter removeTarget:movieWriter]; [movieWriter finishRecording]; A movie won't be usable until it has been finished off, so if this is interrupted before this point, the recording will be lost. ### Interacting with OpenGL ES ### GPUImage can both export and import textures from OpenGL ES through the use of its GPUImageTextureOutput and GPUImageTextureInput classes, respectively. This lets you record a movie from an OpenGL ES scene that is rendered to a framebuffer object with a bound texture, or filter video or images and then feed them into OpenGL ES as a texture to be displayed in the scene. The one caution with this approach is that the textures used in these processes must be shared between GPUImage's OpenGL ES context and any other context via a share group or something similar. ## Built-in filters ## There are currently 125 built-in filters, divided into the following categories: ### Color adjustments ### - **GPUImageBrightnessFilter**: Adjusts the brightness of the image - *brightness*: The adjusted brightness (-1.0 - 1.0, with 0.0 as the default) - **GPUImageExposureFilter**: Adjusts the exposure of the image - *exposure*: The adjusted exposure (-10.0 - 10.0, with 0.0 as the default) - **GPUImageContrastFilter**: Adjusts the contrast of the image - *contrast*: The adjusted contrast (0.0 - 4.0, with 1.0 as the default) - **GPUImageSaturationFilter**: Adjusts the saturation of an image - *saturation*: The degree of saturation or desaturation to apply to the image (0.0 - 2.0, with 1.0 as the default) - **GPUImageGammaFilter**: Adjusts the gamma of an image - *gamma*: The gamma adjustment to apply (0.0 - 3.0, with 1.0 as the default) - **GPUImageLevelsFilter**: Photoshop-like levels adjustment. The min, max, minOut and maxOut parameters are floats in the range [0, 1]. If you have parameters from Photoshop in the range [0, 255] you must first convert them to be [0, 1]. The gamma/mid parameter is a float >= 0. This matches the value from Photoshop. If you want to apply levels to RGB as well as individual channels you need to use this filter twice - first for the individual channels and then for all channels. - **GPUImageColorMatrixFilter**: Transforms the colors of an image by applying a matrix to them - *colorMatrix*: A 4x4 matrix used to transform each color in an image - *intensity*: The degree to which the new transformed color replaces the original color for each pixel - **GPUImageRGBFilter**: Adjusts the individual RGB channels of an image - *red*: Normalized values by which each color channel is multiplied. The range is from 0.0 up, with 1.0 as the default. - *green*: - *blue*: - **GPUImageHueFilter**: Adjusts the hue of an image - *hue*: The hue angle, in degrees. 90 degrees by default - **GPUImageVibranceFilter**: Adjusts the vibrance of an image - *vibrance*: The vibrance adjustment to apply, using 0.0 as the default, and a suggested min/max of around -1.2 and 1.2, respectively. - **GPUImageWhiteBalanceFilter**: Adjusts the white balance of an image. - *temperature*: The temperature to adjust the image by, in ºK. A value of 4000 is very cool and 7000 very warm. The default value is 5000. Note that the scale between 4000 and 5000 is nearly as visually significant as that between 5000 and 7000. - *tint*: The tint to adjust the image by. A value of -200 is *very* green and 200 is *very* pink. The default value is 0. - **GPUImageToneCurveFilter**: Adjusts the colors of an image based on spline curves for each color channel. - *redControlPoints*: - *greenControlPoints*: - *blueControlPoints*: - *rgbCompositeControlPoints*: The tone curve takes in a series of control points that define the spline curve for each color component, or for all three in the composite. These are stored as NSValue-wrapped CGPoints in an NSArray, with normalized X and Y coordinates from 0 - 1. The defaults are (0,0), (0.5,0.5), (1,1). - **GPUImageHighlightShadowFilter**: Adjusts the shadows and highlights of an image - *shadows*: Increase to lighten shadows, from 0.0 to 1.0, with 0.0 as the default. - *highlights*: Decrease to darken highlights, from 1.0 to 0.0, with 1.0 as the default. - **GPUImageHighlightShadowTintFilter**: Allows you to tint the shadows and highlights of an image independently using a color and intensity - *shadowTintColor*: Shadow tint RGB color (GPUVector4). Default: `{1.0f, 0.0f, 0.0f, 1.0f}` (red). - *highlightTintColor*: Highlight tint RGB color (GPUVector4). Default: `{0.0f, 0.0f, 1.0f, 1.0f}` (blue). - *shadowTintIntensity*: Shadow tint intensity, from 0.0 to 1.0. Default: 0.0 - *highlightTintIntensity*: Highlight tint intensity, from 0.0 to 1.0, with 0.0 as the default. - **GPUImageLookupFilter**: Uses an RGB color lookup image to remap the colors in an image. First, use your favourite photo editing application to apply a filter to lookup.png from GPUImage/framework/Resources. For this to work properly each pixel color must not depend on other pixels (e.g. blur will not work). If you need a more complex filter you can create as many lookup tables as required. Once ready, use your new lookup.png file as a second input for GPUImageLookupFilter. - **GPUImageAmatorkaFilter**: A photo filter based on a Photoshop action by Amatorka: http://amatorka.deviantart.com/art/Amatorka-Action-2-121069631 . If you want to use this effect you have to add lookup_amatorka.png from the GPUImage Resources folder to your application bundle. - **GPUImageMissEtikateFilter**: A photo filter based on a Photoshop action by Miss Etikate: http://miss-etikate.deviantart.com/art/Photoshop-Action-15-120151961 . If you want to use this effect you have to add lookup_miss_etikate.png from the GPUImage Resources folder to your application bundle. - **GPUImageSoftEleganceFilter**: Another lookup-based color remapping filter. If you want to use this effect you have to add lookup_soft_elegance_1.png and lookup_soft_elegance_2.png from the GPUImage Resources folder to your application bundle. - **GPUImageSkinToneFilter**: A skin-tone adjustment filter that affects a unique range of light skin-tone colors and adjusts the pink/green or pink/orange range accordingly. Default values are targetted at fair caucasian skin, but can be adjusted as required. - *skinToneAdjust*: Amount to adjust skin tone. Default: 0.0, suggested min/max: -0.3 and 0.3 respectively. - *skinHue*: Skin hue to be detected. Default: 0.05 (fair caucasian to reddish skin). - *skinHueThreshold*: Amount of variance in skin hue. Default: 40.0. - *maxHueShift*: Maximum amount of hue shifting allowed. Default: 0.25. - *maxSaturationShift* = Maximum amount of saturation to be shifted (when using orange). Default: 0.4. - *upperSkinToneColor* = `GPUImageSkinToneUpperColorGreen` or `GPUImageSkinToneUpperColorOrange` - **GPUImageColorInvertFilter**: Inverts the colors of an image - **GPUImageGrayscaleFilter**: Converts an image to grayscale (a slightly faster implementation of the saturation filter, without the ability to vary the color contribution) - **GPUImageMonochromeFilter**: Converts the image to a single-color version, based on the luminance of each pixel - *intensity*: The degree to which the specific color replaces the normal image color (0.0 - 1.0, with 1.0 as the default) - *color*: The color to use as the basis for the effect, with (0.6, 0.45, 0.3, 1.0) as the default. - **GPUImageFalseColorFilter**: Uses the luminance of the image to mix between two user-specified colors - *firstColor*: The first and second colors specify what colors replace the dark and light areas of the image, respectively. The defaults are (0.0, 0.0, 0.5) amd (1.0, 0.0, 0.0). - *secondColor*: - **GPUImageHazeFilter**: Used to add or remove haze (similar to a UV filter) - *distance*: Strength of the color applied. Default 0. Values between -.3 and .3 are best. - *slope*: Amount of color change. Default 0. Values between -.3 and .3 are best. - **GPUImageSepiaFilter**: Simple sepia tone filter - *intensity*: The degree to which the sepia tone replaces the normal image color (0.0 - 1.0, with 1.0 as the default) - **GPUImageOpacityFilter**: Adjusts the alpha channel of the incoming image - *opacity*: The value to multiply the incoming alpha channel for each pixel by (0.0 - 1.0, with 1.0 as the default) - **GPUImageSolidColorGenerator**: This outputs a generated image with a solid color. You need to define the image size using -forceProcessingAtSize: - *color*: The color, in a four component format, that is used to fill the image. - **GPUImageLuminanceThresholdFilter**: Pixels with a luminance above the threshold will appear white, and those below will be black - *threshold*: The luminance threshold, from 0.0 to 1.0, with a default of 0.5 - **GPUImageAdaptiveThresholdFilter**: Determines the local luminance around a pixel, then turns the pixel black if it is below that local luminance and white if above. This can be useful for picking out text under varying lighting conditions. - *blurRadiusInPixels*: A multiplier for the background averaging blur radius in pixels, with a default of 4. - **GPUImageAverageLuminanceThresholdFilter**: This applies a thresholding operation where the threshold is continually adjusted based on the average luminance of the scene. - *thresholdMultiplier*: This is a factor that the average luminance will be multiplied by in order to arrive at the final threshold to use. By default, this is 1.0. - **GPUImageHistogramFilter**: This analyzes the incoming image and creates an output histogram with the frequency at which each color value occurs. The output of this filter is a 3-pixel-high, 256-pixel-wide image with the center (vertical) pixels containing pixels that correspond to the frequency at which various color values occurred. Each color value occupies one of the 256 width positions, from 0 on the left to 255 on the right. This histogram can be generated for individual color channels (kGPUImageHistogramRed, kGPUImageHistogramGreen, kGPUImageHistogramBlue), the luminance of the image (kGPUImageHistogramLuminance), or for all three color channels at once (kGPUImageHistogramRGB). - *downsamplingFactor*: Rather than sampling every pixel, this dictates what fraction of the image is sampled. By default, this is 16 with a minimum of 1. This is needed to keep from saturating the histogram, which can only record 256 pixels for each color value before it becomes overloaded. - **GPUImageHistogramGenerator**: This is a special filter, in that it's primarily intended to work with the GPUImageHistogramFilter. It generates an output representation of the color histograms generated by GPUImageHistogramFilter, but it could be repurposed to display other kinds of values. It takes in an image and looks at the center (vertical) pixels. It then plots the numerical values of the RGB components in separate colored graphs in an output texture. You may need to force a size for this filter in order to make its output visible. - **GPUImageAverageColor**: This processes an input image and determines the average color of the scene, by averaging the RGBA components for each pixel in the image. A reduction process is used to progressively downsample the source image on the GPU, followed by a short averaging calculation on the CPU. The output from this filter is meaningless, but you need to set the colorAverageProcessingFinishedBlock property to a block that takes in four color components and a frame time and does something with them. - **GPUImageLuminosity**: Like the GPUImageAverageColor, this reduces an image to its average luminosity. You need to set the luminosityProcessingFinishedBlock to handle the output of this filter, which just returns a luminosity value and a frame time. - **GPUImageChromaKeyFilter**: For a given color in the image, sets the alpha channel to 0. This is similar to the GPUImageChromaKeyBlendFilter, only instead of blending in a second image for a matching color this doesn't take in a second image and just turns a given color transparent. - *thresholdSensitivity*: How close a color match needs to exist to the target color to be replaced (default of 0.4) - *smoothing*: How smoothly to blend for the color match (default of 0.1) ### Image processing ### - **GPUImageTransformFilter**: This applies an arbitrary 2-D or 3-D transformation to an image - *affineTransform*: This takes in a CGAffineTransform to adjust an image in 2-D - *transform3D*: This takes in a CATransform3D to manipulate an image in 3-D - *ignoreAspectRatio*: By default, the aspect ratio of the transformed image is maintained, but this can be set to YES to make the transformation independent of aspect ratio - **GPUImageCropFilter**: This crops an image to a specific region, then passes only that region on to the next stage in the filter - *cropRegion*: A rectangular area to crop out of the image, normalized to coordinates from 0.0 - 1.0. The (0.0, 0.0) position is in the upper left of the image. - **GPUImageLanczosResamplingFilter**: This lets you up- or downsample an image using Lanczos resampling, which results in noticeably better quality than the standard linear or trilinear interpolation. Simply use -forceProcessingAtSize: to set the target output resolution for the filter, and the image will be resampled for that new size. - **GPUImageSharpenFilter**: Sharpens the image - *sharpness*: The sharpness adjustment to apply (-4.0 - 4.0, with 0.0 as the default) - **GPUImageUnsharpMaskFilter**: Applies an unsharp mask - *blurRadiusInPixels*: The blur radius of the underlying Gaussian blur. The default is 4.0. - *intensity*: The strength of the sharpening, from 0.0 on up, with a default of 1.0 - **GPUImageGaussianBlurFilter**: A hardware-optimized, variable-radius Gaussian blur - *texelSpacingMultiplier*: A multiplier for the spacing between texels, ranging from 0.0 on up, with a default of 1.0. Adjusting this may slightly increase the blur strength, but will introduce artifacts in the result. Highly recommend using other parameters first, before touching this one. - *blurRadiusInPixels*: A radius in pixels to use for the blur, with a default of 2.0. This adjusts the sigma variable in the Gaussian distribution function. - *blurRadiusAsFractionOfImageWidth*: - *blurRadiusAsFractionOfImageHeight*: Setting these properties will allow the blur radius to scale with the size of the image - *blurPasses*: The number of times to sequentially blur the incoming image. The more passes, the slower the filter. - **GPUImageBoxBlurFilter**: A hardware-optimized, variable-radius box blur - *texelSpacingMultiplier*: A multiplier for the spacing between texels, ranging from 0.0 on up, with a default of 1.0. Adjusting this may slightly increase the blur strength, but will introduce artifacts in the result. Highly recommend using other parameters first, before touching this one. - *blurRadiusInPixels*: A radius in pixels to use for the blur, with a default of 2.0. This adjusts the sigma variable in the Gaussian distribution function. - *blurRadiusAsFractionOfImageWidth*: - *blurRadiusAsFractionOfImageHeight*: Setting these properties will allow the blur radius to scale with the size of the image - *blurPasses*: The number of times to sequentially blur the incoming image. The more passes, the slower the filter. - **GPUImageSingleComponentGaussianBlurFilter**: A modification of the GPUImageGaussianBlurFilter that operates only on the red component - *texelSpacingMultiplier*: A multiplier for the spacing between texels, ranging from 0.0 on up, with a default of 1.0. Adjusting this may slightly increase the blur strength, but will introduce artifacts in the result. Highly recommend using other parameters first, before touching this one. - *blurRadiusInPixels*: A radius in pixels to use for the blur, with a default of 2.0. This adjusts the sigma variable in the Gaussian distribution function. - *blurRadiusAsFractionOfImageWidth*: - *blurRadiusAsFractionOfImageHeight*: Setting these properties will allow the blur radius to scale with the size of the image - *blurPasses*: The number of times to sequentially blur the incoming image. The more passes, the slower the filter. - **GPUImageGaussianSelectiveBlurFilter**: A Gaussian blur that preserves focus within a circular region - *blurRadiusInPixels*: A radius in pixels to use for the blur, with a default of 5.0. This adjusts the sigma variable in the Gaussian distribution function. - *excludeCircleRadius*: The radius of the circular area being excluded from the blur - *excludeCirclePoint*: The center of the circular area being excluded from the blur - *excludeBlurSize*: The size of the area between the blurred portion and the clear circle - *aspectRatio*: The aspect ratio of the image, used to adjust the circularity of the in-focus region. By default, this matches the image aspect ratio, but you can override this value. - **GPUImageGaussianBlurPositionFilter**: The inverse of the GPUImageGaussianSelectiveBlurFilter, applying the blur only within a certain circle - *blurSize*: A multiplier for the size of the blur, ranging from 0.0 on up, with a default of 1.0 - *blurCenter*: Center for the blur, defaults to 0.5, 0.5 - *blurRadius*: Radius for the blur, defaults to 1.0 - **GPUImageiOSBlurFilter**: An attempt to replicate the background blur used on iOS 7 in places like the control center. - *blurRadiusInPixels*: A radius in pixels to use for the blur, with a default of 12.0. This adjusts the sigma variable in the Gaussian distribution function. - *saturation*: Saturation ranges from 0.0 (fully desaturated) to 2.0 (max saturation), with 0.8 as the normal level - *downsampling*: The degree to which to downsample, then upsample the incoming image to minimize computations within the Gaussian blur, with a default of 4.0. - **GPUImageMedianFilter**: Takes the median value of the three color components, over a 3x3 area - **GPUImageBilateralFilter**: A bilateral blur, which tries to blur similar color values while preserving sharp edges - *texelSpacingMultiplier*: A multiplier for the spacing between texel reads, ranging from 0.0 on up, with a default of 4.0 - *distanceNormalizationFactor*: A normalization factor for the distance between central color and sample color, with a default of 8.0. - **GPUImageTiltShiftFilter**: A simulated tilt shift lens effect - *blurRadiusInPixels*: The radius of the underlying blur, in pixels. This is 7.0 by default. - *topFocusLevel*: The normalized location of the top of the in-focus area in the image, this value should be lower than bottomFocusLevel, default 0.4 - *bottomFocusLevel*: The normalized location of the bottom of the in-focus area in the image, this value should be higher than topFocusLevel, default 0.6 - *focusFallOffRate*: The rate at which the image gets blurry away from the in-focus region, default 0.2 - **GPUImage3x3ConvolutionFilter**: Runs a 3x3 convolution kernel against the image - *convolutionKernel*: The convolution kernel is a 3x3 matrix of values to apply to the pixel and its 8 surrounding pixels. The matrix is specified in row-major order, with the top left pixel being one.one and the bottom right three.three. If the values in the matrix don't add up to 1.0, the image could be brightened or darkened. - **GPUImageSobelEdgeDetectionFilter**: Sobel edge detection, with edges highlighted in white - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *edgeStrength*: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0. - **GPUImagePrewittEdgeDetectionFilter**: Prewitt edge detection, with edges highlighted in white - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *edgeStrength*: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0. - **GPUImageThresholdEdgeDetectionFilter**: Performs Sobel edge detection, but applies a threshold instead of giving gradual strength values - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *edgeStrength*: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0. - *threshold*: Any edge above this threshold will be black, and anything below white. Ranges from 0.0 to 1.0, with 0.8 as the default - **GPUImageCannyEdgeDetectionFilter**: This uses the full Canny process to highlight one-pixel-wide edges - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *blurRadiusInPixels*: The underlying blur radius for the Gaussian blur. Default is 2.0. - *blurTexelSpacingMultiplier*: The underlying blur texel spacing multiplier. Default is 1.0. - *upperThreshold*: Any edge with a gradient magnitude above this threshold will pass and show up in the final result. Default is 0.4. - *lowerThreshold*: Any edge with a gradient magnitude below this threshold will fail and be removed from the final result. Default is 0.1. - **GPUImageHarrisCornerDetectionFilter**: Runs the Harris corner detection algorithm on an input image, and produces an image with those corner points as white pixels and everything else black. The cornersDetectedBlock can be set, and you will be provided with a list of corners (in normalized 0..1 X, Y coordinates) within that callback for whatever additional operations you want to perform. - *blurRadiusInPixels*: The radius of the underlying Gaussian blur. The default is 2.0. - *sensitivity*: An internal scaling factor applied to adjust the dynamic range of the cornerness maps generated in the filter. The default is 5.0. - *threshold*: The threshold at which a point is detected as a corner. This can vary significantly based on the size, lighting conditions, and iOS device camera type, so it might take a little experimentation to get right for your cases. Default is 0.20. - **GPUImageNobleCornerDetectionFilter**: Runs the Noble variant on the Harris corner detector. It behaves as described above for the Harris detector. - *blurRadiusInPixels*: The radius of the underlying Gaussian blur. The default is 2.0. - *sensitivity*: An internal scaling factor applied to adjust the dynamic range of the cornerness maps generated in the filter. The default is 5.0. - *threshold*: The threshold at which a point is detected as a corner. This can vary significantly based on the size, lighting conditions, and iOS device camera type, so it might take a little experimentation to get right for your cases. Default is 0.2. - **GPUImageShiTomasiCornerDetectionFilter**: Runs the Shi-Tomasi feature detector. It behaves as described above for the Harris detector. - *blurRadiusInPixels*: The radius of the underlying Gaussian blur. The default is 2.0. - *sensitivity*: An internal scaling factor applied to adjust the dynamic range of the cornerness maps generated in the filter. The default is 1.5. - *threshold*: The threshold at which a point is detected as a corner. This can vary significantly based on the size, lighting conditions, and iOS device camera type, so it might take a little experimentation to get right for your cases. Default is 0.2. - **GPUImageNonMaximumSuppressionFilter**: Currently used only as part of the Harris corner detection filter, this will sample a 1-pixel box around each pixel and determine if the center pixel's red channel is the maximum in that area. If it is, it stays. If not, it is set to 0 for all color components. - **GPUImageXYDerivativeFilter**: An internal component within the Harris corner detection filter, this calculates the squared difference between the pixels to the left and right of this one, the squared difference of the pixels above and below this one, and the product of those two differences. - **GPUImageCrosshairGenerator**: This draws a series of crosshairs on an image, most often used for identifying machine vision features. It does not take in a standard image like other filters, but a series of points in its -renderCrosshairsFromArray:count: method, which does the actual drawing. You will need to force this filter to render at the particular output size you need. - *crosshairWidth*: The width, in pixels, of the crosshairs to be drawn onscreen. - **GPUImageDilationFilter**: This performs an image dilation operation, where the maximum intensity of the red channel in a rectangular neighborhood is used for the intensity of this pixel. The radius of the rectangular area to sample over is specified on initialization, with a range of 1-4 pixels. This is intended for use with grayscale images, and it expands bright regions. - **GPUImageRGBDilationFilter**: This is the same as the GPUImageDilationFilter, except that this acts on all color channels, not just the red channel. - **GPUImageErosionFilter**: This performs an image erosion operation, where the minimum intensity of the red channel in a rectangular neighborhood is used for the intensity of this pixel. The radius of the rectangular area to sample over is specified on initialization, with a range of 1-4 pixels. This is intended for use with grayscale images, and it expands dark regions. - **GPUImageRGBErosionFilter**: This is the same as the GPUImageErosionFilter, except that this acts on all color channels, not just the red channel. - **GPUImageOpeningFilter**: This performs an erosion on the red channel of an image, followed by a dilation of the same radius. The radius is set on initialization, with a range of 1-4 pixels. This filters out smaller bright regions. - **GPUImageRGBOpeningFilter**: This is the same as the GPUImageOpeningFilter, except that this acts on all color channels, not just the red channel. - **GPUImageClosingFilter**: This performs a dilation on the red channel of an image, followed by an erosion of the same radius. The radius is set on initialization, with a range of 1-4 pixels. This filters out smaller dark regions. - **GPUImageRGBClosingFilter**: This is the same as the GPUImageClosingFilter, except that this acts on all color channels, not just the red channel. - **GPUImageLocalBinaryPatternFilter**: This performs a comparison of intensity of the red channel of the 8 surrounding pixels and that of the central one, encoding the comparison results in a bit string that becomes this pixel intensity. The least-significant bit is the top-right comparison, going counterclockwise to end at the right comparison as the most significant bit. - **GPUImageLowPassFilter**: This applies a low pass filter to incoming video frames. This basically accumulates a weighted rolling average of previous frames with the current ones as they come in. This can be used to denoise video, add motion blur, or be used to create a high pass filter. - *filterStrength*: This controls the degree by which the previous accumulated frames are blended with the current one. This ranges from 0.0 to 1.0, with a default of 0.5. - **GPUImageHighPassFilter**: This applies a high pass filter to incoming video frames. This is the inverse of the low pass filter, showing the difference between the current frame and the weighted rolling average of previous ones. This is most useful for motion detection. - *filterStrength*: This controls the degree by which the previous accumulated frames are blended and then subtracted from the current one. This ranges from 0.0 to 1.0, with a default of 0.5. - **GPUImageMotionDetector**: This is a motion detector based on a high-pass filter. You set the motionDetectionBlock and on every incoming frame it will give you the centroid of any detected movement in the scene (in normalized X,Y coordinates) as well as an intensity of motion for the scene. - *lowPassFilterStrength*: This controls the strength of the low pass filter used behind the scenes to establish the baseline that incoming frames are compared with. This ranges from 0.0 to 1.0, with a default of 0.5. - **GPUImageHoughTransformLineDetector**: Detects lines in the image using a Hough transform into parallel coordinate space. This approach is based entirely on the PC lines process developed by the Graph@FIT research group at the Brno University of Technology and described in their publications: M. Dubská, J. Havel, and A. Herout. Real-Time Detection of Lines using Parallel Coordinates and OpenGL. Proceedings of SCCG 2011, Bratislava, SK, p. 7 (http://medusa.fit.vutbr.cz/public/data/papers/2011-SCCG-Dubska-Real-Time-Line-Detection-Using-PC-and-OpenGL.pdf) and M. Dubská, J. Havel, and A. Herout. PClines — Line detection using parallel coordinates. 2011 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), p. 1489- 1494 (http://medusa.fit.vutbr.cz/public/data/papers/2011-CVPR-Dubska-PClines.pdf). - *edgeThreshold*: A threshold value for which a point is detected as belonging to an edge for determining lines. Default is 0.9. - *lineDetectionThreshold*: A threshold value for which a local maximum is detected as belonging to a line in parallel coordinate space. Default is 0.20. - *linesDetectedBlock*: This block is called on the detection of lines, usually on every processed frame. A C array containing normalized slopes and intercepts in m, b pairs (y=mx+b) is passed in, along with a count of the number of lines detected and the current timestamp of the video frame. - **GPUImageLineGenerator**: A helper class that generates lines which can overlay the scene. The color of these lines can be adjusted using -setLineColorRed:green:blue: - *lineWidth*: The width of the lines, in pixels, with a default of 1.0. - **GPUImageMotionBlurFilter**: Applies a directional motion blur to an image - *blurSize*: A multiplier for the blur size, ranging from 0.0 on up, with a default of 1.0 - *blurAngle*: The angular direction of the blur, in degrees. 0 degrees by default. - **GPUImageZoomBlurFilter**: Applies a directional motion blur to an image - *blurSize*: A multiplier for the blur size, ranging from 0.0 on up, with a default of 1.0 - *blurCenter*: The normalized center of the blur. (0.5, 0.5) by default ### Blending modes ### - **GPUImageChromaKeyBlendFilter**: Selectively replaces a color in the first image with the second image - *thresholdSensitivity*: How close a color match needs to exist to the target color to be replaced (default of 0.4) - *smoothing*: How smoothly to blend for the color match (default of 0.1) - **GPUImageDissolveBlendFilter**: Applies a dissolve blend of two images - *mix*: The degree with which the second image overrides the first (0.0 - 1.0, with 0.5 as the default) - **GPUImageMultiplyBlendFilter**: Applies a multiply blend of two images - **GPUImageAddBlendFilter**: Applies an additive blend of two images - **GPUImageSubtractBlendFilter**: Applies a subtractive blend of two images - **GPUImageDivideBlendFilter**: Applies a division blend of two images - **GPUImageOverlayBlendFilter**: Applies an overlay blend of two images - **GPUImageDarkenBlendFilter**: Blends two images by taking the minimum value of each color component between the images - **GPUImageLightenBlendFilter**: Blends two images by taking the maximum value of each color component between the images - **GPUImageColorBurnBlendFilter**: Applies a color burn blend of two images - **GPUImageColorDodgeBlendFilter**: Applies a color dodge blend of two images - **GPUImageScreenBlendFilter**: Applies a screen blend of two images - **GPUImageExclusionBlendFilter**: Applies an exclusion blend of two images - **GPUImageDifferenceBlendFilter**: Applies a difference blend of two images - **GPUImageHardLightBlendFilter**: Applies a hard light blend of two images - **GPUImageSoftLightBlendFilter**: Applies a soft light blend of two images - **GPUImageAlphaBlendFilter**: Blends the second image over the first, based on the second's alpha channel - *mix*: The degree with which the second image overrides the first (0.0 - 1.0, with 1.0 as the default) - **GPUImageSourceOverBlendFilter**: Applies a source over blend of two images - **GPUImageColorBurnBlendFilter**: Applies a color burn blend of two images - **GPUImageColorDodgeBlendFilter**: Applies a color dodge blend of two images - **GPUImageNormalBlendFilter**: Applies a normal blend of two images - **GPUImageColorBlendFilter**: Applies a color blend of two images - **GPUImageHueBlendFilter**: Applies a hue blend of two images - **GPUImageSaturationBlendFilter**: Applies a saturation blend of two images - **GPUImageLuminosityBlendFilter**: Applies a luminosity blend of two images - **GPUImageLinearBurnBlendFilter**: Applies a linear burn blend of two images - **GPUImagePoissonBlendFilter**: Applies a Poisson blend of two images - *mix*: Mix ranges from 0.0 (only image 1) to 1.0 (only image 2 gradients), with 1.0 as the normal level - *numIterations*: The number of times to propagate the gradients. Crank this up to 100 or even 1000 if you want to get anywhere near convergence. Yes, this will be slow. - **GPUImageMaskFilter**: Masks one image using another ### Visual effects ### - **GPUImagePixellateFilter**: Applies a pixellation effect on an image or video - *fractionalWidthOfAPixel*: How large the pixels are, as a fraction of the width and height of the image (0.0 - 1.0, default 0.05) - **GPUImagePolarPixellateFilter**: Applies a pixellation effect on an image or video, based on polar coordinates instead of Cartesian ones - *center*: The center about which to apply the pixellation, defaulting to (0.5, 0.5) - *pixelSize*: The fractional pixel size, split into width and height components. The default is (0.05, 0.05) - **GPUImagePolkaDotFilter**: Breaks an image up into colored dots within a regular grid - *fractionalWidthOfAPixel*: How large the dots are, as a fraction of the width and height of the image (0.0 - 1.0, default 0.05) - *dotScaling*: What fraction of each grid space is taken up by a dot, from 0.0 to 1.0 with a default of 0.9. - **GPUImageHalftoneFilter**: Applies a halftone effect to an image, like news print - *fractionalWidthOfAPixel*: How large the halftone dots are, as a fraction of the width and height of the image (0.0 - 1.0, default 0.05) - **GPUImageCrosshatchFilter**: This converts an image into a black-and-white crosshatch pattern - *crossHatchSpacing*: The fractional width of the image to use as the spacing for the crosshatch. The default is 0.03. - *lineWidth*: A relative width for the crosshatch lines. The default is 0.003. - **GPUImageSketchFilter**: Converts video to look like a sketch. This is just the Sobel edge detection filter with the colors inverted - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *edgeStrength*: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0. - **GPUImageThresholdSketchFilter**: Same as the sketch filter, only the edges are thresholded instead of being grayscale - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *edgeStrength*: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0. - *threshold*: Any edge above this threshold will be black, and anything below white. Ranges from 0.0 to 1.0, with 0.8 as the default - **GPUImageToonFilter**: This uses Sobel edge detection to place a black border around objects, and then it quantizes the colors present in the image to give a cartoon-like quality to the image. - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *threshold*: The sensitivity of the edge detection, with lower values being more sensitive. Ranges from 0.0 to 1.0, with 0.2 as the default - *quantizationLevels*: The number of color levels to represent in the final image. Default is 10.0 - **GPUImageSmoothToonFilter**: This uses a similar process as the GPUImageToonFilter, only it precedes the toon effect with a Gaussian blur to smooth out noise. - *texelWidth*: - *texelHeight*: These parameters affect the visibility of the detected edges - *blurRadiusInPixels*: The radius of the underlying Gaussian blur. The default is 2.0. - *threshold*: The sensitivity of the edge detection, with lower values being more sensitive. Ranges from 0.0 to 1.0, with 0.2 as the default - *quantizationLevels*: The number of color levels to represent in the final image. Default is 10.0 - **GPUImageEmbossFilter**: Applies an embossing effect on the image - *intensity*: The strength of the embossing, from 0.0 to 4.0, with 1.0 as the normal level - **GPUImagePosterizeFilter**: This reduces the color dynamic range into the number of steps specified, leading to a cartoon-like simple shading of the image. - *colorLevels*: The number of color levels to reduce the image space to. This ranges from 1 to 256, with a default of 10. - **GPUImageSwirlFilter**: Creates a swirl distortion on the image - *radius*: The radius from the center to apply the distortion, with a default of 0.5 - *center*: The center of the image (in normalized coordinates from 0 - 1.0) about which to twist, with a default of (0.5, 0.5) - *angle*: The amount of twist to apply to the image, with a default of 1.0 - **GPUImageBulgeDistortionFilter**: Creates a bulge distortion on the image - *radius*: The radius from the center to apply the distortion, with a default of 0.25 - *center*: The center of the image (in normalized coordinates from 0 - 1.0) about which to distort, with a default of (0.5, 0.5) - *scale*: The amount of distortion to apply, from -1.0 to 1.0, with a default of 0.5 - **GPUImagePinchDistortionFilter**: Creates a pinch distortion of the image - *radius*: The radius from the center to apply the distortion, with a default of 1.0 - *center*: The center of the image (in normalized coordinates from 0 - 1.0) about which to distort, with a default of (0.5, 0.5) - *scale*: The amount of distortion to apply, from -2.0 to 2.0, with a default of 1.0 - **GPUImageStretchDistortionFilter**: Creates a stretch distortion of the image - *center*: The center of the image (in normalized coordinates from 0 - 1.0) about which to distort, with a default of (0.5, 0.5) - **GPUImageSphereRefractionFilter**: Simulates the refraction through a glass sphere - *center*: The center about which to apply the distortion, with a default of (0.5, 0.5) - *radius*: The radius of the distortion, ranging from 0.0 to 1.0, with a default of 0.25 - *refractiveIndex*: The index of refraction for the sphere, with a default of 0.71 - **GPUImageGlassSphereFilter**: Same as the GPUImageSphereRefractionFilter, only the image is not inverted and there's a little bit of frosting at the edges of the glass - *center*: The center about which to apply the distortion, with a default of (0.5, 0.5) - *radius*: The radius of the distortion, ranging from 0.0 to 1.0, with a default of 0.25 - *refractiveIndex*: The index of refraction for the sphere, with a default of 0.71 - **GPUImageVignetteFilter**: Performs a vignetting effect, fading out the image at the edges - *vignetteCenter*: The center for the vignette in tex coords (CGPoint), with a default of 0.5, 0.5 - *vignetteColor*: The color to use for the vignette (GPUVector3), with a default of black - *vignetteStart*: The normalized distance from the center where the vignette effect starts, with a default of 0.5 - *vignetteEnd*: The normalized distance from the center where the vignette effect ends, with a default of 0.75 - **GPUImageKuwaharaFilter**: Kuwahara image abstraction, drawn from the work of Kyprianidis, et. al. in their publication "Anisotropic Kuwahara Filtering on the GPU" within the GPU Pro collection. This produces an oil-painting-like image, but it is extremely computationally expensive, so it can take seconds to render a frame on an iPad 2. This might be best used for still images. - *radius*: In integer specifying the number of pixels out from the center pixel to test when applying the filter, with a default of 4. A higher value creates a more abstracted image, but at the cost of much greater processing time. - **GPUImageKuwaharaRadius3Filter**: A modified version of the Kuwahara filter, optimized to work over just a radius of three pixels - **GPUImagePerlinNoiseFilter**: Generates an image full of Perlin noise - *colorStart*: - *colorFinish*: The color range for the noise being generated - *scale*: The scaling of the noise being generated - **GPUImageCGAColorspaceFilter**: Simulates the colorspace of a CGA monitor - **GPUImageMosaicFilter**: This filter takes an input tileset, the tiles must ascend in luminance. It looks at the input image and replaces each display tile with an input tile according to the luminance of that tile. The idea was to replicate the ASCII video filters seen in other apps, but the tileset can be anything. - *inputTileSize*: - *numTiles*: - *displayTileSize*: - *colorOn*: - **GPUImageJFAVoronoiFilter**: Generates a Voronoi map, for use in a later stage. - *sizeInPixels*: Size of the individual elements - **GPUImageVoronoiConsumerFilter**: Takes in the Voronoi map, and uses that to filter an incoming image. - *sizeInPixels*: Size of the individual elements You can also easily write your own custom filters using the C-like OpenGL Shading Language, as described above. ## Sample applications ## Several sample applications are bundled with the framework source. Most are compatible with both iPhone and iPad-class devices. They attempt to show off various aspects of the framework and should be used as the best examples of the API while the framework is under development. These include: ### SimpleImageFilter ### A bundled JPEG image is loaded into the application at launch, a filter is applied to it, and the result rendered to the screen. Additionally, this sample shows two ways of taking in an image, filtering it, and saving it to disk. ### SimpleVideoFilter ### A pixellate filter is applied to a live video stream, with a UISlider control that lets you adjust the pixel size on the live video. ### SimpleVideoFileFilter ### A movie file is loaded from disk, an unsharp mask filter is applied to it, and the filtered result is re-encoded as another movie. ### MultiViewFilterExample ### From a single camera feed, four views are populated with realtime filters applied to camera. One is just the straight camera video, one is a preprogrammed sepia tone, and two are custom filters based on shader programs. ### FilterShowcase ### This demonstrates every filter supplied with GPUImage. ### BenchmarkSuite ### This is used to test the performance of the overall framework by testing it against CPU-bound routines and Core Image. Benchmarks involving still images and video are run against all three, with results displayed in-application. ### CubeExample ### This demonstrates the ability of GPUImage to interact with OpenGL ES rendering. Frames are captured from the camera, a sepia filter applied to them, and then they are fed into a texture to be applied to the face of a cube you can rotate with your finger. This cube in turn is rendered to a texture-backed framebuffer object, and that texture is fed back into GPUImage to have a pixellation filter applied to it before rendering to screen. In other words, the path of this application is camera -> sepia tone filter -> cube -> pixellation filter -> display. ### ColorObjectTracking ### A version of my ColorTracking example from http://www.sunsetlakesoftware.com/2010/10/22/gpu-accelerated-video-processing-mac-and-ios ported across to use GPUImage, this application uses color in a scene to track objects from a live camera feed. The four views you can switch between include the raw camera feed, the camera feed with pixels matching the color threshold in white, the processed video where positions are encoded as colors within the pixels passing the threshold test, and finally the live video feed with a dot that tracks the selected color. Tapping the screen changes the color to track to match the color of the pixels under your finger. Tapping and dragging on the screen makes the color threshold more or less forgiving. This is most obvious on the second, color thresholding view. Currently, all processing for the color averaging in the last step is done on the CPU, so this is part is extremely slow.
{'content_hash': 'c74137414ed2291584dea4751bd34fb7', 'timestamp': '', 'source': 'github', 'line_count': 754, 'max_line_length': 818, 'avg_line_length': 84.57824933687003, 'alnum_prop': 0.7775042338330301, 'repo_name': 'r3mus/GPUImage', 'id': '99d9e4c536f75d5311ed5721832bf3c9eda712f6', 'size': '63791', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33261', 'license': 'bsd-3-clause', 'language': [{'name': 'Objective-C', 'bytes': '1172758'}, {'name': 'Ruby', 'bytes': '1282'}, {'name': 'Shell', 'bytes': '1159'}]}
<?xml version="1.0" encoding="utf-8"?> <!-- ~ The MIT License (MIT) ~ ~ Copyright (c) 2015 Vishnu Sosale ~ ~ Permission is hereby granted, free of charge, to any person obtaining a copy ~ of this software and associated documentation files (the "Software"), to deal ~ in the Software without restriction, including without limitation the rights ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ~ copies of the Software, and to permit persons to whom the Software is ~ furnished to do so, subject to the following conditions: ~ ~ The above copyright notice and this permission notice shall be included in ~ all copies or substantial portions of the Software. ~ ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ~ THE SOFTWARE. --> <com.etsy.android.grid.util.DynamicHeightImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/imgView" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="centerCrop" />
{'content_hash': 'cae7a6e07e309bb5daa6b730c83c5312', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 109, 'avg_line_length': 46.0, 'alnum_prop': 0.7370923913043478, 'repo_name': 'vishnusosale/The-Mind', 'id': '3c0dd499ccc61efe48e4c03c6414dcebdf9f4d54', 'size': '1472', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/res/layout/vision_board_row.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '80529'}]}
module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(283); /***/ }, /***/ 3: /***/ function(module, exports) { /* globals __VUE_SSR_CONTEXT__ */ // this module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle module.exports = function normalizeComponent ( rawScriptExports, compiledTemplate, injectStyles, scopeId, moduleIdentifier /* server only */ ) { var esModule var scriptExports = rawScriptExports = rawScriptExports || {} // ES6 modules interop var type = typeof rawScriptExports.default if (type === 'object' || type === 'function') { esModule = rawScriptExports scriptExports = rawScriptExports.default } // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (compiledTemplate) { options.render = compiledTemplate.render options.staticRenderFns = compiledTemplate.staticRenderFns } // scopedId if (scopeId) { options._scopeId = scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || (this.$vnode && this.$vnode.ssrContext) // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = injectStyles } if (hook) { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } return { esModule: esModule, exports: scriptExports, options: options } } /***/ }, /***/ 283: /***/ function(module, exports, __webpack_require__) { 'use strict'; exports.__esModule = true; var _step = __webpack_require__(284); var _step2 = _interopRequireDefault(_step); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* istanbul ignore next */ _step2.default.install = function (Vue) { Vue.component(_step2.default.name, _step2.default); }; exports.default = _step2.default; /***/ }, /***/ 284: /***/ function(module, exports, __webpack_require__) { var Component = __webpack_require__(3)( /* script */ __webpack_require__(285), /* template */ __webpack_require__(286), /* styles */ null, /* scopeId */ null, /* moduleIdentifier (server only) */ null ) module.exports = Component.exports /***/ }, /***/ 285: /***/ function(module, exports) { 'use strict'; exports.__esModule = true; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // exports.default = { name: 'ElStep', props: { title: String, icon: String, description: String, status: String }, data: function data() { return { index: -1, style: {}, lineStyle: {}, mainOffset: 0, isLast: false, internalStatus: '' }; }, beforeCreate: function beforeCreate() { this.$parent.steps.push(this); }, computed: { currentStatus: function currentStatus() { return this.status || this.internalStatus; } }, methods: { updateStatus: function updateStatus(val) { var prevChild = this.$parent.$children[this.index - 1]; if (val > this.index) { this.internalStatus = this.$parent.finishStatus; } else if (val === this.index) { this.internalStatus = this.$parent.processStatus; } else { this.internalStatus = 'wait'; } if (prevChild) prevChild.calcProgress(this.internalStatus); }, calcProgress: function calcProgress(status) { var step = 100; var style = {}; style.transitionDelay = 150 * this.index + 'ms'; if (status === this.$parent.processStatus) { step = 50; } else if (status === 'wait') { step = 0; style.transitionDelay = -150 * this.index + 'ms'; } style.borderWidth = step ? '1px' : 0; this.$parent.direction === 'vertical' ? style.height = step + '%' : style.width = step + '%'; this.lineStyle = style; }, adjustPosition: function adjustPosition() { this.style = {}; this.$parent.stepOffset = this.$el.getBoundingClientRect().width / (this.$parent.steps.length - 1); } }, mounted: function mounted() { var _this = this; var parent = this.$parent; var isCenter = parent.center; var len = parent.steps.length; var isLast = this.isLast = parent.steps[parent.steps.length - 1] === this; var space = typeof parent.space === 'number' ? parent.space + 'px' : parent.space ? parent.space : 100 / (isCenter ? len - 1 : len) + '%'; if (parent.direction === 'horizontal') { this.style = { width: space }; if (parent.alignCenter) { this.mainOffset = -this.$refs.title.getBoundingClientRect().width / 2 + 16 + 'px'; } isCenter && isLast && this.adjustPosition(); } else { if (!isLast) { this.style = { height: space }; } } var unwatch = this.$watch('index', function (val) { _this.$watch('$parent.active', _this.updateStatus, { immediate: true }); unwatch(); }); } }; /***/ }, /***/ 286: /***/ function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { staticClass: "el-step", class: ['is-' + _vm.$parent.direction], style: ([_vm.style, _vm.isLast ? '' : { marginRight: -_vm.$parent.stepOffset + 'px' }]) }, [_c('div', { staticClass: "el-step__head", class: ['is-' + _vm.currentStatus, { 'is-text': !_vm.icon }] }, [_c('div', { staticClass: "el-step__line", class: ['is-' + _vm.$parent.direction, { 'is-icon': _vm.icon }], style: (_vm.isLast ? '' : { marginRight: _vm.$parent.stepOffset + 'px' }) }, [_c('i', { staticClass: "el-step__line-inner", style: (_vm.lineStyle) })]), _c('span', { staticClass: "el-step__icon" }, [(_vm.currentStatus !== 'success' && _vm.currentStatus !== 'error') ? _vm._t("icon", [(_vm.icon) ? _c('i', { class: ['el-icon-' + _vm.icon] }) : _c('div', [_vm._v(_vm._s(_vm.index + 1))])]) : _c('i', { class: ['el-icon-' + (_vm.currentStatus === 'success' ? 'check' : 'close')] })], 2)]), _c('div', { staticClass: "el-step__main", style: ({ marginLeft: _vm.mainOffset }) }, [_c('div', { ref: "title", staticClass: "el-step__title", class: ['is-' + _vm.currentStatus] }, [_vm._t("title", [_vm._v(_vm._s(_vm.title))])], 2), _c('div', { staticClass: "el-step__description", class: ['is-' + _vm.currentStatus] }, [_vm._t("description", [_vm._v(_vm._s(_vm.description))])], 2)])]) },staticRenderFns: []} /***/ } /******/ });
{'content_hash': '6fecae65892476bc5977c7f012f94aa5', 'timestamp': '', 'source': 'github', 'line_count': 381, 'max_line_length': 143, 'avg_line_length': 23.83727034120735, 'alnum_prop': 0.5472362915657344, 'repo_name': 'MrMeno/cms2.0', 'id': '306b9957c91301751e126fa69510cb91962e8f79', 'size': '9082', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'public/css/element-ui/lib/step.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '360357'}, {'name': 'HTML', 'bytes': '645'}, {'name': 'JavaScript', 'bytes': '2279479'}, {'name': 'Vue', 'bytes': '609089'}]}
<?xml version="1.0" encoding="utf-8"?> <!-- --> <selector xmlns:android="http://schemas.android.com/apk/res/android" android:dither="true"> <item android:state_pressed="true"><shape> <gradient android:angle="270" android:endColor="#814CD4" android:startColor="#62359F" /> <stroke android:width="1dp" android:color="#4900D2" /> <corners android:radius="4dp" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> </shape></item> <item><shape> <gradient android:angle="270" android:endColor="#62359F" android:startColor="#814CD4" /> <stroke android:width="1dp" android:color="#4900D2" /> <corners android:radius="4dp" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> </shape></item> </selector>
{'content_hash': '5923ed222582d5358037ee8da2d313be', 'timestamp': '', 'source': 'github', 'line_count': 26, 'max_line_length': 105, 'avg_line_length': 35.19230769230769, 'alnum_prop': 0.6098360655737705, 'repo_name': 'hujiaweibujidao/XingShan', 'id': '5df544207cf5e6eccc4ca5040d07f32d142e0ae0', 'size': '1528', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'ShanShan/app/src/main/res/drawable-hdpi/ps__button_yahoo.xml', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '32038'}, {'name': 'Java', 'bytes': '76363'}, {'name': 'JavaScript', 'bytes': '1085'}, {'name': 'Python', 'bytes': '61693'}]}
<?php namespace Elastica\Test\Query; use Elastica\Document; use Elastica\Query\Match; use Elastica\Query\MatchPhrase; use Elastica\Query\MatchPhrasePrefix; use Elastica\Test\Base as BaseTest; class MatchTest extends BaseTest { /** * @group unit */ public function testToArray() { $field = 'test'; $testQuery = 'Nicolas Ruflin'; $type = 'phrase'; $operator = 'and'; $analyzer = 'myanalyzer'; $boost = 2.0; $minimumShouldMatch = 2; $fuzziness = 0.3; $fuzzyRewrite = 'constant_score_boolean'; $prefixLength = 3; $maxExpansions = 12; $query = new Match(); $query->setFieldQuery($field, $testQuery); $query->setFieldType($field, $type); $query->setFieldOperator($field, $operator); $query->setFieldAnalyzer($field, $analyzer); $query->setFieldBoost($field, $boost); $query->setFieldMinimumShouldMatch($field, $minimumShouldMatch); $query->setFieldFuzziness($field, $fuzziness); $query->setFieldFuzzyRewrite($field, $fuzzyRewrite); $query->setFieldPrefixLength($field, $prefixLength); $query->setFieldMaxExpansions($field, $maxExpansions); $expectedArray = array( 'match' => array( $field => array( 'query' => $testQuery, 'type' => $type, 'operator' => $operator, 'analyzer' => $analyzer, 'boost' => $boost, 'minimum_should_match' => $minimumShouldMatch, 'fuzziness' => $fuzziness, 'fuzzy_rewrite' => $fuzzyRewrite, 'prefix_length' => $prefixLength, 'max_expansions' => $maxExpansions, ), ), ); $this->assertEquals($expectedArray, $query->toArray()); } /** * @group functional */ public function testMatch() { $client = $this->_getClient(); $index = $client->getIndex('test'); $index->create(array(), true); $type = $index->getType('test'); $type->addDocuments(array( new Document(1, array('name' => 'Basel-Stadt')), new Document(2, array('name' => 'New York')), new Document(3, array('name' => 'New Hampshire')), new Document(4, array('name' => 'Basel Land')), )); $index->refresh(); $field = 'name'; $operator = 'or'; $query = new Match(); $query->setFieldQuery($field, 'Basel New'); $query->setFieldOperator($field, $operator); $resultSet = $index->search($query); $this->assertEquals(4, $resultSet->count()); } /** * @group functional */ public function testMatchSetFieldBoost() { $client = $this->_getClient(); $index = $client->getIndex('test'); $index->create(array(), true); $type = $index->getType('test'); $type->addDocuments(array( new Document(1, array('name' => 'Basel-Stadt')), new Document(2, array('name' => 'New York')), new Document(3, array('name' => 'New Hampshire')), new Document(4, array('name' => 'Basel Land')), )); $index->refresh(); $field = 'name'; $operator = 'or'; $query = new Match(); $query->setFieldQuery($field, 'Basel New'); $query->setFieldOperator($field, $operator); $query->setFieldBoost($field, 1.2); $resultSet = $index->search($query); $this->assertEquals(4, $resultSet->count()); } /** * @group functional */ public function testMatchSetFieldBoostWithString() { $client = $this->_getClient(); $index = $client->getIndex('test'); $index->create(array(), true); $type = $index->getType('test'); $type->addDocuments(array( new Document(1, array('name' => 'Basel-Stadt')), new Document(2, array('name' => 'New York')), new Document(3, array('name' => 'New Hampshire')), new Document(4, array('name' => 'Basel Land')), )); $index->refresh(); $field = 'name'; $operator = 'or'; $query = new Match(); $query->setFieldQuery($field, 'Basel New'); $query->setFieldOperator($field, $operator); $query->setFieldBoost($field, '1.2'); $resultSet = $index->search($query); $this->assertEquals(4, $resultSet->count()); } /** * @group functional */ public function testMatchZeroTerm() { $client = $this->_getClient(); $index = $client->getIndex('test'); $index->create(array(), true); $type = $index->getType('test'); $type->addDocuments(array( new Document(1, array('name' => 'Basel-Stadt')), new Document(2, array('name' => 'New York')), )); $index->refresh(); $query = new Match(); $query->setFieldQuery('name', ''); $query->setFieldZeroTermsQuery('name', Match::ZERO_TERM_ALL); $resultSet = $index->search($query); $this->assertEquals(2, $resultSet->count()); } /** * @group functional */ public function testMatchPhrase() { $client = $this->_getClient(); $index = $client->getIndex('test'); $index->create(array(), true); $type = $index->getType('test'); $type->addDocuments(array( new Document(1, array('name' => 'Basel-Stadt')), new Document(2, array('name' => 'New York')), new Document(3, array('name' => 'New Hampshire')), new Document(4, array('name' => 'Basel Land')), )); $index->refresh(); $field = 'name'; $type = 'phrase'; $query = new Match(); $query->setFieldQuery($field, 'New York'); $query->setFieldType($field, $type); $resultSet = $index->search($query); $this->assertEquals(1, $resultSet->count()); } /** * @group functional */ public function testMatchPhraseAlias() { $client = $this->_getClient(); $index = $client->getIndex('test'); $index->create(array(), true); $type = $index->getType('test'); $type->addDocuments(array( new Document(1, array('name' => 'Basel-Stadt')), new Document(2, array('name' => 'New York')), new Document(3, array('name' => 'New Hampshire')), new Document(4, array('name' => 'Basel Land')), )); $index->refresh(); $field = 'name'; $query = new MatchPhrase(); $query->setFieldQuery($field, 'New York'); $resultSet = $index->search($query); $this->assertEquals(1, $resultSet->count()); } /** * @group functional */ public function testMatchPhrasePrefix() { $client = $this->_getClient(); $index = $client->getIndex('test'); $index->create(array(), true); $type = $index->getType('test'); $type->addDocuments(array( new Document(1, array('name' => 'Basel-Stadt')), new Document(2, array('name' => 'New York')), new Document(3, array('name' => 'New Hampshire')), new Document(4, array('name' => 'Basel Land')), )); $index->refresh(); $field = 'name'; $type = 'phrase_prefix'; $query = new Match(); $query->setFieldQuery($field, 'New'); $query->setFieldType($field, $type); $resultSet = $index->search($query); $this->assertEquals(2, $resultSet->count()); } /** * @group functional */ public function testMatchPhrasePrefixAlias() { $client = $this->_getClient(); $index = $client->getIndex('test'); $index->create(array(), true); $type = $index->getType('test'); $type->addDocuments(array( new Document(1, array('name' => 'Basel-Stadt')), new Document(2, array('name' => 'New York')), new Document(3, array('name' => 'New Hampshire')), new Document(4, array('name' => 'Basel Land')), )); $index->refresh(); $field = 'name'; $query = new MatchPhrasePrefix(); $query->setFieldQuery($field, 'New'); $resultSet = $index->search($query); $this->assertEquals(2, $resultSet->count()); } /** * @group unit */ public function testMatchFuzzinessType() { $field = 'test'; $query = new Match(); $fuzziness = 'AUTO'; $query->setFieldFuzziness($field, $fuzziness); $parameters = $query->getParam($field); $this->assertEquals($fuzziness, $parameters['fuzziness']); $fuzziness = 0.3; $query->setFieldFuzziness($field, $fuzziness); $parameters = $query->getParam($field); $this->assertEquals($fuzziness, $parameters['fuzziness']); } /** * @group unit */ public function testConstruct() { $match = new Match(null, 'values'); $this->assertEquals(array('match' => array()), $match->toArray()); $match = new Match('field', null); $this->assertEquals(array('match' => array()), $match->toArray()); $match1 = new Match('field', 'values'); $match2 = new Match(); $match2->setField('field', 'values'); $this->assertEquals($match1->toArray(), $match2->toArray()); } }
{'content_hash': '2657c858367a1dce5b07d9c4ff4763d1', 'timestamp': '', 'source': 'github', 'line_count': 340, 'max_line_length': 74, 'avg_line_length': 28.50294117647059, 'alnum_prop': 0.5178000206377051, 'repo_name': 'parisholley/wordpress-fantastic-elasticsearch', 'id': '3ea0296e064553c6043afeb7cac49038b7239776', 'size': '9691', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'vendor/ruflin/elastica/test/lib/Elastica/Test/Query/MatchTest.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '51472'}, {'name': 'JavaScript', 'bytes': '12083'}, {'name': 'PHP', 'bytes': '288061'}, {'name': 'Shell', 'bytes': '7786'}]}
// Copyright 2014 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 "extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.h" #include "extensions/browser/api/socket/udp_socket.h" #include "extensions/browser/event_router.h" #include "extensions/browser/extension_system.h" #include "extensions/browser/extensions_browser_client.h" #include "net/base/net_errors.h" namespace extensions { namespace core_api { using content::BrowserThread; static base::LazyInstance< BrowserContextKeyedAPIFactory<UDPSocketEventDispatcher> > g_factory = LAZY_INSTANCE_INITIALIZER; // static BrowserContextKeyedAPIFactory<UDPSocketEventDispatcher>* UDPSocketEventDispatcher::GetFactoryInstance() { return g_factory.Pointer(); } // static UDPSocketEventDispatcher* UDPSocketEventDispatcher::Get( content::BrowserContext* context) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); return BrowserContextKeyedAPIFactory<UDPSocketEventDispatcher>::Get(context); } UDPSocketEventDispatcher::UDPSocketEventDispatcher( content::BrowserContext* context) : thread_id_(Socket::kThreadId), browser_context_(context) { ApiResourceManager<ResumableUDPSocket>* manager = ApiResourceManager<ResumableUDPSocket>::Get(browser_context_); DCHECK(manager) << "There is no socket manager. " "If this assertion is failing during a test, then it is likely that " "TestExtensionSystem is failing to provide an instance of " "ApiResourceManager<ResumableUDPSocket>."; sockets_ = manager->data_; } UDPSocketEventDispatcher::~UDPSocketEventDispatcher() {} UDPSocketEventDispatcher::ReceiveParams::ReceiveParams() {} UDPSocketEventDispatcher::ReceiveParams::~ReceiveParams() {} void UDPSocketEventDispatcher::OnSocketBind(const std::string& extension_id, int socket_id) { OnSocketResume(extension_id, socket_id); } void UDPSocketEventDispatcher::OnSocketResume(const std::string& extension_id, int socket_id) { DCHECK(BrowserThread::CurrentlyOn(thread_id_)); ReceiveParams params; params.thread_id = thread_id_; params.browser_context_id = browser_context_; params.extension_id = extension_id; params.sockets = sockets_; params.socket_id = socket_id; StartReceive(params); } /* static */ void UDPSocketEventDispatcher::StartReceive(const ReceiveParams& params) { DCHECK(BrowserThread::CurrentlyOn(params.thread_id)); ResumableUDPSocket* socket = params.sockets->Get(params.extension_id, params.socket_id); if (socket == NULL) { // This can happen if the socket is closed while our callback is active. return; } DCHECK(params.extension_id == socket->owner_extension_id()) << "Socket has wrong owner."; // Don't start another read if the socket has been paused. if (socket->paused()) return; int buffer_size = (socket->buffer_size() <= 0 ? 4096 : socket->buffer_size()); socket->RecvFrom( buffer_size, base::Bind(&UDPSocketEventDispatcher::ReceiveCallback, params)); } /* static */ void UDPSocketEventDispatcher::ReceiveCallback( const ReceiveParams& params, int bytes_read, scoped_refptr<net::IOBuffer> io_buffer, const std::string& address, int port) { DCHECK(BrowserThread::CurrentlyOn(params.thread_id)); // If |bytes_read| == 0, the message contained no data. // If |bytes_read| < 0, there was a network error, and |bytes_read| is a value // from "net::ERR_". if (bytes_read >= 0) { // Dispatch "onReceive" event. sockets_udp::ReceiveInfo receive_info; receive_info.socket_id = params.socket_id; receive_info.data = std::string(io_buffer->data(), bytes_read); receive_info.remote_address = address; receive_info.remote_port = port; scoped_ptr<base::ListValue> args = sockets_udp::OnReceive::Create(receive_info); scoped_ptr<Event> event( new Event(sockets_udp::OnReceive::kEventName, args.Pass())); PostEvent(params, event.Pass()); // Post a task to delay the read until the socket is available, as // calling StartReceive at this point would error with ERR_IO_PENDING. BrowserThread::PostTask( params.thread_id, FROM_HERE, base::Bind(&UDPSocketEventDispatcher::StartReceive, params)); } else if (bytes_read == net::ERR_IO_PENDING) { // This happens when resuming a socket which already had an // active "recv" callback. } else { // Dispatch "onReceiveError" event but don't start another read to avoid // potential infinite reads if we have a persistent network error. sockets_udp::ReceiveErrorInfo receive_error_info; receive_error_info.socket_id = params.socket_id; receive_error_info.result_code = bytes_read; scoped_ptr<base::ListValue> args = sockets_udp::OnReceiveError::Create(receive_error_info); scoped_ptr<Event> event( new Event(sockets_udp::OnReceiveError::kEventName, args.Pass())); PostEvent(params, event.Pass()); // Since we got an error, the socket is now "paused" until the application // "resumes" it. ResumableUDPSocket* socket = params.sockets->Get(params.extension_id, params.socket_id); if (socket) { socket->set_paused(true); } } } /* static */ void UDPSocketEventDispatcher::PostEvent(const ReceiveParams& params, scoped_ptr<Event> event) { DCHECK(BrowserThread::CurrentlyOn(params.thread_id)); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(&DispatchEvent, params.browser_context_id, params.extension_id, base::Passed(event.Pass()))); } /*static*/ void UDPSocketEventDispatcher::DispatchEvent(void* browser_context_id, const std::string& extension_id, scoped_ptr<Event> event) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); content::BrowserContext* context = reinterpret_cast<content::BrowserContext*>(browser_context_id); if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(context)) return; EventRouter* router = ExtensionSystem::Get(context)->event_router(); if (router) router->DispatchEventToExtension(extension_id, event.Pass()); } } // namespace core_api } // namespace extensions
{'content_hash': '446f8a2e58e5f52a543263693d5925a9', 'timestamp': '', 'source': 'github', 'line_count': 183, 'max_line_length': 80, 'avg_line_length': 36.24590163934426, 'alnum_prop': 0.6803859490426655, 'repo_name': 'patrickm/chromium.src', 'id': 'e985dfb7a2b70c23784737244bf6d7e8f9408219', 'size': '6633', 'binary': False, 'copies': '2', 'ref': 'refs/heads/nw', 'path': 'extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ASP', 'bytes': '853'}, {'name': 'AppleScript', 'bytes': '6973'}, {'name': 'Arduino', 'bytes': '464'}, {'name': 'Assembly', 'bytes': '52960'}, {'name': 'Awk', 'bytes': '8660'}, {'name': 'C', 'bytes': '40737238'}, {'name': 'C#', 'bytes': '1132'}, {'name': 'C++', 'bytes': '207930633'}, {'name': 'CSS', 'bytes': '939170'}, {'name': 'Java', 'bytes': '5844934'}, {'name': 'JavaScript', 'bytes': '17837835'}, {'name': 'Mercury', 'bytes': '10533'}, {'name': 'Objective-C', 'bytes': '886228'}, {'name': 'Objective-C++', 'bytes': '6667789'}, {'name': 'PHP', 'bytes': '97817'}, {'name': 'Perl', 'bytes': '672770'}, {'name': 'Python', 'bytes': '10857933'}, {'name': 'Rebol', 'bytes': '262'}, {'name': 'Shell', 'bytes': '1326032'}, {'name': 'Tcl', 'bytes': '277091'}, {'name': 'XSLT', 'bytes': '13493'}, {'name': 'nesC', 'bytes': '15206'}]}
======== Usage ======== To use twitfin in a project:: import twitfin
{'content_hash': '641c0dd00e70b5ee03390ce9374241cf', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 29, 'avg_line_length': 10.285714285714286, 'alnum_prop': 0.5555555555555556, 'repo_name': 'brennv/TwitFin_dev', 'id': '4ed0cd6a4f32db127c56f686c9bc482af941bf4f', 'size': '72', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'twitfin/docs/usage.rst', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '6467'}, {'name': 'Jupyter Notebook', 'bytes': '574085'}, {'name': 'Makefile', 'bytes': '7961'}, {'name': 'Python', 'bytes': '37468'}]}
var Animation = { duration: METRO_ANIMATION_DURATION, func: "swing", switch: function(current, next){ current.hide(); next.css({top: 0, left: 0}).show(); }, slideUp: function(current, next, duration, func){ var h = current.parent().outerHeight(true); if (duration === undefined) {duration = this.duration;} if (func === undefined) {func = this.func;} current.css("z-index", 1).animate({ top: -h }, duration, func); next.css({ top: h, left: 0, zIndex: 2 }).animate({ top: 0 }, duration, func); }, slideDown: function(current, next, duration, func){ var h = current.parent().outerHeight(true); if (duration === undefined) {duration = this.duration;} if (func === undefined) {func = this.func;} current.css("z-index", 1).animate({ top: h }, duration, func); next.css({ left: 0, top: -h, zIndex: 2 }).animate({ top: 0 }, duration, func); }, slideLeft: function(current, next, duration, func){ var w = current.parent().outerWidth(true); if (duration === undefined) {duration = this.duration;} if (func === undefined) {func = this.func;} current.css("z-index", 1).animate({ left: -w }, duration, func); next.css({ left: w, zIndex: 2 }).animate({ left: 0 }, duration, func); }, slideRight: function(current, next, duration, func){ var w = current.parent().outerWidth(true); if (duration === undefined) {duration = this.duration;} if (func === undefined) {func = this.func;} current.css("z-index", 1).animate({ left: w }, duration, func); next.css({ left: -w, zIndex: 2 }).animate({ left: 0 }, duration, func); }, fade: function(current, next, duration){ if (duration === undefined) {duration = this.duration;} current.animate({ opacity: 0 }, duration); next.css({ top: 0, left: 0 }).animate({ opacity: 1 }, duration); } }; Metro['animation'] = Animation;
{'content_hash': 'a1094ac054f5e6d878c3ce38f99711a6', 'timestamp': '', 'source': 'github', 'line_count': 92, 'max_line_length': 63, 'avg_line_length': 26.08695652173913, 'alnum_prop': 0.4825, 'repo_name': 'Pro-Club/MetroCL', 'id': '5563d967f9ffcd8dc91df1f97bc6c42cd3ffa2f9', 'size': '2400', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'js/utils/animation.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1964224'}, {'name': 'JavaScript', 'bytes': '966344'}]}
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 7, transform = "RelativeDifference", sigma = 0.0, exog_count = 0, ar_order = 12);
{'content_hash': '26a7359052ea266d21a9cc444005ebea', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 176, 'avg_line_length': 39.42857142857143, 'alnum_prop': 0.717391304347826, 'repo_name': 'antoinecarme/pyaf', 'id': '91e035cf4b42cdcc0c9c303b7117bdc3b611978a', 'size': '276', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/artificial/transf_RelativeDifference/trend_MovingMedian/cycle_7/ar_12/test_artificial_128_RelativeDifference_MovingMedian_7_12_0.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Makefile', 'bytes': '6773299'}, {'name': 'Procfile', 'bytes': '24'}, {'name': 'Python', 'bytes': '54209093'}, {'name': 'R', 'bytes': '807'}, {'name': 'Shell', 'bytes': '3619'}]}
(function( global, factory ) { if ( typeof module === "object" && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper window is present, // execute the factory and get jQuery // For environments that do not inherently posses a window with a document // (such as Node.js), expose a jQuery-making factory as module.exports // This accentuates the need for the creation of a real window // e.g. var jQuery = require("jquery")(window); // See ticket #14549 for more info module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) { throw new Error( "jQuery requires a window with a document" ); } return factory( w ); }; } else { factory( global ); } // Pass this if window is not defined yet }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ // var arr = []; var slice = arr.slice; var concat = arr.concat; var push = arr.push; var indexOf = arr.indexOf; var class2type = {}; var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; var support = {}; var // Use the correct document accordingly with window argument (sandbox) document = window.document, version = "2.1.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/parseJSON,-ajax/parseXML,-ajax/script,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-css,-css/addGetHookIf,-css/curCSS,-css/defaultDisplay,-css/hiddenVisibleSelectors,-css/support,-css/swap,-css/var/cssExpand,-css/var/getStyles,-css/var/isHidden,-css/var/rmargin,-css/var/rnumnonpx,-effects,-effects/Tween,-effects/animatedSelector,-dimensions,-offset,-event-alias", // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }, // Support: Android<4.1 // Make sure we trim BOM and NBSP rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: version, constructor: jQuery, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num != null ? // Return just the one element from the set ( num < 0 ? this[ num + this.length ] : this[ num ] ) : // Return all the elements in a clean array slice.call( this ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, slice: function() { return this.pushStack( slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: arr.sort, splice: arr.splice }; jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // skip the boolean and the target target = arguments[ i ] || {}; i++; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( i === length ) { target = this; i--; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module isReady: true, error: function( msg ) { throw new Error( msg ); }, noop: function() {}, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray, isWindow: function( obj ) { return obj != null && obj === obj.window; }, isNumeric: function( obj ) { // parseFloat NaNs numeric-cast false positives (null|true|false|"") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; }, isPlainObject: function( obj ) { // Not plain objects: // - Any object or value whose internal [[Class]] property is not "[object Object]" // - DOM nodes // - window if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } if ( obj.constructor && !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { return false; } // If the function hasn't returned already, we're confident that // |obj| is a plain object, created by {} or constructed with new Object return true; }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, type: function( obj ) { if ( obj == null ) { return obj + ""; } // Support: Android < 4.0, iOS < 6 (functionish RegExp) return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call(obj) ] || "object" : typeof obj; }, // Evaluates a script in a global context globalEval: function( code ) { var script, indirect = eval; code = jQuery.trim( code ); if ( code ) { // If the code includes a valid, prologue position // strict mode pragma, execute code by injecting a // script tag into the document. if ( code.indexOf("use strict") === 1 ) { script = document.createElement("script"); script.text = code; document.head.appendChild( script ).parentNode.removeChild( script ); } else { // Otherwise, avoid the DOM node creation, insertion // and removal by using an indirect global eval indirect( code ); } } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Support: Android<4.1 trim: function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { return arr == null ? -1 : indexOf.call( arr, elem, i ); }, merge: function( first, second ) { var len = +second.length, j = 0, i = first.length; for ( ; j < len; j++ ) { first[ i++ ] = second[ j ]; } first.length = i; return first; }, grep: function( elems, callback, invert ) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { callbackInverse = !callback( elems[ i ], i ); if ( callbackInverse !== callbackExpect ) { matches.push( elems[ i ] ); } } return matches; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their new values if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } } // Flatten any nested arrays return concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var tmp, args, proxy; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, now: Date.now, // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support }); // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( type === "function" || jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } /* * Optional (non-Sizzle) selector module for custom builds. * * Note that this DOES NOT SUPPORT many documented jQuery * features in exchange for its smaller size: * * Attribute not equal selector * Positional selectors (:first; :eq(n); :odd; etc.) * Type selectors (:input; :checkbox; :button; etc.) * State-based selectors (:animated; :visible; :hidden; etc.) * :has(selector) * :not(complex selector) * custom selectors via Sizzle extensions * Leading combinators (e.g., $collection.find("> *")) * Reliable functionality on XML fragments * Requiring all parts of a selector to match elements under context * (e.g., $div.find("div > *") now matches children of $div) * Matching against non-elements * Reliable sorting of disconnected nodes * querySelectorAll bug fixes (e.g., unreliable :focus on WebKit) * * If any of these are unacceptable tradeoffs, either use Sizzle or * customize this stub for the project's specific needs. */ var docElem = window.document.documentElement, selector_hasDuplicate, matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector, selector_sortOrder = function( a, b ) { // Flag for duplicate removal if ( a === b ) { selector_hasDuplicate = true; return 0; } var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); if ( compare ) { // Disconnected nodes if ( compare & 1 ) { // Choose the first element that is related to our document if ( a === document || jQuery.contains(document, a) ) { return -1; } if ( b === document || jQuery.contains(document, b) ) { return 1; } // Maintain original order return 0; } return compare & 4 ? -1 : 1; } // Not directly comparable, sort on existence of method return a.compareDocumentPosition ? -1 : 1; }; jQuery.extend({ find: function( selector, context, results, seed ) { var elem, nodeType, i = 0; results = results || []; context = context || document; // Same basic safeguard as Sizzle if ( !selector || typeof selector !== "string" ) { return results; } // Early return if context is not an element or document if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( seed ) { while ( (elem = seed[i++]) ) { if ( jQuery.find.matchesSelector(elem, selector) ) { results.push( elem ); } } } else { jQuery.merge( results, context.querySelectorAll(selector) ); } return results; }, unique: function( results ) { var elem, duplicates = [], i = 0, j = 0; selector_hasDuplicate = false; results.sort( selector_sortOrder ); if ( selector_hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }, text: function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array while ( (node = elem[i++]) ) { // Do not traverse comment nodes ret += jQuery.text( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements return elem.textContent; } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }, contains: function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && adown.contains(bup) ); }, isXMLDoc: function( elem ) { return (elem.ownerDocument || elem).documentElement.nodeName !== "HTML"; }, expr: { attrHandle: {}, match: { bool: /^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i, needsContext: /^[\x20\t\r\n\f]*[>+~]/ } } }); jQuery.extend( jQuery.find, { matches: function( expr, elements ) { return jQuery.find( expr, null, null, elements ); }, matchesSelector: function( elem, expr ) { return matches.call( elem, expr ); }, attr: function( elem, name ) { return elem.getAttribute( name ); } }); var rneedsContext = jQuery.expr.match.needsContext; var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); var risSimple = /^.[^:#\[\.,]*$/; // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( risSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( indexOf.call( qualifier, elem ) >= 0 ) !== not; }); } jQuery.filter = function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }; jQuery.fn.extend({ find: function( selector ) { var i, len = this.length, ret = [], self = this; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; } }); // Initialize a jQuery object // A central reference to the root jQuery(document) var rootjQuery, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, init = jQuery.fn.init = function( selector, context ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return typeof rootjQuery.ready !== "undefined" ? rootjQuery.ready( selector ) : // Execute immediately if ready is not present selector( jQuery ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }; // Give the init function the jQuery prototype for later instantiation init.prototype = jQuery.fn; // Initialize central reference rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.extend({ dir: function( elem, dir, until ) { var matched = [], truncate = until !== undefined; while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) { if ( elem.nodeType === 1 ) { if ( truncate && jQuery( elem ).is( until ) ) { break; } matched.push( elem ); } } return matched; }, sibling: function( n, elem ) { var matched = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { matched.push( n ); } } return matched; } }); jQuery.fn.extend({ has: function( target ) { var targets = jQuery( target, this ), l = targets.length; return this.filter(function() { var i = 0; for ( ; i < l; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, matched = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { matched.push( cur ); break; } } } return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return indexOf.call( jQuery( elem ), this[ 0 ] ); } // Locate the position of the desired element return indexOf.call( this, // If it receives a jQuery object, the first element is used elem.jquery ? elem[ 0 ] : elem ); }, add: function( selector, context ) { return this.pushStack( jQuery.unique( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return elem.contentDocument || jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var matched = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { matched = jQuery.filter( selector, matched ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { jQuery.unique( matched ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { matched.reverse(); } } return this.pushStack( matched ); }; }); var rnotwhite = (/\S+/g); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // Flag to know if list is currently firing firing, // First callback to fire (used internally by add and fireWith) firingStart, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( list && ( !fired || stack ) ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; if ( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); // The deferred used on DOM ready var readyList; jQuery.fn.ready = function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }; jQuery.extend({ // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.triggerHandler ) { jQuery( document ).triggerHandler( "ready" ); jQuery( document ).off( "ready" ); } } }); /** * The ready event handler and self cleanup method */ function completed() { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); jQuery.ready(); } jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); } else { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); } } return readyList.promise( obj ); }; // Kick off the DOM ready check even if the user does not jQuery.ready.promise(); // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, len = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < len; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : len ? fn( elems[0], key ) : emptyGet; }; /** * Determines whether an object can have data */ jQuery.acceptData = function( owner ) { // Accepts only: // - Node // - Node.ELEMENT_NODE // - Node.DOCUMENT_NODE // - Object // - Any /* jshint -W018 */ return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); }; function Data() { // Support: Android < 4, // Old WebKit does not have Object.preventExtensions/freeze method, // return new empty object instead with no [[set]] accessor Object.defineProperty( this.cache = {}, 0, { get: function() { return {}; } }); this.expando = jQuery.expando + Math.random(); } Data.uid = 1; Data.accepts = jQuery.acceptData; Data.prototype = { key: function( owner ) { // We can accept data for non-element nodes in modern browsers, // but we should not, see #8335. // Always return the key for a frozen object. if ( !Data.accepts( owner ) ) { return 0; } var descriptor = {}, // Check if the owner object already has a cache key unlock = owner[ this.expando ]; // If not, create one if ( !unlock ) { unlock = Data.uid++; // Secure it in a non-enumerable, non-writable property try { descriptor[ this.expando ] = { value: unlock }; Object.defineProperties( owner, descriptor ); // Support: Android < 4 // Fallback to a less secure definition } catch ( e ) { descriptor[ this.expando ] = unlock; jQuery.extend( owner, descriptor ); } } // Ensure the cache object if ( !this.cache[ unlock ] ) { this.cache[ unlock ] = {}; } return unlock; }, set: function( owner, data, value ) { var prop, // There may be an unlock assigned to this node, // if there is no entry for this "owner", create one inline // and set the unlock as though an owner entry had always existed unlock = this.key( owner ), cache = this.cache[ unlock ]; // Handle: [ owner, key, value ] args if ( typeof data === "string" ) { cache[ data ] = value; // Handle: [ owner, { properties } ] args } else { // Fresh assignments by object are shallow copied if ( jQuery.isEmptyObject( cache ) ) { jQuery.extend( this.cache[ unlock ], data ); // Otherwise, copy the properties one-by-one to the cache object } else { for ( prop in data ) { cache[ prop ] = data[ prop ]; } } } return cache; }, get: function( owner, key ) { // Either a valid cache is found, or will be created. // New caches will be created and the unlock returned, // allowing direct access to the newly created // empty data object. A valid owner object must be provided. var cache = this.cache[ this.key( owner ) ]; return key === undefined ? cache : cache[ key ]; }, access: function( owner, key, value ) { var stored; // In cases where either: // // 1. No key was specified // 2. A string key was specified, but no value provided // // Take the "read" path and allow the get method to determine // which value to return, respectively either: // // 1. The entire cache object // 2. The data stored at the key // if ( key === undefined || ((key && typeof key === "string") && value === undefined) ) { stored = this.get( owner, key ); return stored !== undefined ? stored : this.get( owner, jQuery.camelCase(key) ); } // [*]When the key is not a string, or both a key and value // are specified, set or extend (existing objects) with either: // // 1. An object of properties // 2. A key and value // this.set( owner, key, value ); // Since the "set" path can have two possible entry points // return the expected data based on which path was taken[*] return value !== undefined ? value : key; }, remove: function( owner, key ) { var i, name, camel, unlock = this.key( owner ), cache = this.cache[ unlock ]; if ( key === undefined ) { this.cache[ unlock ] = {}; } else { // Support array or space separated string of keys if ( jQuery.isArray( key ) ) { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = key.concat( key.map( jQuery.camelCase ) ); } else { camel = jQuery.camelCase( key ); // Try the string as a key before any manipulation if ( key in cache ) { name = [ key, camel ]; } else { // If a key with the spaces exists, use it. // Otherwise, create an array by matching non-whitespace name = camel; name = name in cache ? [ name ] : ( name.match( rnotwhite ) || [] ); } } i = name.length; while ( i-- ) { delete cache[ name[ i ] ]; } } }, hasData: function( owner ) { return !jQuery.isEmptyObject( this.cache[ owner[ this.expando ] ] || {} ); }, discard: function( owner ) { if ( owner[ this.expando ] ) { delete this.cache[ owner[ this.expando ] ]; } } }; var data_priv = new Data(); var data_user = new Data(); /* Implementation Summary 1. Enforce API surface and semantic compatibility with 1.9.x branch 2. Improve the module's maintainability by reducing the storage paths to a single mechanism. 3. Use the same single mechanism to support "private" and "user" data. 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 5. Avoid exposing implementation details on user objects (eg. expando properties) 6. Provide a clear path for implementation upgrade to WeakMap in 2014 */ var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /([A-Z])/g; function dataAttr( elem, key, data ) { var name; // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later data_user.set( elem, key, data ); } else { data = undefined; } } return data; } jQuery.extend({ hasData: function( elem ) { return data_user.hasData( elem ) || data_priv.hasData( elem ); }, data: function( elem, name, data ) { return data_user.access( elem, name, data ); }, removeData: function( elem, name ) { data_user.remove( elem, name ); }, // TODO: Now that all calls to _data and _removeData have been replaced // with direct calls to data_priv methods, these can be deprecated. _data: function( elem, name, data ) { return data_priv.access( elem, name, data ); }, _removeData: function( elem, name ) { data_priv.remove( elem, name ); } }); jQuery.fn.extend({ data: function( key, value ) { var i, name, data, elem = this[ 0 ], attrs = elem && elem.attributes; // Gets all values if ( key === undefined ) { if ( this.length ) { data = data_user.get( elem ); if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) { i = attrs.length; while ( i-- ) { // Support: IE11+ // The attrs elements can be null (#14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } } data_priv.set( elem, "hasDataAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { data_user.set( this, key ); }); } return access( this, function( value ) { var data, camelKey = jQuery.camelCase( key ); // The calling jQuery object (element matches) is not empty // (and therefore has an element appears at this[ 0 ]) and the // `value` parameter was not undefined. An empty jQuery object // will result in `undefined` for elem = this[ 0 ] which will // throw an exception if an attempt to read a data cache is made. if ( elem && value === undefined ) { // Attempt to get data from the cache // with the key as-is data = data_user.get( elem, key ); if ( data !== undefined ) { return data; } // Attempt to get data from the cache // with the key camelized data = data_user.get( elem, camelKey ); if ( data !== undefined ) { return data; } // Attempt to "discover" the data in // HTML5 custom data-* attrs data = dataAttr( elem, camelKey, undefined ); if ( data !== undefined ) { return data; } // We tried really hard, but the data doesn't exist. return; } // Set the data... this.each(function() { // First, attempt to store a copy or reference of any // data that might've been store with a camelCased key. var data = data_user.get( this, camelKey ); // For HTML5 data-* attribute interop, we have to // store property names with dashes in a camelCase form. // This might not apply to all properties...* data_user.set( this, camelKey, value ); // *... In the case of properties that might _actually_ // have dashes, we need to also store a copy of that // unchanged property. if ( key.indexOf("-") !== -1 && data !== undefined ) { data_user.set( this, key, value ); } }); }, null, value, arguments.length > 1, null, true ); }, removeData: function( key ) { return this.each(function() { data_user.remove( this, key ); }); } }); jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = data_priv.get( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray( data ) ) { queue = data_priv.access( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return data_priv.get( elem, key ) || data_priv.access( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { data_priv.remove( elem, [ type + "queue", key ] ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while ( i-- ) { tmp = data_priv.get( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; var rcheckableType = (/^(?:checkbox|radio)$/i); (function() { var fragment = document.createDocumentFragment(), div = fragment.appendChild( document.createElement( "div" ) ), input = document.createElement( "input" ); // #11217 - WebKit loses check when the name is after the checked attribute // Support: Windows Web Apps (WWA) // `name` and `type` need .setAttribute for WWA input.setAttribute( "type", "radio" ); input.setAttribute( "checked", "checked" ); input.setAttribute( "name", "t" ); div.appendChild( input ); // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 // old WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Make sure textarea (and checkbox) defaultValue is properly cloned // Support: IE9-IE11+ div.innerHTML = "<textarea>x</textarea>"; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; })(); var strundefined = typeof undefined; support.focusinBubbles = "onfocusin" in window; var rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = data_priv.get( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply( elem, arguments ) : undefined; }; } // Handle multiple events separated by a space types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = data_priv.hasData( elem ) && data_priv.get( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; data_priv.remove( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var i, cur, tmp, bubbleType, ontype, handle, special, eventPath = [ elem || document ], type = hasOwn.call( event, "type" ) ? event.type : event, namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && handle.apply && jQuery.acceptData( cur ) ) { event.result = handle.apply( cur, data ); if ( event.result === false ) { event.preventDefault(); } } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; elem[ type ](); jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, j, ret, matched, handleObj, handlerQueue = [], args = slice.call( arguments ), handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var i, matches, sel, handleObj, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { for ( ; cur !== this; cur = cur.parentNode || this ) { // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.disabled !== true || event.type !== "click" ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var eventDoc, doc, body, button = original.button; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: Cordova 2.5 (WebKit) (#13255) // All events should have a target; Cordova deviceready doesn't if ( !event.target ) { event.target = document; } // Support: Safari 6.0+, Chrome < 28 // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { this.focus(); return false; } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Support: Firefox 20+ // Firefox doesn't alert if the returnValue field is not set. if ( event.result !== undefined && event.originalEvent ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && // Support: Android < 4.0 src.returnValue === false ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( e && e.preventDefault ) { e.preventDefault(); } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( e && e.stopPropagation ) { e.stopPropagation(); } }, stopImmediatePropagation: function() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if ( e && e.stopImmediatePropagation ) { e.stopImmediatePropagation(); } this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks // Support: Chrome 15+ jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // Create "bubbling" focus and blur events // Support: Firefox, Chrome, Safari if ( !support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler on the document while someone wants focusin/focusout var handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { var doc = this.ownerDocument || this, attaches = data_priv.access( doc, fix ); if ( !attaches ) { doc.addEventListener( orig, handler, true ); } data_priv.access( doc, fix, ( attaches || 0 ) + 1 ); }, teardown: function() { var doc = this.ownerDocument || this, attaches = data_priv.access( doc, fix ) - 1; if ( !attaches ) { doc.removeEventListener( orig, handler, true ); data_priv.remove( doc, fix ); } else { data_priv.access( doc, fix, attaches ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var origFn, type; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { // Support: IE 9 option: [ 1, "<select multiple='multiple'>", "</select>" ], thead: [ 1, "<table>", "</table>" ], col: [ 2, "<table><colgroup>", "</colgroup></table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], _default: [ 0, "", "" ] }; // Support: IE 9 wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; // Support: 1.x compatibility // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[ 1 ]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var i = 0, l = elems.length; for ( ; i < l; i++ ) { data_priv.set( elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; if ( dest.nodeType !== 1 ) { return; } // 1. Copy private data: events, handlers, etc. if ( data_priv.hasData( src ) ) { pdataOld = data_priv.access( src ); pdataCur = data_priv.set( dest, pdataOld ); events = pdataOld.events; if ( events ) { delete pdataCur.handle; pdataCur.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } } // 2. Copy user data if ( data_user.hasData( src ) ) { udataOld = data_user.access( src ); udataCur = jQuery.extend( {}, udataOld ); data_user.set( dest, udataCur ); } } function getAll( context, tag ) { var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) : context.querySelectorAll ? context.querySelectorAll( tag || "*" ) : []; return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], ret ) : ret; } // Support: IE >= 9 function fixInput( src, dest ) { var nodeName = dest.nodeName.toLowerCase(); // Fails to persist the checked state of a cloned checkbox or radio button. if ( nodeName === "input" && rcheckableType.test( src.type ) ) { dest.checked = src.checked; // Fails to return the selected option to the default selected state when cloning options } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var i, l, srcElements, destElements, clone = elem.cloneNode( true ), inPage = jQuery.contains( elem.ownerDocument, elem ); // Support: IE >= 9 // Fix Cloning issues if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); for ( i = 0, l = srcElements.length; i < l; i++ ) { fixInput( srcElements[ i ], destElements[ i ] ); } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0, l = srcElements.length; i < l; i++ ) { cloneCopyEvent( srcElements[ i ], destElements[ i ] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var elem, tmp, tag, wrap, contains, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { // Support: QtWebKit // jQuery.merge because push.apply(_, arraylike) throws jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || fragment.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ]; // Descend through wrappers to the right content j = wrap[ 0 ]; while ( j-- ) { tmp = tmp.lastChild; } // Support: QtWebKit // jQuery.merge because push.apply(_, arraylike) throws jQuery.merge( nodes, tmp.childNodes ); // Remember the top-level container tmp = fragment.firstChild; // Fixes #12346 // Support: Webkit, IE tmp.textContent = ""; } } } // Remove wrapper from fragment fragment.textContent = ""; i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( fragment.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } return fragment; }, cleanData: function( elems ) { var data, elem, type, key, special = jQuery.event.special, i = 0; for ( ; (elem = elems[ i ]) !== undefined; i++ ) { if ( jQuery.acceptData( elem ) ) { key = elem[ data_priv.expando ]; if ( key && (data = data_priv.cache[ key ]) ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } if ( data_priv.cache[ key ] ) { // Discard any remaining `private` data delete data_priv.cache[ key ]; } } } // Discard any remaining `user` data delete data_user.cache[ elem[ data_user.expando ] ]; } } }); jQuery.fn.extend({ text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().each(function() { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.textContent = value; } }); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, remove: function( selector, keepData /* Internal Use Only */ ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { if ( elem.nodeType === 1 ) { // Prevent memory leaks jQuery.cleanData( getAll( elem, false ) ); // Remove any remaining nodes elem.textContent = ""; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map(function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return access( this, function( value ) { var elem = this[ 0 ] || {}, i = 0, l = this.length; if ( value === undefined && elem.nodeType === 1 ) { return elem.innerHTML; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for ( ; i < l; i++ ) { elem = this[ i ] || {}; // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch( e ) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var arg = arguments[ 0 ]; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { arg = this.parentNode; jQuery.cleanData( getAll( this ) ); if ( arg ) { arg.replaceChild( elem, this ); } }); // Force removal if there was no new content (e.g., from empty arguments) return arg && (arg.length || arg.nodeType) ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback ) { // Flatten any nested arrays args = concat.apply( [], args ); var fragment, first, scripts, hasScripts, node, doc, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[ 0 ], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || ( l > 1 && typeof value === "string" && !support.checkClone && rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[ 0 ] = value.call( this, index, self.html() ); } self.domManip( args, callback ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { // Support: QtWebKit // jQuery.merge because push.apply(_, arraylike) throws jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[ i ], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Optional AJAX dependency, but won't run scripts if not present if ( jQuery._evalUrl ) { jQuery._evalUrl( node.src ); } } else { jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); } } } } } } return this; } }); jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, ret = [], insert = jQuery( selector ), last = insert.length - 1, i = 0; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone( true ); jQuery( insert[ i ] )[ original ]( elems ); // Support: QtWebKit // .get() because push.apply(_, arraylike) throws push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ jQuery.fn.delay = function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }; (function() { var input = document.createElement( "input" ), select = document.createElement( "select" ), opt = select.appendChild( document.createElement( "option" ) ); input.type = "checkbox"; // Support: iOS 5.1, Android 4.x, Android 2.3 // Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere) support.checkOn = input.value !== ""; // Must access the parent to make an option select properly // Support: IE9, IE10 support.optSelected = opt.selected; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Check if an input maintains its value after becoming a radio // Support: IE9, IE10 input = document.createElement( "input" ); input.value = "t"; input.type = "radio"; support.radioValue = input.value === "t"; })(); var nodeHook, boolHook, attrHandle = jQuery.expr.attrHandle; jQuery.fn.extend({ attr: function( name, value ) { return access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); } }); jQuery.extend({ attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false elem[ propName ] = false; } elem.removeAttribute( name ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !support.radioValue && value === "radio" && jQuery.nodeName( elem, "input" ) ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } } }); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else { elem.setAttribute( name, name ); } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = attrHandle[ name ] || jQuery.find.attr; attrHandle[ name ] = function( elem, name, isXML ) { var ret, handle; if ( !isXML ) { // Avoid an infinite loop by temporarily removing this function from the getter handle = attrHandle[ name ]; attrHandle[ name ] = ret; ret = getter( elem, name, isXML ) != null ? name.toLowerCase() : null; attrHandle[ name ] = handle; } return ret; }; }); var rfocusable = /^(?:input|select|textarea|button)$/i; jQuery.fn.extend({ prop: function( name, value ) { return access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { return this.each(function() { delete this[ jQuery.propFix[ name ] || name ]; }); } }); jQuery.extend({ propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ? elem.tabIndex : -1; } } } }); // Support: IE9+ // Selectedness for an option in an optgroup can be inaccurate if ( !support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent && parent.parentNode ) { parent.parentNode.selectedIndex; } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); var rclass = /[\t\r\n\f]/g; jQuery.fn.extend({ addClass: function( value ) { var classes, elem, cur, clazz, j, finalValue, proceed = typeof value === "string" && value, i = 0, len = this.length; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } // only assign if different to avoid unneeded rendering. finalValue = jQuery.trim( cur ); if ( elem.className !== finalValue ) { elem.className = finalValue; } } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, finalValue, proceed = arguments.length === 0 || typeof value === "string" && value, i = 0, len = this.length; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } // only assign if different to avoid unneeded rendering. finalValue = value ? jQuery.trim( cur ) : ""; if ( elem.className !== finalValue ) { elem.className = finalValue; } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), classNames = value.match( rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( type === strundefined || type === "boolean" ) { if ( this.className ) { // store className if set data_priv.set( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; } }); var rreturn = /\r/g; jQuery.fn.extend({ val: function( value ) { var hooks, ret, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map( val, function( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { var val = jQuery.find.attr( elem, "value" ); return val != null ? val : // Support: IE10-11+ // option.text throws exceptions (#14686, #14858) jQuery.trim( jQuery.text( elem ) ); } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // IE6-9 doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) { optionSet = true; } } // force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } } }); // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); // Return jQuery for attributes-only inclusion jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.extend({ hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } }); jQuery.fn.extend({ wrapAll: function( html ) { var wrap; if ( jQuery.isFunction( html ) ) { return this.each(function( i ) { jQuery( this ).wrapAll( html.call(this, i) ); }); } if ( this[ 0 ] ) { // The elements to wrap the target around wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); if ( this[ 0 ].parentNode ) { wrap.insertBefore( this[ 0 ] ); } wrap.map(function() { var elem = this; while ( elem.firstElementChild ) { elem = elem.firstElementChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function( i ) { jQuery( this ).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function( i ) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } // Serialize an array of form elements or a set of // key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function() { // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function() { var type = this.type; // Use .is( ":disabled" ) so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !rcheckableType.test( type ) ); }) .map(function( i, elem ) { var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ) { return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string jQuery.parseHTML = function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts && scripts.length ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }; // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. // Note that for maximum portability, libraries that are not jQuery should // declare themselves as anonymous modules, and avoid setting a global if an // AMD loader is present. jQuery is a special case. For more information, see // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon if ( typeof define === "function" && define.amd ) { define( "jquery", [], function() { return jQuery; }); } var // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$; jQuery.noConflict = function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }; // Expose jQuery and $ identifiers, even in // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // and CommonJS for browser emulators (#13566) if ( typeof noGlobal === strundefined ) { window.jQuery = window.$ = jQuery; } return jQuery; }));
{'content_hash': '9fd3cc19a6dc3595fb9e165325ea7b4f', 'timestamp': '', 'source': 'github', 'line_count': 4441, 'max_line_length': 439, 'avg_line_length': 26.091646025669895, 'alnum_prop': 0.6082607682548997, 'repo_name': 'michael829/jquery-builder', 'id': '0d4419847a6d7d0e41622be8e3ec5417a52778e8', 'size': '116574', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'dist/2.1.1/jquery-ajax-css-event-alias-sizzle.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '12296'}]}
<html> <head> <script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script> <link rel="stylesheet" href="main.css"> </head> <body> <h1>Hello world</h1> <p>Edit and save this html page to see LiveReload triggered.</p> <div id="timein"></div> <script> document.getElementById('timein').innerHTML = Date.now(); </script> </body> </html>
{'content_hash': 'f7762c81212633f416e8626cd8be0773', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 155, 'avg_line_length': 31.714285714285715, 'alnum_prop': 0.6328828828828829, 'repo_name': 'henrytseng/hostr', 'id': 'f457a942fa41423e4b992c7206fe6ea1a079e817', 'size': '444', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'examples/index.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '14909'}]}
/** * The Scene Systems Resume Event. * * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, * or as an action from another Scene. * * Listen to it from a Scene using `this.scene.events.on('resume', listener)`. * * @event Phaser.Scenes.Events#RESUME * @since 3.0.0 * * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed. */ module.exports = 'resume';
{'content_hash': '6b2e9b00914948fa222c79d3895c7b30', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 119, 'avg_line_length': 35.11764705882353, 'alnum_prop': 0.7018425460636516, 'repo_name': 'mahill/phaser', 'id': '52e2f5eeb8624f7c68b81e8268a76f7e5c9acc80', 'size': '771', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/scene/events/RESUME_EVENT.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'GLSL', 'bytes': '5440'}, {'name': 'JavaScript', 'bytes': '7845257'}, {'name': 'TypeScript', 'bytes': '25007'}]}
package org.diirt.graphene; import org.diirt.util.stats.Range; import java.awt.Color; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.geom.Path2D; import java.awt.image.BufferedImage; import java.awt.image.DataBufferByte; import java.util.List; import org.diirt.util.array.ListInt; import org.diirt.util.array.ListMath; import org.diirt.util.array.ListNumber; import org.diirt.util.array.ListNumbers; import org.diirt.util.array.SortedListView; /** * Provides low level drawing operations, at the right granularity to perform * them efficiently, but without performing any high level decisions (e.g. formatting, * layout) * <p> * This class takes care of putting the pixels where it is told. It specifically * does not concerns itself with the calculation of what/where to draw. It provides * the drawing of aggregated data structures, so that the plotting can be * efficient and clean. * <p> * It also serves as a wrapper around Java2D (<code>Graphics2D</code>) so that * the drawing can be re-implemented efficiently on other engines in the future, * such as JavaFX. * * @author carcassi, sjdallst, asbarber, jkfeng */ public class GraphBuffer { private final BufferedImage image; private final Graphics2D g; /** * Represents the pixels of a 2D image. if a the image has a width w, then * the point (x, y) is represented by the y*width + x pixel. */ private final byte[] pixels; private final boolean hasAlphaChannel; private final int width, height; /** * Creates a GraphBuffer with the given image on which to draw a graph. * * @param image an image on which we can draw a graph */ private GraphBuffer(BufferedImage image){ this.image = image; width = image.getWidth(); height = image.getHeight(); pixels = ((DataBufferByte)this.image.getRaster().getDataBuffer()).getData(); hasAlphaChannel = image.getAlphaRaster() != null; g = image.createGraphics(); } /** * Creates a GraphBuffer with the given width and height. * * @param width width of the graph * @param height height of the graph */ public GraphBuffer(int width, int height) { this(new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR)); } /** * Creates a GraphBuffer suitable for the given renderer. Makes sure * all the parameters from the renderer are consistent with the buffer itself. * * @param renderer the graph renderer */ public GraphBuffer(Graph2DRenderer<?> renderer) { this(renderer.getImageWidth(), renderer.getImageHeight()); } /** * Changes the pixel at the given coordinates to the given color. * TODO: make sure all other plotting functions use this. * * @param x x-coordinate of a pixel * @param y y-coordinate of a pixel * @param color color-value of the pixel */ public void setPixel(int x, int y, int color){ if(hasAlphaChannel){ pixels[y*image.getWidth()*4 + x*4 + 3] = (byte)(color >> 24 & 0xFF); pixels[y*image.getWidth()*4 + x*4 + 0] = (byte)(color >> 0 & 0xFF); pixels[y*image.getWidth()*4 + x*4 + 1] = (byte)(color >> 8 & 0xFF); pixels[y*image.getWidth()*4 + x*4 + 2] = (byte)(color >> 16 & 0xFF); } else{ pixels[y*image.getWidth()*3 + x*3 + 0] = (byte)(color >> 0 & 0xFF); pixels[y*image.getWidth()*3 + x*3 + 1] = (byte)(color >> 8 & 0xFF); pixels[y*image.getWidth()*3 + x*3 + 2] = (byte)(color >> 16 & 0xFF); } } /** * Temporary method to retrieve the image buffer. Will be removed once * this class is finished. * * @return the rendering buffer */ public BufferedImage getImage(){ return image; } /** * Temporary method to retrieve the graphics context. Will be removed once * this class is finished. * * @return the graphics context */ public Graphics2D getGraphicsContext(){ return g; } /** * Plots a two dimensional array of values encoded by color. * * @param xStartPoint the horizontal coordinate for the first pixel of the image * @param yStartPoint the vertical coordinate for the first pixel of the image * @param xPointToDataMap a map from pixel horizontal offset to data index * @param yPointToDataMap a map from pixel vertical offset to data index * @param data the dataset to be plotted * @param colorMap the color map */ public void drawDataImage(int xStartPoint, int yStartPoint, int[] xPointToDataMap, int[] yPointToDataMap, Cell2DDataset data, NumberColorMapInstance colorMap) { int previousYData = -1; // Loop through the points to be plotted. The length of the image is // given by the point to data map, since it tells how many points are mapped. for (int yOffset = 0; yOffset < yPointToDataMap.length; yOffset++) { int yData = yPointToDataMap[yOffset]; if (yData != previousYData) { for (int xOffset = 0; xOffset < xPointToDataMap.length; xOffset++) { int xData = xPointToDataMap[xOffset]; // Get the value, convert to color and plot int rgb = colorMap.colorFor(data.getValue(xData, yData)); setPixel( xStartPoint + xOffset , yStartPoint + yOffset , rgb ); } // If the current line is the same as the previous, it's // faster to make a copy } else { if (hasAlphaChannel) { System.arraycopy(pixels, (yStartPoint + yOffset - 1)*width*4 + 4*xStartPoint, pixels, (yStartPoint + yOffset)*width*4 + 4*xStartPoint, xPointToDataMap.length*4); } else { System.arraycopy(pixels, (yStartPoint + yOffset - 1)*width*3 + 3*xStartPoint, pixels, (yStartPoint + yOffset)*width*3 + 3*xStartPoint, xPointToDataMap.length*3); } } previousYData = yData; } } private double xLeftValue; private double xRightValue; private double xLeftPixel; private double xRightPixel; private ValueScale xValueScale; /** * Sets the scaling data for the x axis assuming values are going * to represent cells. The minimum value is going to be positioned at the * left of the xMinPixel while the maximum value is going to be position * at the right of the xMaxPixel. * * @param range the range to be displayed * @param xMinPixel the pixel corresponding to the minimum * @param xMaxPixel the pixel corresponding to the maximum * @param xValueScale the scale used to transform values to pixel */ public void setXScaleAsCell(Range range, int xMinPixel, int xMaxPixel, ValueScale xValueScale) { xLeftValue = range.getMinimum(); xRightValue = range.getMaximum(); xLeftPixel = xMinPixel; xRightPixel = xMaxPixel + 1; this.xValueScale = xValueScale; } /** * Sets the scaling data for the x axis assuming values are going * to represent points. The minimum value is going to be positioned in the * center of the xMinPixel while the maximum value is going to be position * in the middle of the xMaxPixel. * * @param range the range to be displayed * @param xMinPixel the pixel corresponding to the minimum * @param xMaxPixel the pixel corresponding to the maximum * @param xValueScale the scale used to transform values to pixel */ public void setXScaleAsPoint(Range range, int xMinPixel, int xMaxPixel, ValueScale xValueScale) { xLeftValue = range.getMinimum(); xRightValue = range.getMaximum(); xLeftPixel = xMinPixel + 0.5; xRightPixel = xMaxPixel + 0.5; this.xValueScale = xValueScale; } /** * Converts the given value to the pixel position. * * @param value the value * @return the pixel where the value should be mapped */ public int xValueToPixel(double value) { return (int) xValueScale.scaleValue(value, xLeftValue, xRightValue, xLeftPixel, xRightPixel); } /** * Converts the left side of given pixel position to the actual value. * * @param pixelValue the pixel * @return the value at the pixel */ public double xPixelLeftToValue(int pixelValue) { return xValueScale.invScaleValue(pixelValue, xLeftValue, xRightValue, xLeftPixel, xRightPixel); } /** * Converts the right side of given pixel position to the actual value. * * @param pixelValue the pixel * @return the value at the pixel */ public double xPixelRightToValue(int pixelValue) { return xValueScale.invScaleValue(pixelValue + 1, xLeftValue, xRightValue, xLeftPixel, xRightPixel); } /** * Converts the center of given pixel position to the actual value. * * @param pixelValue the pixel * @return the value at the pixel */ public double xPixelCenterToValue(int pixelValue) { return xValueScale.invScaleValue(pixelValue + 0.5, xLeftValue, xRightValue, xLeftPixel, xRightPixel); } private double yTopValue; private double yBottomValue; private double yTopPixel; private double yBottomPixel; private ValueScale yValueScale; /** * Sets the scaling data for the y axis assuming values are going * to represent cells. The minimum value is going to be positioned at the * bottom of the yMinPixel while the maximum value is going to be position * at the top of the yMaxPixel. * * @param range the range to be displayed * @param yMinPixel the pixel corresponding to the minimum * @param yMaxPixel the pixel corresponding to the maximum * @param yValueScale the scale used to transform values to pixel */ public void setYScaleAsCell(Range range, int yMinPixel, int yMaxPixel, ValueScale yValueScale) { yTopValue = range.getMaximum(); yBottomValue = range.getMinimum(); yTopPixel = yMaxPixel - 1; yBottomPixel = yMinPixel; this.yValueScale = yValueScale; } /** * Sets the scaling data for the y axis assuming values are going * to represent points. The minimum value is going to be positioned in the * center of the yMinPixel while the maximum value is going to be position * in the center of the yMaxPixel. * * @param range the range to be displayed * @param yMinPixel the pixel corresponding to the minimum * @param yMaxPixel the pixel corresponding to the maximum * @param yValueScale the scale used to transform values to pixel */ public void setYScaleAsPoint(Range range, int yMinPixel, int yMaxPixel, ValueScale yValueScale) { yTopValue = range.getMaximum(); yBottomValue = range.getMinimum(); yTopPixel = yMaxPixel - 0.5; yBottomPixel = yMinPixel - 0.5; this.yValueScale = yValueScale; } /** * Converts the given value to the pixel position. * * @param value the value * @return the pixel where the value should be mapped */ public int yValueToPixel(double value) { return (int) Math.ceil(yValueScale.scaleValue(value, yBottomValue, yTopValue, yBottomPixel, yTopPixel)); } /** * Converts the top side of given pixel position to the actual value. * * @param pixelValue the pixel * @return the value at the pixel */ public double yPixelTopToValue(int pixelValue) { return yValueScale.invScaleValue(pixelValue - 1, yBottomValue, yTopValue, yBottomPixel, yTopPixel); } /** * Converts the center of given pixel position to the actual value. * * @param pixelValue the pixel * @return the value at the pixel */ public double yPixelCenterToValue(int pixelValue) { return yValueScale.invScaleValue(pixelValue - 0.5, yBottomValue, yTopValue, yBottomPixel, yTopPixel); } /** * Converts the bottom side of given pixel position to the actual value. * * @param pixelValue the pixel * @return the value at the pixel */ public double yPixelBottomToValue(int pixelValue) { return yValueScale.invScaleValue(pixelValue, yBottomValue, yTopValue, yBottomPixel, yTopPixel); } void drawBackground(Color color) { g.setColor(color); g.fillRect(0, 0, width, height); } private static final int MIN = 0; private static final int MAX = 1; // TODO: methods to draw labels on the top and on the left side of the graph /** * Draws the given labels a the bottom of the graph area. * <p> * This method may not display some labels in case they would overlap with * each other. It does try, though, to make sure that the first and the * last label are always displayed. * * @param labels a list of x-axis labels to be drawn * @param valuePixelPositions the central x-coordinate of each label * @param labelColor color of the label text * @param labelFont font style of the label text * @param leftPixel the leftmost x-coordinate at which the label may be drawn * @param rightPixel the rightmost x-coordinate at which the label may be drawn * @param topPixel the y-coordinate of the top of the label */ void drawBottomLabels(List<String> labels, ListInt valuePixelPositions, Color labelColor, Font labelFont, int leftPixel, int rightPixel, int topPixel) { // Draw X labels if (labels != null && !labels.isEmpty()) { //g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); g.setColor(labelColor); g.setFont(labelFont); FontMetrics metrics = g.getFontMetrics(); // Draw first and last label to make sure they fit int[] drawRange = new int[] {leftPixel, rightPixel}; drawLineLabel(g, metrics, labels.get(0), valuePixelPositions.getInt(0), drawRange, topPixel, true, false); drawLineLabel(g, metrics, labels.get(labels.size() - 1), valuePixelPositions.getInt(labels.size() - 1), drawRange, topPixel, false, false); for (int i = 1; i < labels.size() - 1; i++) { drawLineLabel(g, metrics, labels.get(i), valuePixelPositions.getInt(i), drawRange, topPixel, true, false); } } } /** * Draws some labels, which are plaintext, on the graph. * * @param graphics the graphics object containing the graph * @param metrics the font style * @param text the text of the label * @param xCenter x coordinate of where the label should be centered * @param drawRange defines the range of coordinates where this label is allowed to be centered * @param yTop define the y-coordinate of the top of the label * @param updateMin whether we should be updating the minimum of the draw range * or the maximum * @param centeredOnly true if the label should be only displayed if it can be * properly centered, and skipped if it cannot */ private static void drawLineLabel(Graphics2D graphics, FontMetrics metrics, String text, int xCenter, int[] drawRange, int yTop, boolean updateMin, boolean centeredOnly) { // If the center is not in the range, don't draw anything if (drawRange[MAX] < xCenter || drawRange[MIN] > xCenter) return; // If there is no space, don't draw anything if (drawRange[MAX] - drawRange[MIN] < metrics.getHeight()) return; Java2DStringUtilities.Alignment alignment = Java2DStringUtilities.Alignment.TOP; int targetX = xCenter; int halfWidth = metrics.stringWidth(text) / 2; if (xCenter < drawRange[MIN] + halfWidth) { // Can't be drawn in the center if (centeredOnly) return; alignment = Java2DStringUtilities.Alignment.TOP_LEFT; targetX = drawRange[MIN]; } else if (xCenter > drawRange[MAX] - halfWidth) { // Can't be drawn in the center if (centeredOnly) return; alignment = Java2DStringUtilities.Alignment.TOP_RIGHT; targetX = drawRange[MAX]; } Java2DStringUtilities.drawString(graphics, alignment, targetX, yTop, text); if (updateMin) { drawRange[MIN] = targetX + metrics.getHeight(); } else { drawRange[MAX] = targetX - metrics.getHeight(); } } void drawLeftLabels(List<String> labels, ListInt valuePixelPositions, Color labelColor, Font labelFont, int bottomPixel, int topPixel, int leftPixel) { // Draw Y labels if (labels != null && !labels.isEmpty()) { //g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); g.setColor(labelColor); g.setFont(labelFont); FontMetrics metrics = g.getFontMetrics(); // Draw first and last label int[] drawRange = new int[] {topPixel, bottomPixel}; drawColumnLabel(g, metrics, labels.get(0), valuePixelPositions.getInt(0), drawRange, leftPixel, true, false); drawColumnLabel(g, metrics, labels.get(labels.size() - 1), valuePixelPositions.getInt(labels.size() - 1), drawRange, leftPixel, false, false); for (int i = 1; i < labels.size() - 1; i++) { drawColumnLabel(g, metrics, labels.get(i), valuePixelPositions.getInt(i), drawRange, leftPixel, true, false); } } } private static void drawColumnLabel(Graphics2D graphics, FontMetrics metrics, String text, int yCenter, int[] drawRange, int xRight, boolean updateMin, boolean centeredOnly) { // If the center is not in the range, don't draw anything if (drawRange[MAX] < yCenter || drawRange[MIN] > yCenter) return; // If there is no space, don't draw anything if (drawRange[MAX] - drawRange[MIN] < metrics.getHeight()) return; Java2DStringUtilities.Alignment alignment = Java2DStringUtilities.Alignment.RIGHT; int targetY = yCenter; int halfHeight = metrics.getAscent() / 2; if (yCenter < drawRange[MIN] + halfHeight) { // Can't be drawn in the center if (centeredOnly) return; alignment = Java2DStringUtilities.Alignment.TOP_RIGHT; targetY = drawRange[MIN]; } else if (yCenter > drawRange[MAX] - halfHeight) { // Can't be drawn in the center if (centeredOnly) return; alignment = Java2DStringUtilities.Alignment.BOTTOM_RIGHT; targetY = drawRange[MAX]; } Java2DStringUtilities.drawString(graphics, alignment, xRight, targetY, text); if (updateMin) { drawRange[MAX] = targetY - metrics.getHeight(); } else { drawRange[MIN] = targetY + metrics.getHeight(); } } void drawHorizontalReferenceLines(ListInt referencePixels, Color lineColor, int graphLeftPixel, int graphRightPixel) { g.setColor(lineColor); g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); //draw a line from (graphLeftPixel, y) to (graphRightPixel, y) for (int i = 0; i < referencePixels.size(); i++) { g.drawLine(graphLeftPixel, referencePixels.getInt(i), graphRightPixel, referencePixels.getInt(i)); } } void drawVerticalReferenceLines(ListInt referencePixels, Color lineColor, int graphBottomPixel, int graphTopPixel) { g.setColor(lineColor); g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); for (int i = 0; i < referencePixels.size(); i++) { g.drawLine(referencePixels.getInt(i), graphTopPixel, referencePixels.getInt(i), graphBottomPixel); } } private static class ScaledData { private double[] scaledX; private double[] scaledY; private int start; private int end; } public void drawValueLine(ListNumber xValues, ListNumber yValues, InterpolationScheme interpolation, ProcessValue pv) { ReductionScheme reductionScheme = ReductionScheme.NONE; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); ScaledData scaledData; switch (reductionScheme) { default: throw new IllegalArgumentException("Reduction scheme " + reductionScheme + " not supported"); case NONE: scaledData = scaleNoReduction(xValues, yValues,pv); break; } // create path Path2D path; switch (interpolation) { default: case NEAREST_NEIGHBOR: path = nearestNeighbour(scaledData); break; case LINEAR: path = linearInterpolation(scaledData); break; case CUBIC: path = cubicInterpolation(scaledData); break; } // Draw the line g.draw(path); } public void drawValueExplicitLine(Point2DDataset data, InterpolationScheme interpolation, ReductionScheme reduction,ProcessValue pv){ SortedListView xValues = ListNumbers.sortedView(data.getXValues()); ListNumber yValues = ListNumbers.sortedView(data.getYValues(), xValues.getIndexes()); this.drawValueExplicitLine(xValues, yValues, interpolation, reduction, pv); } private void drawValueExplicitLine(ListNumber xValues, ListNumber yValues, InterpolationScheme interpolation, ReductionScheme reduction,ProcessValue pv) { g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); ScaledData scaledData; int start = ListNumbers.binarySearchValueOrLower(xValues, xLeftValue); int end = ListNumbers.binarySearchValueOrHigher(xValues, xRightValue); xValues = ListMath.limit(xValues, start, end + 1); yValues = ListMath.limit(yValues, start, end + 1); switch (reduction) { default: throw new IllegalArgumentException("Reduction scheme " + reduction + " not supported"); case NONE: scaledData = scaleNoReduction(xValues, yValues, start,pv); break; case FIRST_MAX_MIN_LAST: scaledData = scaleFirstMaxMinLastReduction(xValues, yValues, start,pv); break; } // create path Path2D path; switch (interpolation) { default: case NEAREST_NEIGHBOR: path = nearestNeighbour(scaledData); break; case LINEAR: path = linearInterpolation(scaledData); break; case CUBIC: path = cubicInterpolation(scaledData); break; } // Draw the line g.draw(path); } private ScaledData scaleNoReduction(ListNumber xValues, ListNumber yValues,ProcessValue pv) { return scaleNoReduction(xValues, yValues, 0,pv); } private ScaledData scaleNoReduction(ListNumber xValues, ListNumber yValues, int dataStart,ProcessValue pv) { ScaledData scaledData = new ScaledData(); int dataCount = xValues.size(); scaledData.scaledX = new double[dataCount]; scaledData.scaledY = new double[dataCount]; for (int i = 0; i < scaledData.scaledY.length; i++) { scaledData.scaledX[i] = xValueToPixel(xValues.getDouble(i)); scaledData.scaledY[i] = yValueToPixel(yValues.getDouble(i)); pv.processScaledValue(dataStart + i, xValues.getDouble(i), yValues.getDouble(i), scaledData.scaledX[i], scaledData.scaledY[i]); } scaledData.end = dataCount; return scaledData; } private ScaledData scaleFirstMaxMinLastReduction(ListNumber xValues, ListNumber yValues, int dataStart, ProcessValue pv) { // The number of points generated by this is about 4 times the // number of points on the x axis. If the number of points is less // than that, it's not worth it. Don't do the data reduction. int xPlotCoordWidth=300; if (xValues.size() < xPlotCoordWidth * 4) { return scaleNoReduction(xValues, yValues, dataStart,pv); } ScaledData scaledData = new ScaledData(); scaledData.scaledX = new double[((int) xPlotCoordWidth + 1)*4 ]; scaledData.scaledY = new double[((int) xPlotCoordWidth + 1)*4]; int cursor = 0; int previousPixel = xValueToPixel(xValues.getDouble(0)); double last = yValueToPixel(yValues.getDouble(0)); double min = last; double max = last; scaledData.scaledX[0] = previousPixel; scaledData.scaledY[0] = min; pv.processScaledValue(dataStart, xValues.getDouble(0), yValues.getDouble(0), xValueToPixel(xValues.getDouble(0)), last); cursor++; for (int i = 1; i < xValues.size(); i++) { double currentScaledX = xValueToPixel(xValues.getDouble(i)); int currentPixel = (int) currentScaledX; if (currentPixel == previousPixel) { last = yValueToPixel(yValues.getDouble(i)); min = MathIgnoreNaN.min(min, last); max = MathIgnoreNaN.max(max, last); pv.processScaledValue(dataStart + i, xValues.getDouble(i), yValues.getDouble(i), currentScaledX, last); } else { scaledData.scaledX[cursor] = previousPixel; scaledData.scaledY[cursor] = max; cursor++; scaledData.scaledX[cursor] = previousPixel; scaledData.scaledY[cursor] = min; cursor++; scaledData.scaledX[cursor] = previousPixel; scaledData.scaledY[cursor] = last; cursor++; previousPixel = currentPixel; last = yValueToPixel(yValues.getDouble(i)); min = last; max = last; scaledData.scaledX[cursor] = currentPixel; scaledData.scaledY[cursor] = last; cursor++; } } scaledData.scaledX[cursor] = previousPixel; scaledData.scaledY[cursor] = max; cursor++; scaledData.scaledX[cursor] = previousPixel; scaledData.scaledY[cursor] = min; cursor++; scaledData.end = cursor; return scaledData; } private static Path2D.Double nearestNeighbour(ScaledData scaledData) { double[] scaledX = scaledData.scaledX; double[] scaledY = scaledData.scaledY; int start = scaledData.start; int end = scaledData.end; Path2D.Double line = new Path2D.Double(); line.moveTo(scaledX[start], scaledY[start]); for (int i = 1; i < end; i++) { double halfX = scaledX[i - 1] + (scaledX[i] - scaledX[i - 1]) / 2; if (!java.lang.Double.isNaN(scaledY[i-1])) { line.lineTo(halfX, scaledY[i - 1]); if (!java.lang.Double.isNaN(scaledY[i])) line.lineTo(halfX, scaledY[i]); } else { line.moveTo(halfX, scaledY[i]); } } line.lineTo(scaledX[end - 1], scaledY[end - 1]); return line; } private static Path2D.Double linearInterpolation(ScaledData scaledData){ double[] scaledX = scaledData.scaledX; double[] scaledY = scaledData.scaledY; int start = scaledData.start; int end = scaledData.end; Path2D.Double line = new Path2D.Double(); for (int i = start; i < end; i++) { // Do I have a current value? if (!java.lang.Double.isNaN(scaledY[i])) { // Do I have a previous value? if (i != start && !java.lang.Double.isNaN(scaledY[i - 1])) { // Here I have both the previous value and the current value line.lineTo(scaledX[i], scaledY[i]); } else { // Don't have a previous value // Do I have a next value? if (i != end - 1 && !java.lang.Double.isNaN(scaledY[i + 1])) { // There is no value before, but there is a value after line.moveTo(scaledX[i], scaledY[i]); } else { // There is no value either before or after line.moveTo(scaledX[i] - 1, scaledY[i]); line.lineTo(scaledX[i] + 1, scaledY[i]); } } } } return line; } private static Path2D.Double cubicInterpolation(ScaledData scaledData){ double[] scaledX = scaledData.scaledX; double[] scaledY = scaledData.scaledY; int start = scaledData.start; int end = scaledData.end; Path2D.Double path = new Path2D.Double(); for (int i = start; i < end; i++) { double y1; double y2; double x1; double x2; double y0; double x0; double y3; double x3; double bx0; double by0; double bx3; double by3; double bdy0; double bdy3; double bx1; double by1; double bx2; double by2; //Do I have current value? if (!java.lang.Double.isNaN(scaledY[i])){ //Do I have previous value? if (i > start && !java.lang.Double.isNaN(scaledY[i - 1])) { //Do I have value two before? if (i > start + 1 && !java.lang.Double.isNaN(scaledY[i - 2])) { //Do I have next value? if (i != end - 1 && !java.lang.Double.isNaN(scaledY[i + 1])) { y2 = scaledY[i]; x2 = scaledX[i]; y0 = scaledY[i - 2]; x0 = scaledX[i - 2]; y3 = scaledY[i + 1]; x3 = scaledX[i + 1]; y1 = scaledY[i - 1]; x1 = scaledX[i - 1]; bx0 = x1; by0 = y1; bx3 = x2; by3 = y2; bdy0 = (y2 - y0) / (x2 - x0); bdy3 = (y3 - y1) / (x3 - x1); bx1 = bx0 + (x2 - x0) / 6.0; by1 = (bx1 - bx0) * bdy0 + by0; bx2 = bx3 - (x3 - x1) / 6.0; by2 = (bx2 - bx3) * bdy3 + by3; path.curveTo(bx1, by1, bx2, by2, bx3, by3); } else{//Have current, previous, two before, but not value after y2 = scaledY[i]; x2 = scaledX[i]; y1 = scaledY[i - 1]; x1 = scaledX[i - 1]; y0 = scaledY[i - 2]; x0 = scaledX[i - 2]; y3 = y2 + (y2 - y1) / 2; x3 = x2 + (x2 - x1) / 2; bx0 = x1; by0 = y1; bx3 = x2; by3 = y2; bdy0 = (y2 - y0) / (x2 - x0); bdy3 = (y3 - y1) / (x3 - x1); bx1 = bx0 + (x2 - x0) / 6.0; by1 = (bx1 - bx0) * bdy0 + by0; bx2 = bx3 - (x3 - x1) / 6.0; by2 = (bx2 - bx3) * bdy3 + by3; path.curveTo(bx1, by1, bx2, by2, bx3, by3); } } else if (i != end - 1 && !java.lang.Double.isNaN(scaledY[i + 1])) { //Have current , previous, and next, but not two before path.moveTo(scaledX[i - 1], scaledY[i - 1]); y2 = scaledY[i]; x2 = scaledX[i]; y1 = scaledY[i - 1]; x1 = scaledX[i - 1]; y0 = y1 - (y2 - y1) / 2; x0 = x1 - (x2 - x1) / 2; y3 = scaledY[i + 1]; x3 = scaledX[i + 1]; bx0 = x1; by0 = y1; bx3 = x2; by3 = y2; bdy0 = (y2 - y0) / (x2 - x0); bdy3 = (y3 - y1) / (x3 - x1); bx1 = bx0 + (x2 - x0) / 6.0; by1 = (bx1 - bx0) * bdy0 + by0; bx2 = bx3 - (x3 - x1) / 6.0; by2 = (bx2 - bx3) * bdy3 + by3; path.curveTo(bx1, by1, bx2, by2, bx3, by3); }else{//have current, previous, but not two before or next path.lineTo(scaledX[i], scaledY[i]); } //have current, but not previous }else{ // No previous value if (i != end - 1 && !java.lang.Double.isNaN(scaledY[i + 1])) { // If we have the next value, just move, we'll draw later path.moveTo(scaledX[i], scaledY[i]); } else { // If not, write a small horizontal line path.moveTo(scaledX[i] - 1, scaledY[i]); path.lineTo(scaledX[i] + 1, scaledY[i]); } } }else{ //do not have current // Do nothing } } return path; } }
{'content_hash': '710930d4ee40f975b326702279149a9c', 'timestamp': '', 'source': 'github', 'line_count': 848, 'max_line_length': 179, 'avg_line_length': 41.54599056603774, 'alnum_prop': 0.5730180806675939, 'repo_name': 'berryma4/diirt', 'id': '0a7d8daae65050d038e14603aaa17daa724f1a50', 'size': '35372', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'graphene/graphene/src/main/java/org/diirt/graphene/GraphBuffer.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '314'}, {'name': 'CSS', 'bytes': '75261'}, {'name': 'GAP', 'bytes': '5847'}, {'name': 'HTML', 'bytes': '423157'}, {'name': 'Java', 'bytes': '4747777'}, {'name': 'JavaScript', 'bytes': '1745584'}, {'name': 'Shell', 'bytes': '3095'}]}
#ifndef PLATFORM_H #define PLATFORM_H #ifdef __linux__ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #endif #include <stdbool.h> #include <stdint.h> /** Convenience macro for making extern "C" more succinct. * */ #if defined(__cplusplus) # define PONY_EXTERN_C_BEGIN extern "C" { # define PONY_EXTERN_C_END } #else # define PONY_EXTERN_C_BEGIN # define PONY_EXTERN_C_END #endif /** Determines the operating system. * */ #if defined(__APPLE__) && defined(__MACH__) # define PLATFORM_IS_MACOSX #elif defined(__linux__) # define PLATFORM_IS_LINUX #elif defined(__FreeBSD__) # define PLATFORM_IS_BSD # define PLATFORM_IS_FREEBSD #elif defined(__DragonFly__) # define PLATFORM_IS_BSD # define PLATFORM_IS_DRAGONFLY #elif defined(__OpenBSD__) # define PLATFORM_IS_BSD # define PLATFORM_IS_OPENBSD #elif defined(__EMSCRIPTEN__) # define PLATFORM_IS_EMSCRIPTEN # define USE_SCHEDULER_SCALING_PTHREADS #elif defined(_WIN32) # define PLATFORM_IS_WINDOWS # if defined(_MSC_VER) # define PLATFORM_IS_VISUAL_STUDIO /** Disable warnings about default constructors and class operators. * * Visual studio complains about the lack of default constructors for * standard C structs (4510). The same applies for assignment operators * (4512). We also do not want to be warned about structs that cannot be * instantiated due to missing default constructors (4610). * * http://msdn.microsoft.com/en-us/library/2cf74y2b.aspx * http://msdn.microsoft.com/en-us/library/hsyx7kbz.aspx * http://msdn.microsoft.com/en-us/library/92d6x4xw.aspx */ # pragma warning(disable:4510) # pragma warning(disable:4512) # pragma warning(disable:4610) # pragma warning(disable:4146) /** Disable warning about __declspec(restrict) not being used at function * definition. According to the documentation, it should not matter. * Also, using extern "C" does not remove this warning. * * http://msdn.microsoft.com/en-us/library/8bcxafdh.aspx * http://msdn.microsoft.com/en-us/library/1aysk3y8.aspx */ # pragma warning(disable:4565) /** Allow formal parameters of functions to remain unused (e.g. actor disp.) * * http://msdn.microsoft.com/en-us/library/26kb9fy0.aspx */ # pragma warning(disable:4100) /** Allow constant conditional expressions (e.g. while(true)). * * Microsoft advises to replace expressions like while(true) with for(;;). * http://msdn.microsoft.com/en-us/library/6t66728h%28v=vs.90%29.aspx */ # pragma warning(disable:4127) /** Although not a standard extension, we want to allow nameless structs and * unions. * * http://msdn.microsoft.com/en-us/library/c89bw853.aspx */ # pragma warning(disable:4201) /** If we pad a structure using __pony_spec_align__ then we really thought * about this before! * * http://msdn.microsoft.com/en-us/library/92fdk6xx.aspx */ # pragma warning(disable:4324) /** Assignments within conditionals expressions are fine, too. * * http://msdn.microsoft.com/en-us/library/7hw7c1he.aspx */ # pragma warning(disable:4706) /** VS2015 warns about a missing delete in Clang 3.6. Delete actually exists. * * https://msdn.microsoft.com/en-us/library/cxdxz3x6.aspx */ # pragma warning(disable:4291) #endif # define WIN32_LEAN_AND_MEAN # define NOMINMAX # include <Windows.h> #else # error PLATFORM NOT SUPPORTED! #endif #if defined(PLATFORM_IS_MACOSX) || defined(PLATFORM_IS_LINUX) \ || defined(PLATFORM_IS_BSD) || defined(PLATFORM_IS_EMSCRIPTEN) # define PLATFORM_IS_POSIX_BASED #endif #if defined(PLATFORM_IS_POSIX_BASED) || defined(__MINGW64__) # define PLATFORM_IS_CLANG_OR_GCC #endif /** The platform's programming model. * */ #if defined(__LP64__) # define PLATFORM_IS_LP64 #elif defined(_WIN64) # define PLATFORM_IS_LLP64 #else # define PLATFORM_IS_ILP32 #endif /** ARM architecture flags. * */ #if defined(__ARM_ARCH_7__) || \ defined(__ARM_ARCH_7R__) || \ defined(__ARM_ARCH_7A__) # define ARMV7 1 #endif #if defined(ARMV7) || \ defined(__ARM_ARCH_6__) || \ defined(__ARM_ARCH_6J__) || \ defined(__ARM_ARCH_6K__) || \ defined(__ARM_ARCH_6Z__) || \ defined(__ARM_ARCH_6T2__) || \ defined(__ARM_ARCH_6ZK__) # define ARMV6 1 #endif #if defined(ARMV6) || \ defined(__ARM_ARCH_5T__) || \ defined(__ARM_ARCH_5E__) || \ defined(__ARM_ARCH_5TE__) || \ defined(__ARM_ARCH_5TEJ__) # define ARMV5 1 #endif #if defined(ARMV5) || \ defined(__ARM_ARCH_4__) || \ defined(__ARM_ARCH_4T__) # define ARMV4 1 #endif #if defined(ARMV4) || \ defined(__ARM_ARCH_3__) || \ defined(__ARM_ARCH_3M__) # define ARMV3 1 #endif #if defined(ARMV3) || \ defined(__ARM_ARCH_2__) # define ARMV2 1 #endif /** Architecture flags. * */ #if defined(ARMV2) || defined(__arm__) || defined(__aarch64__) # define PLATFORM_IS_ARM # if defined(__aarch64__) # define PLATFORM_IS_ARM64 # else # define PLATFORM_IS_ARM32 # endif #elif defined(__i386__) || defined(_M_IX86) || defined(_X86_) || \ defined(__amd64__) || defined(__x86_64__) || defined(_M_X64) || \ defined(_M_AMD64) # define PLATFORM_IS_X86 #elif defined(__riscv) # define PLATFORM_IS_RISCV #endif /** Data types. * */ #ifdef PLATFORM_IS_VISUAL_STUDIO #include <BaseTsd.h> //Microsoft's version of stddef.h typedef SSIZE_T ssize_t; typedef SIZE_T size_t; #elif defined(PLATFORM_IS_CLANG_OR_GCC) #include <stddef.h> #endif #define PONY_ERRNO uint32_t /** Format specifiers and snprintf. * */ #ifdef PLATFORM_IS_VISUAL_STUDIO # include <stdarg.h> # include <stdio.h> // Make __attribute__ annotations (e.g. for checking // printf-like functions a no-op for Visual Studio. // That way, the known semantics of __attribute__(...) // remains clear and no wrapper needs to be used. # define __attribute__(X) # define __zu "%Iu" # define strdup _strdup # if _MSC_VER < 1900 inline int snprintf(char* str, size_t size, const char* format, ...) { int written; va_list argv; va_start(argv, format); written = vsnprintf(str, size, format, argv); va_end(argv); return written; } # endif #else # define __zu "%zu" #endif /** Standard builtins. * */ #ifdef PLATFORM_IS_CLANG_OR_GCC # ifdef PLATFORM_IS_ARM32 uint32_t __pony_popcount(uint32_t x); uint32_t __pony_ffs(uint32_t x); uint32_t __pony_ffsll(uint64_t x); uint32_t __pony_ctz(uint32_t x); uint32_t __pony_clz(uint32_t x); uint32_t __pony_clzll(uint64_t x); # else inline uint32_t __pony_popcount(uint32_t x) { return (uint32_t)__builtin_popcount(x); } inline uint32_t __pony_ffs(uint32_t x) { return (uint32_t)__builtin_ffs((int)x); } inline uint32_t __pony_ffsll(uint64_t x) { return (uint32_t)__builtin_ffsll((long long int)x); } inline uint32_t __pony_ctz(uint32_t x) { return (uint32_t)__builtin_ctz(x); } inline uint32_t __pony_clz(uint32_t x) { return (uint32_t)__builtin_clz(x); } inline uint32_t __pony_clzll(uint64_t x) { return (uint32_t)__builtin_clzll(x); } #endif #else # include <intrin.h> inline uint32_t __pony_popcount(uint32_t x) { return __popcnt(x); } inline uint32_t __pony_ffs(uint32_t x) { DWORD i = 0; unsigned char non_zero = _BitScanForward(&i, x); return non_zero ? i + 1 : 0; } inline uint32_t __pony_ffsll(uint64_t x) { DWORD i = 0; unsigned char non_zero = _BitScanForward64(&i, x); return non_zero ? i + 1 : 0; } inline uint32_t __pony_ctz(uint32_t x) { DWORD i = 0; _BitScanForward(&i, x); return i; } inline uint32_t __pony_clz(uint32_t x) { DWORD i = 0; _BitScanReverse(&i, x); return 31 - i; } inline uint32_t __pony_clzll(uint64_t x) { DWORD i = 0; _BitScanReverse64(&i, x); return 63 - i; } #endif inline uint32_t __pony_ffszu(size_t x) { #ifdef PLATFORM_IS_ILP32 return __pony_ffs(x); #else return __pony_ffsll(x); #endif } inline uint32_t __pony_clzzu(size_t x) { #ifdef PLATFORM_IS_ILP32 return __pony_clz(x); #else return __pony_clzll(x); #endif } /** Static assert * */ #if defined(__clang__) # if __has_feature(cxx_static_assert) # define pony_static_assert(c, m) static_assert(c, m) # elif __has_feature(c_static_assert) # define pony_static_assert(c, m) _Static_assert(c, m) # else # error "Clang doesn't support `static_assert` or `_Static_assert`." # endif #else # include <assert.h> # define pony_static_assert(c, m) static_assert(c, m) #endif /** Storage class modifiers. * */ #ifdef PLATFORM_IS_VISUAL_STUDIO # define __pony_spec_malloc__(FUNC) \ __declspec(restrict) FUNC #elif defined(PLATFORM_IS_CLANG_OR_GCC) # define __pony_spec_malloc__(FUNC) \ FUNC __attribute__((malloc)) #endif /** Symbol visibility for the LLVM JIT. * */ #ifdef PLATFORM_IS_VISUAL_STUDIO # define PONY_API __declspec(dllexport) #elif defined(PLATFORM_IS_CLANG_OR_GCC) # ifdef PLATFORM_IS_WINDOWS # define PONY_API __attribute__((dllexport)) # elif defined(PLATFORM_IS_POSIX_BASED) # define PONY_API __attribute__((visibility("default"))) # endif #endif /** Compile time choose expression. * * (void)0 will cause a compile-time error in non-cpp environments, as * __pony_choose_expr is based on __builtin_choose_expr. */ #if defined(PLATFORM_IS_VISUAL_STUDIO) || defined(__cplusplus) # define EXPR_NONE 0 # define __pony_choose_expr(COND, THEN, ELSE) \ ((COND) ? (THEN) : (ELSE)) #elif defined(PLATFORM_IS_CLANG_OR_GCC) # define EXPR_NONE ((void) 0) # define __pony_choose_expr(COND, THEN, ELSE) \ __builtin_choose_expr(COND, THEN, ELSE) #endif #include "threads.h" #include "paths.h" #if defined(PLATFORM_IS_WINDOWS) # include "vcvars.h" #endif #if defined(ARMV7) && !defined(__ARM_NEON) && !defined(__ARM_NEON__) # define PLATFORM_IS_ARMHF_WITHOUT_NEON 1 #endif #endif
{'content_hash': 'b23a9bd1206c3bc6a159da577658cfe9', 'timestamp': '', 'source': 'github', 'line_count': 402, 'max_line_length': 78, 'avg_line_length': 24.049751243781095, 'alnum_prop': 0.6693214729002896, 'repo_name': 'dipinhora/ponyc', 'id': 'e2175857554516ec51016100797b850f28e18542', 'size': '9668', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'src/common/platform.h', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'C', 'bytes': '2291189'}, {'name': 'C++', 'bytes': '710013'}, {'name': 'CMake', 'bytes': '39734'}, {'name': 'DTrace', 'bytes': '5563'}, {'name': 'Dockerfile', 'bytes': '15042'}, {'name': 'GAP', 'bytes': '11094'}, {'name': 'LLVM', 'bytes': '675'}, {'name': 'Makefile', 'bytes': '13281'}, {'name': 'Pony', 'bytes': '1520879'}, {'name': 'PowerShell', 'bytes': '17069'}, {'name': 'Shell', 'bytes': '20099'}]}
<?php Route::get('laradmin/dashboard', function() { return View::make('laradmin::dashboard'); });
{'content_hash': '56bcb9b27cefec202cfe520b75f4f99c', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 45, 'avg_line_length': 17.166666666666668, 'alnum_prop': 0.6504854368932039, 'repo_name': 'oluijks/laradmin', 'id': 'c23e77ff0bede4c623282820abbbd9a0ef697540', 'size': '103', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/routes.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '777'}]}
FROM balenalib/beagleboard-xm-debian:buster-run ENV NODE_VERSION 14.15.4 ENV YARN_VERSION 1.22.4 RUN buildDeps='curl libatomic1' \ && set -x \ && for key in \ 6A010C5166006599AA17F08146C2130DFD2497F5 \ ; do \ gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends \ && rm -rf /var/lib/apt/lists/* \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-armv7l.tar.gz" \ && echo "ffce90b07675434491361dfc74eee230f9ffc65c6c08efb88a18781bcb931871 node-v$NODE_VERSION-linux-armv7l.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$NODE_VERSION-linux-armv7l.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$NODE_VERSION-linux-armv7l.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \ && rm -rf /tmp/* CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/[email protected]" \ && echo "Running test-stack@node" \ && chmod +x [email protected] \ && bash [email protected] \ && rm -rf [email protected] RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Debian Buster \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v14.15.4, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{'content_hash': 'ba453bb7f7b0e50dfc730e5b34fe7427', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 692, 'avg_line_length': 65.0, 'alnum_prop': 0.7046153846153846, 'repo_name': 'nghiant2710/base-images', 'id': '0436a8dbd677547134fddf9d59ec269a7ab19efc', 'size': '2946', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'balena-base-images/node/beagleboard-xm/debian/buster/14.15.4/run/Dockerfile', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '144558581'}, {'name': 'JavaScript', 'bytes': '16316'}, {'name': 'Shell', 'bytes': '368690'}]}
if [ -z "$1" ] then echo "Version is required." fi # Replace version in package.json files sed -i.bak "s/\"version\": \".*\"/\"version\": \"$1\"/g" ./package.json sed -i.bak "s/\"version\": \".*\"/\"version\": \"$1\"/g" ./src/package.json sed -i.bak "s/download\/v.*\/iSambas/download\/v$1\/iSambas/g" ./src/package.json # Clean up rm ./package.json.bak rm ./src/package.json.bak # Edit CHANGELOG vim ./CHANGELOG # Git commit git add . git commit -m "New version v$1" git tag -a "v$1" -m "v$1" # TODO Paste all commits since the last tag into CHANGELOG
{'content_hash': '3babd6dbc29696f4fd9a1a6209fa3270', 'timestamp': '', 'source': 'github', 'line_count': 23, 'max_line_length': 81, 'avg_line_length': 24.52173913043478, 'alnum_prop': 0.6294326241134752, 'repo_name': 'eyeyunianto/aksara', 'id': '29d0cfb7eb1bf108663b033fb0f3730d6e8a4bdc', 'size': '722', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'iSambas/version.sh', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Shell', 'bytes': '167501'}]}
# All files in http2d are Copyright (C) 2012 Alvaro Lopez Ortega. # # Authors: # * Alvaro Lopez Ortega <[email protected]> # # 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 # 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. # import os, re, sys # Http2d Project: # Error generation and check # # This script loads a error definition file, and generates .h and .c # from it. It also checks whether all the errors are actually being # used, look for undefined errors, and check that the number of # parameters matches between the error definition and the source code. # SOURCE_DIRS = ['.'] # # Error reading # class Http2dError: def __init__ (self, **kwargs): self.id = kwargs['id'] self.title = kwargs['title'] self.description = kwargs.get('desc', '').replace('\n',' ') self.url_admin = kwargs.get('admin', '') self.help = kwargs.get('help', []) self.debug = kwargs.get('debug', '') self.show_bt = kwargs.get('show_bt', True) _errors = [] def e (error_id, title, **kwargs): global _errors # Check dup. errors for err in _errors: if error_id == err.id: raise ValueError, "ERROR: Duplicated error %s" %(error_id) # New error kwargs['id'] = error_id kwargs['title'] = title error = Http2dError (**kwargs) _errors.append (error) def read_errors(): exec (open ("error_list.py", 'r').read()) def check_source_code (dirs): # Defined errors are unseed for def_e in _errors: def_e.__seen_in_grep = False # Grep the source code errors_seen = {} for d in dirs: for f in os.listdir(d): fullpath = os.path.join (d, f) if not fullpath.endswith('.c') or \ not os.path.isfile(fullpath): continue # Check the source code content = open (fullpath, 'r').read() for e in re.findall (r'HTTP2D_ERROR_([\w_]+)[ ,)]', content): errors_seen[e] = fullpath # Mark used object for def_e in _errors: if e == def_e.id: def_e.__seen_in_grep = True # Undefined errors in the source code error_found = False for s in errors_seen.keys(): found = False for e in _errors: if s == e.id: found = True break if not found: print >> sys.stderr, "Undefined Error: HTTP2D_ERROR_%s, used in %s" % (s, errors_seen[s]) error_found = True # Unused errors in the definition file for def_e in _errors: if not def_e.__seen_in_grep: print >> sys.stderr, "Unused Error: HTTP2D_ERROR_%s" % (def_e.id) ### TMP ### error_found = True return error_found def check_parameters (dirs): known_errors_params = {} source_errors_params = {} # Known for error in _errors: tmp = error.title + error.description + error.url_admin + error.debug tmp = tmp.replace('%%', '') known_errors_params [error.id] = tmp.count('%') # Source for d in dirs: for f in os.listdir(d): fullpath = os.path.join (d, f) if not fullpath.endswith('.c') or \ not os.path.isfile(fullpath): continue # Extract the HTTP2D_ERROR_* content = open (fullpath, 'r').read() matches_log = re.findall (r'LOG_[\w_]+ ?' +\ r'\(HTTP2D_ERROR_([\w_]+)[ ,\n\t\\]*' +\ r'(.*?)\);', content, re.MULTILINE | re.DOTALL) matches_errno = re.findall (r'LOG_ERRNO[_S ]*' +\ r'\(.+?,.+?,[ \n\t]*HTTP2D_ERROR_([\w_]+)[ ,\n\t\\]*' +\ r'(.*?)\);', content, re.MULTILINE | re.DOTALL) matches = matches_errno + matches_log for match in matches: error = match[0] params = match[1].strip() # Remove internal sub-parameters (function parameters) tmp = params while True: internal_params = re.findall(r'(\(.*?\))', tmp) if not internal_params: break for param in internal_params: tmp = tmp.replace(param, '') params_num = len (filter (lambda x: len(x), tmp.split(','))) source_errors_params[error] = params_num # Compare both error_found = False for error in _errors: source_num = source_errors_params.get(error.id) known_num = known_errors_params.get(error.id) if not source_num or not known_num: print >> sys.stderr, "ERROR: Invalid parameter number: %s (source %s, definition %s)" % (error.id, source_num, known_num) #### TMP ##### error_found = True elif source_num != known_num: print >> sys.stderr, "ERROR: Parameter number mismatch: %s (source %d, definition %d)" % (error.id, source_num, known_num) error_found = True return error_found # # File generation # HEADER = """/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* All files in http2d are Copyright (C) 2012 Alvaro Lopez Ortega. * * Authors: * * Alvaro Lopez Ortega <[email protected]> * * 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 * 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. */ /* NOTE: File automatically generated (by error_list.py). */ """ def generate_C_defines (): txt = '' max_len = max([len(e.id) for e in _errors]) for num in range(len(_errors)): err = _errors[num] pad = " " * (max_len - len(err.id)) txt += '#define HTTP2D_ERROR_%s %s %d\n' %(err.id.upper(), pad, num) return txt def generate_C_errors (): txt = '' txt += 'static const http2d_error_t __http2d_errors[] =\n' txt += '{\n' for num in range(len(_errors)): err = _errors[num] txt += ' { % 3d, "%s", ' %(num, err.title) if err.description: txt += '"%s", ' % (err.description) else: txt += 'NULL, ' if err.url_admin: txt += '"%s", ' % (err.url_admin) else: txt += 'NULL, ' if err.debug: txt += '"%s", ' % (err.debug) else: txt += 'NULL, ' txt += ('false', 'true')[err.show_bt] txt += ' },\n' txt += ' { -1, NULL, NULL, NULL, NULL, true }\n' txt += '};\n' return txt def main(): # Check parameters error = False do_defines = '--defines' in sys.argv do_errors = '--errors' in sys.argv dont_test = '--skip-tests' in sys.argv if len(sys.argv) >= 1: file = sys.argv[-1] if file.startswith ('-'): error = True if not do_defines and not do_errors: error = True else: error = True if error: print "USAGE:" print print " * Create the definitions file:" print " %s [--skip-tests] --defines output_file" %(sys.argv[0]) print print " * Create the error list file:" print " %s [--skip-tests] --errors output_file" %(sys.argv[0]) print sys.exit(1) # Perform read_errors() if not dont_test: error = check_source_code (SOURCE_DIRS) error |= check_parameters (SOURCE_DIRS) if error: sys.exit(1) if do_defines: txt = HEADER txt += generate_C_defines() open (file, 'w+').write(txt) if do_errors: txt = HEADER txt += generate_C_errors() open (file, 'w+').write(txt) if __name__ == '__main__': main()
{'content_hash': '416987e5125c0b8ce70f148200b874c8', 'timestamp': '', 'source': 'github', 'line_count': 319, 'max_line_length': 134, 'avg_line_length': 32.36050156739812, 'alnum_prop': 0.5728954761212826, 'repo_name': 'http2d/SPDY_test', 'id': '6b6a878c43b6804ede25bb8b9c44584cb2ce8b8d', 'size': '10323', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/errors.py', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'C', 'bytes': '681023'}, {'name': 'Python', 'bytes': '53274'}, {'name': 'Shell', 'bytes': '3437'}]}
 #include <aws/redshift-data/model/ListStatementsRequest.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::RedshiftDataAPIService::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; ListStatementsRequest::ListStatementsRequest() : m_maxResults(0), m_maxResultsHasBeenSet(false), m_nextTokenHasBeenSet(false), m_roleLevel(false), m_roleLevelHasBeenSet(false), m_statementNameHasBeenSet(false), m_status(StatusString::NOT_SET), m_statusHasBeenSet(false) { } Aws::String ListStatementsRequest::SerializePayload() const { JsonValue payload; if(m_maxResultsHasBeenSet) { payload.WithInteger("MaxResults", m_maxResults); } if(m_nextTokenHasBeenSet) { payload.WithString("NextToken", m_nextToken); } if(m_roleLevelHasBeenSet) { payload.WithBool("RoleLevel", m_roleLevel); } if(m_statementNameHasBeenSet) { payload.WithString("StatementName", m_statementName); } if(m_statusHasBeenSet) { payload.WithString("Status", StatusStringMapper::GetNameForStatusString(m_status)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection ListStatementsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "RedshiftData.ListStatements")); return headers; }
{'content_hash': 'b6755d148af745a3e556ea1ccb957db0', 'timestamp': '', 'source': 'github', 'line_count': 70, 'max_line_length': 92, 'avg_line_length': 20.271428571428572, 'alnum_prop': 0.7357293868921776, 'repo_name': 'awslabs/aws-sdk-cpp', 'id': '2d6173a5a53ade6aed02f7864adbe3ce5314a012', 'size': '1538', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'aws-cpp-sdk-redshift-data/source/model/ListStatementsRequest.cpp', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '7596'}, {'name': 'C++', 'bytes': '61740540'}, {'name': 'CMake', 'bytes': '337520'}, {'name': 'Java', 'bytes': '223122'}, {'name': 'Python', 'bytes': '47357'}]}
package mil.emp3.api.utils; import org.cmapi.primitives.GeoFillStyle; import org.cmapi.primitives.GeoStrokeStyle; import org.cmapi.primitives.IGeoAltitudeMode; import org.cmapi.primitives.IGeoColor; import org.cmapi.primitives.IGeoFillStyle; import org.cmapi.primitives.IGeoStrokeStyle; import mil.emp3.api.Polygon; public class FeatureUtils { /** * Builds a basic polygon with graphic properties. * @return */ public static Polygon setupDrawPolygon() { IGeoStrokeStyle strokeStyle = new GeoStrokeStyle(); IGeoFillStyle fillStyle = new GeoFillStyle(); IGeoColor geoColor = new EmpGeoColor(1.0, 0, 255, 255); IGeoColor geoFillColor = new EmpGeoColor(0.7, 0, 0, 255); Polygon polygon = new Polygon(); strokeStyle.setStrokeColor(geoColor); strokeStyle.setStrokeWidth(5); strokeStyle.setStipplingPattern((short) 0xCCCC); strokeStyle.setStipplingFactor(4); polygon.setStrokeStyle(strokeStyle); fillStyle.setFillColor(geoFillColor); fillStyle.setFillPattern(IGeoFillStyle.FillPattern.hatched); polygon.setFillStyle(fillStyle); polygon.setAltitudeMode(IGeoAltitudeMode.AltitudeMode.CLAMP_TO_GROUND); return polygon; } }
{'content_hash': 'eba789eaacae8d1878a96b38cf2cf870', 'timestamp': '', 'source': 'github', 'line_count': 38, 'max_line_length': 79, 'avg_line_length': 33.3421052631579, 'alnum_prop': 0.7190213101815311, 'repo_name': 'missioncommand/emp3-android', 'id': 'b4272957a5dd8598f91bc906f35b971bb643cef9', 'size': '1267', 'binary': False, 'copies': '1', 'ref': 'refs/heads/development', 'path': 'sdk/sdk-view/src/test/java/mil/emp3/api/utils/FeatureUtils.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Groovy', 'bytes': '3584'}, {'name': 'Java', 'bytes': '4081324'}, {'name': 'PowerShell', 'bytes': '1087'}, {'name': 'Shell', 'bytes': '4282'}]}
#ifndef CPPTL_JSON_H_INCLUDED # define CPPTL_JSON_H_INCLUDED # include "forwards.h" # include <string> # include <vector> # ifndef JSON_USE_CPPTL_SMALLMAP # include <map> # else # include <cpptl/smallmap.h> # endif # ifdef JSON_USE_CPPTL # include <cpptl/forwards.h> # endif /** \brief JSON (JavaScript Object Notation). */ namespace Json { /** \brief Type of the value held by a Value object. */ enum ValueType { nullValue = 0, ///< 'null' value intValue, ///< signed integer value uintValue, ///< unsigned integer value realValue, ///< double value stringValue, ///< UTF-8 string value booleanValue, ///< bool value arrayValue, ///< array value (ordered list) objectValue ///< object value (collection of name/value pairs). }; enum CommentPlacement { commentBefore = 0, ///< a comment placed on the line before a value commentAfterOnSameLine, ///< a comment just after a value on the same line commentAfter, ///< a comment on the line after a value (only make sense for root value) numberOfCommentPlacement }; //# ifdef JSON_USE_CPPTL // typedef CppTL::AnyEnumerator<const char *> EnumMemberNames; // typedef CppTL::AnyEnumerator<const Value &> EnumValues; //# endif /** \brief Lightweight wrapper to tag static string. * * Value constructor and objectValue member assignement takes advantage of the * StaticString and avoid the cost of string duplication when storing the * string or the member name. * * Example of usage: * \code * Json::Value aValue( StaticString("some text") ); * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode */ class JSON_API StaticString { public: explicit StaticString( const char *czstring ) : str_( czstring ) { } operator const char *() const { return str_; } const char *c_str() const { return str_; } private: const char *str_; }; /** \brief Represents a <a HREF="http://www.json.org">JSON</a> value. * * This class is a discriminated union wrapper that can represents a: * - signed integer [range: Value::minInt - Value::maxInt] * - unsigned integer (range: 0 - Value::maxUInt) * - double * - UTF-8 string * - boolean * - 'null' * - an ordered list of Value * - collection of name/value pairs (javascript object) * * The type of the held value is represented by a #ValueType and * can be obtained using type(). * * values of an #objectValue or #arrayValue can be accessed using operator[]() methods. * Non const methods will automatically create the a #nullValue element * if it does not exist. * The sequence of an #arrayValue will be automatically resize and initialized * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. * * The get() methods can be used to obtanis default value in the case the required element * does not exist. * * It is possible to iterate over the list of a #objectValue values using * the getMemberNames() method. */ class JSON_API Value { friend class ValueIteratorBase; # ifdef JSON_VALUE_USE_INTERNAL_MAP friend class ValueInternalLink; friend class ValueInternalMap; # endif public: typedef std::vector<std::string> Members; typedef ValueIterator iterator; typedef ValueConstIterator const_iterator; typedef Json::UInt UInt; typedef Json::Int Int; typedef UInt ArrayIndex; static const Value null; static const Int minInt; static const Int maxInt; static const UInt maxUInt; private: #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION # ifndef JSON_VALUE_USE_INTERNAL_MAP class CZString { public: enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy }; CZString( int index ); CZString( const char *cstr, DuplicationPolicy allocate ); CZString( const CZString &other ); ~CZString(); CZString &operator =( const CZString &other ); bool operator<( const CZString &other ) const; bool operator==( const CZString &other ) const; int index() const; const char *c_str() const; bool isStaticString() const; private: void swap( CZString &other ); const char *cstr_; int index_; }; public: # ifndef JSON_USE_CPPTL_SMALLMAP typedef std::map<CZString, Value> ObjectValues; # else typedef CppTL::SmallMap<CZString, Value> ObjectValues; # endif // ifndef JSON_USE_CPPTL_SMALLMAP # endif // ifndef JSON_VALUE_USE_INTERNAL_MAP #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION public: /** \brief Create a default Value of the given type. This is a very useful constructor. To create an empty array, pass arrayValue. To create an empty object, pass objectValue. Another Value can then be set to this one by assignment. This is useful since clear() and resize() will not alter types. Examples: \code Json::Value null_value; // null Json::Value arr_value(Json::arrayValue); // [] Json::Value obj_value(Json::objectValue); // {} \endcode */ Value( ValueType type = nullValue ); Value( Int value ); Value( UInt value ); Value( double value ); Value( const char *value ); Value( const char *beginValue, const char *endValue ); /** \brief Constructs a value from a static string. * Like other value string constructor but do not duplicate the string for * internal storage. The given string must remain alive after the call to this * constructor. * Example of usage: * \code * Json::Value aValue( StaticString("some text") ); * \endcode */ Value( const StaticString &value ); Value( const std::string &value ); # ifdef JSON_USE_CPPTL Value( const CppTL::ConstString &value ); # endif Value( bool value ); Value( const Value &other ); ~Value(); Value &operator=( const Value &other ); /// Swap values. /// \note Currently, comments are intentionally not swapped, for /// both logic and efficiency. void swap( Value &other ); ValueType type() const; bool operator <( const Value &other ) const; bool operator <=( const Value &other ) const; bool operator >=( const Value &other ) const; bool operator >( const Value &other ) const; bool operator ==( const Value &other ) const; bool operator !=( const Value &other ) const; int compare( const Value &other ); const char *asCString() const; std::string asString() const; # ifdef JSON_USE_CPPTL CppTL::ConstString asConstString() const; # endif Int asInt() const; UInt asUInt() const; double asDouble() const; bool asBool() const; bool isNull() const; bool isBool() const; bool isInt() const; bool isUInt() const; bool isIntegral() const; bool isDouble() const; bool isNumeric() const; bool isString() const; bool isArray() const; bool isObject() const; bool isConvertibleTo( ValueType other ) const; /// Number of values in array or object UInt size() const; /// \brief Return true if empty array, empty object, or null; /// otherwise, false. bool empty() const; /// Return isNull() bool operator!() const; /// Remove all object members and array elements. /// \pre type() is arrayValue, objectValue, or nullValue /// \post type() is unchanged void clear(); /// Resize the array to size elements. /// New elements are initialized to null. /// May only be called on nullValue or arrayValue. /// \pre type() is arrayValue or nullValue /// \post type() is arrayValue void resize( UInt size ); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are inserted /// in the array so that its size is index+1. /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) Value &operator[]( UInt index ); /// Access an array element (zero based index ) /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) const Value &operator[]( UInt index ) const; /// If the array contains at least index+1 elements, returns the element value, /// otherwise returns defaultValue. Value get( UInt index, const Value &defaultValue ) const; /// Return true if index < size(). bool isValidIndex( UInt index ) const; /// \brief Append value to array at the end. /// /// Equivalent to jsonvalue[jsonvalue.size()] = value; Value &append( const Value &value ); /// Access an object value by name, create a null member if it does not exist. Value &operator[]( const char *key ); /// Access an object value by name, returns null if there is no member with that name. const Value &operator[]( const char *key ) const; /// Access an object value by name, create a null member if it does not exist. Value &operator[]( const std::string &key ); /// Access an object value by name, returns null if there is no member with that name. const Value &operator[]( const std::string &key ) const; /** \brief Access an object value by name, create a null member if it does not exist. * If the object as no entry for that name, then the member name used to store * the new entry is not duplicated. * Example of use: * \code * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode */ Value &operator[]( const StaticString &key ); # ifdef JSON_USE_CPPTL /// Access an object value by name, create a null member if it does not exist. Value &operator[]( const CppTL::ConstString &key ); /// Access an object value by name, returns null if there is no member with that name. const Value &operator[]( const CppTL::ConstString &key ) const; # endif /// Return the member named key if it exist, defaultValue otherwise. Value get( const char *key, const Value &defaultValue ) const; /// Return the member named key if it exist, defaultValue otherwise. Value get( const std::string &key, const Value &defaultValue ) const; # ifdef JSON_USE_CPPTL /// Return the member named key if it exist, defaultValue otherwise. Value get( const CppTL::ConstString &key, const Value &defaultValue ) const; # endif /// \brief Remove and return the named member. /// /// Do nothing if it did not exist. /// \return the removed Value, or null. /// \pre type() is objectValue or nullValue /// \post type() is unchanged Value removeMember( const char* key ); /// Same as removeMember(const char*) Value removeMember( const std::string &key ); /// Return true if the object has a member named key. bool isMember( const char *key ) const; /// Return true if the object has a member named key. bool isMember( const std::string &key ) const; # ifdef JSON_USE_CPPTL /// Return true if the object has a member named key. bool isMember( const CppTL::ConstString &key ) const; # endif /// \brief Return a list of the member names. /// /// If null, return an empty list. /// \pre type() is objectValue or nullValue /// \post if type() was nullValue, it remains nullValue Members getMemberNames() const; //# ifdef JSON_USE_CPPTL // EnumMemberNames enumMemberNames() const; // EnumValues enumValues() const; //# endif /// Comments must be //... or /* ... */ void setComment( const char *comment, CommentPlacement placement ); /// Comments must be //... or /* ... */ void setComment( const std::string &comment, CommentPlacement placement ); bool hasComment( CommentPlacement placement ) const; /// Include delimiters and embedded newlines. std::string getComment( CommentPlacement placement ) const; std::string toStyledString() const; const_iterator begin() const; const_iterator end() const; iterator begin(); iterator end(); private: Value &resolveReference( const char *key, bool isStatic ); # ifdef JSON_VALUE_USE_INTERNAL_MAP inline bool isItemAvailable() const { return itemIsUsed_ == 0; } inline void setItemUsed( bool isUsed = true ) { itemIsUsed_ = isUsed ? 1 : 0; } inline bool isMemberNameStatic() const { return memberNameIsStatic_ == 0; } inline void setMemberNameIsStatic( bool isStatic ) { memberNameIsStatic_ = isStatic ? 1 : 0; } # endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP private: struct CommentInfo { CommentInfo(); ~CommentInfo(); void setComment( const char *text ); char *comment_; }; //struct MemberNamesTransform //{ // typedef const char *result_type; // const char *operator()( const CZString &name ) const // { // return name.c_str(); // } //}; union ValueHolder { Int int_; UInt uint_; double real_; bool bool_; char *string_; # ifdef JSON_VALUE_USE_INTERNAL_MAP ValueInternalArray *array_; ValueInternalMap *map_; #else ObjectValues *map_; # endif } value_; ValueType type_ : 8; int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. # ifdef JSON_VALUE_USE_INTERNAL_MAP unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. # endif CommentInfo *comments_; }; /** \brief Experimental and untested: represents an element of the "path" to access a node. */ class PathArgument { public: friend class Path; PathArgument(); PathArgument( UInt index ); PathArgument( const char *key ); PathArgument( const std::string &key ); private: enum Kind { kindNone = 0, kindIndex, kindKey }; std::string key_; UInt index_; Kind kind_; }; /** \brief Experimental and untested: represents a "path" to access a node. * * Syntax: * - "." => root node * - ".[n]" => elements at index 'n' of root node (an array value) * - ".name" => member named 'name' of root node (an object value) * - ".name1.name2.name3" * - ".[0][1][2].name1[3]" * - ".%" => member name is provided as parameter * - ".[%]" => index is provied as parameter */ class Path { public: Path( const std::string &path, const PathArgument &a1 = PathArgument(), const PathArgument &a2 = PathArgument(), const PathArgument &a3 = PathArgument(), const PathArgument &a4 = PathArgument(), const PathArgument &a5 = PathArgument() ); const Value &resolve( const Value &root ) const; Value resolve( const Value &root, const Value &defaultValue ) const; /// Creates the "path" to access the specified node and returns a reference on the node. Value &make( Value &root ) const; private: typedef std::vector<const PathArgument *> InArgs; typedef std::vector<PathArgument> Args; void makePath( const std::string &path, const InArgs &in ); void addPathInArg( const std::string &path, const InArgs &in, InArgs::const_iterator &itInArg, PathArgument::Kind kind ); void invalidPath( const std::string &path, int location ); Args args_; }; /** \brief Experimental do not use: Allocator to customize member name and string value memory management done by Value. * * - makeMemberName() and releaseMemberName() are called to respectively duplicate and * free an Json::objectValue member name. * - duplicateStringValue() and releaseStringValue() are called similarly to * duplicate and free a Json::stringValue value. */ class ValueAllocator { public: enum { unknown = (unsigned)-1 }; virtual ~ValueAllocator(); virtual char *makeMemberName( const char *memberName ) = 0; virtual void releaseMemberName( char *memberName ) = 0; virtual char *duplicateStringValue( const char *value, unsigned int length = unknown ) = 0; virtual void releaseStringValue( char *value ) = 0; }; #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief Allocator to customize Value internal map. * Below is an example of a simple implementation (default implementation actually * use memory pool for speed). * \code class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { return new ValueInternalMap(); } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { return new ValueInternalMap( other ); } virtual void destructMap( ValueInternalMap *map ) { delete map; } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { return new ValueInternalLink(); } virtual void releaseMapLink( ValueInternalLink *link ) { delete link; } }; * \endcode */ class JSON_API ValueMapAllocator { public: virtual ~ValueMapAllocator(); virtual ValueInternalMap *newMap() = 0; virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) = 0; virtual void destructMap( ValueInternalMap *map ) = 0; virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) = 0; virtual void releaseMapBuckets( ValueInternalLink *links ) = 0; virtual ValueInternalLink *allocateMapLink() = 0; virtual void releaseMapLink( ValueInternalLink *link ) = 0; }; /** \brief ValueInternalMap hash-map bucket chain link (for internal use only). * \internal previous_ & next_ allows for bidirectional traversal. */ class JSON_API ValueInternalLink { public: enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. enum InternalFlags { flagAvailable = 0, flagUsed = 1 }; ValueInternalLink(); ~ValueInternalLink(); Value items_[itemPerLink]; char *keys_[itemPerLink]; ValueInternalLink *previous_; ValueInternalLink *next_; }; /** \brief A linked page based hash-table implementation used internally by Value. * \internal ValueInternalMap is a tradional bucket based hash-table, with a linked * list in each bucket to handle collision. There is an addional twist in that * each node of the collision linked list is a page containing a fixed amount of * value. This provides a better compromise between memory usage and speed. * * Each bucket is made up of a chained list of ValueInternalLink. The last * link of a given bucket can be found in the 'previous_' field of the following bucket. * The last link of the last bucket is stored in tailLink_ as it has no following bucket. * Only the last link of a bucket may contains 'available' item. The last link always * contains at least one element unless is it the bucket one very first link. */ class JSON_API ValueInternalMap { friend class ValueIteratorBase; friend class Value; public: typedef unsigned int HashKey; typedef unsigned int BucketIndex; # ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION struct IteratorState { IteratorState() : map_(0) , link_(0) , itemIndex_(0) , bucketIndex_(0) { } ValueInternalMap *map_; ValueInternalLink *link_; BucketIndex itemIndex_; BucketIndex bucketIndex_; }; # endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION ValueInternalMap(); ValueInternalMap( const ValueInternalMap &other ); ValueInternalMap &operator =( const ValueInternalMap &other ); ~ValueInternalMap(); void swap( ValueInternalMap &other ); BucketIndex size() const; void clear(); bool reserveDelta( BucketIndex growth ); bool reserve( BucketIndex newItemCount ); const Value *find( const char *key ) const; Value *find( const char *key ); Value &resolveReference( const char *key, bool isStatic ); void remove( const char *key ); void doActualRemove( ValueInternalLink *link, BucketIndex index, BucketIndex bucketIndex ); ValueInternalLink *&getLastLinkInBucket( BucketIndex bucketIndex ); Value &setNewItem( const char *key, bool isStatic, ValueInternalLink *link, BucketIndex index ); Value &unsafeAdd( const char *key, bool isStatic, HashKey hashedKey ); HashKey hash( const char *key ) const; int compare( const ValueInternalMap &other ) const; private: void makeBeginIterator( IteratorState &it ) const; void makeEndIterator( IteratorState &it ) const; static bool equals( const IteratorState &x, const IteratorState &other ); static void increment( IteratorState &iterator ); static void incrementBucket( IteratorState &iterator ); static void decrement( IteratorState &iterator ); static const char *key( const IteratorState &iterator ); static const char *key( const IteratorState &iterator, bool &isStatic ); static Value &value( const IteratorState &iterator ); static int distance( const IteratorState &x, const IteratorState &y ); private: ValueInternalLink *buckets_; ValueInternalLink *tailLink_; BucketIndex bucketsSize_; BucketIndex itemCount_; }; /** \brief A simplified deque implementation used internally by Value. * \internal * It is based on a list of fixed "page", each page contains a fixed number of items. * Instead of using a linked-list, a array of pointer is used for fast item look-up. * Look-up for an element is as follow: * - compute page index: pageIndex = itemIndex / itemsPerPage * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] * * Insertion is amortized constant time (only the array containing the index of pointers * need to be reallocated when items are appended). */ class JSON_API ValueInternalArray { friend class Value; friend class ValueIteratorBase; public: enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo. typedef Value::ArrayIndex ArrayIndex; typedef unsigned int PageIndex; # ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION struct IteratorState // Must be a POD { IteratorState() : array_(0) , currentPageIndex_(0) , currentItemIndex_(0) { } ValueInternalArray *array_; Value **currentPageIndex_; unsigned int currentItemIndex_; }; # endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION ValueInternalArray(); ValueInternalArray( const ValueInternalArray &other ); ValueInternalArray &operator =( const ValueInternalArray &other ); ~ValueInternalArray(); void swap( ValueInternalArray &other ); void clear(); void resize( ArrayIndex newSize ); Value &resolveReference( ArrayIndex index ); Value *find( ArrayIndex index ) const; ArrayIndex size() const; int compare( const ValueInternalArray &other ) const; private: static bool equals( const IteratorState &x, const IteratorState &other ); static void increment( IteratorState &iterator ); static void decrement( IteratorState &iterator ); static Value &dereference( const IteratorState &iterator ); static Value &unsafeDereference( const IteratorState &iterator ); static int distance( const IteratorState &x, const IteratorState &y ); static ArrayIndex indexOf( const IteratorState &iterator ); void makeBeginIterator( IteratorState &it ) const; void makeEndIterator( IteratorState &it ) const; void makeIterator( IteratorState &it, ArrayIndex index ) const; void makeIndexValid( ArrayIndex index ); Value **pages_; ArrayIndex size_; PageIndex pageCount_; }; /** \brief Experimental: do not use. Allocator to customize Value internal array. * Below is an example of a simple implementation (actual implementation use * memory pool). \code class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { return new ValueInternalArray(); } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { return new ValueInternalArray( other ); } virtual void destruct( ValueInternalArray *array ) { delete array; } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); if ( !newIndexes ) throw std::bad_alloc(); indexCount = newIndexCount; indexes = static_cast<Value **>( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast<Value *>( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); } virtual void releaseArrayPage( Value *value ) { if ( value ) free( value ); } }; \endcode */ class JSON_API ValueArrayAllocator { public: virtual ~ValueArrayAllocator(); virtual ValueInternalArray *newArray() = 0; virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) = 0; virtual void destructArray( ValueInternalArray *array ) = 0; /** \brief Reallocate array page index. * Reallocates an array of pointer on each page. * \param indexes [input] pointer on the current index. May be \c NULL. * [output] pointer on the new index of at least * \a minNewIndexCount pages. * \param indexCount [input] current number of pages in the index. * [output] number of page the reallocated index can handle. * \b MUST be >= \a minNewIndexCount. * \param minNewIndexCount Minimum number of page the new index must be able to * handle. */ virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) = 0; virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) = 0; virtual Value *allocateArrayPage() = 0; virtual void releaseArrayPage( Value *value ) = 0; }; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief base class for Value iterators. * */ class JSON_API ValueIteratorBase { public: typedef unsigned int size_t; typedef int difference_type; typedef ValueIteratorBase SelfType; ValueIteratorBase(); #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIteratorBase( const Value::ObjectValues::iterator &current ); #else ValueIteratorBase( const ValueInternalArray::IteratorState &state ); ValueIteratorBase( const ValueInternalMap::IteratorState &state ); #endif bool operator ==( const SelfType &other ) const { return isEqual( other ); } bool operator !=( const SelfType &other ) const { return !isEqual( other ); } difference_type operator -( const SelfType &other ) const { return computeDistance( other ); } /// Return either the index or the member name of the referenced value as a Value. Value key() const; /// Return the index of the referenced Value. -1 if it is not an arrayValue. UInt index() const; /// Return the member name of the referenced Value. "" if it is not an objectValue. const char *memberName() const; protected: Value &deref() const; void increment(); void decrement(); difference_type computeDistance( const SelfType &other ) const; bool isEqual( const SelfType &other ) const; void copy( const SelfType &other ); private: #ifndef JSON_VALUE_USE_INTERNAL_MAP Value::ObjectValues::iterator current_; // Indicates that iterator is for a null value. bool isNull_; #else union { ValueInternalArray::IteratorState array_; ValueInternalMap::IteratorState map_; } iterator_; bool isArray_; #endif }; /** \brief const iterator for object and array value. * */ class JSON_API ValueConstIterator : public ValueIteratorBase { friend class Value; public: typedef unsigned int size_t; typedef int difference_type; typedef const Value &reference; typedef const Value *pointer; typedef ValueConstIterator SelfType; ValueConstIterator(); private: /*! \internal Use by Value to create an iterator. */ #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueConstIterator( const Value::ObjectValues::iterator &current ); #else ValueConstIterator( const ValueInternalArray::IteratorState &state ); ValueConstIterator( const ValueInternalMap::IteratorState &state ); #endif public: SelfType &operator =( const ValueIteratorBase &other ); SelfType operator++( int ) { SelfType temp( *this ); ++*this; return temp; } SelfType operator--( int ) { SelfType temp( *this ); --*this; return temp; } SelfType &operator--() { decrement(); return *this; } SelfType &operator++() { increment(); return *this; } reference operator *() const { return deref(); } }; /** \brief Iterator for object and array value. */ class JSON_API ValueIterator : public ValueIteratorBase { friend class Value; public: typedef unsigned int size_t; typedef int difference_type; typedef Value &reference; typedef Value *pointer; typedef ValueIterator SelfType; ValueIterator(); ValueIterator( const ValueConstIterator &other ); ValueIterator( const ValueIterator &other ); private: /*! \internal Use by Value to create an iterator. */ #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIterator( const Value::ObjectValues::iterator &current ); #else ValueIterator( const ValueInternalArray::IteratorState &state ); ValueIterator( const ValueInternalMap::IteratorState &state ); #endif public: SelfType &operator =( const SelfType &other ); SelfType operator++( int ) { SelfType temp( *this ); ++*this; return temp; } SelfType operator--( int ) { SelfType temp( *this ); --*this; return temp; } SelfType &operator--() { decrement(); return *this; } SelfType &operator++() { increment(); return *this; } reference operator *() const { return deref(); } }; } // namespace Json #endif // CPPTL_JSON_H_INCLUDED
{'content_hash': '28da7932af16b80488185a38f09cfea2', 'timestamp': '', 'source': 'github', 'line_count': 1069, 'max_line_length': 123, 'avg_line_length': 28.90271281571562, 'alnum_prop': 0.6763763472181765, 'repo_name': 'hsu1994/Terminator', 'id': '652bb9cb0e36951c31e97b6b89a19db3f75089c6', 'size': '30897', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Server/RelyON/common/json/value.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '223360'}, {'name': 'Batchfile', 'bytes': '43670'}, {'name': 'C', 'bytes': '3717232'}, {'name': 'C#', 'bytes': '12172138'}, {'name': 'C++', 'bytes': '188465965'}, {'name': 'CMake', 'bytes': '119765'}, {'name': 'CSS', 'bytes': '430770'}, {'name': 'Cuda', 'bytes': '52444'}, {'name': 'DIGITAL Command Language', 'bytes': '6246'}, {'name': 'FORTRAN', 'bytes': '1856'}, {'name': 'GLSL', 'bytes': '143058'}, {'name': 'Groff', 'bytes': '5189'}, {'name': 'HTML', 'bytes': '234253948'}, {'name': 'IDL', 'bytes': '14'}, {'name': 'JavaScript', 'bytes': '694216'}, {'name': 'Lex', 'bytes': '1231'}, {'name': 'M4', 'bytes': '29689'}, {'name': 'Makefile', 'bytes': '1459789'}, {'name': 'Max', 'bytes': '36857'}, {'name': 'Objective-C', 'bytes': '15456'}, {'name': 'Objective-C++', 'bytes': '630'}, {'name': 'PHP', 'bytes': '59030'}, {'name': 'Perl', 'bytes': '38649'}, {'name': 'Perl6', 'bytes': '2053'}, {'name': 'Protocol Buffer', 'bytes': '409987'}, {'name': 'Python', 'bytes': '1764372'}, {'name': 'QML', 'bytes': '593'}, {'name': 'QMake', 'bytes': '16692'}, {'name': 'Rebol', 'bytes': '354'}, {'name': 'Ruby', 'bytes': '5532'}, {'name': 'Shell', 'bytes': '362208'}, {'name': 'Smalltalk', 'bytes': '2796'}, {'name': 'Tcl', 'bytes': '1172'}, {'name': 'TeX', 'bytes': '32117'}, {'name': 'XSLT', 'bytes': '265714'}, {'name': 'Yacc', 'bytes': '19623'}]}
package helptool; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.util.ArrayList; import model.StockIn; import model.StockOut; import org.json.JSONArray; import org.json.JSONTokener; import android.content.Context; import android.util.Log; public class StockJson { private Context context; private String filename; public StockJson(Context context, String filename){ this.context = context; this.filename = filename; } //----------------------------Èë¿â--------------------------------- public void saveStockIns(ArrayList<StockIn> stockIns) throws Exception{ // Log.d("wangbin", "½øÈëµ÷ÓÃjson·½·¨"+stockIns.size()+".\\"); JSONArray array = new JSONArray(); Writer writer = null; try { OutputStream out = context.openFileOutput(filename, Context.MODE_PRIVATE); writer = new OutputStreamWriter(out); for(StockIn stockIn:stockIns){ array.put(stockIn.toJson()); } writer.write(array.toString()); // Log.d("wangbin", "½øÈëµ÷Ó÷½·¨"+array.toString()); } catch (Exception e) { e.printStackTrace(); }finally{ if(writer != null){ writer.close(); } } } public ArrayList<StockIn> loadStockIns() throws Exception{ ArrayList<StockIn> stockIns = new ArrayList<StockIn>(); BufferedReader reader = null; try { InputStream in = context.openFileInput(filename); reader = new BufferedReader(new InputStreamReader(in)); StringBuilder builder = new StringBuilder(); String line; while((line = reader.readLine()) != null){ builder.append(line); } // Log.d("wangbin", "½øÈëµ÷Ó÷½·¨"+line+".."); JSONArray array = (JSONArray) new JSONTokener(builder.toString()).nextValue(); // Log.d("wangbin", "½øÈëµ÷Ó÷½·¨"+array.length()+".****."); for(int i=0; i<array.length(); i++){ stockIns.add(new StockIn(array.getJSONObject(i))); } } catch (Exception e) { e.printStackTrace(); }finally{ if(reader != null){ reader.close(); } } return stockIns; } //-----------------------------³ö¿â-------------------------------- public void saveStockOuts(ArrayList<StockOut> stockOuts)throws Exception{ JSONArray array = new JSONArray(); for(StockOut stockOut : stockOuts){ array.put(stockOut.toJson()); } Writer writer = null; try { OutputStream out = context.openFileOutput(filename, Context.MODE_PRIVATE); writer = new OutputStreamWriter(out); writer.write(array.toString()); // Log.d("wangbin", "½øÈëµ÷Ó÷½·¨"+array.toString()+"\n´æ´¢³É¹¦"); } catch (Exception e) { e.printStackTrace(); // Log.d("wangbin", "´æ´¢³ö¿â£¬Å׳öÒì³£"); }finally{ if(writer!= null){ writer.close(); } } Log.d("wangbin", "ÏÖÔÚ¿ªÊ¼½âÎö"); ArrayList<StockOut>stockOuts1 = new ArrayList<StockOut>(); BufferedReader reader1 = null; try { InputStream in1 = context.openFileInput(filename); reader1 = new BufferedReader(new InputStreamReader(in1)); StringBuilder builder1 = new StringBuilder(); String line1; while((line1 = reader1.readLine()) != null){ builder1.append(line1); } // Log.d("wangbin", "ÏÖÔÚ¿ªÊ¼½âÎö"+builder1.toString()+"!!!!"); JSONArray array1 = (JSONArray) new JSONTokener(builder1.toString()).nextValue(); for (int i = 0; i < array1.length(); i++) { // Log.d("wangbin", "µÚ¼¸´Î½øÈë"); stockOuts1.add(new StockOut(array.getJSONObject(i))); } // Log.d("wangbin", "ÏÖÔÚ¿ªÊ¼½âÎö"+stockOuts1.size()+"@@"); } catch (Exception e) { e.printStackTrace(); // Log.d("wangbin", "¶ÁÈ¡Å׳öÒì³£"); }finally{ if(reader1 != null){ reader1.close(); } } } public ArrayList<StockOut> loadStockOuts() throws Exception{ ArrayList<StockOut>stockOuts = new ArrayList<StockOut>(); BufferedReader reader = null; try { InputStream in = context.openFileInput(filename); reader = new BufferedReader(new InputStreamReader(in)); StringBuilder builder = new StringBuilder(); String line; while((line = reader.readLine()) != null){ builder.append(line); } JSONArray array = (JSONArray) new JSONTokener(builder.toString()).nextValue(); for (int i = 0; i < array.length(); i++) { stockOuts.add(new StockOut(array.getJSONObject(i))); } } catch (Exception e) { e.printStackTrace(); }finally{ if(reader != null){ reader.close(); } } return stockOuts; } }
{'content_hash': '0a39c775abb9d8e9c4640a5c22e816dd', 'timestamp': '', 'source': 'github', 'line_count': 155, 'max_line_length': 84, 'avg_line_length': 29.46451612903226, 'alnum_prop': 0.6321436391504269, 'repo_name': '1938316175/Warehouse', 'id': '64bff174e813c3a727389f6ef42d9964bd862ccf', 'size': '4567', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/helptool/StockJson.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '129777'}]}
"""Support for Xiaomi Gateways.""" from datetime import timedelta import logging import voluptuous as vol from xiaomi_gateway import XiaomiGateway, XiaomiGatewayDiscovery from homeassistant.components import persistent_notification from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( ATTR_BATTERY_LEVEL, ATTR_DEVICE_ID, ATTR_VOLTAGE, CONF_HOST, CONF_MAC, CONF_PORT, CONF_PROTOCOL, EVENT_HOMEASSISTANT_STOP, Platform, ) from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.helpers import device_registry as dr import homeassistant.helpers.config_validation as cv from homeassistant.helpers.device_registry import format_mac from homeassistant.helpers.entity import DeviceInfo, Entity from homeassistant.helpers.event import async_track_point_in_utc_time from homeassistant.helpers.typing import ConfigType from homeassistant.util.dt import utcnow from .const import ( CONF_INTERFACE, CONF_KEY, CONF_SID, DEFAULT_DISCOVERY_RETRY, DOMAIN, GATEWAYS_KEY, LISTENER_KEY, ) _LOGGER = logging.getLogger(__name__) GATEWAY_PLATFORMS = [ Platform.BINARY_SENSOR, Platform.COVER, Platform.LIGHT, Platform.LOCK, Platform.SENSOR, Platform.SWITCH, ] GATEWAY_PLATFORMS_NO_KEY = [Platform.BINARY_SENSOR, Platform.SENSOR] ATTR_GW_MAC = "gw_mac" ATTR_RINGTONE_ID = "ringtone_id" ATTR_RINGTONE_VOL = "ringtone_vol" TIME_TILL_UNAVAILABLE = timedelta(minutes=150) SERVICE_PLAY_RINGTONE = "play_ringtone" SERVICE_STOP_RINGTONE = "stop_ringtone" SERVICE_ADD_DEVICE = "add_device" SERVICE_REMOVE_DEVICE = "remove_device" SERVICE_SCHEMA_PLAY_RINGTONE = vol.Schema( { vol.Required(ATTR_RINGTONE_ID): vol.All( vol.Coerce(int), vol.NotIn([9, 14, 15, 16, 17, 18, 19]) ), vol.Optional(ATTR_RINGTONE_VOL): vol.All( vol.Coerce(int), vol.Clamp(min=0, max=100) ), } ) SERVICE_SCHEMA_REMOVE_DEVICE = vol.Schema( {vol.Required(ATTR_DEVICE_ID): vol.All(cv.string, vol.Length(min=14, max=14))} ) def setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Xiaomi component.""" def play_ringtone_service(call: ServiceCall) -> None: """Service to play ringtone through Gateway.""" ring_id = call.data.get(ATTR_RINGTONE_ID) gateway = call.data.get(ATTR_GW_MAC) kwargs = {"mid": ring_id} if (ring_vol := call.data.get(ATTR_RINGTONE_VOL)) is not None: kwargs["vol"] = ring_vol gateway.write_to_hub(gateway.sid, **kwargs) def stop_ringtone_service(call: ServiceCall) -> None: """Service to stop playing ringtone on Gateway.""" gateway = call.data.get(ATTR_GW_MAC) gateway.write_to_hub(gateway.sid, mid=10000) def add_device_service(call: ServiceCall) -> None: """Service to add a new sub-device within the next 30 seconds.""" gateway = call.data.get(ATTR_GW_MAC) gateway.write_to_hub(gateway.sid, join_permission="yes") persistent_notification.async_create( hass, "Join permission enabled for 30 seconds! " "Please press the pairing button of the new device once.", title="Xiaomi Aqara Gateway", ) def remove_device_service(call: ServiceCall) -> None: """Service to remove a sub-device from the gateway.""" device_id = call.data.get(ATTR_DEVICE_ID) gateway = call.data.get(ATTR_GW_MAC) gateway.write_to_hub(gateway.sid, remove_device=device_id) gateway_only_schema = _add_gateway_to_schema(hass, vol.Schema({})) hass.services.register( DOMAIN, SERVICE_PLAY_RINGTONE, play_ringtone_service, schema=_add_gateway_to_schema(hass, SERVICE_SCHEMA_PLAY_RINGTONE), ) hass.services.register( DOMAIN, SERVICE_STOP_RINGTONE, stop_ringtone_service, schema=gateway_only_schema ) hass.services.register( DOMAIN, SERVICE_ADD_DEVICE, add_device_service, schema=gateway_only_schema ) hass.services.register( DOMAIN, SERVICE_REMOVE_DEVICE, remove_device_service, schema=_add_gateway_to_schema(hass, SERVICE_SCHEMA_REMOVE_DEVICE), ) return True async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up the xiaomi aqara components from a config entry.""" hass.data.setdefault(DOMAIN, {}) hass.data[DOMAIN].setdefault(GATEWAYS_KEY, {}) # Connect to Xiaomi Aqara Gateway xiaomi_gateway = await hass.async_add_executor_job( XiaomiGateway, entry.data[CONF_HOST], entry.data[CONF_SID], entry.data[CONF_KEY], DEFAULT_DISCOVERY_RETRY, entry.data[CONF_INTERFACE], entry.data[CONF_PORT], entry.data[CONF_PROTOCOL], ) hass.data[DOMAIN][GATEWAYS_KEY][entry.entry_id] = xiaomi_gateway gateway_discovery = hass.data[DOMAIN].setdefault( LISTENER_KEY, XiaomiGatewayDiscovery(hass.add_job, [], entry.data[CONF_INTERFACE]), ) if len(hass.data[DOMAIN][GATEWAYS_KEY]) == 1: # start listining for local pushes (only once) await hass.async_add_executor_job(gateway_discovery.listen) # register stop callback to shutdown listining for local pushes def stop_xiaomi(event): """Stop Xiaomi Socket.""" _LOGGER.debug("Shutting down Xiaomi Gateway Listener") gateway_discovery.stop_listen() hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_xiaomi) gateway_discovery.gateways[entry.data[CONF_HOST]] = xiaomi_gateway _LOGGER.debug( "Gateway with host '%s' connected, listening for broadcasts", entry.data[CONF_HOST], ) device_registry = dr.async_get(hass) device_registry.async_get_or_create( config_entry_id=entry.entry_id, identifiers={(DOMAIN, entry.unique_id)}, manufacturer="Xiaomi Aqara", name=entry.title, sw_version=entry.data[CONF_PROTOCOL], ) if entry.data[CONF_KEY] is not None: platforms = GATEWAY_PLATFORMS else: platforms = GATEWAY_PLATFORMS_NO_KEY hass.config_entries.async_setup_platforms(entry, platforms) return True async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Unload a config entry.""" if entry.data[CONF_KEY] is not None: platforms = GATEWAY_PLATFORMS else: platforms = GATEWAY_PLATFORMS_NO_KEY unload_ok = await hass.config_entries.async_unload_platforms(entry, platforms) if unload_ok: hass.data[DOMAIN][GATEWAYS_KEY].pop(entry.entry_id) if len(hass.data[DOMAIN][GATEWAYS_KEY]) == 0: # No gateways left, stop Xiaomi socket hass.data[DOMAIN].pop(GATEWAYS_KEY) _LOGGER.debug("Shutting down Xiaomi Gateway Listener") gateway_discovery = hass.data[DOMAIN].pop(LISTENER_KEY) await hass.async_add_executor_job(gateway_discovery.stop_listen) return unload_ok class XiaomiDevice(Entity): """Representation a base Xiaomi device.""" def __init__(self, device, device_type, xiaomi_hub, config_entry): """Initialize the Xiaomi device.""" self._state = None self._is_available = True self._sid = device["sid"] self._model = device["model"] self._protocol = device["proto"] self._name = f"{device_type}_{self._sid}" self._device_name = f"{self._model}_{self._sid}" self._type = device_type self._write_to_hub = xiaomi_hub.write_to_hub self._get_from_hub = xiaomi_hub.get_from_hub self._extra_state_attributes = {} self._remove_unavailability_tracker = None self._xiaomi_hub = xiaomi_hub self.parse_data(device["data"], device["raw_data"]) self.parse_voltage(device["data"]) if hasattr(self, "_data_key") and self._data_key: # pylint: disable=no-member self._unique_id = ( f"{self._data_key}{self._sid}" # pylint: disable=no-member ) else: self._unique_id = f"{self._type}{self._sid}" self._gateway_id = config_entry.unique_id if config_entry.data[CONF_MAC] == format_mac(self._sid): # this entity belongs to the gateway itself self._is_gateway = True self._device_id = config_entry.unique_id else: # this entity is connected through zigbee self._is_gateway = False self._device_id = self._sid def _add_push_data_job(self, *args): self.hass.add_job(self.push_data, *args) async def async_added_to_hass(self): """Start unavailability tracking.""" self._xiaomi_hub.callbacks[self._sid].append(self._add_push_data_job) self._async_track_unavailable() @property def name(self): """Return the name of the device.""" return self._name @property def unique_id(self) -> str: """Return a unique ID.""" return self._unique_id @property def device_id(self): """Return the device id of the Xiaomi Aqara device.""" return self._device_id @property def device_info(self) -> DeviceInfo: """Return the device info of the Xiaomi Aqara device.""" if self._is_gateway: device_info = DeviceInfo( identifiers={(DOMAIN, self._device_id)}, model=self._model, ) else: device_info = DeviceInfo( connections={(dr.CONNECTION_ZIGBEE, self._device_id)}, identifiers={(DOMAIN, self._device_id)}, manufacturer="Xiaomi Aqara", model=self._model, name=self._device_name, sw_version=self._protocol, via_device=(DOMAIN, self._gateway_id), ) return device_info @property def available(self): """Return True if entity is available.""" return self._is_available @property def should_poll(self): """Return the polling state. No polling needed.""" return False @property def extra_state_attributes(self): """Return the state attributes.""" return self._extra_state_attributes @callback def _async_set_unavailable(self, now): """Set state to UNAVAILABLE.""" self._remove_unavailability_tracker = None self._is_available = False self.async_write_ha_state() @callback def _async_track_unavailable(self): if self._remove_unavailability_tracker: self._remove_unavailability_tracker() self._remove_unavailability_tracker = async_track_point_in_utc_time( self.hass, self._async_set_unavailable, utcnow() + TIME_TILL_UNAVAILABLE ) if not self._is_available: self._is_available = True return True return False @callback def push_data(self, data, raw_data): """Push from Hub.""" _LOGGER.debug("PUSH >> %s: %s", self, data) was_unavailable = self._async_track_unavailable() is_data = self.parse_data(data, raw_data) is_voltage = self.parse_voltage(data) if is_data or is_voltage or was_unavailable: self.async_write_ha_state() def parse_voltage(self, data): """Parse battery level data sent by gateway.""" if "voltage" in data: voltage_key = "voltage" elif "battery_voltage" in data: voltage_key = "battery_voltage" else: return False max_volt = 3300 min_volt = 2800 voltage = data[voltage_key] self._extra_state_attributes[ATTR_VOLTAGE] = round(voltage / 1000.0, 2) voltage = min(voltage, max_volt) voltage = max(voltage, min_volt) percent = ((voltage - min_volt) / (max_volt - min_volt)) * 100 self._extra_state_attributes[ATTR_BATTERY_LEVEL] = round(percent, 1) return True def parse_data(self, data, raw_data): """Parse data sent by gateway.""" raise NotImplementedError() def _add_gateway_to_schema(hass, schema): """Extend a voluptuous schema with a gateway validator.""" def gateway(sid): """Convert sid to a gateway.""" sid = str(sid).replace(":", "").lower() for gateway in hass.data[DOMAIN][GATEWAYS_KEY].values(): if gateway.sid == sid: return gateway raise vol.Invalid(f"Unknown gateway sid {sid}") kwargs = {} if (xiaomi_data := hass.data.get(DOMAIN)) is not None: gateways = list(xiaomi_data[GATEWAYS_KEY].values()) # If the user has only 1 gateway, make it the default for services. if len(gateways) == 1: kwargs["default"] = gateways[0].sid return schema.extend({vol.Required(ATTR_GW_MAC, **kwargs): gateway})
{'content_hash': 'd4c47cf828ab998ee9f4bb4b5a1bea1d', 'timestamp': '', 'source': 'github', 'line_count': 395, 'max_line_length': 88, 'avg_line_length': 32.959493670886076, 'alnum_prop': 0.6268530609109763, 'repo_name': 'GenericStudent/home-assistant', 'id': '1857b6e83b21ed428f0167d80fbc196f9b8932f8', 'size': '13019', 'binary': False, 'copies': '3', 'ref': 'refs/heads/dev', 'path': 'homeassistant/components/xiaomi_aqara/__init__.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '3070'}, {'name': 'Python', 'bytes': '44491729'}, {'name': 'Shell', 'bytes': '5092'}]}
'use strict'; require( './app/boot' );
{'content_hash': '16521bdb7f6db881eb4d516e1a1067f1', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 24, 'avg_line_length': 13.0, 'alnum_prop': 0.5897435897435898, 'repo_name': 'pjasiun/fuma', 'id': '6bf3de1f65d38fd32ce2c35526fd712aae72dcf6', 'size': '39', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '24993'}, {'name': 'JavaScript', 'bytes': '96927'}]}
jekyll-menu =========== A Jekyll plugin that helps you generate nested and sorted menus. ## Installation The following guide assumes Jekyll allows symlinks in _includes, which only works in unsafe mode. If you do not want to enable unsafe mode, copy files instead of symlinking them. ### Your site is under version control with git Open up a terminal and change to your sites root. Then add a git submodule in the folder `_vendor` and symlink `menu.html` in `_includes` and `menu_generator.rb` in `_plugins`. tl;dr: ```bash mkdir _vendor cd _vendor git submodule add https://github.com/Ahti/jekyll-menu.git cd ../_includes ln -s ../_vendor/jekyll-menu/menu.html cd ../_plugins ln -s ../_vendor/jekyll-menu/menu_generator.rb ``` ### Your site is not under version control or not using git Start using git. > But I don't want to! Then at least check out this repo into _vendor and follow the steps outlined above. Instead of git submodule add https://github.com/Ahti/jekyll-menu.git use git clone https://github.com/Ahti/jekyll-menu.git > I really don't want to use git at all >:( If you insist, just download `menu.html` and `menu_generator.rb` and put them into your `_includes` and `_plugins` folder respectively ## Usage In any of your layouts, insert this code anywhere. I would recommend putting it inside a nav-tag: {% include menu.html menu=site.menu %} To include pages in this menu, there are some frontmatter settings that you can specify for each site: ```yaml menu: name: something parent: main position: 42 ``` Setting | Meaning -----------|-------- `name` | The name to be displayed in the menu for this page (also the name referenced in parent). Defaults to the pages title attribute. `parent` | The menu entry under which to nest the menu item for this page. Specify `main` for top-level entries. Defaults to nothgin which leads to the page not getting a menu entry at all. `position` | A position used for sorting The menu entries. Pages without this option are sorted by name and come after all pages that have a position set. The output of the include tag is best described by example: ```html <ul class="menu-level-0"> <li> <a href="/">Index</a> </li> <li class="current-parent"> <a href="/something/">A page with a subpage</a> <ul class="menu-level-1"> <li class="current"> <a href="/something/else/">The subpage (also the current page)</a> </li> </ul> </li> </ul> ``` As you can see, the output is a list of links and lists. The list item for the current page has the class `current`, parent menu items have the class `current-parent`. Also, each list has a class corresponding to the nesting level of the menu it represents.
{'content_hash': '25e12b84e9f5e24fe8f1d81689bf640d', 'timestamp': '', 'source': 'github', 'line_count': 87, 'max_line_length': 257, 'avg_line_length': 32.05747126436781, 'alnum_prop': 0.6984582287558264, 'repo_name': 'kutulus/jekyll-menu', 'id': '2c1e4d3a9697f8d7e9fc78f619e3e4c9796df07a', 'size': '2789', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '671'}, {'name': 'Ruby', 'bytes': '3278'}]}
package com.ucar.weex.http; import java.io.File; import java.util.Map; /** * Created by david on 16/4/29. */ public interface HttpMultiRequest extends HttpRequest { String getFilePart(); File getFile(); Map<String,String> getParams(); }
{'content_hash': 'f9e6862e2830dd1549ddd026c86af587', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 55, 'avg_line_length': 15.117647058823529, 'alnum_prop': 0.688715953307393, 'repo_name': 'weexext/ucar-weex-core', 'id': '4faa9f318f0fa5f31fe619f5f1d2f76e2cef6a6e', 'size': '257', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'platforms/android/uwx/src/main/java/com/ucar/weex/http/HttpMultiRequest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '19182'}, {'name': 'C', 'bytes': '55321'}, {'name': 'HTML', 'bytes': '587'}, {'name': 'Java', 'bytes': '2249187'}, {'name': 'JavaScript', 'bytes': '1499730'}, {'name': 'Objective-C', 'bytes': '1456335'}, {'name': 'Objective-C++', 'bytes': '3296'}, {'name': 'Ruby', 'bytes': '3032'}, {'name': 'Shell', 'bytes': '18977'}, {'name': 'Vue', 'bytes': '287695'}]}
<!-- Copyright (c) 2016, preview-code 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 preview-code 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. --> <link rel="import" href="../../../bower_components/polymerfire/firebase-document.html"> <link rel="import" href="../../ajax/github-authenticated-ajax.html"> <link rel="import" href="../project-behavior.html"> <dom-module id="get-comments"> <template> <style> :host { display: block; } </style> <github-authenticated-ajax id="githubComments" refurl="[[commentsGhPath]]" per-page="250" on-response="_divideComments"> </github-authenticated-ajax> <firebase-document app-name="preview-code" path="[[commentsFbPath]]" data="{{fbComments}}" ></firebase-document> </template> <script> /*global ProjectBehavior*/ Polymer({ is: 'get-comments', behaviors: [ProjectBehavior], properties: { pullRequest: Object, commentsFbPath: { type: String, computed: '_computeCommentsFbPath(pullRequest)' }, commentsGhPath: { type: String, computed: '_computeCommentsGhPath(pullRequest)' }, generalComments: { notify: true, type: Array, value: function() { return []; } }, groupComments: { notify: true, type: Array, value: function() { return []; } } }, observers: [ '_fireAjax(pullRequest, fbComments)' ], _fireAjax: function() { this.$.githubComments.generateRequest(); }, _computeCommentsFbPath: function(pullRequest) { return '/' + pullRequest.base.repo.owner.login + '/' + pullRequest.base.repo.name + '/pulls/' + pullRequest.number + '/groupcomments'; }, _computeCommentsGhPath: function(pullRequest) { return 'https://api.github.com/repos/' + pullRequest.base.repo.owner.login + '/' + pullRequest.base.repo.name + '/issues/' + pullRequest.number + '/comments'; }, _divideComments: function(e) { if (e.detail.response) { this._flushComments(); var comments = e.detail.response; for (var i = 0; i < comments.length; i++ ) { var groupID = this.fbComments[comments[i].id]; if (groupID) { this.push('groupComments', {groupID: groupID, comment: comments[i]}); } else { this.push('generalComments', comments[i]); } } this.fire('added-comments'); } }, _flushComments: function() { this.generalComments = []; this.groupComments = []; } }); </script> </dom-module>
{'content_hash': 'e3e3ece08119d8111b16169810f3cdea', 'timestamp': '', 'source': 'github', 'line_count': 119, 'max_line_length': 166, 'avg_line_length': 34.78991596638655, 'alnum_prop': 0.6384057971014493, 'repo_name': 'preview-code/rite-evaluation', 'id': 'f35426437cff26a4c91f91a1df130aeb4d358959', 'size': '4140', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/projects/pull-request/get-comments.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'HTML', 'bytes': '463560'}, {'name': 'JavaScript', 'bytes': '23094'}]}
Copyright (c) 2016-2021: Justin Angevaare. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{'content_hash': 'a72a4ebece91d8aedf3d9193cabed404', 'timestamp': '', 'source': 'github', 'line_count': 20, 'max_line_length': 70, 'avg_line_length': 53.35, 'alnum_prop': 0.8050609184629803, 'repo_name': 'jangevaa/Pathogen.jl', 'id': 'd59886f70ecbdda2878c85ca3632714f547b491c', 'size': '1067', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'LICENSE.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Julia', 'bytes': '141053'}]}
<html> <head> <meta name="keywords" content="java, biology, bioinformatics, EMBOSS, GUI, Jemboss, computational biology, sequence analysis, interface"> <title>Jemboss File Manager</title> </head> <body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000"> <center><img SRC="../images/Jemboss_logo_large.gif" height=110 width=240><br>&nbsp; </center> <p> <h1>Jemboss Results Manager</h1> Applications in Jemboss can be run <b>'interactively'</b> or in <b>'batch'</b> mode. A default mode is given, and is based on the length of time it is likely to run for. If it is a short program it is run interactively or if it is usually a medium or long program batch is used. <p> Interactive applications wait for the process to finish and the results pop up on the screen. Batch process run in the background so that other tasks can be performed in Jemboss while the application is running. In both cases the results are stored on the server machine and can be retieved at any time. <p> To retrieve the results from applications run previously, go to the 'File' menu and select 'Saved Results'. A list of all the previous runs is then presented in a separate window from which individual runs can be viewed or deleted. On the right hand side of this window the run details are provided with the parameters used. <p> Batch results are monitored by the 'Job Manager' in the bar at the bottom of the main Jemboss window. This provides the current status of batch processes (i.e. running or completed). Clicking on this bar opens the results manager for the batch processes in that session. On completion batch results can be viewed by double clicking on the program in the list. <p> <hr> </body> </html>
{'content_hash': '4a1dfe25f69eb9abb7545bc28bcb3438', 'timestamp': '', 'source': 'github', 'line_count': 52, 'max_line_length': 140, 'avg_line_length': 33.5, 'alnum_prop': 0.7560275545350172, 'repo_name': 'lauringlab/CodonShuffle', 'id': '86f7057b7fbf32c2ff0b470ca443be242077ac3f', 'size': '1742', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'lib/EMBOSS-6.6.0/jemboss/resources/results.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '26005'}, {'name': 'Batchfile', 'bytes': '410'}, {'name': 'C', 'bytes': '32248936'}, {'name': 'C++', 'bytes': '666976'}, {'name': 'CSS', 'bytes': '24950'}, {'name': 'DIGITAL Command Language', 'bytes': '1919'}, {'name': 'Eiffel', 'bytes': '9228'}, {'name': 'FORTRAN', 'bytes': '7327'}, {'name': 'Groff', 'bytes': '385461'}, {'name': 'HTML', 'bytes': '21580322'}, {'name': 'Java', 'bytes': '1268950'}, {'name': 'JavaScript', 'bytes': '144823'}, {'name': 'Makefile', 'bytes': '662688'}, {'name': 'Max', 'bytes': '224'}, {'name': 'Module Management System', 'bytes': '3943'}, {'name': 'Parrot', 'bytes': '5376'}, {'name': 'Perl', 'bytes': '652946'}, {'name': 'Perl6', 'bytes': '4794'}, {'name': 'PostScript', 'bytes': '606530'}, {'name': 'Prolog', 'bytes': '1731'}, {'name': 'Python', 'bytes': '158248'}, {'name': 'QMake', 'bytes': '7518'}, {'name': 'R', 'bytes': '7233'}, {'name': 'Shell', 'bytes': '709299'}, {'name': 'SourcePawn', 'bytes': '10316'}, {'name': 'Standard ML', 'bytes': '1327'}, {'name': 'TeX', 'bytes': '741088'}, {'name': 'XS', 'bytes': '12050'}]}
import Disposable from '../Disposable'; import { FrameState } from '../PluggableMap'; import { Transform } from '../transform'; import WebGLArrayBuffer from './Buffer'; import WebGLRenderTarget from './RenderTarget'; export interface AttributeDescription { name: string; size: number; type?: AttributeType; } export interface BufferCacheEntry { buffer: WebGLArrayBuffer; webGlBuffer: WebGLBuffer; } export interface Options { uniforms?: { [key: string]: UniformValue }; postProcesses?: PostProcessesOptions[]; } export interface PostProcessesOptions { scaleRatio?: number; vertexShader?: string; fragmentShader?: string; uniforms?: { [key: string]: UniformValue }; } export type UniformLiteralValue = number | number[] | HTMLCanvasElement | HTMLImageElement | ImageData | Transform; export type UniformValue = UniformLiteralValue | ((p0: FrameState) => UniformLiteralValue); export enum AttributeType { UNSIGNED_BYTE = 5121, UNSIGNED_SHORT = 5123, UNSIGNED_INT = 5125, FLOAT = 5126, } export enum DefaultUniform { PROJECTION_MATRIX = 'u_projectionMatrix', OFFSET_SCALE_MATRIX = 'u_offsetScaleMatrix', OFFSET_ROTATION_MATRIX = 'u_offsetRotateMatrix', TIME = 'u_time', ZOOM = 'u_zoom', RESOLUTION = 'u_resolution', } export enum ShaderType { FRAGMENT_SHADER = 35632, VERTEX_SHADER = 35633, } export default class WebGLHelper extends Disposable { constructor(opt_options?: Options); bindBuffer(buffer: WebGLArrayBuffer): void; compileShader(source: string, type: ShaderType): WebGLShader; createTexture( size: number[], opt_data?: ImageData | HTMLImageElement | HTMLCanvasElement, opt_texture?: WebGLTexture, ): WebGLTexture; deleteBuffer(buf: WebGLArrayBuffer): void; drawElements(start: number, end: number): void; enableAttributes(attributes: AttributeDescription[]): void; finalizeDraw(frameState: FrameState): void; flushBufferData(buffer: WebGLArrayBuffer): void; getAttributeLocation(name: string): number; getCanvas(): HTMLCanvasElement; getGL(): WebGLRenderingContext; getProgram(fragmentShaderSource: string, vertexShaderSource: string): WebGLProgram; getShaderCompileErrors(): string; getUniformLocation(name: string): WebGLUniformLocation; makeProjectionTransform(frameState: FrameState, transform: Transform): Transform; prepareDraw(frameState: FrameState): void; prepareDrawToRenderTarget( frameState: FrameState, renderTarget: WebGLRenderTarget, opt_disableAlphaBlend?: boolean, ): void; setUniformFloatValue(uniform: string, value: number): void; setUniformMatrixValue(uniform: string, value: number[]): void; useProgram(program: WebGLProgram): boolean; } export function computeAttributesStride(attributes: AttributeDescription[]): number;
{'content_hash': '3b4c87fde5df09f69e684bb50844fee3', 'timestamp': '', 'source': 'github', 'line_count': 77, 'max_line_length': 115, 'avg_line_length': 37.493506493506494, 'alnum_prop': 0.7260131624523727, 'repo_name': 'dsebastien/DefinitelyTyped', 'id': '6a0ec158db12a3ab689adaad6d60d73c0b8043c3', 'size': '2887', 'binary': False, 'copies': '11', 'ref': 'refs/heads/master', 'path': 'types/ol/webgl/Helper.d.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CoffeeScript', 'bytes': '15'}, {'name': 'HTML', 'bytes': '308'}, {'name': 'Protocol Buffer', 'bytes': '678'}, {'name': 'TypeScript', 'bytes': '20293816'}]}
<article class="post"> <header class="post-header"> <h1 class="post-title">{{ page.title }}</h1> </header> <div class="post-content"> {{ content }} </div> </article>
{'content_hash': 'd042091649af6dd0c103e44ec53d5019', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 52, 'avg_line_length': 18.272727272727273, 'alnum_prop': 0.527363184079602, 'repo_name': 'groundh0g/gamedevutils.com', 'id': 'fefe42d1c920238e2f68e8c6490400815b102af1', 'size': '201', 'binary': False, 'copies': '3', 'ref': 'refs/heads/gh-pages', 'path': '_includes/layouts/default/_page.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2623250'}, {'name': 'HTML', 'bytes': '108044'}, {'name': 'JavaScript', 'bytes': '707134'}, {'name': 'Liquid', 'bytes': '43655'}, {'name': 'Ruby', 'bytes': '10827'}]}
{% load i18n future pages_tags %} {% spaceless %} {% if page_branch_in_menu %} {% if branch_level == 0 %} <ul class="nav navbar-nav"> {% for page in page_branch %} {% if not has_home and page.is_primary and forloop.first %} <li{% if on_home %} class="active"{% endif %} id="dropdown-menu-home"> <a href="{% url "home" %}">{% trans "Home" %}</a> </li> {% endif %} {% if page.in_menu %} <li class="{% if page.has_children_in_menu %}dropdown{% endif %} {% if page.is_current_or_ascendant %}active{% endif %}" id="{{ page.html_id }}"> <a href="{{ page.get_absolute_url }}" {% if page.has_children_in_menu %} class="dropdown-toggle disabled" data-toggle="dropdown" {% endif %}> {{ page.meta_title }} {% if page.has_children_in_menu %}<b class="caret"></b>{% endif %} </a> {% if page.has_children_in_menu %}{% page_menu page %}{% endif %} </li> {% endif %} {% endfor %} </ul> {% else %} <ul class="dropdown-menu"> {% for page in page_branch %} {% if page.in_menu %} <li class="{% if page.has_children_in_menu %}dropdown-submenu{% endif %} {% if page.is_current_or_ascendant %}active{% endif %}" id="{{ page.html_id }}"> <a href="{{ page.get_absolute_url }}">{{ page.meta_title }}</a> {% if page.has_children_in_menu %}{% page_menu page %}{% endif %} </li> {% endif %} {% endfor %} </ul> {% endif %} {% endif %} {% endspaceless %}
{'content_hash': 'ce6806a2f5615e78ccb65fbaaa61d993', 'timestamp': '', 'source': 'github', 'line_count': 46, 'max_line_length': 78, 'avg_line_length': 33.32608695652174, 'alnum_prop': 0.5179386823222439, 'repo_name': 'cccs-web/mezzanine', 'id': '504778134607d0f6687f333c2131360e0736487b', 'size': '1533', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'mezzanine/pages/templates/pages/menus/dropdown.html', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'CSS', 'bytes': '108170'}, {'name': 'JavaScript', 'bytes': '228868'}, {'name': 'Python', 'bytes': '1084061'}]}
<?php declare(strict_types=1); namespace Xcore\Generator\Doctrine\ORM\Entity\Property; use MabeEnum\Enum; final class GetterType extends Enum { public const GET = 'get'; public const HAS = 'has'; public const IS = 'is'; public static function createFromJson(string $value): ?GetterType { switch ($value) { case 'true': $getter = self::get(self::GET); break; case 'false': $getter = null; break; default: $getter = self::get($value); } return $getter; } }
{'content_hash': 'd57d1b8338d2e7c613e0502ec5095c4f', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 69, 'avg_line_length': 20.193548387096776, 'alnum_prop': 0.5191693290734825, 'repo_name': 'XcoreCMS/Generator', 'id': '25dfca5f230c4590a9221a641466450645739ab8', 'size': '626', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Doctrine/ORM/Entity/Property/GetterType.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '169495'}]}
package harness import ( "context" "fmt" "log" "net" "strings" "testing" "github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/harness/statecache" fnpb "github.com/apache/beam/sdks/v2/go/pkg/beam/model/fnexecution_v1" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/test/bufconn" ) type BeamFnWorkerStatusServicer struct { fnpb.UnimplementedBeamFnWorkerStatusServer response chan string } func (w *BeamFnWorkerStatusServicer) WorkerStatus(b fnpb.BeamFnWorkerStatus_WorkerStatusServer) error { b.Send(&fnpb.WorkerStatusRequest{Id: "1"}) resp, err := b.Recv() if err != nil { return fmt.Errorf("error receiving response b.recv: %v", err) } w.response <- resp.GetStatusInfo() return nil } var lis *bufconn.Listener func setup(t *testing.T, srv *BeamFnWorkerStatusServicer) { const buffsize = 1024 * 1024 server := grpc.NewServer() lis = bufconn.Listen(buffsize) fnpb.RegisterBeamFnWorkerStatusServer(server, srv) go func() { if err := server.Serve(lis); err != nil { log.Fatalf("failed to serve: %v", err) } }() t.Cleanup(func() { server.Stop() }) } func dialer(context.Context, string) (net.Conn, error) { return lis.Dial() } func TestSendStatusResponse(t *testing.T) { ctx := context.Background() srv := &BeamFnWorkerStatusServicer{response: make(chan string)} setup(t, srv) conn, err := grpc.DialContext(ctx, "bufnet", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(dialer)) if err != nil { t.Fatalf("unable to start test server: %v", err) } statusHandler := workerStatusHandler{conn: conn, cache: &statecache.SideInputCache{}, metStoreToString: func(builder *strings.Builder) { builder.WriteString("metStore metadata") }} if err := statusHandler.start(ctx); err != nil { t.Fatal(err) } response := []string{} response = append(response, <-srv.response) if len(response) == 0 { t.Errorf("no response received: %v", response) } if err := statusHandler.stop(ctx); err != nil { t.Error(err) } }
{'content_hash': '658974ed7c10fbf67475d39e94f1f19d', 'timestamp': '', 'source': 'github', 'line_count': 81, 'max_line_length': 137, 'avg_line_length': 25.358024691358025, 'alnum_prop': 0.7142161635832522, 'repo_name': 'lukecwik/incubator-beam', 'id': '9cc2e5330797102fdd643b0c0d60bda51632c33b', 'size': '2849', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'sdks/go/pkg/beam/core/runtime/harness/worker_status_test.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '1598'}, {'name': 'C', 'bytes': '3869'}, {'name': 'CSS', 'bytes': '4957'}, {'name': 'Cython', 'bytes': '70760'}, {'name': 'Dart', 'bytes': '830463'}, {'name': 'Dockerfile', 'bytes': '54446'}, {'name': 'FreeMarker', 'bytes': '7933'}, {'name': 'Go', 'bytes': '5375910'}, {'name': 'Groovy', 'bytes': '923345'}, {'name': 'HCL', 'bytes': '101921'}, {'name': 'HTML', 'bytes': '182819'}, {'name': 'Java', 'bytes': '40844089'}, {'name': 'JavaScript', 'bytes': '120093'}, {'name': 'Jupyter Notebook', 'bytes': '55818'}, {'name': 'Kotlin', 'bytes': '215314'}, {'name': 'Lua', 'bytes': '3620'}, {'name': 'Python', 'bytes': '10573729'}, {'name': 'SCSS', 'bytes': '318158'}, {'name': 'Sass', 'bytes': '25936'}, {'name': 'Scala', 'bytes': '1429'}, {'name': 'Shell', 'bytes': '362995'}, {'name': 'Smarty', 'bytes': '2618'}, {'name': 'Thrift', 'bytes': '3260'}, {'name': 'TypeScript', 'bytes': '1955893'}]}
#ifndef __GSL_VECTOR_SHORT_H__ #define __GSL_VECTOR_SHORT_H__ #include <stdlib.h> #include <gsl/gsl_types.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_inline.h> #include <gsl/gsl_check_range.h> #include <gsl/gsl_block_short.h> #undef __BEGIN_DECLS #undef __END_DECLS #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } #else # define __BEGIN_DECLS /* empty */ # define __END_DECLS /* empty */ #endif __BEGIN_DECLS typedef struct { size_t size; size_t stride; short *data; gsl_block_short *block; int owner; } gsl_vector_short; typedef struct { gsl_vector_short vector; } _gsl_vector_short_view; typedef _gsl_vector_short_view gsl_vector_short_view; typedef struct { gsl_vector_short vector; } _gsl_vector_short_const_view; typedef const _gsl_vector_short_const_view gsl_vector_short_const_view; /* Allocation */ gsl_vector_short *gsl_vector_short_alloc (const size_t n); gsl_vector_short *gsl_vector_short_calloc (const size_t n); gsl_vector_short *gsl_vector_short_alloc_from_block (gsl_block_short * b, const size_t offset, const size_t n, const size_t stride); gsl_vector_short *gsl_vector_short_alloc_from_vector (gsl_vector_short * v, const size_t offset, const size_t n, const size_t stride); void gsl_vector_short_free (gsl_vector_short * v); /* Views */ _gsl_vector_short_view gsl_vector_short_view_array (short *v, size_t n); _gsl_vector_short_view gsl_vector_short_view_array_with_stride (short *base, size_t stride, size_t n); _gsl_vector_short_const_view gsl_vector_short_const_view_array (const short *v, size_t n); _gsl_vector_short_const_view gsl_vector_short_const_view_array_with_stride (const short *base, size_t stride, size_t n); _gsl_vector_short_view gsl_vector_short_subvector (gsl_vector_short *v, size_t i, size_t n); _gsl_vector_short_view gsl_vector_short_subvector_with_stride (gsl_vector_short *v, size_t i, size_t stride, size_t n); _gsl_vector_short_const_view gsl_vector_short_const_subvector (const gsl_vector_short *v, size_t i, size_t n); _gsl_vector_short_const_view gsl_vector_short_const_subvector_with_stride (const gsl_vector_short *v, size_t i, size_t stride, size_t n); /* Operations */ void gsl_vector_short_set_zero (gsl_vector_short * v); void gsl_vector_short_set_all (gsl_vector_short * v, short x); int gsl_vector_short_set_basis (gsl_vector_short * v, size_t i); int gsl_vector_short_fread (FILE * stream, gsl_vector_short * v); int gsl_vector_short_fwrite (FILE * stream, const gsl_vector_short * v); int gsl_vector_short_fscanf (FILE * stream, gsl_vector_short * v); int gsl_vector_short_fprintf (FILE * stream, const gsl_vector_short * v, const char *format); int gsl_vector_short_memcpy (gsl_vector_short * dest, const gsl_vector_short * src); int gsl_vector_short_reverse (gsl_vector_short * v); int gsl_vector_short_swap (gsl_vector_short * v, gsl_vector_short * w); int gsl_vector_short_swap_elements (gsl_vector_short * v, const size_t i, const size_t j); short gsl_vector_short_max (const gsl_vector_short * v); short gsl_vector_short_min (const gsl_vector_short * v); void gsl_vector_short_minmax (const gsl_vector_short * v, short * min_out, short * max_out); size_t gsl_vector_short_max_index (const gsl_vector_short * v); size_t gsl_vector_short_min_index (const gsl_vector_short * v); void gsl_vector_short_minmax_index (const gsl_vector_short * v, size_t * imin, size_t * imax); int gsl_vector_short_add (gsl_vector_short * a, const gsl_vector_short * b); int gsl_vector_short_sub (gsl_vector_short * a, const gsl_vector_short * b); int gsl_vector_short_mul (gsl_vector_short * a, const gsl_vector_short * b); int gsl_vector_short_div (gsl_vector_short * a, const gsl_vector_short * b); int gsl_vector_short_scale (gsl_vector_short * a, const double x); int gsl_vector_short_add_constant (gsl_vector_short * a, const double x); int gsl_vector_short_isnull (const gsl_vector_short * v); int gsl_vector_short_ispos (const gsl_vector_short * v); int gsl_vector_short_isneg (const gsl_vector_short * v); int gsl_vector_short_isnonneg (const gsl_vector_short * v); INLINE_DECL short gsl_vector_short_get (const gsl_vector_short * v, const size_t i); INLINE_DECL void gsl_vector_short_set (gsl_vector_short * v, const size_t i, short x); INLINE_DECL short * gsl_vector_short_ptr (gsl_vector_short * v, const size_t i); INLINE_DECL const short * gsl_vector_short_const_ptr (const gsl_vector_short * v, const size_t i); #ifdef HAVE_INLINE INLINE_FUN short gsl_vector_short_get (const gsl_vector_short * v, const size_t i) { #if GSL_RANGE_CHECK if (GSL_RANGE_COND(i >= v->size)) { GSL_ERROR_VAL ("index out of range", GSL_EINVAL, 0); } #endif return v->data[i * v->stride]; } INLINE_FUN void gsl_vector_short_set (gsl_vector_short * v, const size_t i, short x) { #if GSL_RANGE_CHECK if (GSL_RANGE_COND(i >= v->size)) { GSL_ERROR_VOID ("index out of range", GSL_EINVAL); } #endif v->data[i * v->stride] = x; } INLINE_FUN short * gsl_vector_short_ptr (gsl_vector_short * v, const size_t i) { #if GSL_RANGE_CHECK if (GSL_RANGE_COND(i >= v->size)) { GSL_ERROR_NULL ("index out of range", GSL_EINVAL); } #endif return (short *) (v->data + i * v->stride); } INLINE_FUN const short * gsl_vector_short_const_ptr (const gsl_vector_short * v, const size_t i) { #if GSL_RANGE_CHECK if (GSL_RANGE_COND(i >= v->size)) { GSL_ERROR_NULL ("index out of range", GSL_EINVAL); } #endif return (const short *) (v->data + i * v->stride); } #endif /* HAVE_INLINE */ __END_DECLS #endif /* __GSL_VECTOR_SHORT_H__ */
{'content_hash': 'e305dd913f86cd0bc382a54604470f49', 'timestamp': '', 'source': 'github', 'line_count': 210, 'max_line_length': 98, 'avg_line_length': 31.12857142857143, 'alnum_prop': 0.5976747743613279, 'repo_name': 'yunhkim/dcshell', 'id': 'da2dc236bdabb93943323160336e58d73f64648e', 'size': '7377', 'binary': False, 'copies': '8', 'ref': 'refs/heads/master', 'path': 'lib/gsl/include/gsl/gsl_vector_short.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '3205771'}, {'name': 'C++', 'bytes': '3187015'}, {'name': 'CMake', 'bytes': '10794'}, {'name': 'GLSL', 'bytes': '13655'}, {'name': 'Makefile', 'bytes': '56773'}, {'name': 'Objective-C', 'bytes': '18043'}, {'name': 'Shell', 'bytes': '566'}]}
package io.katharsis.spring.boot; import javax.servlet.Filter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; import io.katharsis.dispatcher.RequestDispatcher; import io.katharsis.errorhandling.mapper.ExceptionMapperRegistry; import io.katharsis.resource.registry.ResourceRegistry; import io.katharsis.spring.ErrorHandlerFilter; import io.katharsis.spring.KatharsisFilterV2; @Configuration @Import({RequestDispatcherConfiguration.class, QueryParamsBuilderConfiguration.class, JacksonConfiguration.class, JsonLocatorConfiguration.class, ModuleConfiguration.class, KatharsisRegistryConfiguration.class}) @EnableConfigurationProperties(KatharsisSpringBootProperties.class) public class KatharsisConfigV2 { @Autowired private KatharsisSpringBootProperties properties; @Autowired private ObjectMapper objectMapper; @Autowired private ResourceRegistry resourceRegistry; @Autowired private ExceptionMapperRegistry exceptionMapperRegistry; @Autowired private RequestDispatcher requestDispatcher; @Autowired private Module parameterNamesModule; @Bean public Filter springBootSampleKatharsisFilter() { objectMapper.registerModule(parameterNamesModule); return new KatharsisFilterV2(objectMapper, resourceRegistry, requestDispatcher, properties.getPathPrefix()); } @Bean public Filter errorHandlerFilter() { return new ErrorHandlerFilter(objectMapper, exceptionMapperRegistry); } }
{'content_hash': '7a552ae77aade17f64fd3225e8fcb8e5', 'timestamp': '', 'source': 'github', 'line_count': 59, 'max_line_length': 87, 'avg_line_length': 31.915254237288135, 'alnum_prop': 0.8061603823685608, 'repo_name': 'iMDT/katharsis-framework-j6', 'id': '4a2ab488346b7429668d506ef4abc256de8b634f', 'size': '1883', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'katharsis-spring/src/main/java/io/katharsis/spring/boot/KatharsisConfigV2.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '404'}, {'name': 'HTML', 'bytes': '1136'}, {'name': 'Java', 'bytes': '1911013'}, {'name': 'JavaScript', 'bytes': '878'}, {'name': 'Shell', 'bytes': '1213'}]}
using System.Reflection; using System.Runtime.CompilerServices; 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("DotWeb Admin")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("DotSystem Indonesia")] [assembly: AssemblyProduct("DotWeb Admin")] [assembly: AssemblyCopyright("Copyright © DotSystem 2016")] [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("901fbfb1-6451-4bbd-85a2-5a947a06599e")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("0.1.1.*")] [assembly: AssemblyFileVersion("0.1.1")]
{'content_hash': 'dac3792146fc86c71d85453aa2f5abd8', 'timestamp': '', 'source': 'github', 'line_count': 35, 'max_line_length': 84, 'avg_line_length': 39.457142857142856, 'alnum_prop': 0.7523533671252716, 'repo_name': 'dotindo/6ba5ea2b', 'id': '024ae89af591b638e53339d38ceda7bede1b8cd8', 'size': '1381', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'DotWeb/DotWeb.Admin/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ASP', 'bytes': '81734'}, {'name': 'C#', 'bytes': '246732'}, {'name': 'CSS', 'bytes': '29745'}]}
<?php namespace MidnightLuke\PhpUnitsOfMeasureBundle\Doctrine\Types; use PhpUnitsOfMeasure\PhysicalQuantity; class EnergyType extends AbstractPhysicalQuantityType { const UNIT_CLASS = PhysicalQuantity\Energy::class; const STANDARD_UNIT = 'J'; const TYPE_NAME = 'energy'; /** * {@inheritdoc} */ public function getUnitClass() { return self::UNIT_CLASS; } /** * {@inheritdoc} */ public function getStandardUnit() { return self::STANDARD_UNIT; } /** * {@inheritdoc} */ public function getTypeName() { return self::TYPE_NAME; } }
{'content_hash': '0d4fa6a36829fe9695789c2880373ccf', 'timestamp': '', 'source': 'github', 'line_count': 38, 'max_line_length': 62, 'avg_line_length': 17.05263157894737, 'alnum_prop': 0.6064814814814815, 'repo_name': 'midnightLuke/php-units-of-measure-bundle', 'id': '45f975db8030b3626dd25a9040439786e23de65e', 'size': '915', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Doctrine/Types/EnergyType.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '64573'}]}
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.17626 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace Flashlight.Resources { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class AppResources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal AppResources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Flashlight.Resources.AppResources", typeof(AppResources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized string similar to LeftToRight. /// </summary> public static string ResourceFlowDirection { get { return ResourceManager.GetString("ResourceFlowDirection", resourceCulture); } } /// <summary> /// Looks up a localized string similar to us-EN. /// </summary> public static string ResourceLanguage { get { return ResourceManager.GetString("ResourceLanguage", resourceCulture); } } /// <summary> /// Looks up a localized string similar to MY APPLICATION. /// </summary> public static string ApplicationTitle { get { return ResourceManager.GetString("ApplicationTitle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to button. /// </summary> public static string AppBarButtonText { get { return ResourceManager.GetString("AppBarButtonText", resourceCulture); } } /// <summary> /// Looks up a localized string similar to menu item. /// </summary> public static string AppBarMenuItemText { get { return ResourceManager.GetString("AppBarMenuItemText", resourceCulture); } } } }
{'content_hash': '65dfffb8923f4dddcd3b2d30c0bcb5a0', 'timestamp': '', 'source': 'github', 'line_count': 127, 'max_line_length': 181, 'avg_line_length': 34.39370078740158, 'alnum_prop': 0.5691391941391941, 'repo_name': 'SnoopWall/flashlight-windows-phone', 'id': 'c89f51db96392e65f81237ff92ea669c7b38906b', 'size': '4370', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Flashlight/Resources/AppResources.Designer.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '17893'}]}
# 创建Stub Content Provider > 编写:[jdneo](https://github.com/jdneo) - 原文: Sync Adapter框架是设计成用来和设备数据一起工作的,这些设备的数据被灵活且高安全的Content Provider所管理。因此,Sync Adapter框架会期望应用所使用的框架已经为它的本地数据定义了Content Provider。如果Sync Adapter框架尝试去运行你的Sync Adapter,而你的应用没有一个Content Provider的话,那么你的Sync Adapter将会崩溃。 如果你正在开发一个新的应用,它将数据从服务器传输到一台设备上,那么你务必应该考虑将本地数据存储于Content Provider中。因为它对于Sync Adapter来说是很重要的,另外Content Provider可以给予许多安全上的好处,并且是专门被设计成在Android设备上处理数据存储的。要学习如何创建一个Content Provider,可以阅读:[Creating a Content Provider](http://developer.android.com/guide/topics/providers/content-provider-creating.html)。 然而,如果你已经通过别的形式来存储本地数据,你仍然可以使用Sync Adapter来处理数据传输。为了满足Sync Adapter框架对于Content Provider的要求,可以在你的应用中添加一个空的Content Provider(Stub Content Provider)。一个Stub Content Provider实现了Content Provider类,但是所有的方法都返回null或者0。如果你添加了一个空提供器,你可以使用Sync Adapter从任何你选择的存储机制来传输数据。 如果你在你的应用中已经有了一个Content Provider,那么你就不需要一个Stub Content Provider了。在这种情况下,你可以略过这节课程,直接进入:[创建Sync Adapter](creating-sync-adapter.html)。如果你还没有一个Content Provider,这节课将向你展示如何添加一个Stub Content Provider,来允许你将你的Sync Adapter添加到框架中。 ## 添加一个Stub Content Provider 要为你的应用创建一个Stub Content Provider,继承[ContentProvider](http://developer.android.com/reference/android/content/ContentProvider.html)并且置空它需要的方法。下面的代码片段展示了你应该如何创建Stub Content Provider: ```java /* * Define an implementation of ContentProvider that stubs out * all methods */ public class StubProvider extends ContentProvider { /* * Always return true, indicating that the * provider loaded correctly. */ @Override public boolean onCreate() { return true; } /* * Return an empty String for MIME type */ @Override public String getType() { return new String(); } /* * query() always returns no results * */ @Override public Cursor query( Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { return null; } /* * insert() always returns null (no URI) */ @Override public Uri insert(Uri uri, ContentValues values) { return null; } /* * delete() always returns "no rows affected" (0) */ @Override public int delete(Uri uri, String selection, String[] selectionArgs) { return 0; } /* * update() always returns "no rows affected" (0) */ public int update( Uri uri, ContentValues values, String selection, String[] selectionArgs) { return 0; } } ``` ## 在清单文件中声明提供器 Sync Adapter框架会检查你的应用在清单文件中是否声明了一个Provider来验证你的应用是否有一个Content Provider。为了在清单文件中声明Stub Content Provider,添加一个[`<provider>`](http://developer.android.com/guide/topics/manifest/provider-element.html)标签,并让它拥有下列属性字段: **android:name="com.example.android.datasync.provider.StubProvider"** 指定一个实现了Stub Content Provider的类的完整包名。 **android:authorities="com.example.android.datasync.provider"** 一个URI Authority来指定Stub Content Provider。让它的值是你的应用包名加上字符串“.provider”。虽然你在这向系统声明了你的空提供器,但是这并不会导致对提供器的访问。 **android:exported="false"** 确定其它应用是否可以访问Content Provider。对于你的Stub Content Provider,由于没有让其它应用访问提供器的必要,将值设置为“false”。该值并不会影响Sync Adapter框架和Content Provider之间的交互。 **android:syncable="true"** 设置一个指明该提供器是可同步的标识。如果将这个值设置为“true”,你不需要在你的代码中调用[setIsSyncable()](http://developer.android.com/reference/android/content/ContentResolver.html#setIsSyncable\(android.accounts.Account, java.lang.String, int\))。这一标识将会允许Sync Adapter框架和Content Provider进行数据传输,但是仅仅在你显式地执行这一传输时才会进行。 下面的代码片段展示了你应该如何将[`<provider>`](http://developer.android.com/guide/topics/manifest/provider-element.html)添加到应用清单文件中: ```xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.network.sync.BasicSyncAdapter" android:versionCode="1" android:versionName="1.0" > <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > ... <provider android:name="com.example.android.datasync.provider.StubProvider" android:authorities="com.example.android.datasync.provider" android:export="false" android:syncable="true"/> ... </application> </manifest> ``` 现在你已经创建了Sync Adapter框架所需要的依赖关系,你可以创建封装你的数据传输代码的组件了。该组件就叫做Sync Adapter。下节课将会展示如何将它添加到你的应用中。
{'content_hash': '5cf7184d3910578c0c189d809b824305', 'timestamp': '', 'source': 'github', 'line_count': 121, 'max_line_length': 295, 'avg_line_length': 36.47107438016529, 'alnum_prop': 0.7369136641740313, 'repo_name': 'zhenghuiy/android-training-course-in-chinese', 'id': 'cb7534a146ff47c6238ae4664fac29db71013669', 'size': '6139', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'connectivity/sync-adapters/create-stub-provider.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
<resources> <string name="app_name">懵圈</string> <string name="$dot">•</string> <string name="$slash">/</string> <string name="no_reply">暂无回复</string> <string name="create_topic_content_hint">说点什么吧&#8230;</string> </resources>
{'content_hash': 'e906885b7c51c50fa1fb239b2ce27740', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 66, 'avg_line_length': 35.142857142857146, 'alnum_prop': 0.6382113821138211, 'repo_name': 'Dongjian1020/mengquan', 'id': '38d57b780bd306dc4b4fa4bcbe7af09fd9772e0f', 'size': '270', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/res/values/strings.xml', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '122306'}]}
""" This implements a global (and a local) blacklist against wiki spammers. @copyright: 2005-2008 MoinMoin:ThomasWaldmann @license: GNU GPL, see COPYING for details """ import re, time, datetime from MoinMoin import log logging = log.getLogger(__name__) from MoinMoin.support.python_compatibility import frozenset from MoinMoin.security import Permissions from MoinMoin import caching, wikiutil # Errors --------------------------------------------------------------- class Error(Exception): """Base class for antispam errors.""" def __str__(self): return repr(self) class WikirpcError(Error): """ Raised when we get xmlrpclib.Fault """ def __init__(self, msg, fault): """ Init with msg and xmlrpclib.Fault dict """ self.msg = msg self.fault = fault def __str__(self): """ Format the using description and data from the fault """ return self.msg + ": [%(faultCode)s] %(faultString)s" % self.fault # Functions ------------------------------------------------------------ def makelist(text): """ Split text into lines, strip them, skip # comments """ lines = text.splitlines() result = [] for line in lines: line = line.split(' # ', 1)[0] # rest of line comment line = line.strip() if line and not line.startswith('#'): result.append(line) return result def getblacklist(request, pagename, do_update): """ Get blacklist, possibly downloading new copy @param request: current request (request instance) @param pagename: bad content page name (unicode) @rtype: list @return: list of blacklisted regular expressions """ from MoinMoin.PageEditor import PageEditor p = PageEditor(request, pagename, uid_override="Antispam subsystem") mymtime = wikiutil.version2timestamp(p.mtime_usecs()) if do_update: tooold = time.time() - 1800 failure = caching.CacheEntry(request, "antispam", "failure", scope='wiki') fail_time = failure.mtime() # only update if no failure in last hour if (mymtime < tooold) and (fail_time < tooold): logging.info("%d *BadContent too old, have to check for an update..." % tooold) import xmlrpclib import socket timeout = 15 # time out for reaching the master server via xmlrpc old_timeout = socket.getdefaulttimeout() socket.setdefaulttimeout(timeout) master_url = request.cfg.antispam_master_url master = xmlrpclib.ServerProxy(master_url) try: # Get BadContent info master.putClientInfo('ANTISPAM-CHECK', request.url) response = master.getPageInfo(pagename) # It seems that response is always a dict if isinstance(response, dict) and 'faultCode' in response: raise WikirpcError("failed to get BadContent information", response) # Compare date against local BadContent copy masterdate = response['lastModified'] if isinstance(masterdate, datetime.datetime): # for python 2.5 mydate = datetime.datetime(*tuple(time.gmtime(mymtime))[0:6]) else: # for python <= 2.4.x mydate = xmlrpclib.DateTime(tuple(time.gmtime(mymtime))) logging.debug("master: %s mine: %s" % (masterdate, mydate)) if mydate < masterdate: # Get new copy and save logging.info("Fetching page from %s..." % master_url) master.putClientInfo('ANTISPAM-FETCH', request.url) response = master.getPage(pagename) if isinstance(response, dict) and 'faultCode' in response: raise WikirpcError("failed to get BadContent data", response) p._write_file(response) mymtime = wikiutil.version2timestamp(p.mtime_usecs()) else: failure.update("") # we didn't get a modified version, this avoids # permanent polling for every save when there # is no updated master page except (socket.error, xmlrpclib.ProtocolError), err: logging.error('Timeout / socket / protocol error when accessing %s: %s' % (master_url, str(err))) # update cache to wait before the next try failure.update("") except (xmlrpclib.Fault, ), err: logging.error('Fault on %s: %s' % (master_url, str(err))) # update cache to wait before the next try failure.update("") except Error, err: # In case of Error, we log the error and use the local BadContent copy. logging.error(str(err)) # set back socket timeout socket.setdefaulttimeout(old_timeout) blacklist = p.get_raw_body() return mymtime, makelist(blacklist) class SecurityPolicy(Permissions): """ Extend the default security policy with antispam feature """ def save(self, editor, newtext, rev, **kw): BLACKLISTPAGES = ["BadContent", "LocalBadContent"] if not editor.page_name in BLACKLISTPAGES: request = editor.request # Start timing of antispam operation request.clock.start('antispam') blacklist = [] latest_mtime = 0 for pn in BLACKLISTPAGES: do_update = (pn != "LocalBadContent" and request.cfg.interwikiname != 'MoinMaster') # MoinMaster wiki shall not fetch updates from itself blacklist_mtime, blacklist_entries = getblacklist(request, pn, do_update) blacklist += blacklist_entries latest_mtime = max(latest_mtime, blacklist_mtime) if blacklist: invalid_cache = not getattr(request.cfg.cache, "antispam_blacklist", None) if invalid_cache or request.cfg.cache.antispam_blacklist[0] < latest_mtime: mmblcache = [] for blacklist_re in blacklist: try: mmblcache.append(re.compile(blacklist_re, re.I)) except re.error, err: logging.error("Error in regex '%s': %s. Please check the pages %s." % ( blacklist_re, str(err), ', '.join(BLACKLISTPAGES))) request.cfg.cache.antispam_blacklist = (latest_mtime, mmblcache) from MoinMoin.Page import Page oldtext = "" if rev > 0: # rev is the revision of the old page page = Page(request, editor.page_name, rev=rev) oldtext = page.get_raw_body() newset = frozenset(newtext.splitlines(1)) oldset = frozenset(oldtext.splitlines(1)) difference = newset - oldset addedtext = kw.get('comment', u'') + u''.join(difference) for blacklist_re in request.cfg.cache.antispam_blacklist[1]: match = blacklist_re.search(addedtext) if match: # Log error and raise SaveError, PageEditor should handle this. _ = editor.request.getText msg = _('Sorry, can not save page because "%(content)s" is not allowed in this wiki.') % { 'content': wikiutil.escape(match.group()) } logging.info(msg) raise editor.SaveError(msg) request.clock.stop('antispam') # No problem to save if my base class agree return Permissions.save(self, editor, newtext, rev, **kw)
{'content_hash': 'a562d1bb87c4c005b1dfd7dc4ba1fd86', 'timestamp': '', 'source': 'github', 'line_count': 194, 'max_line_length': 125, 'avg_line_length': 43.0, 'alnum_prop': 0.5344042196116039, 'repo_name': 'Glottotopia/aagd', 'id': '1ca9be07d984982a604a3775157c2fffe96f72de', 'size': '8372', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'moin/local/moin/MoinMoin/security/antispam.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '152885'}, {'name': 'CSS', 'bytes': '454208'}, {'name': 'ColdFusion', 'bytes': '438820'}, {'name': 'HTML', 'bytes': '1998354'}, {'name': 'Java', 'bytes': '510468'}, {'name': 'JavaScript', 'bytes': '6505329'}, {'name': 'Lasso', 'bytes': '72399'}, {'name': 'Makefile', 'bytes': '10216'}, {'name': 'PHP', 'bytes': '259528'}, {'name': 'Perl', 'bytes': '137186'}, {'name': 'Python', 'bytes': '13713475'}, {'name': 'Shell', 'bytes': '346'}, {'name': 'XSLT', 'bytes': '15970'}]}
package com.github.weisj.darklaf.task; import java.awt.*; import javax.swing.*; import javax.swing.text.html.HTMLEditorKit; import javax.swing.text.html.StyleSheet; import com.github.weisj.darklaf.theme.Theme; import com.github.weisj.darklaf.util.ColorUtil; public class StyleSheetInitTask implements DefaultsInitTask { private UIDefaults defaults; @Override public void run(final Theme currentTheme, final UIDefaults defaults) { this.defaults = defaults; StyleSheet styleSheet = new StyleSheet(); Font font = defaults.getFont("html.font"); CSSBuilder builder = new CSSBuilder(); builder.group("body") .fontSize(pt(14)) .fontFamily(font.getFamily(), font.getName()) .fontWeight("normal") .marginRight(0) .marginLeft(0) .color(hex("textForeground")); builder.group("p") .marginTop(px(15)); builder.group("h1") .fontSize("x-large") .fontWeight("bold") .marginTop(px(10)) .marginBottom(px(10)); builder.group("h2") .fontSize("large") .fontWeight("bold") .marginTop(px(10)) .marginBottom(px(10)); builder.group("h3") .fontSize("medium") .fontWeight("bold") .marginTop(px(10)) .marginBottom(px(10)); builder.group("h4") .fontSize("small") .fontWeight("bold") .marginTop(px(10)) .marginBottom(px(10)); builder.group("h5") .fontSize("x-small") .fontWeight("bold") .marginTop(px(10)) .marginBottom(px(10)); builder.group("h6") .fontSize("xx-small") .fontWeight("bold") .marginTop(px(10)) .marginBottom(px(10)); builder.group("li p") .marginTop(0) .marginBottom(0); builder.group("td p") .marginTop(0); builder.group("menu li p") .marginTop(0) .marginBottom(0); builder.group("menu li") .margin(0); builder.group("menu") .marginLeftLTR(px(40)) .marginRightRTL(px(40)) .marginTop(px(10)) .marginBottom(px(10)); builder.group("dir li p") .marginTop(0) .marginBottom(0); builder.group("dir li") .margin(0); builder.group("dir") .marginLeftLTR(px(40)) .marginRightRTL(px(40)) .marginTop(px(10)) .marginBottom(px(10)); builder.group("dd") .marginLeftLTR(px(40)) .marginRightRTL(px(40)) .marginTop(px(10)) .marginBottom(px(10)); builder.group("dd p") .margin(0); builder.group("dt") .marginTop(0) .marginBottom(0); builder.group("dl") .marginLeft(0) .marginTop(px(10)) .marginBottom(px(10)); builder.group("ol li") .margin(0); builder.group("ol") .marginTop(px(10)) .marginBottom(px(10)) .marginLeftLTR(px(50)) .marginRightRTL(px(50)) .listStyleType("decimal"); builder.group("ol li p") .marginTop(0) .marginBottom(0); builder.group("ul li") .margin(0); builder.group("ul") .marginTop(px(10)) .marginBottom(px(10)) .marginLeftLTR(px(50)) .marginRightRTL(px(50)) .listStyleType("disc") .property("-bullet-gap", px(10)); builder.group("ul li ul li") .margin(0); builder.group("ul li ul") .marginLeftLTR(px(25)) .marginRightRTL(px(25)) .listStyleType("circle"); builder.group("ul li ul li ul li") .margin(0); builder.group("ul li menu") .marginLeftLTR(px(25)) .marginRightRTL(px(25)) .listStyleType("circle"); builder.group("ul li p") .marginTop(0) .marginBottom(0); builder.group("a") .color(hex("hyperlink")) .textDecoration("underline"); builder.group("address") .color(hex("hyperlink")) .fontStyle("italic"); builder.group("big") .fontSize("x-large"); builder.group("small") .fontSize("x-small"); builder.group("samp") .fontSize("small") .fontFamily("Monospaced", "monospace"); builder.group("code") .fontSize("small") .fontFamily("Monospaced", "monospace"); builder.group("kbd") .fontSize("small") .fontFamily("Monospaced", "monospace"); builder.group("cite") .fontStyle("italic"); builder.group("dfn") .fontStyle("italic"); builder.group("em") .fontStyle("italic"); builder.group("i") .fontStyle("italic"); builder.group("b") .fontWeight("bold"); builder.group("strong") .fontWeight("bold"); builder.group("strike") .textDecoration("line-through"); builder.group("s") .textDecoration("line-through"); builder.group("sub") .property("vertical-align", "sub"); builder.group("sup") .property("vertical-align", "sub"); builder.group("tt") .fontFamily("Monospaced", "monospace"); builder.group("u") .textDecoration("underline"); builder.group("var") .fontWeight("bold") .fontStyle("italic"); builder.group("table") .borderStyle("none") .borderCollapse("collapse"); builder.group("td") .borderColor(hex("border")) .borderStyle("none") .borderWidth(px(1)) .padding(px(3)) .borderCollapse("collapse"); builder.group("th") .borderColor(hex("border")) .borderStyle("solid") .borderWidth(px(1)) .padding(px(3)) .fontWeight("bold") .borderCollapse("collapse"); builder.group("tr") .property("text-align", "left"); builder.group("blockquote") .margin(px(5) + " " + px(35)); builder.group("center") .property("text-align", "center"); builder.group("pre") .marginTop(px(5)) .marginBottom(px(5)) .fontFamily("Monospaced", "monospace"); builder.group("pre p") .marginTop(0); builder.group("caption") .property("caption-side", "top") .property("text-align", "center"); builder.group("nobr") .property("white-space", "nowrap"); builder.group("input") .border("none"); builder.group("div") .borderColor(hex("borderSecondary")) .borderWidth(px(1)); styleSheet.addRule(builder.toString()); StyleSheet custom = currentTheme.loadStyleSheet(); if (custom.getStyleNames().hasMoreElements()) { styleSheet.addStyleSheet(custom); } new HTMLEditorKit().setStyleSheet(styleSheet); } protected String hex(final String key) { Color c = defaults.getColor(key); return "#" + ColorUtil.toHex(c); } protected String px(final int px) { return px + "px"; } protected String pt(final int pt) { return pt + "pt"; } @Override public boolean onlyDuringInstallation() { return true; } }
{'content_hash': '95d157149468242532ce1ebf42ff8176', 'timestamp': '', 'source': 'github', 'line_count': 247, 'max_line_length': 74, 'avg_line_length': 33.91093117408907, 'alnum_prop': 0.47361509073543456, 'repo_name': 'weisJ/darklaf', 'id': 'bdd5f10e33e3a8769ffd94afc950d234e1fd09c6', 'size': '9505', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'core/src/main/java/com/github/weisj/darklaf/task/StyleSheetInitTask.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '2609'}, {'name': 'C++', 'bytes': '40050'}, {'name': 'CSS', 'bytes': '4031'}, {'name': 'Java', 'bytes': '3992909'}, {'name': 'Kotlin', 'bytes': '70507'}, {'name': 'Objective-C', 'bytes': '2779'}, {'name': 'Objective-C++', 'bytes': '21437'}]}
package net.javacrumbs.shedlock.spring.aop; import net.javacrumbs.shedlock.core.LockProvider; import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.concurrent.CustomizableThreadFactory; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import static net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock.InterceptMode.PROXY_SCHEDULER; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; /** * Test creation of default task scheduler */ @ExtendWith(SpringExtension.class) @ContextConfiguration(classes = SchedulerProxyScheduledExecutorServiceSchedulerTest.SchedulerWrapperConfig.class) public class SchedulerProxyScheduledExecutorServiceSchedulerTest extends AbstractSchedulerProxyTest { @Override protected void assertRightSchedulerUsed() { assertThat(Thread.currentThread().getName()).startsWith("my-thread"); } @Configuration @EnableScheduling @EnableSchedulerLock(defaultLockAtMostFor = "${default.lock_at_most_for}", defaultLockAtLeastFor = "${default.lock_at_least_for}", interceptMode = PROXY_SCHEDULER) @PropertySource("test.properties") static class SchedulerWrapperConfig { @Bean public LockProvider lockProvider() { return mock(LockProvider.class); } @Bean public ScheduledExecutorService executorService() { return Executors.newScheduledThreadPool(10, new CustomizableThreadFactory("my-thread")); } } }
{'content_hash': '9541d2aa899a17fa06b3f1d168f338c3', 'timestamp': '', 'source': 'github', 'line_count': 50, 'max_line_length': 167, 'avg_line_length': 40.36, 'alnum_prop': 0.7973240832507433, 'repo_name': 'lukas-krecan/ShedLock', 'id': '0ce5444caa9ee377a7cd28ee4b8d12d18fc6438d', 'size': '2634', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spring/shedlock-spring/src/test/java/net/javacrumbs/shedlock/spring/aop/SchedulerProxyScheduledExecutorServiceSchedulerTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '686665'}, {'name': 'Kotlin', 'bytes': '5187'}]}
Rev API python client ================================== Description ------------ Python client example for the rev transcription API. See API documentation: http://www.rev.com/api Installation ------------ 1. Install ``` python setup.py install ``` 2. Copy settings.example.ini to settings.ini and fill in your credentials and configuration options. Usage -------- ``` python create_transcription_order.py ``` or ``` python save_transcripts.py ``` Known issues --------- Soon Troubleshooting ---------- Soon also! Next steps ---------- * More unit testing * Questions ---------- TBD
{'content_hash': 'c82b2e183850f26d3022c7fc13d6a631', 'timestamp': '', 'source': 'github', 'line_count': 55, 'max_line_length': 100, 'avg_line_length': 10.963636363636363, 'alnum_prop': 0.6086235489220564, 'repo_name': 'koemei/rev-api', 'id': '6a18f4bac94e19069428b4d18dfc65e7cf8c7593', 'size': '603', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Python', 'bytes': '30562'}]}
<?php namespace VerifyPaypal\Classes; require_once __DIR__ . '/../Config/VerifyPaypalConfig.php'; Class VerifyPaypal { protected $clientID; protected $secretKey; protected $paypalID; protected $paypalPW; protected $paypalSIG; protected $receiverEmail; protected $viro; protected $status; public function __construct($viro) { if ($viro == "live") { $this->clientID = CLIENT_ID; $this->secretKey = SECRET_KEY; $this->paypalID = PAYPAL_ID; $this->paypalPW = PAYPAL_PW; $this->paypalSIG = PAYPAL_SIG; $this->receiverEmail = RECEIVER_EMAIL; } else if ($viro == "sandbox") { $this->clientID = CLIENT_ID_SANDBOX; $this->secretKey = SECRET_KEY_SANDBOX; $this->paypalID = PAYPAL_ID_SANDBOX; $this->paypalPW = PAYPAL_PW_SANDBOX; $this->paypalSIG = PAYPAL_SIG_SANDBOX; $this->receiverEmail = RECEIVER_EMAIL_SANDBOX; } else throw new \Exception('Invalid enviornment, "live" or "sandbox" only.'); $this->viro = $viro; } public function getStatus() { return $this->status; } public static function isWorking() { echo "VerifyPaypal was installed correctly!"; } } ?>
{'content_hash': '0660594fd00c6847741c2c82d9df7414', 'timestamp': '', 'source': 'github', 'line_count': 55, 'max_line_length': 74, 'avg_line_length': 20.618181818181817, 'alnum_prop': 0.6728395061728395, 'repo_name': 'botnik/VerifyPaypal', 'id': '05c0edfcaf8344f61d93d6d5026afada8321b9d6', 'size': '1134', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/VerifyPaypal/Classes/VerifyPaypal.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '9273'}]}
<?xml version="1.0" encoding="utf-8"?> <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:initialLayout="@layout/widget_1x1" android:minWidth="72dip" android:minHeight="72dip" android:label="@string/widget1" android:updatePeriodMillis="300000" />
{'content_hash': 'fe34eb1794bff9a7ff5a2432e531d9f9', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 78, 'avg_line_length': 37.75, 'alnum_prop': 0.7251655629139073, 'repo_name': 'albertogcatalan/abebattery-android', 'id': 'd358287216f69fcf8309794ebabb9a2f852aceff', 'size': '302', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'res/xml/widget_1x1.xml', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '237955'}]}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Fri Mar 06 22:15:34 CST 2015 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Package org.apache.hadoop.yarn.server.resourcemanager.resource (hadoop-yarn-server-resourcemanager 2.3.0 API) </TITLE> <META NAME="date" CONTENT="2015-03-06"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package org.apache.hadoop.yarn.server.resourcemanager.resource (hadoop-yarn-server-resourcemanager 2.3.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?org/apache/hadoop/yarn/server/resourcemanager/resource/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Package<br>org.apache.hadoop.yarn.server.resourcemanager.resource</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../../../org/apache/hadoop/yarn/server/resourcemanager/resource/package-summary.html">org.apache.hadoop.yarn.server.resourcemanager.resource</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.hadoop.yarn.server.resourcemanager.resource"><B>org.apache.hadoop.yarn.server.resourcemanager.resource</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair"><B>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.policies"><B>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.policies</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.hadoop.yarn.server.resourcemanager.resource"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../../../../../org/apache/hadoop/yarn/server/resourcemanager/resource/package-summary.html">org.apache.hadoop.yarn.server.resourcemanager.resource</A> used by <A HREF="../../../../../../../org/apache/hadoop/yarn/server/resourcemanager/resource/package-summary.html">org.apache.hadoop.yarn.server.resourcemanager.resource</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../../../../org/apache/hadoop/yarn/server/resourcemanager/resource/class-use/ResourceType.html#org.apache.hadoop.yarn.server.resourcemanager.resource"><B>ResourceType</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../../../../org/apache/hadoop/yarn/server/resourcemanager/resource/class-use/ResourceWeights.html#org.apache.hadoop.yarn.server.resourcemanager.resource"><B>ResourceWeights</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../../../../../org/apache/hadoop/yarn/server/resourcemanager/resource/package-summary.html">org.apache.hadoop.yarn.server.resourcemanager.resource</A> used by <A HREF="../../../../../../../org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/package-summary.html">org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../../../../org/apache/hadoop/yarn/server/resourcemanager/resource/class-use/ResourceWeights.html#org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair"><B>ResourceWeights</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.policies"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../../../../../org/apache/hadoop/yarn/server/resourcemanager/resource/package-summary.html">org.apache.hadoop.yarn.server.resourcemanager.resource</A> used by <A HREF="../../../../../../../org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/package-summary.html">org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.policies</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../../../../org/apache/hadoop/yarn/server/resourcemanager/resource/class-use/ResourceType.html#org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.policies"><B>ResourceType</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?org/apache/hadoop/yarn/server/resourcemanager/resource/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2015 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>
{'content_hash': '78f398ad78632c570168c826b79d9b81', 'timestamp': '', 'source': 'github', 'line_count': 215, 'max_line_length': 392, 'avg_line_length': 48.55348837209302, 'alnum_prop': 0.6500622665006227, 'repo_name': 'jsrudani/HadoopHDFSProject', 'id': 'c2108394ab9f174223c5bfe9f4cfafcf69891d4c', 'size': '10439', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/target/org/apache/hadoop/yarn/server/resourcemanager/resource/package-use.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AspectJ', 'bytes': '31146'}, {'name': 'C', 'bytes': '1198902'}, {'name': 'C++', 'bytes': '164551'}, {'name': 'CMake', 'bytes': '131069'}, {'name': 'CSS', 'bytes': '131494'}, {'name': 'Erlang', 'bytes': '464'}, {'name': 'HTML', 'bytes': '485534855'}, {'name': 'Java', 'bytes': '37974886'}, {'name': 'JavaScript', 'bytes': '80446'}, {'name': 'Makefile', 'bytes': '104088'}, {'name': 'Perl', 'bytes': '18992'}, {'name': 'Protocol Buffer', 'bytes': '159216'}, {'name': 'Python', 'bytes': '11309'}, {'name': 'Shell', 'bytes': '724779'}, {'name': 'TeX', 'bytes': '19322'}, {'name': 'XSLT', 'bytes': '91404'}]}
using System.Collections.Generic; using System.Collections.ObjectModel; using System.Net.Http.Headers; using System.Web.Http.Description; using MediaUpload.Areas.HelpPage.ModelDescriptions; namespace MediaUpload.Areas.HelpPage.Models { /// <summary> /// The model that represents an API displayed on the help page. /// </summary> public class HelpPageApiModel { /// <summary> /// Initializes a new instance of the <see cref="HelpPageApiModel"/> class. /// </summary> public HelpPageApiModel() { UriParameters = new Collection<ParameterDescription>(); SampleRequests = new Dictionary<MediaTypeHeaderValue, object>(); SampleResponses = new Dictionary<MediaTypeHeaderValue, object>(); ErrorMessages = new Collection<string>(); } /// <summary> /// Gets or sets the <see cref="ApiDescription"/> that describes the API. /// </summary> public ApiDescription ApiDescription { get; set; } /// <summary> /// Gets or sets the <see cref="ParameterDescription"/> collection that describes the URI parameters for the API. /// </summary> public Collection<ParameterDescription> UriParameters { get; private set; } /// <summary> /// Gets or sets the documentation for the request. /// </summary> public string RequestDocumentation { get; set; } /// <summary> /// Gets or sets the <see cref="ModelDescription"/> that describes the request body. /// </summary> public ModelDescription RequestModelDescription { get; set; } /// <summary> /// Gets the request body parameter descriptions. /// </summary> public IList<ParameterDescription> RequestBodyParameters { get { return GetParameterDescriptions(RequestModelDescription); } } /// <summary> /// Gets or sets the <see cref="ModelDescription"/> that describes the resource. /// </summary> public ModelDescription ResourceDescription { get; set; } /// <summary> /// Gets the resource property descriptions. /// </summary> public IList<ParameterDescription> ResourceProperties { get { return GetParameterDescriptions(ResourceDescription); } } /// <summary> /// Gets the sample requests associated with the API. /// </summary> public IDictionary<MediaTypeHeaderValue, object> SampleRequests { get; private set; } /// <summary> /// Gets the sample responses associated with the API. /// </summary> public IDictionary<MediaTypeHeaderValue, object> SampleResponses { get; private set; } /// <summary> /// Gets the error messages associated with this model. /// </summary> public Collection<string> ErrorMessages { get; private set; } private static IList<ParameterDescription> GetParameterDescriptions(ModelDescription modelDescription) { ComplexTypeModelDescription complexTypeModelDescription = modelDescription as ComplexTypeModelDescription; if (complexTypeModelDescription != null) { return complexTypeModelDescription.Properties; } CollectionModelDescription collectionModelDescription = modelDescription as CollectionModelDescription; if (collectionModelDescription != null) { complexTypeModelDescription = collectionModelDescription.ElementDescription as ComplexTypeModelDescription; if (complexTypeModelDescription != null) { return complexTypeModelDescription.Properties; } } return null; } } }
{'content_hash': '414803ff495383bc9329fa2e6d579be9', 'timestamp': '', 'source': 'github', 'line_count': 108, 'max_line_length': 123, 'avg_line_length': 36.592592592592595, 'alnum_prop': 0.6148785425101214, 'repo_name': 'peteratseneca/dps907fall2015', 'id': 'aad7418157f139c9fbcde45b97d116b3b8c6a5e0', 'size': '3952', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Week_07/MediaUploadAndDeliver/MediaUpload/Areas/HelpPage/Models/HelpPageApiModel.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '2125'}, {'name': 'C#', 'bytes': '3926705'}, {'name': 'CSS', 'bytes': '46205'}, {'name': 'HTML', 'bytes': '101548'}, {'name': 'JavaScript', 'bytes': '380745'}]}
SELECT * FROM `rates` WHERE `cost` < 500; SELECT * FROM `clientaddress` WHERE `city` = 'Minsk'; SELECT * FROM `rates` WHERE `rate_hour` < 12 AND `rate_minute` > 50; SELECT * FROM `users` WHERE `user_id` = (SELECT `user_id` FROM `rates` WHERE `cost` = (SELECT MAX(`cost`) FROM `rates`))
{'content_hash': '05f7ab1d586e291a856385fbff478dbb', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 120, 'avg_line_length': 33.333333333333336, 'alnum_prop': 0.6233333333333333, 'repo_name': 'VerkhovtsovPavel/BSUIR_Labs', 'id': '1a4099435c348f0525babd0873ffa93a17cf403f', 'size': '300', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Labs/DB/6 sem/statement/Selects.sql', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '11743'}, {'name': 'Batchfile', 'bytes': '1203'}, {'name': 'C', 'bytes': '705'}, {'name': 'C#', 'bytes': '245141'}, {'name': 'C++', 'bytes': '7393'}, {'name': 'CSS', 'bytes': '1814'}, {'name': 'Clojure', 'bytes': '27036'}, {'name': 'HTML', 'bytes': '16955'}, {'name': 'Java', 'bytes': '1046956'}, {'name': 'JavaScript', 'bytes': '6201'}, {'name': 'Makefile', 'bytes': '381'}, {'name': 'Python', 'bytes': '1237'}, {'name': 'Scala', 'bytes': '123281'}, {'name': 'Shell', 'bytes': '363'}, {'name': 'Stata', 'bytes': '22328'}, {'name': 'TSQL', 'bytes': '12193'}, {'name': 'TeX', 'bytes': '903391'}, {'name': 'TypeScript', 'bytes': '1331'}, {'name': 'VHDL', 'bytes': '210587'}]}
<!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 (1.8.0_111) on Wed Jan 25 17:06:12 EET 2017 --> <title>Uses of Class ee.ria.dhx.server.types.ee.riik.schemas.dhl.GetSendingOptionsResponse</title> <meta name="date" content="2017-01-25"> <link rel="stylesheet" type="text/css" href="../../../../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class ee.ria.dhx.server.types.ee.riik.schemas.dhl.GetSendingOptionsResponse"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <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="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../../../index.html?ee/ria/dhx/server/types/ee/riik/schemas/dhl/class-use/GetSendingOptionsResponse.html" target="_top">Frames</a></li> <li><a href="GetSendingOptionsResponse.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../../../../allclasses-noframe.html">All&nbsp;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 ee.ria.dhx.server.types.ee.riik.schemas.dhl.GetSendingOptionsResponse" class="title">Uses of Class<br>ee.ria.dhx.server.types.ee.riik.schemas.dhl.GetSendingOptionsResponse</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">GetSendingOptionsResponse</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#ee.ria.dhx.server.endpoint">ee.ria.dhx.server.endpoint</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#ee.ria.dhx.server.service">ee.ria.dhx.server.service</a></td> <td class="colLast"> <div class="block">Package contains service classes that perform main logic of dhx-adapter-server that is not related to database.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#ee.ria.dhx.server.types.ee.riik.xrd.dhl.producers.producer.dhl">ee.ria.dhx.server.types.ee.riik.xrd.dhl.producers.producer.dhl</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="ee.ria.dhx.server.endpoint"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">GetSendingOptionsResponse</a> in <a href="../../../../../../../../../../ee/ria/dhx/server/endpoint/package-summary.html">ee.ria.dhx.server.endpoint</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../../../../ee/ria/dhx/server/endpoint/package-summary.html">ee.ria.dhx.server.endpoint</a> that return <a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">GetSendingOptionsResponse</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">GetSendingOptionsResponse</a></code></td> <td class="colLast"><span class="typeNameLabel">ServerEndpoint.</span><code><span class="memberNameLink"><a href="../../../../../../../../../../ee/ria/dhx/server/endpoint/ServerEndpoint.html#getSendingOptions-ee.ria.dhx.server.types.ee.riik.xrd.dhl.producers.producer.dhl.GetSendingOptions-org.springframework.ws.context.MessageContext-">getSendingOptions</a></span>(<a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/xrd/dhl/producers/producer/dhl/GetSendingOptions.html" title="class in ee.ria.dhx.server.types.ee.riik.xrd.dhl.producers.producer.dhl">GetSendingOptions</a>&nbsp;request, org.springframework.ws.context.MessageContext&nbsp;messageContext)</code> <div class="block">X-road SOAP service getSendingOptions.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="ee.ria.dhx.server.service"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">GetSendingOptionsResponse</a> in <a href="../../../../../../../../../../ee/ria/dhx/server/service/package-summary.html">ee.ria.dhx.server.service</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../../../../ee/ria/dhx/server/service/package-summary.html">ee.ria.dhx.server.service</a> that return <a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">GetSendingOptionsResponse</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">GetSendingOptionsResponse</a></code></td> <td class="colLast"><span class="typeNameLabel">SoapService.</span><code><span class="memberNameLink"><a href="../../../../../../../../../../ee/ria/dhx/server/service/SoapService.html#getSendingOptions-ee.ria.dhx.server.types.ee.riik.xrd.dhl.producers.producer.dhl.GetSendingOptions-ee.ria.dhx.types.InternalXroadMember-ee.ria.dhx.types.InternalXroadMember-org.springframework.ws.context.MessageContext-">getSendingOptions</a></span>(<a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/xrd/dhl/producers/producer/dhl/GetSendingOptions.html" title="class in ee.ria.dhx.server.types.ee.riik.xrd.dhl.producers.producer.dhl">GetSendingOptions</a>&nbsp;request, ee.ria.dhx.types.InternalXroadMember&nbsp;senderMember, ee.ria.dhx.types.InternalXroadMember&nbsp;recipientMember, org.springframework.ws.context.MessageContext&nbsp;context)</code> <div class="block">Method returns list of organisations that are able to receive the documents using DHX protocol.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="ee.ria.dhx.server.types.ee.riik.xrd.dhl.producers.producer.dhl"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">GetSendingOptionsResponse</a> in <a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/xrd/dhl/producers/producer/dhl/package-summary.html">ee.ria.dhx.server.types.ee.riik.xrd.dhl.producers.producer.dhl</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/xrd/dhl/producers/producer/dhl/package-summary.html">ee.ria.dhx.server.types.ee.riik.xrd.dhl.producers.producer.dhl</a> that return <a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">GetSendingOptionsResponse</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">GetSendingOptionsResponse</a></code></td> <td class="colLast"><span class="typeNameLabel">ObjectFactory.</span><code><span class="memberNameLink"><a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/xrd/dhl/producers/producer/dhl/ObjectFactory.html#createGetSendingOptionsResponse--">createGetSendingOptionsResponse</a></span>()</code> <div class="block">Create an instance of <a href="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl"><code>GetSendingOptionsResponse</code></a></div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <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="../../../../../../../../../../ee/ria/dhx/server/types/ee/riik/schemas/dhl/GetSendingOptionsResponse.html" title="class in ee.ria.dhx.server.types.ee.riik.schemas.dhl">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../../../index.html?ee/ria/dhx/server/types/ee/riik/schemas/dhl/class-use/GetSendingOptionsResponse.html" target="_top">Frames</a></li> <li><a href="GetSendingOptionsResponse.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../../../../allclasses-noframe.html">All&nbsp;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 ======= --> </body> </html>
{'content_hash': '695db2d401fc60ca9d6cce3647d90ca9', 'timestamp': '', 'source': 'github', 'line_count': 221, 'max_line_length': 675, 'avg_line_length': 58.737556561085974, 'alnum_prop': 0.652723210846622, 'repo_name': 'e-gov/DHX-adapter', 'id': 'd6f77c031ac525ee148005820eda06a2eec5060e', 'size': '12981', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'dhx-adapter-server/doc/ee/ria/dhx/server/types/ee/riik/schemas/dhl/class-use/GetSendingOptionsResponse.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '40090'}, {'name': 'Dockerfile', 'bytes': '161'}, {'name': 'FreeMarker', 'bytes': '904'}, {'name': 'Groovy', 'bytes': '64412'}, {'name': 'HTML', 'bytes': '9090458'}, {'name': 'Java', 'bytes': '1539155'}, {'name': 'JavaScript', 'bytes': '2481'}, {'name': 'TSQL', 'bytes': '3587'}]}
import * as React from "react"; export interface EditorLinkProps { children: React.ReactNode; contentState: Record<string, unknown>; entityKey?: string; } declare function EditorLink(props: EditorLinkProps): JSX.Element; export default EditorLink;
{'content_hash': '3a8842839617acac997c328a09390b07', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 65, 'avg_line_length': 23.363636363636363, 'alnum_prop': 0.7704280155642024, 'repo_name': 'Sage/carbon', 'id': '642d3f171f504f3fe577676762d81029fc45cccb', 'size': '257', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/components/text-editor/__internal__/editor-link/editor-link.d.ts', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '1508'}, {'name': 'Gherkin', 'bytes': '12106'}, {'name': 'HTML', 'bytes': '3068'}, {'name': 'JavaScript', 'bytes': '2451316'}, {'name': 'TypeScript', 'bytes': '1699384'}]}
export class Index { configureRouter(config, router) { config.map([ {route:['', '/list'], moduleId:'./list', name:'list', nav:false, title:'Pembayaran'}, {route:'view/:id', moduleId:'./view', name:'view', nav:false, title:'View:Pembayaran'}, {route:'create', moduleId:'./create', name:'create', nav:false, title:'Create:Pembayaran'} ]); this.router = router; } }
{'content_hash': '3f50428198f63215dff8673f14af1bac', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 126, 'avg_line_length': 48.9, 'alnum_prop': 0.4948875255623722, 'repo_name': 'lioenel/bateeq-ui', 'id': 'dbd81923be961f86c9a34e6111b08f2278cebc80', 'size': '489', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/pos-payment-cr/index.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '8572'}, {'name': 'HTML', 'bytes': '329338'}, {'name': 'JavaScript', 'bytes': '283473'}]}
layout: category imgCategory: /img/portfolio/6.jpg title: Madeiradas category: games ---
{'content_hash': 'c12a8ab76be00c23cb233da52483b892', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 33, 'avg_line_length': 17.8, 'alnum_prop': 0.7752808988764045, 'repo_name': 'francispires/francispires.github.io', 'id': '2785b05ff3616e76815af3c05755d980dd621882', 'size': '93', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'madeirada/index.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '18732'}, {'name': 'HTML', 'bytes': '116437'}, {'name': 'JavaScript', 'bytes': '151283'}, {'name': 'PHP', 'bytes': '447'}]}
title: axv26 type: products image: /img/Screen Shot 2017-05-09 at 11.56.54 AM.png heading: v26 description: lksadjf lkasdjf lksajdf lksdaj flksadj flksa fdj main: heading: Foo Bar BAz description: |- ***This is i a thing***kjh hjk kj # Blah Blah ## Blah![undefined](undefined) ### Baah image1: alt: kkkk ---
{'content_hash': 'f31ae89fff322526329c7855d2271406', 'timestamp': '', 'source': 'github', 'line_count': 15, 'max_line_length': 61, 'avg_line_length': 22.333333333333332, 'alnum_prop': 0.6656716417910448, 'repo_name': 'pblack/kaldi-hugo-cms-template', 'id': 'd43c0e43781d2c79dc12a204dab9c1c5f3325d36', 'size': '339', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'site/content/pages2/axv26.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '94394'}, {'name': 'HTML', 'bytes': '18889'}, {'name': 'JavaScript', 'bytes': '10014'}]}
from __future__ import print_function, unicode_literals import io import os import sys import errno from .app import Grip from .readers import DirectoryReader, StdinReader, TextReader from .renderers import GitHubRenderer, OfflineRenderer def create_app(path=None, user_content=False, context=None, username=None, password=None, render_offline=False, render_wide=False, render_inline=False, api_url=None, title=None, text=None, autorefresh=None, quiet=None, grip_class=None): """ Creates a Grip application with the specified overrides. """ # Customize the app if grip_class is None: grip_class = Grip # Customize the reader if text is not None: display_filename = DirectoryReader(path, True).filename_for(None) source = TextReader(text, display_filename) elif path == '-': source = StdinReader() else: source = DirectoryReader(path) # Customize the renderer if render_offline: renderer = OfflineRenderer(user_content, context) elif user_content or context or api_url: renderer = GitHubRenderer(user_content, context, api_url) else: renderer = None # Optional basic auth auth = (username, password) if username or password else None # Create the customized app with default asset manager return grip_class(source, auth, renderer, None, render_wide, render_inline, title, autorefresh, quiet) def serve(path=None, host=None, port=None, user_content=False, context=None, username=None, password=None, render_offline=False, render_wide=False, render_inline=False, api_url=None, title=None, autorefresh=True, browser=False, quiet=None, grip_class=None): """ Starts a server to render the specified file or directory containing a README. """ app = create_app(path, user_content, context, username, password, render_offline, render_wide, render_inline, api_url, title, None, autorefresh, quiet, grip_class) app.run(host, port, open_browser=browser) def clear_cache(grip_class=None): """ Clears the cached styles and assets. """ if grip_class is None: grip_class = Grip grip_class(StdinReader()).clear_cache() def render_page(path=None, user_content=False, context=None, username=None, password=None, render_offline=False, render_wide=False, render_inline=False, api_url=None, title=None, text=None, quiet=None, grip_class=None): """ Renders the specified markup text to an HTML page and returns it. """ return create_app(path, user_content, context, username, password, render_offline, render_wide, render_inline, api_url, title, text, False, quiet, grip_class).render() def render_content(text, user_content=False, context=None, username=None, password=None, render_offline=False, api_url=None): """ Renders the specified markup and returns the result. """ renderer = (GitHubRenderer(user_content, context, api_url) if not render_offline else OfflineRenderer(user_content, context)) auth = (username, password) if username or password else None return renderer.render(text, auth) def export(path=None, user_content=False, context=None, username=None, password=None, render_offline=False, render_wide=False, render_inline=True, out_filename=None, api_url=None, title=None, quiet=False, grip_class=None): """ Exports the rendered HTML to a file. """ export_to_stdout = out_filename == '-' if out_filename is None: if path == '-': export_to_stdout = True else: filetitle, _ = os.path.splitext( os.path.relpath(DirectoryReader(path).root_filename)) out_filename = '{0}.html'.format(filetitle) if not export_to_stdout and not quiet: print('Exporting to', out_filename, file=sys.stderr) page = render_page(path, user_content, context, username, password, render_offline, render_wide, render_inline, api_url, title, None, quiet, grip_class) if export_to_stdout: try: print(page) except IOError as ex: if ex.errno != 0 and ex.errno != errno.EPIPE: raise else: with io.open(out_filename, 'w', encoding='utf-8') as f: f.write(page)
{'content_hash': '68802149cec2eecf71ba99a419c8203b', 'timestamp': '', 'source': 'github', 'line_count': 128, 'max_line_length': 77, 'avg_line_length': 36.140625, 'alnum_prop': 0.6294855166450497, 'repo_name': 'joeyespo/grip', 'id': '06d9ef92032e4dbe464c551316985bdb7b6bc7ab', 'size': '4626', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'grip/api.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '9661'}, {'name': 'Python', 'bytes': '81960'}]}
#define JPEG_INTERNALS #include "jinclude.h" #include "jpeglib.h" typedef enum { /* JPEG marker codes */ M_SOF0 = 0xc0, M_SOF1 = 0xc1, M_SOF2 = 0xc2, M_SOF3 = 0xc3, M_SOF5 = 0xc5, M_SOF6 = 0xc6, M_SOF7 = 0xc7, M_JPG = 0xc8, M_SOF9 = 0xc9, M_SOF10 = 0xca, M_SOF11 = 0xcb, M_SOF13 = 0xcd, M_SOF14 = 0xce, M_SOF15 = 0xcf, M_DHT = 0xc4, M_DAC = 0xcc, M_RST0 = 0xd0, M_RST1 = 0xd1, M_RST2 = 0xd2, M_RST3 = 0xd3, M_RST4 = 0xd4, M_RST5 = 0xd5, M_RST6 = 0xd6, M_RST7 = 0xd7, M_SOI = 0xd8, M_EOI = 0xd9, M_SOS = 0xda, M_DQT = 0xdb, M_DNL = 0xdc, M_DRI = 0xdd, M_DHP = 0xde, M_EXP = 0xdf, M_APP0 = 0xe0, M_APP1 = 0xe1, M_APP2 = 0xe2, M_APP3 = 0xe3, M_APP4 = 0xe4, M_APP5 = 0xe5, M_APP6 = 0xe6, M_APP7 = 0xe7, M_APP8 = 0xe8, M_APP9 = 0xe9, M_APP10 = 0xea, M_APP11 = 0xeb, M_APP12 = 0xec, M_APP13 = 0xed, M_APP14 = 0xee, M_APP15 = 0xef, M_JPG0 = 0xf0, M_JPG13 = 0xfd, M_COM = 0xfe, M_TEM = 0x01, M_ERROR = 0x100 } JPEG_MARKER; /* Private state */ typedef struct { struct jpeg_marker_writer pub; /* public fields */ unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */ } my_marker_writer; typedef my_marker_writer * my_marker_ptr; /* * Basic output routines. * * Note that we do not support suspension while writing a marker. * Therefore, an application using suspension must ensure that there is * enough buffer space for the initial markers (typ. 600-700 bytes) before * calling jpeg_start_compress, and enough space to write the trailing EOI * (a few bytes) before calling jpeg_finish_compress. Multipass compression * modes are not supported at all with suspension, so those two are the only * points where markers will be written. */ LOCAL(void) emit_byte (j_compress_ptr cinfo, int val) /* Emit a byte */ { struct jpeg_destination_mgr * dest = cinfo->dest; *(dest->next_output_byte)++ = (JOCTET) val; if (--dest->free_in_buffer == 0) { if (! (*dest->empty_output_buffer) (cinfo)) ERREXIT(cinfo, JERR_CANT_SUSPEND); } } LOCAL(void) emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark) /* Emit a marker code */ { emit_byte(cinfo, 0xFF); emit_byte(cinfo, (int) mark); } LOCAL(void) emit_2bytes (j_compress_ptr cinfo, int value) /* Emit a 2-byte integer; these are always MSB first in JPEG files */ { emit_byte(cinfo, (value >> 8) & 0xFF); emit_byte(cinfo, value & 0xFF); } /* * Routines to write specific marker types. */ LOCAL(int) emit_dqt (j_compress_ptr cinfo, int indexval) /* Emit a DQT marker */ /* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */ { JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[indexval]; int prec; int i; if (qtbl == NULL) ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, indexval); prec = 0; for (i = 0; i <= cinfo->lim_Se; i++) { if (qtbl->quantval[cinfo->natural_order[i]] > 255) prec = 1; } if (! qtbl->sent_table) { emit_marker(cinfo, M_DQT); emit_2bytes(cinfo, prec ? cinfo->lim_Se * 2 + 2 + 1 + 2 : cinfo->lim_Se + 1 + 1 + 2); emit_byte(cinfo, indexval + (prec<<4)); for (i = 0; i <= cinfo->lim_Se; i++) { /* The table entries must be emitted in zigzag order. */ unsigned int qval = qtbl->quantval[cinfo->natural_order[i]]; if (prec) emit_byte(cinfo, (int) (qval >> 8)); emit_byte(cinfo, (int) (qval & 0xFF)); } qtbl->sent_table = TRUE; } return prec; } LOCAL(void) emit_dht (j_compress_ptr cinfo, int indexval, boolean is_ac) /* Emit a DHT marker */ { JHUFF_TBL * htbl; int length, i; if (is_ac) { htbl = cinfo->ac_huff_tbl_ptrs[indexval]; indexval += 0x10; /* output index has AC bit set */ } else { htbl = cinfo->dc_huff_tbl_ptrs[indexval]; } if (htbl == NULL) ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, indexval); if (! htbl->sent_table) { emit_marker(cinfo, M_DHT); length = 0; for (i = 1; i <= 16; i++) length += htbl->bits[i]; emit_2bytes(cinfo, length + 2 + 1 + 16); emit_byte(cinfo, indexval); for (i = 1; i <= 16; i++) emit_byte(cinfo, htbl->bits[i]); for (i = 0; i < length; i++) emit_byte(cinfo, htbl->huffval[i]); htbl->sent_table = TRUE; } } LOCAL(void) emit_dac (j_compress_ptr cinfo) /* Emit a DAC marker */ /* Since the useful info is so small, we want to emit all the tables in */ /* one DAC marker. Therefore this routine does its own scan of the table. */ { #ifdef C_ARITH_CODING_SUPPORTED char dc_in_use[NUM_ARITH_TBLS]; char ac_in_use[NUM_ARITH_TBLS]; int length, i; jpeg_component_info *compptr; for (i = 0; i < NUM_ARITH_TBLS; i++) dc_in_use[i] = ac_in_use[i] = 0; for (i = 0; i < cinfo->comps_in_scan; i++) { compptr = cinfo->cur_comp_info[i]; /* DC needs no table for refinement scan */ if (cinfo->Ss == 0 && cinfo->Ah == 0) dc_in_use[compptr->dc_tbl_no] = 1; /* AC needs no table when not present */ if (cinfo->Se) ac_in_use[compptr->ac_tbl_no] = 1; } length = 0; for (i = 0; i < NUM_ARITH_TBLS; i++) length += dc_in_use[i] + ac_in_use[i]; emit_marker(cinfo, M_DAC); emit_2bytes(cinfo, length*2 + 2); for (i = 0; i < NUM_ARITH_TBLS; i++) { if (dc_in_use[i]) { emit_byte(cinfo, i); emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4)); } if (ac_in_use[i]) { emit_byte(cinfo, i + 0x10); emit_byte(cinfo, cinfo->arith_ac_K[i]); } } #endif /* C_ARITH_CODING_SUPPORTED */ } LOCAL(void) emit_dri (j_compress_ptr cinfo) /* Emit a DRI marker */ { emit_marker(cinfo, M_DRI); emit_2bytes(cinfo, 4); /* fixed length */ emit_2bytes(cinfo, (int) cinfo->restart_interval); } LOCAL(void) emit_sof (j_compress_ptr cinfo, JPEG_MARKER code) /* Emit a SOF marker */ { int ci; jpeg_component_info *compptr; emit_marker(cinfo, code); emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */ /* Make sure image isn't bigger than SOF field can handle */ if ((long) cinfo->jpeg_height > 65535L || (long) cinfo->jpeg_width > 65535L) ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535); emit_byte(cinfo, cinfo->data_precision); emit_2bytes(cinfo, (int) cinfo->jpeg_height); emit_2bytes(cinfo, (int) cinfo->jpeg_width); emit_byte(cinfo, cinfo->num_components); for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { emit_byte(cinfo, compptr->component_id); emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor); emit_byte(cinfo, compptr->quant_tbl_no); } } LOCAL(void) emit_sos (j_compress_ptr cinfo) /* Emit a SOS marker */ { int i, td, ta; jpeg_component_info *compptr; emit_marker(cinfo, M_SOS); emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */ emit_byte(cinfo, cinfo->comps_in_scan); for (i = 0; i < cinfo->comps_in_scan; i++) { compptr = cinfo->cur_comp_info[i]; emit_byte(cinfo, compptr->component_id); /* We emit 0 for unused field(s); this is recommended by the P&M text * but does not seem to be specified in the standard. */ /* DC needs no table for refinement scan */ td = cinfo->Ss == 0 && cinfo->Ah == 0 ? compptr->dc_tbl_no : 0; /* AC needs no table when not present */ ta = cinfo->Se ? compptr->ac_tbl_no : 0; emit_byte(cinfo, (td << 4) + ta); } emit_byte(cinfo, cinfo->Ss); emit_byte(cinfo, cinfo->Se); emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al); } LOCAL(void) emit_pseudo_sos (j_compress_ptr cinfo) /* Emit a pseudo SOS marker */ { emit_marker(cinfo, M_SOS); emit_2bytes(cinfo, 2 + 1 + 3); /* length */ emit_byte(cinfo, 0); /* Ns */ emit_byte(cinfo, 0); /* Ss */ emit_byte(cinfo, cinfo->block_size * cinfo->block_size - 1); /* Se */ emit_byte(cinfo, 0); /* Ah/Al */ } LOCAL(void) emit_jfif_app0 (j_compress_ptr cinfo) /* Emit a JFIF-compliant APP0 marker */ { /* * Length of APP0 block (2 bytes) * Block ID (4 bytes - ASCII "JFIF") * Zero byte (1 byte to terminate the ID string) * Version Major, Minor (2 bytes - major first) * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm) * Xdpu (2 bytes - dots per unit horizontal) * Ydpu (2 bytes - dots per unit vertical) * Thumbnail X size (1 byte) * Thumbnail Y size (1 byte) */ emit_marker(cinfo, M_APP0); emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */ emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */ emit_byte(cinfo, 0x46); emit_byte(cinfo, 0x49); emit_byte(cinfo, 0x46); emit_byte(cinfo, 0); emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */ emit_byte(cinfo, cinfo->JFIF_minor_version); emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */ emit_2bytes(cinfo, (int) cinfo->X_density); emit_2bytes(cinfo, (int) cinfo->Y_density); emit_byte(cinfo, 0); /* No thumbnail image */ emit_byte(cinfo, 0); } LOCAL(void) emit_adobe_app14 (j_compress_ptr cinfo) /* Emit an Adobe APP14 marker */ { /* * Length of APP14 block (2 bytes) * Block ID (5 bytes - ASCII "Adobe") * Version Number (2 bytes - currently 100) * Flags0 (2 bytes - currently 0) * Flags1 (2 bytes - currently 0) * Color transform (1 byte) * * Although Adobe TN 5116 mentions Version = 101, all the Adobe files * now in circulation seem to use Version = 100, so that's what we write. * * We write the color transform byte as 1 if the JPEG color space is * YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with * whether the encoder performed a transformation, which is pretty useless. */ emit_marker(cinfo, M_APP14); emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */ emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */ emit_byte(cinfo, 0x64); emit_byte(cinfo, 0x6F); emit_byte(cinfo, 0x62); emit_byte(cinfo, 0x65); emit_2bytes(cinfo, 100); /* Version */ emit_2bytes(cinfo, 0); /* Flags0 */ emit_2bytes(cinfo, 0); /* Flags1 */ switch (cinfo->jpeg_color_space) { case JCS_YCbCr: emit_byte(cinfo, 1); /* Color transform = 1 */ break; case JCS_YCCK: emit_byte(cinfo, 2); /* Color transform = 2 */ break; default: emit_byte(cinfo, 0); /* Color transform = 0 */ break; } } /* * These routines allow writing an arbitrary marker with parameters. * The only intended use is to emit COM or APPn markers after calling * write_file_header and before calling write_frame_header. * Other uses are not guaranteed to produce desirable results. * Counting the parameter bytes properly is the caller's responsibility. */ METHODDEF(void) write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen) /* Emit an arbitrary marker header */ { if (datalen > (unsigned int) 65533) /* safety check */ ERREXIT(cinfo, JERR_BAD_LENGTH); emit_marker(cinfo, (JPEG_MARKER) marker); emit_2bytes(cinfo, (int) (datalen + 2)); /* total length */ } METHODDEF(void) write_marker_byte (j_compress_ptr cinfo, int val) /* Emit one byte of marker parameters following write_marker_header */ { emit_byte(cinfo, val); } /* * Write datastream header. * This consists of an SOI and optional APPn markers. * We recommend use of the JFIF marker, but not the Adobe marker, * when using YCbCr or grayscale data. The JFIF marker should NOT * be used for any other JPEG colorspace. The Adobe marker is helpful * to distinguish RGB, CMYK, and YCCK colorspaces. * Note that an application can write additional header markers after * jpeg_start_compress returns. */ METHODDEF(void) write_file_header (j_compress_ptr cinfo) { my_marker_ptr marker = (my_marker_ptr) cinfo->marker; emit_marker(cinfo, M_SOI); /* first the SOI */ /* SOI is defined to reset restart interval to 0 */ marker->last_restart_interval = 0; if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */ emit_jfif_app0(cinfo); if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */ emit_adobe_app14(cinfo); } /* * Write frame header. * This consists of DQT and SOFn markers, and a conditional pseudo SOS marker. * Note that we do not emit the SOF until we have emitted the DQT(s). * This avoids compatibility problems with incorrect implementations that * try to error-check the quant table numbers as soon as they see the SOF. */ METHODDEF(void) write_frame_header (j_compress_ptr cinfo) { int ci, prec; boolean is_baseline; jpeg_component_info *compptr; /* Emit DQT for each quantization table. * Note that emit_dqt() suppresses any duplicate tables. */ prec = 0; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { prec += emit_dqt(cinfo, compptr->quant_tbl_no); } /* now prec is nonzero iff there are any 16-bit quant tables. */ /* Check for a non-baseline specification. * Note we assume that Huffman table numbers won't be changed later. */ if (cinfo->arith_code || cinfo->progressive_mode || cinfo->data_precision != 8 || cinfo->block_size != DCTSIZE) { is_baseline = FALSE; } else { is_baseline = TRUE; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1) is_baseline = FALSE; } if (prec && is_baseline) { is_baseline = FALSE; /* If it's baseline except for quantizer size, warn the user */ TRACEMS(cinfo, 0, JTRC_16BIT_TABLES); } } /* Emit the proper SOF marker */ if (cinfo->arith_code) { if (cinfo->progressive_mode) emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */ else emit_sof(cinfo, M_SOF9); /* SOF code for sequential arithmetic */ } else { if (cinfo->progressive_mode) emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */ else if (is_baseline) emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */ else emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */ } /* Check to emit pseudo SOS marker */ if (cinfo->progressive_mode && cinfo->block_size != DCTSIZE) emit_pseudo_sos(cinfo); } /* * Write scan header. * This consists of DHT or DAC markers, optional DRI, and SOS. * Compressed data will be written following the SOS. */ METHODDEF(void) write_scan_header (j_compress_ptr cinfo) { my_marker_ptr marker = (my_marker_ptr) cinfo->marker; int i; jpeg_component_info *compptr; if (cinfo->arith_code) { /* Emit arith conditioning info. We may have some duplication * if the file has multiple scans, but it's so small it's hardly * worth worrying about. */ emit_dac(cinfo); } else { /* Emit Huffman tables. * Note that emit_dht() suppresses any duplicate tables. */ for (i = 0; i < cinfo->comps_in_scan; i++) { compptr = cinfo->cur_comp_info[i]; /* DC needs no table for refinement scan */ if (cinfo->Ss == 0 && cinfo->Ah == 0) emit_dht(cinfo, compptr->dc_tbl_no, FALSE); /* AC needs no table when not present */ if (cinfo->Se) emit_dht(cinfo, compptr->ac_tbl_no, TRUE); } } /* Emit DRI if required --- note that DRI value could change for each scan. * We avoid wasting space with unnecessary DRIs, however. */ if (cinfo->restart_interval != marker->last_restart_interval) { emit_dri(cinfo); marker->last_restart_interval = cinfo->restart_interval; } emit_sos(cinfo); } /* * Write datastream trailer. */ METHODDEF(void) write_file_trailer (j_compress_ptr cinfo) { emit_marker(cinfo, M_EOI); } /* * Write an abbreviated table-specification datastream. * This consists of SOI, DQT and DHT tables, and EOI. * Any table that is defined and not marked sent_table = TRUE will be * emitted. Note that all tables will be marked sent_table = TRUE at exit. */ METHODDEF(void) write_tables_only (j_compress_ptr cinfo) { int i; emit_marker(cinfo, M_SOI); for (i = 0; i < NUM_QUANT_TBLS; i++) { if (cinfo->quant_tbl_ptrs[i] != NULL) (void) emit_dqt(cinfo, i); } if (! cinfo->arith_code) { for (i = 0; i < NUM_HUFF_TBLS; i++) { if (cinfo->dc_huff_tbl_ptrs[i] != NULL) emit_dht(cinfo, i, FALSE); if (cinfo->ac_huff_tbl_ptrs[i] != NULL) emit_dht(cinfo, i, TRUE); } } emit_marker(cinfo, M_EOI); } /* * Initialize the marker writer module. */ GLOBAL(void) jinit_marker_writer (j_compress_ptr cinfo) { my_marker_ptr marker; /* Create the subobject */ marker = (my_marker_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_marker_writer)); cinfo->marker = (struct jpeg_marker_writer *) marker; /* Initialize method pointers */ marker->pub.write_file_header = write_file_header; marker->pub.write_frame_header = write_frame_header; marker->pub.write_scan_header = write_scan_header; marker->pub.write_file_trailer = write_file_trailer; marker->pub.write_tables_only = write_tables_only; marker->pub.write_marker_header = write_marker_header; marker->pub.write_marker_byte = write_marker_byte; /* Initialize private state */ marker->last_restart_interval = 0; }
{'content_hash': '84ec4d19e4632d9251b71fe765523e70', 'timestamp': '', 'source': 'github', 'line_count': 671, 'max_line_length': 79, 'avg_line_length': 26.853949329359164, 'alnum_prop': 0.605860480603807, 'repo_name': 'RayRuizhiLiao/ITK_4D', 'id': '468b744435919f5d35dbcd192259494a702e3b0b', 'size': '18346', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Modules/ThirdParty/JPEG/src/itkjpeg/jcmarker.c', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '572693'}, {'name': 'C++', 'bytes': '36720665'}, {'name': 'CMake', 'bytes': '1448020'}, {'name': 'CSS', 'bytes': '18346'}, {'name': 'Java', 'bytes': '29480'}, {'name': 'Objective-C++', 'bytes': '6753'}, {'name': 'Perl', 'bytes': '6113'}, {'name': 'Python', 'bytes': '385395'}, {'name': 'Ruby', 'bytes': '309'}, {'name': 'Shell', 'bytes': '92050'}, {'name': 'Tcl', 'bytes': '75202'}, {'name': 'XSLT', 'bytes': '8874'}]}
<?xml version="1.0" ?><!DOCTYPE TS><TS language="nl" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Unstakeable</source> <translation>Over Unstakeable</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Unstakeable&lt;/b&gt; version</source> <translation>&lt;b&gt;Unstakeable&lt;/b&gt; versie</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source> <translation> Dit is experimentele software. Gedistribueerd onder de MIT/X11 software licentie, zie het bijgevoegde bestand COPYING of http://www.opensource.org/licenses/mit-license.php. Dit product bevat software ontwikkeld door het OpenSSL Project voor gebruik in de OpenSSL Toolkit (http://www.openssl.org/) en cryptografische software gemaakt door Eric Young ([email protected]) en UPnP software geschreven door Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Auteursrecht</translation> </message> <message> <location line="+0"/> <source>The Unstakeable developers</source> <translation>De Unstakeable-ontwikkelaars</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Adresboek</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Dubbelklik om adres of label te wijzigen</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Maak een nieuw adres aan</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopieer het huidig geselecteerde adres naar het klembord</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Nieuw Adres</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Unstakeable 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>Dit zijn uw Unstakeableadressen om betalingen mee te ontvangen. U kunt er voor kiezen om een uniek adres aan te maken voor elke afzender. Op deze manier kunt u bijhouden wie al aan u betaald heeft.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Kopiëer Adres</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Toon &amp;QR-Code</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Unstakeable address</source> <translation>Onderteken een bericht om te bewijzen dat u een bepaald Unstakeableadres bezit</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>&amp;Onderteken Bericht</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Verwijder het geselecteerde adres van de lijst</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Exporteer de data in de huidige tab naar een bestand</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Exporteer</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Unstakeable address</source> <translation>Controleer een bericht om te verifiëren dat het gespecificeerde Unstakeableadres het bericht heeft ondertekend.</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Verifiëer Bericht</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Verwijder</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Unstakeable addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Dit zijn uw Unstakeableadressen om betalingen mee te verzenden. Check altijd het bedrag en het ontvangende adres voordat u uw unstakeables verzendt.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Kopiëer &amp;Label</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Bewerk</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Verstuur &amp;Coins</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Exporteer Gegevens van het Adresboek</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Kommagescheiden bestand (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Fout bij exporteren</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Kon niet schrijven naar bestand %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Label</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adres</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(geen label)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Wachtwoorddialoogscherm</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Voer wachtwoord in</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nieuw wachtwoord</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Herhaal wachtwoord</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>Vul een nieuw wachtwoord in voor uw portemonnee. &lt;br/&gt; Gebruik een wachtwoord van &lt;b&gt;10 of meer lukrake karakters&lt;/b&gt;, of &lt;b&gt; acht of meer woorden&lt;/b&gt; . </translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Versleutel portemonnee</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Deze operatie vereist uw portemonneewachtwoord om de portemonnee te openen.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Open portemonnee</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Deze operatie vereist uw portemonneewachtwoord om de portemonnee te ontsleutelen</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Ontsleutel portemonnee</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Wijzig wachtwoord</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Vul uw oude en nieuwe portemonneewachtwoord in.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Bevestig versleuteling van de portemonnee</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR LITECOINS&lt;/b&gt;!</source> <translation>Waarschuwing: Als u uw portemonnee versleutelt en uw wachtwoord vergeet, zult u &lt;b&gt;AL UW LITECOINS VERLIEZEN&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Weet u zeker dat u uw portemonnee wilt versleutelen?</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>BELANGRIJK: Elke eerder gemaakte backup van uw portemonneebestand dient u te vervangen door het nieuw gegenereerde, versleutelde portemonneebestand. Om veiligheidsredenen zullen eerdere backups van het niet-versleutelde portemonneebestand onbruikbaar worden zodra u uw nieuwe, versleutelde, portemonnee begint te gebruiken.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Waarschuwing: De Caps-Lock-toets staat aan!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Portemonnee versleuteld</translation> </message> <message> <location line="-56"/> <source>Unstakeable will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your unstakeables from being stolen by malware infecting your computer.</source> <translation>Unstakeable zal nu afsluiten om het versleutelingsproces te voltooien. Onthoud dat het versleutelen van uw portemonnee u niet volledig kan beschermen: Malware kan uw computer infecteren en uw unstakeables stelen.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Portemonneeversleuteling mislukt</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Portemonneeversleuteling mislukt door een interne fout. Uw portemonnee is niet versleuteld.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>De opgegeven wachtwoorden komen niet overeen</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Portemonnee openen mislukt</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Het opgegeven wachtwoord voor de portemonnee-ontsleuteling is niet correct.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Portemonnee-ontsleuteling mislukt</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Portemonneewachtwoord is met succes gewijzigd.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>&amp;Onderteken bericht...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Synchroniseren met netwerk...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;Overzicht</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Toon algemeen overzicht van de portemonnee</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transacties</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Blader door transactieverleden</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Bewerk de lijst van opgeslagen adressen en labels</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Toon lijst van adressen om betalingen mee te ontvangen</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>&amp;Afsluiten</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Programma afsluiten</translation> </message> <message> <location line="+4"/> <source>Show information about Unstakeable</source> <translation>Laat informatie zien over Unstakeable</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Over &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Toon informatie over Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>O&amp;pties...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Versleutel Portemonnee...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Backup Portemonnee...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Wijzig Wachtwoord</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Blokken aan het importeren vanaf harde schijf...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Bezig met herindexeren van blokken op harde schijf...</translation> </message> <message> <location line="-347"/> <source>Send coins to a Unstakeable address</source> <translation>Verstuur munten naar een Unstakeableadres</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Unstakeable</source> <translation>Wijzig instellingen van Unstakeable</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>&amp;Backup portemonnee naar een andere locatie</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Wijzig het wachtwoord voor uw portemonneversleuteling</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>&amp;Debugscherm</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Open debugging en diagnostische console</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Verifiëer bericht...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Unstakeable</source> <translation>Unstakeable</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Portemonnee</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Versturen</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Ontvangen</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Adressen</translation> </message> <message> <location line="+22"/> <source>&amp;About Unstakeable</source> <translation>&amp;Over Unstakeable</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Toon / Verberg</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Toon of verberg het hoofdvenster</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Versleutel de geheime sleutels die bij uw portemonnee horen</translation> </message> <message> <location line="+7"/> <source>Sign messages with your Unstakeable addresses to prove you own them</source> <translation>Onderteken berichten met uw Unstakeableadressen om te bewijzen dat u deze adressen bezit</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Unstakeable addresses</source> <translation>Verifiëer handtekeningen om zeker te zijn dat de berichten zijn ondertekend met de gespecificeerde Unstakeableadressen</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Bestand</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Instellingen</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Hulp</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Tab-werkbalk</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnetwerk]</translation> </message> <message> <location line="+47"/> <source>Unstakeable client</source> <translation>Unstakeable client</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Unstakeable network</source> <translation><numerusform>%n actieve connectie naar Unstakeablenetwerk</numerusform><numerusform>%n actieve connecties naar Unstakeablenetwerk</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>Geen bron van blokken beschikbaar...</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>%1 van %2 (geschat) blokken van de transactiehistorie verwerkt.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>%1 blokken van transactiehistorie verwerkt.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n uur</numerusform><numerusform>%n uur</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n dag</numerusform><numerusform>%n dagen</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n week</numerusform><numerusform>%n weken</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>%1 achter</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>Laatst ontvangen blok was %1 geleden gegenereerd.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Transacties na dit moment zullen nu nog niet zichtbaar zijn.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>Fout</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Waarschuwing</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Informatie</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>Deze transactie overschrijdt de groottelimiet. Om de transactie alsnog te versturen kunt u transactiekosten betalen van %1. Deze transactiekosten gaan naar de nodes die uw transactie verwerken en het helpt op deze manier bij het ondersteunen van het Unstakeablenetwerk. Wilt u de transactiekosten betalen?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Bijgewerkt</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Aan het bijwerken...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Bevestig transactiekosten</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Verzonden transactie</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Binnenkomende transactie</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Datum: %1 Bedrag: %2 Type: %3 Adres: %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>URI-behandeling</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Unstakeable address or malformed URI parameters.</source> <translation>URI kan niet worden geïnterpreteerd. Dit kan komen door een ongeldig Unstakeableadres of misvormde URI-parameters.</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>Portemonnee is &lt;b&gt;versleuteld&lt;/b&gt; en momenteel &lt;b&gt;geopend&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>Portemonnee is &lt;b&gt;versleuteld&lt;/b&gt; en momenteel &lt;b&gt;gesloten&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Unstakeable can no longer continue safely and will quit.</source> <translation>Er is een fatale fout opgetreden. Unstakeable kan niet meer veilig doorgaan en zal nu afgesloten worden.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Netwerkwaarschuwing</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Bewerk Adres</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Label</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Het label dat geassocieerd is met dit adres</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Adres</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>Het adres dat geassocieerd is met deze inschrijving in het adresboek. Dit kan alleen worden veranderd voor zend-adressen.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Nieuw ontvangstadres</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nieuw adres om naar te verzenden</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Bewerk ontvangstadres</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Bewerk adres om naar te verzenden</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Het opgegeven adres &quot;%1&quot; bestaat al in uw adresboek.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Unstakeable address.</source> <translation>Het opgegeven adres &quot;%1&quot; is een ongeldig Unstakeableadres</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Kon de portemonnee niet openen.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Genereren nieuwe sleutel mislukt.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Unstakeable-Qt</source> <translation>Unstakeable-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>versie</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Gebruik:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>commandoregel-opties</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>gebruikersinterfaceopties</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Stel taal in, bijvoorbeeld &apos;&apos;de_DE&quot; (standaard: systeeminstellingen)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Geminimaliseerd starten</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Laat laadscherm zien bij het opstarten. (standaard: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Opties</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Algemeen</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>Optionele transactiekosten per kB. Transactiekosten helpen ervoor te zorgen dat uw transacties snel verwerkt worden. De meeste transacties zijn 1kB.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Betaal &amp;transactiekosten</translation> </message> <message> <location line="+31"/> <source>Automatically start Unstakeable after logging in to the system.</source> <translation>Start Unstakeable automatisch na inloggen in het systeem</translation> </message> <message> <location line="+3"/> <source>&amp;Start Unstakeable on system login</source> <translation>Start &amp;Unstakeable bij het inloggen in het systeem</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>Reset alle clientopties naar de standaardinstellingen.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>&amp;Reset Opties</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Netwerk</translation> </message> <message> <location line="+6"/> <source>Automatically open the Unstakeable client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Open de Unstakeable-poort automatisch op de router. Dit werkt alleen als de router UPnP ondersteunt en het aanstaat.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Portmapping via &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Unstakeable network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Verbind met het Unstakeable-netwerk via een SOCKS-proxy (bijv. wanneer u via Tor wilt verbinden)</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Verbind via een 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-adres van de proxy (bijv. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Poort:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Poort van de proxy (bijv. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS-&amp;Versie:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>SOCKS-versie van de proxy (bijv. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Scherm</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Laat alleen een systeemvak-icoon zien wanneer het venster geminimaliseerd is</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimaliseer naar het systeemvak in plaats van de taakbalk</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>Minimaliseer het venster in de plaats van de applicatie af te sluiten als het venster gesloten wordt. Wanneer deze optie aan staan, kan de applicatie alleen worden afgesloten door Afsluiten te kiezen in het menu.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>Minimaliseer bij sluiten van het &amp;venster</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Interface</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>Taal &amp;Gebruikersinterface:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Unstakeable.</source> <translation>De taal van de gebruikersinterface kan hier ingesteld worden. Deze instelling zal pas van kracht worden nadat Unstakeable herstart wordt.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Eenheid om bedrag in te tonen:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Kies de standaard onderverdelingseenheid om weer te geven in uw programma, en voor het versturen van munten</translation> </message> <message> <location line="+9"/> <source>Whether to show Unstakeable addresses in the transaction list or not.</source> <translation>Of Unstakeableadressen getoond worden in de transactielijst</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>Toon a&amp;dressen in de transactielijst</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>Ann&amp;uleren</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Toepassen</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>standaard</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>Bevestig reset opties</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>Sommige instellingen vereisen het herstarten van de client voordat ze in werking treden.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation> Wilt u doorgaan?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Waarschuwing</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Unstakeable.</source> <translation>Deze instelling zal pas van kracht worden na het herstarten van Unstakeable.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Het opgegeven proxyadres is ongeldig.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Vorm</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Unstakeable network after a connection is established, but this process has not completed yet.</source> <translation>De weergegeven informatie kan verouderd zijn. Uw portemonnee synchroniseert automaticsh met het Unstakeablenetwerk nadat een verbinding is gelegd, maar dit proces is nog niet voltooid.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Onbevestigd:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Portemonnee</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Immatuur:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Gedolven saldo dat nog niet tot wasdom is gekomen</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Recente transacties&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Uw huidige 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>Totaal van de transacties die nog moeten worden bevestigd en nog niet zijn meegeteld in uw huidige saldo </translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>niet gesynchroniseerd</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start unstakeable: click-to-pay handler</source> <translation>Kan unstakeable niet starten: click-to-pay handler</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>QR-codescherm</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Vraag betaling aan</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Bedrag:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Label:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Bericht:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Opslaan Als...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Fout tijdens encoderen URI in QR-code</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Het opgegeven bedrag is ongeldig, controleer het s.v.p.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>Resulterende URI te lang, probeer de tekst korter te maken voor het label/bericht.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Sla QR-code op</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG-Afbeeldingen (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Clientnaam</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>N.v.t.</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Clientversie</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informatie</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Gebruikt OpenSSL versie</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Opstarttijd</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Netwerk</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Aantal connecties</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Op testnet</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Blokketen</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Huidig aantal blokken</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Geschat totaal aantal blokken</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Tijd laatste blok</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Open</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Commandoregel-opties</translation> </message> <message> <location line="+7"/> <source>Show the Unstakeable-Qt help message to get a list with possible Unstakeable command-line options.</source> <translation>Toon het UnstakeableQt-hulpbericht voor een lijst met mogelijke Unstakeable commandoregel-opties.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Toon</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Console</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Bouwdatum</translation> </message> <message> <location line="-104"/> <source>Unstakeable - Debug window</source> <translation>Unstakeable-debugscherm</translation> </message> <message> <location line="+25"/> <source>Unstakeable Core</source> <translation>Unstakeable Kern</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Debug-logbestand</translation> </message> <message> <location line="+7"/> <source>Open the Unstakeable debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Open het Unstakeabledebug-logbestand van de huidige datamap. Dit kan een aantal seconden duren voor grote logbestanden.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Maak console leeg</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Unstakeable RPC console.</source> <translation>Welkom bij de Unstakeable RPC-console.</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>Gebruik de pijltjestoetsen om door de geschiedenis te navigeren, en &lt;b&gt;Ctrl-L&lt;/b&gt; om het scherm leeg te maken.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Typ &lt;b&gt;help&lt;/b&gt; voor een overzicht van de beschikbare commando&apos;s.</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>Verstuur munten</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Verstuur aan verschillende ontvangers ineens</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Voeg &amp;Ontvanger Toe</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Verwijder alle transactievelden</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Verwijder &amp;Alles</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Bevestig de verstuuractie</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Verstuur</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; aan %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Bevestig versturen munten</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Weet u zeker dat u %1 wil versturen?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> en </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>Het ontvangstadres is niet geldig, controleer uw invoer.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Het ingevoerde bedrag moet groter zijn dan 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Bedrag is hoger dan uw huidige saldo</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Totaal overschrijdt uw huidige saldo wanneer de %1 transactiekosten worden meegerekend</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Dubbel adres gevonden, u kunt slechts eenmaal naar een bepaald adres verzenden per verstuurtransactie</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Fout: Aanmaak transactie mislukt!</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>Fout: De transactie was afgewezen. Dit kan gebeuren als u eerder uitgegeven munten opnieuw wilt versturen, zoals wanneer u een kopie van uw portemonneebestand (wallet.dat) heeft gebruikt en in de kopie deze munten zijn uitgegeven, maar in de huidige portemonnee deze nog niet als zodanig zijn gemarkeerd.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Vorm</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Bedra&amp;g:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Betaal &amp;Aan:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Het adres waaraan u wilt betalen (bijv. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Vul een label in voor dit adres om het toe te voegen aan uw adresboek</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Label:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Kies adres uit adresboek</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>Plak adres vanuit klembord</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>Verwijder deze ontvanger</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Unstakeable address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Vul een Unstakeableadres in (bijv. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Handtekeningen - Onderteken een bericht / Verifiëer een handtekening</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>O&amp;nderteken Bericht</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>U kunt berichten ondertekenen met een van uw adressen om te bewijzen dat u dit adres bezit. Pas op dat u geen onduidelijke dingen ondertekent, want phishingaanvallen zouden u kunnen misleiden om zo uw identiteit te stelen. Onderteken alleen berichten waarmee u het volledig eens bent.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Het adres om het bericht mee te ondertekenen (Vb.: Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2).</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Kies een adres uit het adresboek</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>Plak adres vanuit klembord</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>Typ hier het bericht dat u wilt ondertekenen</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Handtekening</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Kopieer de huidige handtekening naar het systeemklembord</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Unstakeable address</source> <translation>Onderteken een bericht om te bewijzen dat u een bepaald Unstakeableadres bezit</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Onderteken &amp;Bericht</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Verwijder alles in de invulvelden</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Verwijder &amp;Alles</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Verifiëer Bericht</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>Voer het ondertekenende adres, bericht en handtekening hieronder in (let erop dat u nieuwe regels, spaties en tabs juist overneemt) om de handtekening te verifiëren. Let erop dat u niet meer uit het bericht interpreteert dan er daadwerkelijk staat, om te voorkomen dat u wordt misleid in een man-in-the-middle-aanval.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Het adres waarmee bet bericht was ondertekend (Vb.: Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2).</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Unstakeable address</source> <translation>Controleer een bericht om te verifiëren dat het gespecificeerde Unstakeableadres het bericht heeft ondertekend.</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>Verifiëer &amp;Bericht</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Verwijder alles in de invulvelden</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Unstakeable address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Vul een Unstakeableadres in (bijv. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Klik &quot;Onderteken Bericht&quot; om de handtekening te genereren</translation> </message> <message> <location line="+3"/> <source>Enter Unstakeable signature</source> <translation>Voer Unstakeable-handtekening in</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Het opgegeven adres is ongeldig.</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>Controleer s.v.p. het adres en probeer het opnieuw.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Het opgegeven adres verwijst niet naar een sleutel.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Portemonnee-ontsleuteling is geannuleerd</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Geheime sleutel voor het ingevoerde adres is niet beschikbaar.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Ondertekenen van het bericht is mislukt.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Bericht ondertekend.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>De handtekening kon niet worden gedecodeerd.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Controleer s.v.p. de handtekening en probeer het opnieuw.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>De handtekening hoort niet bij het bericht.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Berichtverificatie mislukt.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Bericht correct geverifiëerd.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Unstakeable developers</source> <translation>De Unstakeable-ontwikkelaars</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnetwerk]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Openen totdat %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/offline</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/onbevestigd</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 bevestigingen</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>, uitgezonden naar %n node</numerusform><numerusform>, uitgezonden naar %n nodes</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Bron</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Gegenereerd</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Van</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Aan</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>eigen adres</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>label</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Credit</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>komt tot wasdom na %n nieuw blok</numerusform><numerusform>komt tot wasdom na %n nieuwe blokken</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>niet geaccepteerd</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>Transactiekosten</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Netto bedrag</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Bericht</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Opmerking</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>Transactie-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>Gegeneerde munten moeten 120 blokken wachten voordat ze tot wasdom komen en kunnen worden uitgegeven. Uw net gegenereerde blok is uitgezonden aan het netwerk om te worden toegevoegd aan de blokketen. Als het niet wordt geaccepteerd in de keten, zal het blok als &quot;niet geaccepteerd&quot; worden aangemerkt en kan het niet worden uitgegeven. Dit kan soms gebeuren als een andere node net iets sneller een blok heeft gegenereerd; een paar seconden voor het uwe.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Debug-informatie</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transactie</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Inputs</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Bedrag</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>waar</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>onwaar</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, is nog niet met succes uitgezonden</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Open voor nog %n blok</numerusform><numerusform>Open voor nog %n blokken</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>onbekend</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Transactiedetails</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Dit venster laat een uitgebreide beschrijving van de transactie zien</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adres</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Bedrag</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>Open voor nog %n blok</numerusform><numerusform>Open voor nog %n blokken</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Open tot %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Niet verbonden (%1 bevestigingen)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Onbevestigd (%1 van %2 bevestigd)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Bevestigd (%1 bevestigingen)</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>Gedolven saldo zal beschikbaar komen als het tot wasdom komt na %n blok</numerusform><numerusform>Gedolven saldo zal beschikbaar komen als het tot wasdom komt na %n blokken</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>Dit blok is niet ontvangen bij andere nodes en zal waarschijnlijk niet worden geaccepteerd!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Gegenereerd maar niet geaccepteerd</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Ontvangen met</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Ontvangen van</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Verzonden aan</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Betaling aan uzelf</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Gedolven</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(nvt)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Transactiestatus. Houd de muiscursor boven dit veld om het aantal bevestigingen te laten zien.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Datum en tijd waarop deze transactie is ontvangen.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Type transactie.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Ontvangend adres van transactie.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Bedrag verwijderd van of toegevoegd aan saldo</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Alles</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Vandaag</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Deze week</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Deze maand</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Vorige maand</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Dit jaar</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Bereik...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Ontvangen met</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Verzonden aan</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Aan uzelf</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Gedolven</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Anders</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Vul adres of label in om te zoeken</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Min. bedrag</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Kopieer adres</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopieer label</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopieer bedrag</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Kopieer transactie-ID</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Bewerk label</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Toon transactiedetails</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Exporteer transactiegegevens</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Kommagescheiden bestand (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Bevestigd</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Label</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Adres</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Bedrag</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Fout bij exporteren</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Kon niet schrijven naar bestand %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Bereik:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>naar</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Verstuur munten</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation>&amp;Exporteer</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Exporteer de data in de huidige tab naar een bestand</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Portomonnee backuppen</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Portemonnee-data (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Backup Mislukt</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Er is een fout opgetreden bij het wegschrijven van de portemonnee-data naar de nieuwe locatie.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Backup Succesvol</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>De portemonneedata is succesvol opgeslagen op de nieuwe locatie.</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Unstakeable version</source> <translation>Unstakeableversie</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Gebruik:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or unstakeabled</source> <translation>Stuur commando naar -server of unstakeabled</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Lijst van commando&apos;s</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Toon hulp voor een commando</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Opties:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: unstakeable.conf)</source> <translation>Specificeer configuratiebestand (standaard: unstakeable.conf) </translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: unstakeabled.pid)</source> <translation>Specificeer pid-bestand (standaard: unstakeabled.pid) </translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Stel datamap in</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Stel databankcachegrootte in in megabytes (standaard: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 3456 or testnet: 13456)</source> <translation>Luister voor verbindingen op &lt;poort&gt; (standaard: 3456 of testnet: 13456)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Onderhoud maximaal &lt;n&gt; verbindingen naar peers (standaard: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Verbind naar een node om adressen van anderen op te halen, en verbreek vervolgens de verbinding</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Specificeer uw eigen publieke adres</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Drempel om verbinding te verbreken naar zich misdragende peers (standaard: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Aantal seconden dat zich misdragende peers niet opnieuw mogen verbinden (standaard: 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>Er is een fout opgetreden tijdens het instellen van de inkomende RPC-poort %u op IPv4: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 4567 or testnet: 13456)</source> <translation>Wacht op JSON-RPC-connecties op poort &lt;port&gt; (standaard: 4567 of testnet: 13456)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Aanvaard commandoregel- en JSON-RPC-commando&apos;s</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Draai in de achtergrond als daemon en aanvaard commando&apos;s</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Gebruik het testnetwerk</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Accepteer verbindingen van buitenaf (standaard: 1 als geen -proxy of -connect is opgegeven)</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=unstakeablerpc 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;Unstakeable Alert&quot; [email protected] </source> <translation>%s, u moet een RPC-wachtwoord instellen in het configuratiebestand: %s U wordt aangeraden het volgende willekeurige wachtwoord te gebruiken: rpcuser=unstakeablerpc rpcpassword=%s (u hoeft dit wachtwoord niet te onthouden) De gebruikersnaam en wachtwoord mogen niet hetzelfde zijn. Als het bestand niet bestaat, make hem dan aan met leesrechten voor enkel de eigenaar. Het is ook aan te bevelen &quot;alertnotify&quot; in te stellen zodat u op de hoogte gesteld wordt van problemen; for example: alertnotify=echo %%s | mail -s &quot;Unstakeable Alert&quot; [email protected]</translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Er is een fout opgetreden tijdens het instellen van de inkomende RPC-poort %u op IPv6, terugval naar 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 aan opgegeven adres en luister er altijd op. Gebruik [host]:port notatie voor IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Unstakeable is probably already running.</source> <translation>Kan geen lock op de datamap %s verkrijgen. Unstakeable draait vermoedelijk reeds.</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Fout: De transactie was afgewezen! Dit kan gebeuren als sommige munten in uw portemonnee al eerder uitgegeven zijn, zoals wanneer u een kopie van uw wallet.dat heeft gebruikt en in de kopie deze munten zijn uitgegeven, maar in deze portemonnee die munten nog niet als zodanig zijn gemarkeerd.</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>Fout: Deze transactie vereist transactiekosten van tenminste %s, vanwege zijn grootte, complexiteit, of het gebruik van onlangs ontvangen munten!</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Voer opdracht uit zodra een relevante melding ontvangen is (%s wordt in cmd vervangen door het bericht)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Voer opdracht uit zodra een portemonneetransactie verandert (%s in cmd wordt vervangen door TxID)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Stel maximumgrootte in in bytes voor hoge-prioriteits-/lage-transactiekosten-transacties (standaard: 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>Dit is een pre-release testversie - gebruik op eigen risico! Gebruik deze niet voor het delven van munten of handelsdoeleinden</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Waarschuwing: -paytxfee is zeer hoog ingesteld. Dit zijn de transactiekosten die u betaalt bij het versturen van een transactie.</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>Waarschuwing: Weergegeven transacties zijn mogelijk niet correct! Mogelijk dient u te upgraden, of andere nodes dienen te upgraden.</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 Unstakeable will not work properly.</source> <translation>Waarschuwing: Controleer dat de datum en tijd op uw computer correct zijn ingesteld. Als uw klok fout staat zal Unstakeable niet correct werken.</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>Waarschuwing: Fout bij het lezen van wallet.dat! Alle sleutels zijn in goede orde uitgelezen, maar transactiedata of adresboeklemma&apos;s zouden kunnen ontbreken of fouten bevatten.</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Waarschuwing: wallet.dat is corrupt, data is veiliggesteld! Originele wallet.dat is opgeslagen als wallet.{tijdstip}.bak in %s; als uw balans of transacties incorrect zijn dient u een backup terug te zetten.</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Poog de geheime sleutels uit een corrupt wallet.dat bestand terug te halen</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Blokcreatie-opties:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Verbind alleen naar de gespecificeerde node(s)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>Corrupte blokkendatabase gedetecteerd</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Ontdek eigen IP-adres (standaard: 1 als er wordt geluisterd en geen -externalip is opgegeven)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Wilt u de blokkendatabase nu herbouwen?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>Fout bij intialisatie blokkendatabase</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Probleem met initializeren van de database-omgeving %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Fout bij het laden van blokkendatabase</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Fout bij openen blokkendatabase</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Fout: Weinig vrije diskruimte!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Fout: Portemonnee vergrendeld, aanmaak transactie niet mogelijk!</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Fout: Systeemfout:</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Mislukt om op welke poort dan ook te luisteren. Gebruik -listen=0 as u dit wilt.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>Lezen van blokinformatie mislukt</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>Lezen van blok mislukt</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>Synchroniseren van blokindex mislukt</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>Schrijven van blokindex mislukt</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>Schrijven van blokinformatie mislukt</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>Schrijven van blok mislukt</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>Schrijven van bestandsinformatie mislukt</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>Schrijven naar coindatabase mislukt</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>Schrijven van transactieindex mislukt</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>Schrijven van undo-data mislukt</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Vind andere nodes d.m.v. DNS-naslag (standaard: 1 tenzij -connect)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>Genereer munten (standaard: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Aantal te checken blokken bij het opstarten (standaard: 288, 0 = allemaal)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>Hoe grondig de blokverificatie is (0-4, standaard: 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation>Niet genoeg file descriptors beschikbaar.</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Blokketen opnieuw opbouwen van huidige blk000??.dat-bestanden</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Stel het aantal threads in om RPC-aanvragen mee te bedienen (standaard: 4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Blokken aan het controleren...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Portomonnee aan het controleren...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Importeert blokken van extern blk000??.dat bestand</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>Stel het aantal threads voor scriptverificatie in (max 16, 0 = auto, &lt;0 = laat zoveel cores vrij, standaard: 0)</translation> </message> <message> <location line="+77"/> <source>Information</source> <translation>Informatie</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Ongeldig -tor adres: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Ongeldig bedrag voor -minrelaytxfee=&lt;bedrag&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Ongeldig bedrag voor -mintxfee=&lt;bedrag&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>Onderhoud een volledige transactieindex (standaard: 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Maximum per-connectie ontvangstbuffer, &lt;n&gt;*1000 bytes (standaard: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Maximum per-connectie zendbuffer, &lt;n&gt;*1000 bytes (standaard: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Accepteer alleen blokketen die overeenkomt met de ingebouwde checkpoints (standaard: 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Verbind alleen naar nodes in netwerk &lt;net&gt; (IPv4, IPv6 of Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Output extra debugginginformatie. Impliceert alle andere -debug* opties</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Output extra netwerk-debugginginformatie</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Voorzie de debuggingsuitvoer van een tijdsaanduiding</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Unstakeable Wiki for SSL setup instructions)</source> <translation>SSL-opties: (zie de Unstakeable wiki voor SSL-instructies)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Selecteer de versie van de SOCKS-proxy om te gebruiken (4 of 5, standaard is 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Stuur trace/debug-info naar de console in plaats van het debug.log bestand</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Stuur trace/debug-info naar debugger</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Stel maximum blokgrootte in in bytes (standaard: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Stel minimum blokgrootte in in bytes (standaard: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Verklein debug.log-bestand bij het opstarten van de client (standaard: 1 als geen -debug)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>Ondertekenen van transactie mislukt</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Specificeer de time-outtijd in milliseconden (standaard: 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Systeemfout:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation>Transactiebedrag te klein</translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>Transactiebedragen moeten positief zijn</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>Transactie te groot</translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Gebruik UPnP om de luisterende poort te mappen (standaard: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Gebruik UPnP om de luisterende poort te mappen (standaard: 1 als er wordt geluisterd)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Gebruik proxy om &apos;tor hidden services&apos; te bereiken (standaard: hetzelfde als -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Gebruikersnaam voor JSON-RPC-verbindingen</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Waarschuwing</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Waarschuwing: Deze versie is verouderd, een upgrade is vereist!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>U moet de databases herbouwen met behulp van -reindex om -txindex te kunnen veranderen</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrupt, veiligstellen mislukt</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Wachtwoord voor JSON-RPC-verbindingen</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Sta JSON-RPC verbindingen van opgegeven IP-adres toe</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Verstuur commando&apos;s naar proces dat op &lt;ip&gt; draait (standaard: 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>Voer commando uit zodra het beste blok verandert (%s in cmd wordt vervangen door blockhash)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Vernieuw portemonnee naar nieuwste versie</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Stel sleutelpoelgrootte in op &lt;n&gt; (standaard: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Doorzoek de blokketen op ontbrekende portemonnee-transacties</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Gebruik OpenSSL (https) voor JSON-RPC-verbindingen</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Certificaat-bestand voor server (standaard: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Geheime sleutel voor server (standaard: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Aanvaardbare ciphers (standaard: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Dit helpbericht</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Niet in staat om aan %s te binden op deze computer (bind gaf error %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Verbind via een socks-proxy</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Sta DNS-naslag toe voor -addnode, -seednode en -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Adressen aan het laden...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Fout bij laden wallet.dat: Portemonnee corrupt</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Unstakeable</source> <translation>Fout bij laden wallet.dat: Portemonnee vereist een nieuwere versie van Unstakeable</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Unstakeable to complete</source> <translation>Portemonnee moest herschreven worden: Herstart Unstakeable om te voltooien</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Fout bij laden wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Ongeldig -proxy adres: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Onbekend netwerk gespecificeerd in -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Onbekende -socks proxyversie aangegeven: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Kan -bind adres niet herleiden: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Kan -externlip adres niet herleiden: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Ongeldig bedrag voor -paytxfee=&lt;bedrag&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Ongeldig bedrag</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Ontoereikend saldo</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Blokindex aan het laden...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Voeg een node om naar te verbinden toe en probeer de verbinding open te houden</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Unstakeable is probably already running.</source> <translation>Niet in staat om aan %s te binden op deze computer. Unstakeable draait vermoedelijk reeds.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Kosten per KB om aan transacties toe te voegen die u verstuurt</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Portemonnee aan het laden...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Kan portemonnee niet downgraden</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Kan standaardadres niet schrijven</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Blokketen aan het doorzoeken...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Klaar met laden</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Om de %s optie te gebruiken</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Fout</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>U dient rpcpassword=&lt;wachtwoord&gt; in te stellen in het configuratiebestand: %s Als het bestand niet bestaat, maak het dan aan, met een alleen-lezen-permissie.</translation> </message> </context> </TS>
{'content_hash': 'd050532e25c91d79059330c707dc5c41', 'timestamp': '', 'source': 'github', 'line_count': 2938, 'max_line_length': 498, 'avg_line_length': 40.43022464261402, 'alnum_prop': 0.6383435479525862, 'repo_name': 'Action-Committee/unstakeable', 'id': '43bcb7dc2c3da4dcd7e88accc6d9abb0bbd638d7', 'size': '118797', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/qt/locale/bitcoin_nl.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '31208'}, {'name': 'C++', 'bytes': '2496982'}, {'name': 'CSS', 'bytes': '1127'}, {'name': 'Groff', 'bytes': '18284'}, {'name': 'HTML', 'bytes': '50615'}, {'name': 'Makefile', 'bytes': '5122'}, {'name': 'NSIS', 'bytes': '6178'}, {'name': 'Objective-C', 'bytes': '858'}, {'name': 'Objective-C++', 'bytes': '5711'}, {'name': 'Python', 'bytes': '69712'}, {'name': 'QMake', 'bytes': '14116'}, {'name': 'Shell', 'bytes': '9737'}]}
package org.flexlabs.widgets.dualbattery.widgetsettings; import android.app.AlertDialog; import android.appwidget.AppWidgetManager; import android.content.Intent; import android.content.res.Configuration; import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.app.FragmentTransaction; import android.support.v4.view.ViewPager; import android.view.View; import android.widget.*; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.MenuItem; import com.viewpagerindicator.PageIndicator; import com.viewpagerindicator.TabPageIndicator; import org.flexlabs.widgets.dualbattery.BatteryWidgetUpdater; import org.flexlabs.widgets.dualbattery.R; import org.flexlabs.widgets.dualbattery.app.AboutFragment; import org.flexlabs.widgets.dualbattery.app.DonateFragment; import org.flexlabs.widgets.dualbattery.app.FeedbackFragment; import org.flexlabs.widgets.dualbattery.service.MonitorService; public class WidgetActivity extends SherlockFragmentActivity implements AdapterView.OnItemClickListener { public int appWidgetId; private ListView mList; private int mCurrentTab = -1; private Fragment[] fragments; private String[] titles; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); startService(new Intent(this, MonitorService.class)); Bundle extras = getIntent().getExtras(); appWidgetId = extras.getInt( AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); fragments = new Fragment[5]; fragments[0] = new BatteryInfoFragment(); fragments[1] = new PropertiesFragment(); fragments[2] = new FeedbackFragment(); fragments[3] = new DonateFragment(); fragments[4] = new AboutFragment(); titles = new String[5]; titles[0] = getString(R.string.propHeader_BatteryInfo); titles[1] = getString(R.string.propHeader_Properties); titles[2] = getString(R.string.propHeader_Feedback); titles[3] = getString(R.string.propHeader_Donate); titles[4] = getString(R.string.propHeader_About); int screenLayout = getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && screenLayout > Configuration.SCREENLAYOUT_SIZE_LARGE) { setContentView(R.layout.preference_list_large); ArrayAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_activated_1, titles); mList = (ListView)findViewById(android.R.id.list); mList.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE); mList.setOnItemClickListener(this); mList.setAdapter(adapter); mList.setItemChecked(0, true); mList.performClick(); getSupportFragmentManager().beginTransaction().replace(R.id.prefs, fragments[0]).commit(); } else { setContentView(R.layout.widgetsettings); PagerTabAdapter mPagerAdapter = new PagerTabAdapter(getSupportFragmentManager()); ViewPager mPager = (ViewPager) findViewById(R.id.pager); mPager.setAdapter(mPagerAdapter); PageIndicator mIndicator = (TabPageIndicator) findViewById(R.id.indicator); mIndicator.setViewPager(mPager); } if (WidgetSettingsContainer.getUpgradeSwappedSingle(this, appWidgetId)) { new AlertDialog.Builder(this) .setTitle(R.string.app_name) .setMessage(R.string.alert_just_swapped) .setPositiveButton("OK", null) .show(); } } private class PagerTabAdapter extends FragmentPagerAdapter { public PagerTabAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int i) { return fragments[i]; } @Override public int getCount() { return fragments.length; } @Override public CharSequence getPageTitle(int position) { return titles[position]; } } @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { if (mCurrentTab == position) return; mCurrentTab = position; FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); transaction.replace(R.id.prefs, fragments[position]); transaction.commit(); mList.setItemChecked(position, true); } @Override protected void onPause() { super.onPause(); BatteryWidgetUpdater.updateWidget(this, appWidgetId); } @Override protected void onStop() { super.onStop(); finish(); } @Override public boolean onOptionsItemSelected(MenuItem item) { return ((BatteryInfoFragment)fragments[0]).onMenuItemSelected(item) || super.onOptionsItemSelected(item); } }
{'content_hash': '27516b56a627a0c2b978d150454cc55b', 'timestamp': '', 'source': 'github', 'line_count': 142, 'max_line_length': 121, 'avg_line_length': 37.58450704225352, 'alnum_prop': 0.6818437324339517, 'repo_name': 'artiomchi/Dual-Battery-Widget', 'id': '799092d7a9ab700dbc5718948b4224a4eb2c3cc1', 'size': '5953', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/org/flexlabs/widgets/dualbattery/widgetsettings/WidgetActivity.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '436322'}]}
package com.android.volley; import android.os.Handler; import android.os.Looper; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Queue; import java.util.Set; import java.util.concurrent.PriorityBlockingQueue; import java.util.concurrent.atomic.AtomicInteger; /** * A call dispatch queue with a thread pool of dispatchers. * * Calling {@link #add(Request)} will enqueue the given Request for dispatch, * resolving from either cache or network on a worker thread, and then delivering * a parsed response on the main thread. */ public class RequestQueue { /** Callback interface for completed requests. */ public static interface RequestFinishedListener<T> { /** Called when a call has finished processing. */ public void onRequestFinished(Request<T> request); } /** Used for generating monotonically-increasing sequence numbers for requests. */ private AtomicInteger mSequenceGenerator = new AtomicInteger(); /** * Staging area for requests that already have a duplicate call in flight. * * <ul> * <li>containsKey(cacheKey) indicates that there is a call in flight for the given cache * key.</li> * <li>get(cacheKey) returns waiting requests for the given cache key. The in flight call * is <em>not</em> contained in that list. Is null if no requests are staged.</li> * </ul> */ private final Map<String, Queue<Request<?>>> mWaitingRequests = new HashMap<String, Queue<Request<?>>>(); /** * The set of all requests currently being processed by this RequestQueue. A Request * will be in this set if it is waiting in any queue or currently being processed by * any dispatcher. */ private final Set<Request<?>> mCurrentRequests = new HashSet<Request<?>>(); /** The cache triage queue. */ private final PriorityBlockingQueue<Request<?>> mCacheQueue = new PriorityBlockingQueue<Request<?>>(); /** The queue of requests that are actually going out to the network. */ private final PriorityBlockingQueue<Request<?>> mNetworkQueue = new PriorityBlockingQueue<Request<?>>(); /** Number of network call dispatcher threads to start. */ private static final int DEFAULT_NETWORK_THREAD_POOL_SIZE = 4; /** Cache interface for retrieving and storing responses. */ private final Cache mCache; /** Network interface for performing requests. */ private final Network mNetwork; /** Response delivery mechanism. */ private final ResponseDelivery mDelivery; /** The network dispatchers. */ private NetworkDispatcher[] mDispatchers; /** The cache dispatcher. */ private CacheDispatcher mCacheDispatcher; private List<RequestFinishedListener> mFinishedListeners = new ArrayList<RequestFinishedListener>(); /** * Creates the worker pool. Processing will not begin until {@link #start()} is called. * * @param cache A Cache to use for persisting responses to disk * @param network A Network interface for performing HTTP requests * @param threadPoolSize Number of network dispatcher threads to create * @param delivery A ResponseDelivery interface for posting responses and errors */ public RequestQueue(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery) { mCache = cache; mNetwork = network; mDispatchers = new NetworkDispatcher[threadPoolSize]; mDelivery = delivery; } /** * Creates the worker pool. Processing will not begin until {@link #start()} is called. * * @param cache A Cache to use for persisting responses to disk * @param network A Network interface for performing HTTP requests * @param threadPoolSize Number of network dispatcher threads to create */ public RequestQueue(Cache cache, Network network, int threadPoolSize) { this(cache, network, threadPoolSize, new ExecutorDelivery(new Handler(Looper.getMainLooper()))); } /** * Creates the worker pool. Processing will not begin until {@link #start()} is called. * * @param cache A Cache to use for persisting responses to disk * @param network A Network interface for performing HTTP requests */ public RequestQueue(Cache cache, Network network) { this(cache, network, DEFAULT_NETWORK_THREAD_POOL_SIZE); } /** * Starts the dispatchers in this queue. */ public void start() { stop(); // Make sure any currently running dispatchers are stopped. // Create the cache dispatcher and start it. mCacheDispatcher = new CacheDispatcher(mCacheQueue, mNetworkQueue, mCache, mDelivery); mCacheDispatcher.start(); // Create network dispatchers (and corresponding threads) up to the pool size. for (int i = 0; i < mDispatchers.length; i++) { NetworkDispatcher networkDispatcher = new NetworkDispatcher(mNetworkQueue, mNetwork, mCache, mDelivery); mDispatchers[i] = networkDispatcher; networkDispatcher.start(); } } /** * Stops the cache and network dispatchers. */ public void stop() { if (mCacheDispatcher != null) { mCacheDispatcher.quit(); } for (int i = 0; i < mDispatchers.length; i++) { if (mDispatchers[i] != null) { mDispatchers[i].quit(); } } } /** * Gets a sequence number. */ public int getSequenceNumber() { return mSequenceGenerator.incrementAndGet(); } /** * Gets the {@link Cache} instance being used. */ public Cache getCache() { return mCache; } /** * A simple predicate or filter interface for Requests, for use by * {@link RequestQueue#cancelAll(RequestFilter)}. */ public interface RequestFilter { public boolean apply(Request<?> request); } /** * Cancels all requests in this queue for which the given filter applies. * @param filter The filtering function to use */ public void cancelAll(RequestFilter filter) { synchronized (mCurrentRequests) { for (Request<?> request : mCurrentRequests) { if (filter.apply(request)) { request.cancel(); } } } } /** * Cancels all requests in this queue with the given tag. Tag must be non-null * and equality is by identity. */ public void cancelAll(final Object tag) { if (tag == null) { throw new IllegalArgumentException("Cannot cancelAll with a null tag"); } cancelAll(new RequestFilter() { @Override public boolean apply(Request<?> request) { return request.getTag() == tag; } }); } /** * Adds a Request to the dispatch queue. * @param request The call to service * @return The passed-in call */ public <T> Request<T> add(Request<T> request) { // Tag the call as belonging to this queue and add it to the set of current requests. request.setRequestQueue(this); synchronized (mCurrentRequests) { mCurrentRequests.add(request); } // Process requests in the order they are added. request.setSequence(getSequenceNumber()); request.addMarker("add-to-queue"); // If the call is uncacheable, skip the cache queue and go straight to the network. if (!request.shouldCache()) { mNetworkQueue.add(request); return request; } // Insert call into stage if there's already a call with the same cache key in flight. synchronized (mWaitingRequests) { String cacheKey = request.getCacheKey(); if (mWaitingRequests.containsKey(cacheKey)) { // There is already a call in flight. Queue up. Queue<Request<?>> stagedRequests = mWaitingRequests.get(cacheKey); if (stagedRequests == null) { stagedRequests = new LinkedList<Request<?>>(); } stagedRequests.add(request); mWaitingRequests.put(cacheKey, stagedRequests); if (VolleyLog.DEBUG) { VolleyLog.v("Request for cacheKey=%s is in flight, putting on hold.", cacheKey); } } else { // Insert 'null' queue for this cacheKey, indicating there is now a call in // flight. mWaitingRequests.put(cacheKey, null); mCacheQueue.add(request); } return request; } } /** * Called from {@link Request#finish(String)}, indicating that processing of the given call * has finished. * * <p>Releases waiting requests for <code>call.getCacheKey()</code> if * <code>call.shouldCache()</code>.</p> */ <T> void finish(Request<T> request) { // Remove from the set of requests currently being processed. synchronized (mCurrentRequests) { mCurrentRequests.remove(request); } synchronized (mFinishedListeners) { for (RequestFinishedListener<T> listener : mFinishedListeners) { listener.onRequestFinished(request); } } if (request.shouldCache()) { synchronized (mWaitingRequests) { String cacheKey = request.getCacheKey(); Queue<Request<?>> waitingRequests = mWaitingRequests.remove(cacheKey); if (waitingRequests != null) { if (VolleyLog.DEBUG) { VolleyLog.v("Releasing %d waiting requests for cacheKey=%s.", waitingRequests.size(), cacheKey); } // Process all queued up requests. They won't be considered as in flight, but // that's not a problem as the cache has been primed by 'call'. mCacheQueue.addAll(waitingRequests); } } } } public <T> void addRequestFinishedListener(RequestFinishedListener<T> listener) { synchronized (mFinishedListeners) { mFinishedListeners.add(listener); } } /** * Remove a RequestFinishedListener. Has no effect if listener was not previously added. */ public <T> void removeRequestFinishedListener(RequestFinishedListener<T> listener) { synchronized (mFinishedListeners) { mFinishedListeners.remove(listener); } } }
{'content_hash': '45b3c6e3d8ca0da5a8c5b37d29f4c825', 'timestamp': '', 'source': 'github', 'line_count': 303, 'max_line_length': 100, 'avg_line_length': 35.92739273927393, 'alnum_prop': 0.6197868822340621, 'repo_name': 'SxdsF/Alliance', 'id': '7602a13315b9ae9efd322a4ee121cf9bae9db91f', 'size': '11505', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'sample/src/main/java/com/android/volley/RequestQueue.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '255381'}]}
package com.cloudera.sqoop.mapreduce; import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.NullWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.WritableComparable; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import com.cloudera.sqoop.ConnFactory; import com.cloudera.sqoop.Sqoop; import com.cloudera.sqoop.manager.ManagerFactory; import com.cloudera.sqoop.testutil.ImportJobTestCase; import com.cloudera.sqoop.testutil.InjectableManagerFactory; import com.cloudera.sqoop.testutil.InjectableConnManager; import com.cloudera.sqoop.tool.ImportTool; /** * Test aspects of the DataDrivenImportJob class' failure reporting. * * These tests have strange error checking because they have different correct * exit conditions when run in "debug mode" when run by ('ant test') and when * run within eclipse. Debug mode is entered by setting system property * SQOOP_RETHROW_PROPERTY = "sqoop.throwOnError". */ public class TestImportJob extends ImportJobTestCase { public void testFailedImportDueToIOException() throws IOException { // Make sure that if a MapReduce job to do the import fails due // to an IOException, we tell the user about it. // Create a table to attempt to import. createTableForColType("VARCHAR(32)", "'meep'"); Configuration conf = new Configuration(); LogFactory.getLog(getClass()).info( " getWarehouseDir() " + getWarehouseDir()); // Make the output dir exist so we know the job will fail via IOException. Path outputPath = new Path(new Path(getWarehouseDir()), getTableName()); FileSystem fs = FileSystem.getLocal(conf); fs.mkdirs(outputPath); assertTrue(fs.exists(outputPath)); String[] argv = getArgv(true, new String[] { "DATA_COL0" }, conf); Sqoop importer = new Sqoop(new ImportTool()); try { int ret = Sqoop.runSqoop(importer, argv); assertTrue("Expected ImportException running this job.", 1==ret); } catch (Exception e) { // In debug mode, IOException is wrapped in RuntimeException. LOG.info("Got exceptional return (expected: ok). msg is: " + e); } } /** A mapper that is guaranteed to cause the task to fail. */ public static class NullDereferenceMapper extends AutoProgressMapper<Object, Object, Text, NullWritable> { public void map(Object key, Object val, Context c) throws IOException, InterruptedException { String s = null; s.length(); // This will throw a NullPointerException. } } /** Run a "job" that just delivers a record to the mapper. */ public static class DummyImportJob extends ImportJobBase { @Override public void configureInputFormat(Job job, String tableName, String tableClassName, String splitByCol) throws ClassNotFoundException, IOException { // Write a line of text into a file so that we can get // a record to the map task. Path dir = new Path(this.options.getTempDir()); Path p = new Path(dir, "sqoop-dummy-import-job-file.txt"); FileSystem fs = FileSystem.getLocal(this.options.getConf()); if (fs.exists(p)) { boolean result = fs.delete(p, false); assertTrue("Couldn't delete temp file!", result); } BufferedWriter w = new BufferedWriter( new OutputStreamWriter(fs.create(p))); w.append("This is a line!"); w.close(); FileInputFormat.addInputPath(job, p); // And set the InputFormat itself. super.configureInputFormat(job, tableName, tableClassName, splitByCol); } } public void testFailedImportDueToJobFail() throws IOException { // Test that if the job returns 'false' it still fails and informs // the user. // Create a table to attempt to import. createTableForColType("VARCHAR(32)", "'meep2'"); Configuration conf = new Configuration(); // Use the dependency-injection manager. conf.setClass(ConnFactory.FACTORY_CLASS_NAMES_KEY, InjectableManagerFactory.class, ManagerFactory.class); String[] argv = getArgv(true, new String[] { "DATA_COL0" }, conf); // Use dependency injection to specify a mapper that we know // will fail. conf.setClass(InjectableConnManager.MAPPER_KEY, NullDereferenceMapper.class, Mapper.class); conf.setClass(InjectableConnManager.IMPORT_JOB_KEY, DummyImportJob.class, ImportJobBase.class); Sqoop importer = new Sqoop(new ImportTool(), conf); try { int ret = Sqoop.runSqoop(importer, argv); assertTrue("Expected ImportException running this job.", 1==ret); } catch (Exception e) { // In debug mode, ImportException is wrapped in RuntimeException. LOG.info("Got exceptional return (expected: ok). msg is: " + e); } } public void testFailedNoColumns() throws IOException { // Make sure that if a MapReduce job to do the import fails due // to an IOException, we tell the user about it. // Create a table to attempt to import. createTableForColType("VARCHAR(32)", "'meep'"); Configuration conf = new Configuration(); // Make the output dir exist so we know the job will fail via IOException. Path outputPath = new Path(new Path(getWarehouseDir()), getTableName()); FileSystem fs = FileSystem.getLocal(conf); fs.mkdirs(outputPath); assertTrue(fs.exists(outputPath)); String [] argv = getArgv(true, new String [] { "" }, conf); Sqoop importer = new Sqoop(new ImportTool()); try { int ret = Sqoop.runSqoop(importer, argv); assertTrue("Expected job to fail due to no colnames.", 1==ret); } catch (Exception e) { // In debug mode, IOException is wrapped in RuntimeException. LOG.info("Got exceptional return (expected: ok). msg is: " + e); } } public void testFailedIllegalColumns() throws IOException { // Make sure that if a MapReduce job to do the import fails due // to an IOException, we tell the user about it. // Create a table to attempt to import. createTableForColType("VARCHAR(32)", "'meep'"); Configuration conf = new Configuration(); // Make the output dir exist so we know the job will fail via IOException. Path outputPath = new Path(new Path(getWarehouseDir()), getTableName()); FileSystem fs = FileSystem.getLocal(conf); fs.mkdirs(outputPath); assertTrue(fs.exists(outputPath)); // DATA_COL0 ok, by zyzzyva not good String [] argv = getArgv(true, new String [] { "DATA_COL0", "zyzzyva" }, conf); Sqoop importer = new Sqoop(new ImportTool()); try { int ret = Sqoop.runSqoop(importer, argv); assertTrue("Expected job to fail due bad colname.", 1==ret); } catch (Exception e) { // In debug mode, IOException is wrapped in RuntimeException. LOG.info("Got exceptional return (expected: ok). msg is: " + e); } } public void testDuplicateColumns() throws IOException { // Make sure that if a MapReduce job to do the import fails due // to an IOException, we tell the user about it. // Create a table to attempt to import. createTableForColType("VARCHAR(32)", "'meep'"); Configuration conf = new Configuration(); // Make the output dir exist so we know the job will fail via IOException. Path outputPath = new Path(new Path(getWarehouseDir()), getTableName()); FileSystem fs = FileSystem.getLocal(conf); fs.mkdirs(outputPath); assertTrue(fs.exists(outputPath)); String[] argv = getArgv(true, new String[] { "DATA_COL0,DATA_COL0" }, conf); Sqoop importer = new Sqoop(new ImportTool()); try { int ret = Sqoop.runSqoop(importer, argv); assertTrue("Expected job to fail!", 1 == ret); } catch (Exception e) { // In debug mode, ImportException is wrapped in RuntimeException. LOG.info("Got exceptional return (expected: ok). msg is: " + e); } } // helper method to get contents of a given dir containing sequence files private String[] getContent(Configuration conf, Path path) throws Exception { FileSystem fs = FileSystem.getLocal(conf); FileStatus[] stats = fs.listStatus(path); String [] fileNames = new String[stats.length]; for (int i = 0; i < stats.length; i++) { fileNames[i] = stats[i].getPath().toString(); } // Read all the files adding the value lines to the list. List<String> strings = new ArrayList<String>(); for (String fileName : fileNames) { if (fileName.startsWith("_") || fileName.startsWith(".")) { continue; } SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf); WritableComparable key = (WritableComparable) reader.getKeyClass().newInstance(); Writable value = (Writable) reader.getValueClass().newInstance(); while (reader.next(key, value)) { strings.add(value.toString()); } } return strings.toArray(new String[0]); } public void testDeleteTargetDir() throws Exception { // Make sure that if a MapReduce job to do the import fails due // to an IOException, we tell the user about it. // Create a table to attempt to import. createTableForColType("VARCHAR(32)", "'meep'"); Configuration conf = new Configuration(); // Make the output dir does not exist Path outputPath = new Path(new Path(getWarehouseDir()), getTableName()); FileSystem fs = FileSystem.getLocal(conf); fs.delete(outputPath, true); assertTrue(!fs.exists(outputPath)); String[] argv = getArgv(true, new String[] { "DATA_COL0" }, conf); argv = Arrays.copyOf(argv, argv.length + 1); argv[argv.length - 1] = "--delete-target-dir"; Sqoop importer = new Sqoop(new ImportTool()); try { int ret = Sqoop.runSqoop(importer, argv); assertTrue("Expected job to go through if target directory" + " does not exist.", 0 == ret); assertTrue(fs.exists(outputPath)); // expecting one _SUCCESS file and one file containing data assertTrue("Expecting two files in the directory.", fs.listStatus(outputPath).length == 2); String[] output = getContent(conf, outputPath); assertEquals("Expected output and actual output should be same.", "meep", output[0]); ret = Sqoop.runSqoop(importer, argv); assertTrue("Expected job to go through if target directory exists.", 0 == ret); assertTrue(fs.exists(outputPath)); // expecting one _SUCCESS file and one file containing data assertTrue("Expecting two files in the directory.", fs.listStatus(outputPath).length == 2); output = getContent(conf, outputPath); assertEquals("Expected output and actual output should be same.", "meep", output[0]); } catch (Exception e) { // In debug mode, ImportException is wrapped in RuntimeException. LOG.info("Got exceptional return (expected: ok). msg is: " + e); } } }
{'content_hash': 'c4bca525ef08f15af44be55b25814053', 'timestamp': '', 'source': 'github', 'line_count': 306, 'max_line_length': 80, 'avg_line_length': 37.41503267973856, 'alnum_prop': 0.6829417416368242, 'repo_name': 'tyro89/json-sqoop', 'id': 'b22b2b6b6759a3c2f9b36aa5f5e728692de81ad3', 'size': '12255', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'src/test/com/cloudera/sqoop/mapreduce/TestImportJob.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '5262'}, {'name': 'Java', 'bytes': '2776525'}, {'name': 'Python', 'bytes': '7439'}, {'name': 'Shell', 'bytes': '47221'}, {'name': 'XSLT', 'bytes': '14009'}]}
FROM php:8.0-apache LABEL maintainer="Alterway <[email protected]>" RUN apt-get update && \ apt-get install -y \ libfreetype6-dev \ libjpeg62-turbo-dev \ libpng-dev \ libgmp-dev \ libxml2-dev \ zlib1g-dev \ libncurses5-dev \ libldb-dev \ libldap2-dev \ libicu-dev \ libmemcached-dev \ libcurl4-openssl-dev \ libssl-dev \ libsqlite3-dev \ libzip-dev \ libonig-dev \ curl \ msmtp \ mariadb-client \ git \ subversion \ wget && \ rm -rf /var/lib/apt/lists/* && \ wget https://getcomposer.org/download/1.10.17/composer.phar -O /usr/local/bin/composer && \ wget https://getcomposer.org/download/2.0.7/composer.phar -O /usr/local/bin/composer2 && \ chmod a+rx /usr/local/bin/composer /usr/local/bin/composer2 RUN ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h && \ ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so && \ ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so && \ docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \ docker-php-ext-install ldap && \ docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd && \ docker-php-ext-install pdo_mysql && \ docker-php-ext-configure mysqli --with-mysqli=mysqlnd && \ docker-php-ext-install mysqli && \ docker-php-ext-install pdo_sqlite && \ docker-php-ext-configure gd --with-freetype --with-jpeg && \ docker-php-ext-install gd && \ docker-php-ext-install soap && \ docker-php-ext-install intl && \ docker-php-ext-install gmp && \ docker-php-ext-install bcmath && \ docker-php-ext-install mbstring && \ docker-php-ext-install zip && \ docker-php-ext-install pcntl && \ docker-php-ext-install ftp && \ docker-php-ext-install sockets && \ pecl install mongodb && \ pecl install memcached && \ pecl install redis && \ pecl install xdebug ADD http://www.zlib.net/zlib-1.2.12.tar.gz /tmp/zlib.tar.gz RUN tar zxpf /tmp/zlib.tar.gz -C /tmp && \ cd /tmp/zlib-1.2.12 && \ ./configure --prefix=/usr/local/zlib && \ make && make install && \ rm -Rf /tmp/zlib-1.2.12 && \ rm /tmp/zlib.tar.gz ADD https://blackfire.io/api/v1/releases/probe/php/linux/amd64/80 /tmp/blackfire-probe.tar.gz RUN tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp && \ mv /tmp/blackfire-*.so `php -r "echo ini_get('extension_dir');"`/blackfire.so && \ rm /tmp/blackfire-probe.tar.gz ENV LOCALTIME Europe/Paris ENV HTTPD_CONF_DIR /etc/apache2/conf-enabled/ ENV HTTPD__DocumentRoot /var/www/html ENV HTTPD__LogFormat '"%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" common' RUN rm $PHP_INI_DIR/conf.d/docker-php-ext* && \ echo 'sendmail_path = /usr/bin/msmtp -t' >> $PHP_INI_DIR/conf.d/00-default.ini && \ sed -i "s/DocumentRoot.*/DocumentRoot \${HTTPD__DocumentRoot}/" /etc/apache2/apache2.conf && \ echo 'ServerName ${HOSTNAME}' > $HTTPD_CONF_DIR/00-default.conf && \ echo 'ServerSignature Off' > /etc/apache2/conf-enabled/z-security.conf && \ echo 'ServerTokens Minimal' >> /etc/apache2/conf-enabled/z-security.conf && \ touch /etc/msmtprc && chmod a+w -R $HTTPD_CONF_DIR/ /etc/apache2/mods-enabled $PHP_INI_DIR/ /etc/msmtprc && \ rm /etc/apache2/sites-enabled/000-default.conf COPY docker-entrypoint.sh /entrypoint.sh WORKDIR /var/www ENTRYPOINT ["/entrypoint.sh"]
{'content_hash': '7b17b950bab3e6c62b31ab4b9b81cb8d', 'timestamp': '', 'source': 'github', 'line_count': 90, 'max_line_length': 113, 'avg_line_length': 38.93333333333333, 'alnum_prop': 0.6304223744292238, 'repo_name': 'alterway/docker-php', 'id': '7489ff7fa93aef1c231f9fcdfb7e258c116f8705', 'size': '3504', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '8.0-apache/Dockerfile', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Dockerfile', 'bytes': '122698'}, {'name': 'Shell', 'bytes': '117293'}]}
import sbt._ import sbt.Keys._ object OpenProjects extends Build { import SharedProjects._ lazy val root = Project("root", file(".")) .aggregate(oscalaJVM, oscalaSJS, serlandJVM, serlandSJS, cenumJVM, cenumSJS) // .settings(crossScalaVersions := Seq("2.10.2", "2.11.1")) .settings(crossScalaVersions := Seq("2.11.7")) .settings(sbtrelease.ReleasePlugin.releaseSettings: _*) .settings(Publish.settings: _*) .settings(publish :=()) .settings(publishLocal :=()) }
{'content_hash': '4534dcc108816a676852ca451cefa8aa', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 80, 'avg_line_length': 27.555555555555557, 'alnum_prop': 0.6754032258064516, 'repo_name': 'cgta/open', 'id': '2909739be7a100a67f1359c23007656d65c1e544', 'size': '496', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'project/OpenProjects.scala', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '548'}, {'name': 'Scala', 'bytes': '510668'}, {'name': 'Shell', 'bytes': '1686'}]}
angular.module('MessagesCtrl', []) .controller('MessagesController', function($scope, $rootScope, MessagesService) { $rootScope.emailCounts = { inboxCount: MessagesService.getInboxEmailCount(), flaggedCount: MessagesService.getFlaggedEmailCount(), sentCount: MessagesService.getOutboxEmailCount() }; });
{'content_hash': '13d335b05fb3813c975416c93da1019b', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 81, 'avg_line_length': 38.22222222222222, 'alnum_prop': 0.7063953488372093, 'repo_name': 'leoz/blogus', 'id': '0981a54f83f789bf0363e2196261b2764f3c6bd7', 'size': '345', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'www/app/messages/messagesctrl.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '3505'}, {'name': 'HTML', 'bytes': '18464'}, {'name': 'JavaScript', 'bytes': '45650'}]}
<?xml version="1.0" encoding="iso-8859-1"?><!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/html; charset=iso-8859-1" /> <title>Combination Chart JSON </title> <link rel="stylesheet" href="../../assets/ui/css/style.css" type="text/css" /> <script type="text/javascript" src="../../assets/prettify/prettify.js"></script> <link rel="stylesheet" type="text/css" href="../../assets/prettify/prettify.css" /> <script type="text/javascript" src="../../assets/ui/js/jquery.min.js" ></script> <style type="text/css"> <!-- div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; } a.whtbtnhide, a.whtbtnshow, a.whtbtnhidenav , a.whtbtnshownav { border-bottom:none !important; } --> </style> <script type="text/javascript" language="javascript1.2" src="../../assets/ui/js/whmsg.js"></script> <script type="text/javascript" language="javascript" src="../../assets/ui/js/whver.js"></script> <script type="text/javascript" language="javascript1.2" src="../../assets/ui/js/whproxy.js"></script> <script type="text/javascript" language="javascript1.2" src="../../assets/ui/js/whutils.js"></script> <script type="text/javascript" language="javascript1.2" src="../../assets/ui/js/whlang.js"></script> <script type="text/javascript" language="javascript1.2" src="../../assets/ui/js/whtopic.js"></script> <script type="text/javascript" src="../../assets/ui/js/lib.js"></script> </head> <body> <!-- breadcrumb starts here --> <div id="breadcrumb"></div> <script type="text/javascript"> document.write( addFCBreadcrumb( [ "Home|../../Introduction/Overview.html", "FusionCharts XT Data Formats", "JSON|Overview.html", "Combination chart JSON" ] ) ); </script> <!-- breadcrumb ends here --> <table width="98%" border="0" cellspacing="0" cellpadding="3" align="center"> <tr> <td class="pageHeader">Combination Chart JSON </td> </tr> <tr> <td valign="top" class="text"><p>Combination charts are helpful when you want to plot multiple chart types on the same chart or use two different scales for two different axes. FusionCharts XT offers two categories of Combination Charts:</p> <ol> <li><strong>Single Y Axis Combination Chart</strong>: In these charts, there is only one y-axis and all the data sets are plotted against this axis.</li> <li><strong>Dual Y Axis Combination Chart</strong>: In these charts, there are two y-axes, which can represent different scales (e.g., revenue and quantity or visits and downloads etc.). The axis on the left of the chart is called primary axis and the one on right is called secondary axis (though, you can reverse this in few charts by configuring the JSON).</li> </ol> <p class="highlightBlock">Note that the basic JSON structure of Combination charts is same as multi-series chart </p> <p>FusionCharts XT has both 2D and 3D combination charts. Shown below is a 2D Single Y Combination Chart.</p> </td> </tr> <tr> <td valign="top" class="text"><img src="../../ChartSS/Images/Combi_2D.jpg" /></td> </tr> <tr> <td valign="top" class="text"><p>In the above chart, all the data-series are plotted against the same (primary) y-axis. Each dataset has an attribute <span class="codeInline">renderAs </span>that specifies whether the series has to be rendered as column, line, or area. </p> <p>The JSON for the above chart looks as under:</p> </td> </tr> <tr> <td valign="top" class="text"><div style="width:98%;height:500px; overflow:auto;" class="code_container"><pre class="prettyprint lang-js">{ "chart":{ "caption":"Business Results 2005 v 2006", "xaxisname":"Month", "yaxisname":"Revenue", "showvalues":"0", "numberprefix":"$" }, "categories":[{ "category":[{ "label":"Jan" }, { "label":"Feb" }, { "label":"Mar" }, { "label":"Apr" }, { "label":"May" }, { "label":"Jun" }, { "label":"Jul" }, { "label":"Aug" }, { "label":"Sep" }, { "label":"Oct" }, { "label":"Nov" }, { "label":"Dec" } ] } ], "dataset":[{ "seriesname":"2006", "data":[{ "value":"27400" }, { "value":"29800" }, { "value":"25800" }, { "value":"26800" }, { "value":"29600" }, { "value":"32600" }, { "value":"31800" }, { "value":"36700" }, { "value":"29700" }, { "value":"31900" }, { "value":"34800" }, { "value":"24800" } ] }, { "seriesname":"2005", "renderas":"Area", "data":[{ "value":"10000" }, { "value":"11500" }, { "value":"12500" }, { "value":"15000" }, { "value":"11000" }, { "value":"9800" }, { "value":"11800" }, { "value":"19700" }, { "value":"21700" }, { "value":"21900" }, { "value":"22900" }, { "value":"20800" } ] }, { "seriesname":"2004", "renderas":"Line", "data":[{ "value":"7000" }, { "value":"10500" }, { "value":"9500" }, { "value":"10000" }, { "value":"9000" }, { "value":"8800" }, { "value":"9800" }, { "value":"15700" }, { "value":"16700" }, { "value":"14900" }, { "value":"12900" }, { "value":"8800" } ] } ], "trendlines":{ "line":[{ "startvalue":"22000", "color":"91C728", "displayvalue":"Target", "showontop":"1" } ] }, "styles": { "definition": [ { "name": "CanvasAnim", "type": "animation", "param": "_xScale", "start": "0", "duration": "1" } ], "application": [ { "toobject": "Canvas", "styles": "CanvasAnim" } ] } }</pre></div></td> </tr> <tr> <td valign="top" class="text"><p>An example of a 2D Dual Y Combination Chart looks as under:</p></td> </tr> <tr> <td valign="top" class="text"><img src="../../ChartSS/Images/Combi_DY_CP_AS.jpg" width="598" height="397" /></td> </tr> <tr> <td valign="top" class="text"><p>As you can see in the image above, we are plotting sales and quantity on the chart. The chart has two y-axes:</p> <ul> <li>The primary y-axis (left) representing sales. The columns which represent sales are plotted against the primary y-axis </li> <li>The secondary y-axis (right) representing quantity. The area plot which represents quantity is plotted against the secondary y-axis </li> </ul> <p>For Dual Y Axis combination charts, it is necessary to provide at least two datasets - one for the primary axis and the other for the secondary axis. If you do not provide this, the chart will not render properly.</p> <p>The JSON for the above Dual Y Axis chart looks as under:</p> </td></tr> <tr> <td valign="top" class="text"><div class="code_container" style="width:98%;height:500px; overflow:auto;"><pre class="prettyprint lang-js" >{ "chart":{ "caption":"Sales Volume", "pyaxisname":"Revenue", "syaxisname":"Quantity", "showvalues":"0", "numberprefix":"$" }, "categories":[{ "category":[{ "label":"Jan" }, { "label":"Feb" }, { "label":"Mar" }, { "label":"Apr" }, { "label":"May" }, { "label":"Jun" }, { "label":"Jul" }, { "label":"Aug" }, { "label":"Sep" }, { "label":"Oct" }, { "label":"Nov" }, { "label":"Dec" } ] } ], "dataset":[{ "seriesname":"Revenue", "parentyaxis":"P", "data":[{ "value":"1700000" }, { "value":"610000" }, { "value":"1420000" }, { "value":"1350000" }, { "value":"2140000" }, { "value":"1210000" }, { "value":"1130000" }, { "value":"1560000" }, { "value":"2120000" }, { "value":"900000" }, { "value":"1320000" }, { "value":"1010000" } ] }, { "seriesname":"Quantity", "parentyaxis":"S", "data":[{ "value":"340" }, { "value":"120" }, { "value":"280" }, { "value":"270" }, { "value":"430" }, { "value":"240" }, { "value":"230" }, { "value":"310" }, { "value":"430" }, { "value":"180" }, { "value":"260" }, { "value":"200" } ] } ], "trendlines":{ "line":[{ "startvalue":"2100000", "color":"009933", "displayvalue":"Target" } ] }, "styles": { "definition": [ { "name": "CanvasAnim", "type": "animation", "param": "_xScale", "start": "0", "duration": "1" } ], "application": [ { "toobject": "Canvas", "styles": "CanvasAnim" } ] } }</pre></div><br /></td> </tr> <tr> <td valign="top" class="header">Brief Explanation</td> </tr> <tr> <td valign="top" class="text"><p>The JSON structure for a combination chart is very similar to that of <a href="MultiSeries.html">multi-series chart</a>. So, we will not discuss it all over again. Rather, we will discuss the differences.</p> </td> </tr> <tr> <td valign="top" class="header">Single Y Axis Combination Charts</td> </tr> <tr> <td valign="top" class="text"><p>Single Y Axis Combination Charts allow you to plot multiple datasets as different types of plots (columns, lines or areas), but against the same y-axis (primary). Since all the datasets belong to the same primary axis, the number formatting properties do not change across them. </p> <p>To select which dataset should be rendered as what plot type, you use the <span class="codeInline">renderAs</span> property as under:</p> <pre class="code_container prettyprint lang-js">"seriesname":"2005", <strong>"renderas":"Area"</strong> "seriesname":"2006", <strong>"renderas":"line"</strong> "seriesname":"2007", <strong>"renderas":"column"</strong></pre><br /></td> </tr> <tr> <td valign="top" class="header">Dual Y Axis Combination Charts</td> </tr> <tr> <td valign="top" class="text"> <p>In Dual Y Axis Combination Charts, you have two y-axes. Each y-axis can have its own scale and number formatting properties. You can also explicitly set the y-axis lower and upper limits for both the axes.</p> <p>You can choose the axis of each dataset using the <span class="codeInline">parentYAxis</span> property in the <span class="codeInline">dataset </span><span class="text">object</span>. This attribute can take a value of <span class="codeInline">P</span> or <span class="codeInline">S</span>. <span class="codeInline">P</span> denotes primary axis and <span class="codeInline">S</span> denotes secondary axis.</p> <pre class="code_container prettyprint lang-js"> "dataset":[{ "seriesname":"Revenue", <strong> "parentyaxis":"P",</strong> <nocode>...</nocode></pre> <p>and the Quantity dataset on secondary axis:</p> <pre class="code_container prettyprint lang-js"> "dataset":[{ "seriesname":"Quantity", <strong> "parentyaxis":"S",</strong> <nocode>...</nocode></pre> <p class="highlightBlock">In Dual Y 3D Combination Charts, the column chart by default plots on the primary axis and lines on the secondary. To switch this, you can specify the property &quot;primaryAxisOnLeft&quot;:&quot;0&quot; in the chart object. You can have more than one primary or secondary datasets but at least one of each is required.</p> <p>Each trend-line has to be associated with an axis, against which it will be plotted. Example:</p> <pre class="code_container prettyprint lang-js"> "trendlines":{ "line":[{ "startvalue":"2100000", <strong>"parentYAxis": "S",</strong> "color":"009933", "displayvalue":"Target" } ] },</pre> <p class="text">By default, they conform to the primary axis.</p> <p class="text">Thereafter, you can define <a href="../../Styles/Styles.html">Styles</a> elements similar to what we discussed in the Single Series JSON format page. </p> </td> </tr> </table> <!-- footer links starts--> <div id="fcfooter"></div> <script type="text/javascript"> document.getElementById("fcfooter").innerHTML = addFCFooter("Multi Series chart JSON|MultiSeries.html","Scatter &amp; Bubble chart JSON|ScatterBubble.html"); </script> <!-- footer links ends --> <script type="text/javascript" language="javascript1.2">//<![CDATA[ <!-- highlightSearch(); //--> //]]></script> </body> </html>
{'content_hash': 'c11ad9ec997eb18d1ca8e69b83d6d338', 'timestamp': '', 'source': 'github', 'line_count': 528, 'max_line_length': 211, 'avg_line_length': 28.59280303030303, 'alnum_prop': 0.49287938000927334, 'repo_name': 'TechFor/agile', 'id': '535cfc2e7cd40a7e87720c4e09aa89b65b450319', 'size': '15097', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'library/FusionCharts_XT_Evaluation/Contents/DataFormats/JSON/Combination.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ASP', 'bytes': '1790776'}, {'name': 'C#', 'bytes': '587920'}, {'name': 'ColdFusion', 'bytes': '109902'}, {'name': 'Java', 'bytes': '540408'}, {'name': 'JavaScript', 'bytes': '9488929'}, {'name': 'PHP', 'bytes': '18211450'}, {'name': 'PowerShell', 'bytes': '1028'}, {'name': 'Ruby', 'bytes': '327926'}, {'name': 'Shell', 'bytes': '1468'}, {'name': 'Visual Basic', 'bytes': '236000'}]}
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{'content_hash': '5f80c5f6d5af2886b0dae7a262f2927a', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': 'd3fada17b805605953672471b9eb1b9d7e8b8500', 'size': '187', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Polypodiaceae/Grammitis/Grammitis wolfii/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
FOUNDATION_EXPORT double KFTextInputHelperVersionNumber; FOUNDATION_EXPORT const unsigned char KFTextInputHelperVersionString[];
{'content_hash': '1fb8ef1177dfcd3bca44f6d97b328570', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 71, 'avg_line_length': 43.333333333333336, 'alnum_prop': 0.8846153846153846, 'repo_name': 'K6F/KFTextInputHelper', 'id': '79f025b0cf6a6300edcee938b9dba75a90d541b8', 'size': '297', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Example/Pods/Target Support Files/KFTextInputHelper/KFTextInputHelper-umbrella.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Objective-C', 'bytes': '41581'}, {'name': 'Ruby', 'bytes': '1417'}, {'name': 'Shell', 'bytes': '7231'}]}
import unittest from app.util.Gram import Gram class GramTest(unittest.TestCase): """Docstring for GramTest. """ def test_followingWordsOfPrevExist(self): """Getting tuple of (freq,currentWord) of existing prevGram :returns: TODO """ obj = Gram(self.gramData, self.wordList) self.assertTupleEqual(tuple(obj.gen_bigram(3)), ((1, 8), (2, 3))) self.assertTupleEqual(tuple(obj.gen_bigram('3')), ((1, 8), (2, 3))) def test_sortByDesc(self): """ Sorting a list reserved :return tupltrye """ obj = Gram(self.gramData, self.wordList) unsortedList = obj.gen_bigram(2) sortedTuple = obj.sort(unsortedList) self.assertTupleEqual(sortedTuple, ((6, 7), (6, 0), (4, 5), (2, 6), (1, 4))) def test_sortByAsc(self): """Sorting a list not reserved :return tuple """ obj = Gram(self.gramData, self.wordList) unsortedList = obj.gen_bigram(2) sortedTuple = obj.sort(unsortedList, reverse=False) self.assertTupleEqual(sortedTuple, ((1, 4), (2, 6), (4, 5), (6, 0), (6, 7))) def test_getWordByIdStr(self): """Getting existing word from wordList by word Id (string) :returns: """ obj = Gram(self.gramData, self.wordList) self.assertEqual(obj.getWordFromId('2'), 'c') self.assertEqual(obj.getWordFromId(2), 'c') def test_nonExistingWordiByIdStr(self): """Getting None by non existing word from wordList (string id) :returns: """ obj = Gram(self.gramData, self.wordList) self.assertIsNone(obj.getWordFromId(99)) def test_nonExistingWordiById(self): """Getting None of anon existing word from wordList :returns: """ obj = Gram(self.gramData, self.wordList) self.assertIsNone(obj.getWordFromId(99)) def test_getWordId(self): """Getting existing index of word from wordList :returns: """ obj = Gram(self.gramData, self.wordList) self.assertEqual(obj.getIndexOfWord('g'), 6) def test_nonExistingIdFromWord(self): """Getting non existing index of word from wordList :returns: """ obj = Gram(self.gramData, self.wordList) self.assertIsNone(obj.getIndexOfWord('non')) def test_getAllNextWordsByid(self): """Getting all following words given an existed previous word, sorting reverse :returns: """ obj = Gram(self.gramData, self.wordList) self.assertTupleEqual(tuple(obj.gen_followingWordOf(2)), ('h', 'a', 'f', 'g', 'e')) self.assertTupleEqual(tuple(obj.gen_followingWordOf('2')), ('h', 'a', 'f', 'g', 'e')) def test_RaiseErrorEmptyPrevgramBygen_bigram(self): """Raise error on gen_bigram for empty args :returns: """ obj = Gram(self.gramData, self.wordList) with self.assertRaises(ValueError): list(obj.gen_bigram(None)) with self.assertRaises(ValueError): list(obj.gen_bigram('')) def test_raiseErrorWordExistNoBigram(self): """Raise error on gen_followingWordOf if word exist but no bigram :returns: """ obj = Gram(self.gramData, self.wordList) with self.assertRaises(ValueError): list(obj.gen_followingWordOf(obj.getIndexOfWord('j'))) def setUp(self): self.gramData = [[0, 3, 8, 1], [1, 3, 3, 2], [2, 2, 6, 2], [3, 5, 3, 1], [40, 7, 2, 4], [41, 8, 1, 1], [42, 6, 2, 1], [43, 6, 7, 1], [44, 1, 8, 3], [47, 2, 4, 1], [48, 2, 7, 6], [49, 2, 5, 4], [400, 2, 0, 6]] self.wordList = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i','j'] if __name__ == '__main__': unittest.main()
{'content_hash': '677838d4dbe729212d68a621f4ea6dc4', 'timestamp': '', 'source': 'github', 'line_count': 116, 'max_line_length': 93, 'avg_line_length': 35.31896551724138, 'alnum_prop': 0.5369782767878936, 'repo_name': 'eronde/suggest-bigram', 'id': '92488f2a65167488de98b6591a3a1783b4e215b5', 'size': '4097', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/tests/test_gram.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '6961'}]}
<HTML><HEAD> <TITLE>Review for Deuce Bigalow: Male Gigolo (1999)</TITLE> <LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css"> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1 ALIGN="CENTER" CLASS="title"><A HREF="/Title?0205000">Deuce Bigalow: Male Gigolo (1999)</A></H1><H3 ALIGN=CENTER>reviewed by<BR><A HREF="/ReviewsBy?Brandon+Herring+">Brandon Herring </A></H3><HR WIDTH="40%" SIZE="4"> <P>WARNING!: MAY CONTAIN SOME MILD SPOILERS AND OFFENSIVE MATERIAL. </P> <PRE>Rating: * * *½ out of * * * *</PRE> <P>Rated: R (!) for sexual content, crude and sexual humor, and some nudity.. (A mild R rating) </P> <P>Starring: Rob Schneider, Oded Fehr, Eddie Griffin, Arija Bareikis, Amy Poehler, Norm McDonald. </P> <PRE>Running Time: 88 Minutes </PRE> <P>"Deuce Bigalow: Male Gigolo" is simply a hilarious good-natured comedy that may offend some, but underneath all it's crude humor and sexual content is a sweet little love story that is surprisingly involving. It isn't any kind of cinematic classic, but it's a very very funny comedy that keeps us entertained until the end credits which themselves are funny too. It has all it needs to be a breezy entertaining comedy: the acting is up to pace and some of the performances quite funny, the screenplay is witty and smart, and the whole story is sweet and cute. </P> <P>Deuce Bigalow (Rob Schneider) is your typically average guy: He cleans fish tanks for a living and gets an average of 10 bucks for it. Though one might call him a loser, Deuce gets a job he would never thought he would get. He gets to clean the tank for a Male Gigolo (Oded Fehr) and gets offered to watch over his place while he goes on a trip. Trying to be like him he hangs upside down from a pole and accidentally pushes off the fishtank and burns his cabinets. The thing is now he has to try and find $6,000 dollars in three weeks to make sure everything looks right again. So he decides to go "Man-whoring" and to his luck gets the oddest people on Earth: An over-weight woman who decidedly wants to eat everything in site, a woman with Narcolepsy who sleeps all the time, a woman who has sudden screaming outbursts, and a woman he can't stop thinking about. He charges $10 but he is willing to negotiate. From now on he is considered Deuce Bigalow: Male Gigolo. </P> <P>With non-stop laughs an a abundence of crude humor "Deuce Bigalow: Male Gigolo" is sometimes like last years hit "There's Something About Mary" that is offensive but very funny. The screenplay by Harris Goldberg and Rob Schneider himself is a smart, clever and witty screenplay that seems to have been written with care to make is so hilariously funny. The characters in the film are all actually likable especially "Jabba Lady" with her big body but soft heart. There are actually times in the movie where I fell out of my chair laughing so hard that my stomach was killing me. Even though I thought "Toy Story 2" and "Being John Malkovich" were the funniest of the year "Deuce Bigalow" follows right behind them. </P> <P>The directing by Mike Mitchell is fantastic and shows he took time on the film. Rob Schneider gives a surprisingly endearing performance and when his romance develops with one of his customers Kate (Arija Bareikis) it is a sweet romance that we get involved in and actually like being involved in it. "Deuce Bigalow" is a good-natured film worth all the merit it can get. Its not a classic or a masterpiece, it's just a comedy that we don't feel bad about watching. Sure it may come off as offensive and may come off as dumb sometimes, but you cannot deny that it isn't funny. </P> <P>"Deuce Bigalow: Male Gigolo" is no disappointment. Its a fast paced, entertaining sweet and hilarious comedy that may be destined to become a cult classic. Fans of Schneider will not be disappointed and fans of crude but nice comedies will not either. For some reason the film garnered an R rating but with no "f words" or extensive use of sexual content or explicit nudity I was really wondering why the film was R. A mild R to put it to the least, but even if your under 17 or above at least 13 this film is good enough for you to see. Don't try to be one of those people who make so much of a film that they do not like it, just sit back, laugh and enjoy the movie. </P> <P>Reviewed by Brandon Herring December 9, 1999</P> <P>Brandon Herring <A HREF="Http://www.geocities.com/hollywood/movie/3160/moviereviewheaven.html">Http://www.geocities.com/hollywood/movie/3160/moviereviewheaven.html</A></P> <PRE>"He Came Home"- Halloween "I don't know if anyone can stop him!"- H4 "Im so scared!"- Blair Witch " "- Silent Bob</PRE> <HR><P CLASS=flush><SMALL>The review above was posted to the <A HREF="news:rec.arts.movies.reviews">rec.arts.movies.reviews</A> newsgroup (<A HREF="news:de.rec.film.kritiken">de.rec.film.kritiken</A> for German reviews).<BR> The Internet Movie Database accepts no responsibility for the contents of the review and has no editorial control. Unless stated otherwise, the copyright belongs to the author.<BR> Please direct comments/criticisms of the review to relevant newsgroups.<BR> Broken URLs inthe reviews are the responsibility of the author.<BR> The formatting of the review is likely to differ from the original due to ASCII to HTML conversion. </SMALL></P> <P ALIGN=CENTER>Related links: <A HREF="/Reviews/">index of all rec.arts.movies.reviews reviews</A></P> </P></BODY></HTML>
{'content_hash': 'e575efdd1ef871479a9f4f8e6c30523f', 'timestamp': '', 'source': 'github', 'line_count': 83, 'max_line_length': 220, 'avg_line_length': 66.48192771084338, 'alnum_prop': 0.7519028633562885, 'repo_name': 'xianjunzhengbackup/code', 'id': '97d62b34f55ea773b89a46dfc2acfafcebf8bc1c', 'size': '5518', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'data science/machine_learning_for_the_web/chapter_4/movie/22156.html', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'BitBake', 'bytes': '113'}, {'name': 'BlitzBasic', 'bytes': '256'}, {'name': 'CSS', 'bytes': '49827'}, {'name': 'HTML', 'bytes': '157006325'}, {'name': 'JavaScript', 'bytes': '14029'}, {'name': 'Jupyter Notebook', 'bytes': '4875399'}, {'name': 'Mako', 'bytes': '2060'}, {'name': 'Perl', 'bytes': '716'}, {'name': 'Python', 'bytes': '874414'}, {'name': 'R', 'bytes': '454'}, {'name': 'Shell', 'bytes': '3984'}]}
FROM balenalib/var-som-mx6-ubuntu:eoan-run ENV GO_VERSION 1.15.7 # gcc for cgo RUN apt-get update && apt-get install -y --no-install-recommends \ g++ \ gcc \ libc6-dev \ make \ pkg-config \ git \ && rm -rf /var/lib/apt/lists/* RUN set -x \ && fetchDeps=' \ curl \ ' \ && apt-get update && apt-get install -y $fetchDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ && mkdir -p /usr/local/go \ && curl -SLO "http://resin-packages.s3.amazonaws.com/golang/v$GO_VERSION/go$GO_VERSION.linux-armv7hf.tar.gz" \ && echo "16da0e296dabb6c1199ccaa2de1a83e679ae2512263f6e05923319f4903beac1 go$GO_VERSION.linux-armv7hf.tar.gz" | sha256sum -c - \ && tar -xzf "go$GO_VERSION.linux-armv7hf.tar.gz" -C /usr/local/go --strip-components=1 \ && rm -f go$GO_VERSION.linux-armv7hf.tar.gz ENV GOROOT /usr/local/go ENV GOPATH /go ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" WORKDIR $GOPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/[email protected]" \ && echo "Running test-stack@golang" \ && chmod +x [email protected] \ && bash [email protected] \ && rm -rf [email protected] RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Ubuntu eoan \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.15.7 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{'content_hash': '98df137d0353b23a8887a3cc1cbba402', 'timestamp': '', 'source': 'github', 'line_count': 46, 'max_line_length': 670, 'avg_line_length': 50.65217391304348, 'alnum_prop': 0.7055793991416309, 'repo_name': 'nghiant2710/base-images', 'id': '29520214f388fa1fa193fa2c63906d7f0ada039c', 'size': '2351', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'balena-base-images/golang/var-som-mx6/ubuntu/eoan/1.15.7/run/Dockerfile', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '144558581'}, {'name': 'JavaScript', 'bytes': '16316'}, {'name': 'Shell', 'bytes': '368690'}]}
package slowCheck; import org.jetbrains.annotations.NotNull; import java.util.*; import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.IntStream; /** * A generator for objects based on random data from {@link DataStructure}. * * @author peter */ public final class Generator<T> { private final Function<DataStructure, T> myFunction; private Generator(Function<DataStructure, T> function) { myFunction = function; } @NotNull public static <T> Generator<T> from(@NotNull Function<DataStructure, T> function) { return new Generator<>(function); } public T generateValue(@NotNull DataStructure data) { return myFunction.apply(data.subStructure()); } public T generateUnstructured(@NotNull DataStructure data) { return myFunction.apply(data); } public <V> Generator<V> map(@NotNull Function<T,V> fun) { return from(data -> fun.apply(myFunction.apply(data))); } public <V> Generator<V> flatMap(@NotNull Function<T,Generator<V>> fun) { return from(data -> { T value = generateValue(data); Generator<V> result = fun.apply(value); if (result == null) throw new NullPointerException(fun + " returned null on " + value); return result.generateValue(data); }); } public Generator<T> noShrink() { return from(data -> data.generateNonShrinkable(this)); } public Generator<T> suchThat(@NotNull Predicate<T> condition) { return from(data -> data.generateConditional(this, condition)); } // ------------------------------------ // common generators // ------------------------------------ public static <T> Generator<T> constant(T value) { return from(data -> value); } @SafeVarargs public static <T> Generator<T> sampledFrom(T... values) { return sampledFrom(Arrays.asList(values)); } public static <T> Generator<T> sampledFrom(List<T> values) { return anyOf(values.stream().map(Generator::constant).collect(Collectors.toList())); } @SafeVarargs public static <T> Generator<T> anyOf(Generator<? extends T>... alternatives) { return anyOf(Arrays.asList(alternatives)); } public static <T> Generator<T> anyOf(List<Generator<? extends T>> alternatives) { if (alternatives.isEmpty()) throw new IllegalArgumentException("No alternatives to choose from"); return from(data -> { int index = data.generateNonShrinkable(integers(0, alternatives.size() - 1)); return alternatives.get(index).generateValue(data); }); } public static <T> Generator<T> frequency(int weight1, Generator<? extends T> alternative1, int weight2, Generator<? extends T> alternative2) { Map<Integer, Generator<? extends T>> alternatives = new HashMap<>(); alternatives.put(weight1, alternative1); alternatives.put(weight2, alternative2); return frequency(alternatives); } public static <T> Generator<T> frequency(int weight1, Generator<? extends T> alternative1, int weight2, Generator<? extends T> alternative2, int weight3, Generator<? extends T> alternative3) { Map<Integer, Generator<? extends T>> alternatives = new HashMap<>(); alternatives.put(weight1, alternative1); alternatives.put(weight2, alternative2); alternatives.put(weight3, alternative3); return frequency(alternatives); } public static <T> Generator<T> frequency(Map<Integer, Generator<? extends T>> alternatives) { List<Integer> weights = new ArrayList<>(alternatives.keySet()); IntDistribution distribution = IntDistribution.frequencyDistribution(weights); return from(data -> alternatives.get(weights.get(data.drawInt(distribution))).generateValue(data)); } public static <A,B,C> Generator<C> zipWith(Generator<A> gen1, Generator<B> gen2, BiFunction<A,B,C> zip) { return from(data -> zip.apply(gen1.generateValue(data), gen2.generateValue(data))); } public static Generator<Boolean> booleans() { return integers(0, 1).map(i -> i == 1); } // char generators public static Generator<Character> charsInRange(char min, char max) { return integers(min, max).map(i -> (char)i.intValue()).noShrink(); } public static Generator<Character> asciiPrintableChars() { return charsInRange((char)32, (char)126); } public static Generator<Character> asciiUppercaseChars() { return charsInRange('A', 'Z'); } public static Generator<Character> asciiLowercaseChars() { return charsInRange('a', 'z'); } public static Generator<Character> asciiLetters() { return frequency(9, asciiLowercaseChars(), 1, asciiUppercaseChars()).noShrink(); } public static Generator<Character> digits() { return charsInRange('0', '9'); } // strings public static Generator<String> stringsOf(@NotNull String possibleChars) { List<Character> chars = IntStream.range(0, possibleChars.length()).mapToObj(possibleChars::charAt).collect(Collectors.toList()); return stringsOf(sampledFrom(chars)); } public static Generator<String> stringsOf(@NotNull Generator<Character> charGen) { return listsOf(charGen).map(chars -> { StringBuilder sb = new StringBuilder(); chars.forEach(sb::append); return sb.toString(); }); } public static Generator<String> asciiIdentifiers() { return stringsOf(frequency(50, asciiLetters(), 5, digits(), 1, constant('_'))) .suchThat(s -> s.length() > 0 && !Character.isDigit(s.charAt(0))); } // numbers public static Generator<Integer> integers() { return from(data -> data.drawInt()); } public static Generator<Integer> integers(int min, int max) { IntDistribution distribution = IntDistribution.uniform(min, max); return from(data -> data.drawInt(distribution)); } public static Generator<Double> doubles() { return from(data -> { long i1 = data.drawInt(); long i2 = data.drawInt(); return Double.longBitsToDouble((i1 << 32) + i2); }); } // lists public static <T> Generator<List<T>> listsOf(Generator<T> itemGenerator) { return from(data -> generateList(itemGenerator, data, data.suggestCollectionSize())); } public static <T> Generator<List<T>> nonEmptyLists(Generator<T> itemGenerator) { return listsOf(itemGenerator).suchThat(l -> !l.isEmpty()); } public static <T> Generator<List<T>> listsOf(IntDistribution length, Generator<T> itemGenerator) { return from(data -> generateList(itemGenerator, data, data.drawInt(length))); } private static <T> List<T> generateList(Generator<T> itemGenerator, DataStructure data, int size) { List<T> list = new ArrayList<>(size); for (int i = 0; i < size; i++) { list.add(itemGenerator.generateValue(data)); } return Collections.unmodifiableList(list); } }
{'content_hash': '1550b29fc2b5b10064c93b1324e5a0dc', 'timestamp': '', 'source': 'github', 'line_count': 209, 'max_line_length': 132, 'avg_line_length': 33.60765550239235, 'alnum_prop': 0.6684225512528473, 'repo_name': 'asedunov/intellij-community', 'id': '48671d7808f29134125dcc747701f1f7741d5254', 'size': '7024', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'slowCheck/src/slowCheck/Generator.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AMPL', 'bytes': '20665'}, {'name': 'AspectJ', 'bytes': '182'}, {'name': 'Batchfile', 'bytes': '60827'}, {'name': 'C', 'bytes': '211454'}, {'name': 'C#', 'bytes': '1264'}, {'name': 'C++', 'bytes': '199030'}, {'name': 'CMake', 'bytes': '1675'}, {'name': 'CSS', 'bytes': '201445'}, {'name': 'CoffeeScript', 'bytes': '1759'}, {'name': 'Erlang', 'bytes': '10'}, {'name': 'Groovy', 'bytes': '3250629'}, {'name': 'HLSL', 'bytes': '57'}, {'name': 'HTML', 'bytes': '1899872'}, {'name': 'J', 'bytes': '5050'}, {'name': 'Java', 'bytes': '165745831'}, {'name': 'JavaScript', 'bytes': '570364'}, {'name': 'Jupyter Notebook', 'bytes': '93222'}, {'name': 'Kotlin', 'bytes': '4687386'}, {'name': 'Lex', 'bytes': '147047'}, {'name': 'Makefile', 'bytes': '2352'}, {'name': 'NSIS', 'bytes': '51039'}, {'name': 'Objective-C', 'bytes': '27861'}, {'name': 'Perl', 'bytes': '903'}, {'name': 'Perl6', 'bytes': '26'}, {'name': 'Protocol Buffer', 'bytes': '6680'}, {'name': 'Python', 'bytes': '25459263'}, {'name': 'Roff', 'bytes': '37534'}, {'name': 'Ruby', 'bytes': '1217'}, {'name': 'Shell', 'bytes': '66338'}, {'name': 'Smalltalk', 'bytes': '338'}, {'name': 'TeX', 'bytes': '25473'}, {'name': 'Thrift', 'bytes': '1846'}, {'name': 'TypeScript', 'bytes': '9469'}, {'name': 'Visual Basic', 'bytes': '77'}, {'name': 'XSLT', 'bytes': '113040'}]}
using Microsoft.AspNet.SignalR.Client; using System; using System.Threading.Tasks; namespace CommonTools.Lib.fx45.SignalrTools { public static class HubConnectionExtensions { public static async Task<IHubProxy> ConnectToHub(this HubConnection conn, string hubName) { var hub = conn.CreateHubProxy(hubName); await conn.Start(); return hub; } public static async Task TryStartUntilConnected(this HubConnection conn, Action<Exception> errorHandlr) { while (conn.State != ConnectionState.Connected) { try { await conn.Start(); } catch (Exception ex) { errorHandlr(ex); await Task.Delay(1000 * 5); } } } } }
{'content_hash': '7a42692fa3b8587b644b30a1c7920b18', 'timestamp': '', 'source': 'github', 'line_count': 33, 'max_line_length': 111, 'avg_line_length': 27.12121212121212, 'alnum_prop': 0.5262569832402234, 'repo_name': 'peterson1/FreshCopy', 'id': '772efe01da9b73e6cea4d038f09d218ce00e23b1', 'size': '897', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'CommonTools.Lib.fx45/SignalrTools/HubConnectionExtensions.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '472319'}]}
import os import urlparse import zipfile import requests from bs4 import BeautifulSoup from downloader import Downloader from common import Subtitles, User class Subscene(object): def __init__(self): super(Subscene, self).__init__() self._base_url = u'http://subscene.com/' self._search_url = self._get_full_url(u'/subtitles/title') self._cookies = dict(LanguageFilter=u'13') self._timeout = 10.0 def _get_full_url(self, relative_url): return urlparse.urljoin(self._base_url, relative_url) def _get_soup(self, source): return BeautifulSoup(source, u'html.parser') def _parse_search_results_source(self, source): if not source: return list() soup = self._get_soup(source) subs = list() for tr in soup.find(u'tbody').find_all(u'tr'): sub = Subtitles() tds= tr.find_all(u'td') try: sub.page_url = self._get_full_url(tds[0].find(u'a')[u'href']) except IndexError, e: pass else: try: sub.language = tds[0].find_all(u'span')[0].text.strip() except IndexError, e: pass try: sub.name = tds[0].find_all(u'span')[1].text.strip() except IndexError, e: pass try: sub.files_count = int(tds[1].text.strip()) if tds[1].text.strip() else None except IndexError, e: pass try: sub.hearing_impared = True if u'a41' in tds[2][u'class'] else False except IndexError, e: pass try: sub.uploader.name = tds[3].find(u'a').text.strip() sub.uploader.profile_url = self._get_full_url(tds[3].find('a')['href']) except IndexError, e: pass try: sub.comment = tds[4].find(u'div').text.strip() except IndexError, e: pass if sub.page_url: subs.append(sub) return subs def search(self, query): if not query: return list() data = { u'q': query, u'l': None } r = requests.get(self._search_url, params=data, cookies=self._cookies, timeout=self._timeout) if r.status_code == 200: return self._parse_search_results_source(r.text) def _extract_sub_zip(self, zip_path, sub_path): if zipfile.is_zipfile(zip_path): try: with zipfile.ZipFile(zip_path) as z: with z.open(z.namelist()[0]) as sz, open(sub_path, u'wb') as so: so.write(sz.read()) return True except Exception, e: pass return False def download(self, sub, path): r = requests.get(sub.page_url) if r.status_code == 200: soup = self._get_soup(r.text) sub.url = self._get_full_url( soup.find(u'a', id=u'downloadButton')[u'href'] ) dl = Downloader() zip_path = os.path.splitext(path)[0] + u'.zip' if dl.download_file(sub.url, zip_path): is_extration_success = self._extract_sub_zip(zip_path, path) try: os.remove(zip_path) except OSError, e: pass if is_extration_success: return True return False
{'content_hash': '84aa65d068dcb175f8a757254e15ec25', 'timestamp': '', 'source': 'github', 'line_count': 108, 'max_line_length': 95, 'avg_line_length': 26.083333333333332, 'alnum_prop': 0.6364927227547036, 'repo_name': 'scorpiontahir02/easysub', 'id': 'acc7f31a571ba5eea9eeb42b8c9edd0e60de4582', 'size': '2817', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/easysub/subscene.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '42367'}]}
class SpreeAvatax::TaxComputer DEFAULT_DOC_TYPE = 'SalesOrder' DEFAULT_STATUS_FIELD = :avatax_response_at DEFAULT_TAX_AMOUNT = 0.0 class MissingTaxAmountError < StandardError; end attr_reader :order, :doc_type, :status_field def initialize(order, options = {}) @doc_type = options[:doc_type] || DEFAULT_DOC_TYPE @status_field = options[:status_field] || DEFAULT_STATUS_FIELD @order = order end def compute return unless order.avataxable? reset_tax_attributes(order) tax_response = Avalara.get_tax(invoice_for_order) logger.debug(tax_response) order.line_items.each do |line_item| tax_amount = tax_response.tax_lines.detect { |tl| tl.line_no == line_item.id.to_s }.try(:tax_calculated) raise MissingTaxAmountError if tax_amount.nil? line_item.update_column(:pre_tax_amount, line_item.discounted_amount) line_item.adjustments.tax.create!({ :adjustable => line_item, :amount => tax_amount, :order => @order, :label => Spree.t(:avatax_label), :included => false, # true for VAT :source => Spree::TaxRate.avatax_the_one_rate, :state => 'closed', # this tells spree not to automatically recalculate avatax tax adjustments }) Spree::Adjustable::AdjustmentsUpdater.new(line_item).update line_item.save! end Spree::OrderUpdater.new(order).update order[status_field] = Time.now order.save! rescue Avalara::ApiError, Avalara::TimeoutError, Avalara::Error => e handle_avalara_error(e) end ## # Need to clean out old taxes and update to prevent the 10 to 1 "Jordan" bug. def reset_tax_attributes(order) order.all_adjustments.tax.destroy_all order.line_items.each do |line_item| line_item.update_attributes!({ additional_tax_total: 0, adjustment_total: 0, pre_tax_amount: 0, included_tax_total: 0, }) Spree::Adjustable::AdjustmentsUpdater.new(line_item).update line_item.save! end order.update_attributes!({ additional_tax_total: 0, adjustment_total: 0, included_tax_total: 0, }) Spree::OrderUpdater.new(order).update order.save! end def invoice_for_order SpreeAvatax::Invoice.new(order, doc_type, logger).invoice end def handle_avalara_error(e) logger.error(e) Honeybadger.notify(e) if defined?(Honeybadger) order.update_column(status_field, nil) end def logger @logger ||= Logger.new("#{Rails.root}/log/avatax.log") end end
{'content_hash': '8816efb9c4d94f44a2cff4dc5e5bc2dc', 'timestamp': '', 'source': 'github', 'line_count': 90, 'max_line_length': 110, 'avg_line_length': 28.333333333333332, 'alnum_prop': 0.6588235294117647, 'repo_name': 'mitchellstoresweb/spree_avatax', 'id': 'e058052fea0af7fed367c6a9d6db6d734083d232', 'size': '2550', 'binary': False, 'copies': '1', 'ref': 'refs/heads/3-0-dev', 'path': 'app/models/spree_avatax/tax_computer.rb', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []}
.styleSans158.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 158.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 12pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 11.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 9.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 8.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 7.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans2.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 2.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 10.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 6.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans465.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 465.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans1.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 1.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans521.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 521.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans3.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 3.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans13.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 13.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans4.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 4.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans344.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 344.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans625.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 625.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans581.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 581.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans690.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 690.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans496.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 496.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans532.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 532.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans451.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 451.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans450.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 450.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans483.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 483.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans522.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 522.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans428.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 428.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans477.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 477.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans534.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 534.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans275.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 275.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans12.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 12.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans209.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 209.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans224.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 224.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans19.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 19.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans20.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 20.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans193.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 193.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans758.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 758.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans29.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 29.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans145.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 145.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans15.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 15.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans16.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 16.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans39.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 39.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans14.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 14.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans71.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 71.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans95.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 95.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans33.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 33.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans53.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 53.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans161.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 161.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans122.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 122.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans56.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 56.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans133.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 133.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans44.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 44.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans28.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 28.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans41.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 41.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans57.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 57.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans134.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 134.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans307.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 307.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans25.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 25.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans30.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 30.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans36.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 36.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans144.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 144.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans286.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 286.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans751.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 751.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans32.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 32.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans26.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 26.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans17.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 17.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans5.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 5.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans231.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 231.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans347.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 347.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans525.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 525.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans740.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 740.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans746.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 746.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans747.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 747.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans710.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 710.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans744.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 744.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans714.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 714.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans745.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 745.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans694.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 694.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans48.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 48.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans110.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 110.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans131.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 131.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans50.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 50.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans663.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 663.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans474.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 474.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans475.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 475.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans429.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 429.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans432.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 432.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans301.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 301.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans373.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 373.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans248.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 248.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans269.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 269.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans313.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 313.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans101.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 101.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans302.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 302.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans467.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 467.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans326.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 326.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans318.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 318.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans343.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 343.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans588.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 588.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans425.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 425.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans600.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 600.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans599.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 599.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans589.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 589.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans331.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 331.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans582.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 582.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans321.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 321.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans455.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 455.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans602.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 602.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans595.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 595.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans583.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 583.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans310.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 310.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans601.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 601.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans576.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 576.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans580.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 580.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans320.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 320.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans597.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 597.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans306.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 306.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans140.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 140.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans330.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 330.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans791.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 791.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans571.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 571.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans38.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 38.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans424.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 424.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans621.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 621.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans556.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 556.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; } .styleSans436.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> { font-family: Sans; font-size: 436.0pt; font-weight: normal; font-style: normal; text-align: 0; letter-spacing: 0pt; line-height: 0pt; }
{'content_hash': 'd35118b2ae2ac10e06a07833e86e9c3d', 'timestamp': '', 'source': 'github', 'line_count': 1373, 'max_line_length': 110, 'avg_line_length': 25.1442097596504, 'alnum_prop': 0.6778669292935144, 'repo_name': 'datamade/elpc_bakken', 'id': 'ea75239ac08e7235ac4638f6d21a2245b7f31ad1', 'size': '34525', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ocr_extracted/W28647_text/style.css', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '17512999'}, {'name': 'HTML', 'bytes': '421900941'}, {'name': 'Makefile', 'bytes': '991'}, {'name': 'Python', 'bytes': '7186'}]}
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; namespace LargeSort { class Program { static void Main(string[] args) { FileInfo tSortFile = new FileInfo("data.dat"); int tSortFileLines = 18765432; int tSortAtOnce = 700000; var tQuickSorter = new LargeQuickSorter(new DirectoryInfo("temp_quick"), tSortAtOnce); var tRadixSorter = new LargeRadixSorter(new DirectoryInfo("temp_raix"), tSortAtOnce); var tNopSorter = new NopLargeSorter(new DirectoryInfo("temp_nop"), tSortAtOnce); FileInfo tQuickSortedFile = new FileInfo("quick_sorted.dat"); FileInfo tRadixSortedFile = new FileInfo("radix_sorted.dat"); FileInfo tNopSortedFile = new FileInfo("nop_sorted.dat"); CreateFile(tSortFile, tSortFileLines); Console.WriteLine("radix sort"); Sort(tRadixSorter, tSortFile, tRadixSortedFile, 2); Console.WriteLine(); Console.WriteLine("quick sort"); Sort(tQuickSorter, tSortFile, tQuickSortedFile, 2); Console.WriteLine(); Console.WriteLine("nop sort"); Sort(tNopSorter, tSortFile, tNopSortedFile, 2); Console.WriteLine("owata"); Console.Read(); } private static void Sort(LargeSorter aSorter, FileInfo aSortFile, FileInfo aOutputFile, int aSortIndex) { using(var tReader = new StreamReader(aSortFile.OpenRead())) using (var tWriter = new StreamWriter(aOutputFile.OpenWrite())) { Console.WriteLine(DateTime.Now + "ソートを開始します。"); var tSorter = aSorter; tSorter.Sort(tReader, tWriter, aSortIndex); Console.WriteLine(DateTime.Now + "ソート完了。"); } } private static void CreateFile(FileInfo aFile, int aLineCount) { if (aFile.Exists) aFile.Delete(); Console.WriteLine(DateTime.Now + "ソート対象ファイルを生成します。"); Random tRnd = new Random(34456); using (var tWriter = new StreamWriter(aFile.OpenWrite())) { for (int i = 0; i < aLineCount; i++) { tWriter.WriteLine(CreateLine(tRnd)); } } Console.WriteLine(DateTime.Now + "生成完了 " + aLineCount + "行"); } private static char[] ALPHABET = new char[]{ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; private static string CreateRandomString(Random aRnd, int aLength){ StringBuilder tBuilder = new StringBuilder(); for (int i = 0; i < aLength; i++) { tBuilder.Append(ALPHABET[aRnd.Next(ALPHABET.Length)]); } return tBuilder.ToString(); } private static string CreateLine(Random aRnd) { StringBuilder tBuilder = new StringBuilder(); tBuilder.Append(CreateRandomString(aRnd, 10)); tBuilder.Append(','); tBuilder.Append(CreateRandomString(aRnd, 10)); tBuilder.Append(','); tBuilder.Append(CreateRandomString(aRnd, 50)); tBuilder.Append(','); tBuilder.Append(CreateRandomString(aRnd, 21)); tBuilder.Append(','); tBuilder.Append(CreateRandomString(aRnd, 15)); tBuilder.Append(','); tBuilder.Append(CreateRandomString(aRnd, 16)); return tBuilder.ToString(); } } }
{'content_hash': '5200bf2cfb0e636ba12ae398f6a93066', 'timestamp': '', 'source': 'github', 'line_count': 126, 'max_line_length': 111, 'avg_line_length': 32.76984126984127, 'alnum_prop': 0.5013320416565754, 'repo_name': 'seraphr/large-sort', 'id': '3578940c2a5a09153c71ce4bc0b34c41fcd87734', 'size': '4205', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'LargeSort/Program.cs', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'C#', 'bytes': '20417'}]}
void flash_init(void); void flash_test1(void); void flash_test_erase_chip(void); void flash_test_read_chip(void); void flash_test_write_chip(void); void flash_test_dump_flash_sectors(uint8_t count); uint8_t flash_read_manuf_dev_id(uint8_t* manu_id, uint8_t* dev_id); uint8_t flash_read_status_reg_1(uint8_t* stat1); uint8_t flash_read_status_reg_2(uint8_t* stat2); uint8_t flash_read_status_reg_3(uint8_t* stat3); uint8_t flash_write_enable(void); uint8_t flash_write_disable(void); // Can take about 40 secs uint8_t flash_chip_erase(void); uint8_t flash_wait_while_busy(void); uint8_t flash_read_data(uint32_t addr, uint8_t* buf, uint16_t len); uint8_t flash_sector_erase(uint32_t addr); // 0-256 bytes uint8_t flash_page_program(uint32_t addr, uint8_t* buf, uint16_t len); uint8_t flash_read_page_buffer(uint32_t addr); // page aligned. uint8_t flash_write_page_buffer(uint32_t addr); // page aligned. void flash_dump_write_page_buffer(void); extern uint8_t flash_page_read_buffer[FLASH_PAGE_SIZE]; extern uint8_t flash_page_write_buffer[FLASH_PAGE_SIZE]; #endif //FLASH_S25L_H
{'content_hash': '3126f045b36bd2165af3ed663c1bab41', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 70, 'avg_line_length': 34.0, 'alnum_prop': 0.7398897058823529, 'repo_name': 'sbaconbits/car_battery_logger', 'id': '93dea79db04a3695d805a5728a8d5c87af6745a5', 'size': '2827', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'code/flash_S25FL.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '103856'}, {'name': 'Game Maker Language', 'bytes': '46722'}, {'name': 'Groff', 'bytes': '200687'}, {'name': 'KiCad Layout', 'bytes': '271206'}, {'name': 'Makefile', 'bytes': '2529'}, {'name': 'Objective-C', 'bytes': '3023'}, {'name': 'Python', 'bytes': '3266'}]}
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:focusable="true" android:focusableInTouchMode="true" android:orientation="vertical" android:padding="5dp" tools:context="com.lizheblogs.domainsearch.main.once.SearchFragment"> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.design.widget.TextInputEditText android:id="@+id/domainACTV" android:layout_width="match_parent" android:layout_height="wrap_content" android:digits=".1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM" android:hint="@string/prompt_domain" android:imeOptions="actionSearch" android:inputType="textUri" android:selectAllOnFocus="true" android:singleLine="true" /> </android.support.design.widget.TextInputLayout> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp" android:text="@string/info_instruction" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/DomainName" /> <TextView android:id="@+id/DomainName" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/Registrar" /> <TextView android:id="@+id/Registrar" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/CreationDate" /> <TextView android:id="@+id/CreationDate" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/ExpirationDate" /> <TextView android:id="@+id/ExpirationDate" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/UpdatedDate" /> <TextView android:id="@+id/UpdatedDate" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/RegistrantName" /> <TextView android:id="@+id/RegistrantName" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/RegistrantCountry" /> <TextView android:id="@+id/RegistrantCountry" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/RegistrantPhone" /> <TextView android:id="@+id/RegistrantPhone" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/AdminName" /> <TextView android:id="@+id/AdminName" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/AdminPhone" /> <TextView android:id="@+id/AdminPhone" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/TechName" /> <TextView android:id="@+id/TechName" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/TechPhone" /> <TextView android:id="@+id/TechPhone" style="@style/TextStyle" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="5dp"> <TextView style="@style/TextStyle" android:text="@string/OriginalInfo" /> <TextView android:id="@+id/OriginalInfo" style="@style/TextStyle" android:gravity="left" /> </LinearLayout> </LinearLayout> </ScrollView> <LinearLayout android:id="@+id/ingPB" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#aaaaaaaa" android:gravity="center" android:orientation="vertical" android:visibility="gone"> <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> </RelativeLayout> </LinearLayout>
{'content_hash': '327f05210945bed8a920599993b4f45e', 'timestamp': '', 'source': 'github', 'line_count': 268, 'max_line_length': 92, 'avg_line_length': 35.72014925373134, 'alnum_prop': 0.4729969706466103, 'repo_name': 'pulque/DomainSearch', 'id': '9bd3bfd89f13a3ebc6ca87d85e4fa66aba073e71', 'size': '9573', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/res/layout/activity_info.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '110285'}]}
package android.support.v4.util; /** * CircularIntArray is a circular integer array data structure that provides O(1) random read, O(1) * prepend and O(1) append. The CircularIntArray automatically grows its capacity when number of * added integers is over its capacity. */ public final class CircularIntArray { private int[] mElements; private int mHead; private int mTail; private int mCapacityBitmask; /** * Create a CircularIntArray with default capacity. */ public CircularIntArray() { this(8); } /** * Create a CircularIntArray with capacity for at least minCapacity elements. * * @param minCapacity The minimum capacity required for the CircularIntArray. */ public CircularIntArray(int minCapacity) { if (minCapacity <= 0) { throw new IllegalArgumentException("capacity must be positive"); } int arrayCapacity = minCapacity; // If minCapacity isn't a power of 2, round up to the next highest power // of 2. if (Integer.bitCount(minCapacity) != 1) { arrayCapacity = 1 << (Integer.highestOneBit(minCapacity) + 1); } mCapacityBitmask = arrayCapacity - 1; mElements = new int[arrayCapacity]; } private void doubleCapacity() { int n = mElements.length; int r = n - mHead; int newCapacity = n << 1; if (newCapacity < 0) { throw new RuntimeException("Max array capacity exceeded"); } int[] a = new int[newCapacity]; System.arraycopy(mElements, mHead, a, 0, r); System.arraycopy(mElements, 0, a, r, mHead); mElements = a; mHead = 0; mTail = n; mCapacityBitmask = newCapacity - 1; } /** * Add an integer in front of the CircularIntArray. * * @param e Integer to add. */ public void addFirst(int e) { mHead = (mHead - 1) & mCapacityBitmask; mElements[mHead] = e; if (mHead == mTail) { doubleCapacity(); } } /** * Add an integer at end of the CircularIntArray. * * @param e Integer to add. */ public void addLast(int e) { mElements[mTail] = e; mTail = (mTail + 1) & mCapacityBitmask; if (mTail == mHead) { doubleCapacity(); } } /** * Remove first integer from front of the CircularIntArray and return it. * * @return The integer removed. * @throws ArrayIndexOutOfBoundsException if CircularIntArray is empty. */ public int popFirst() { if (mHead == mTail) throw new ArrayIndexOutOfBoundsException(); int result = mElements[mHead]; mHead = (mHead + 1) & mCapacityBitmask; return result; } /** * Remove last integer from end of the CircularIntArray and return it. * * @return The integer removed. * @throws ArrayIndexOutOfBoundsException if CircularIntArray is empty. */ public int popLast() { if (mHead == mTail) throw new ArrayIndexOutOfBoundsException(); int t = (mTail - 1) & mCapacityBitmask; int result = mElements[t]; mTail = t; return result; } /** * Remove all integers from the CircularIntArray. */ public void clear() { mTail = mHead; } /** * Remove multiple integers from front of the CircularIntArray, ignore when numOfElements * is less than or equals to 0. * * @param numOfElements Number of integers to remove. * @throws ArrayIndexOutOfBoundsException if numOfElements is larger than * {@link #size()} */ public void removeFromStart(int numOfElements) { if (numOfElements <= 0) { return; } if (numOfElements > size()) { throw new ArrayIndexOutOfBoundsException(); } mHead = (mHead + numOfElements) & mCapacityBitmask; } /** * Remove multiple elements from end of the CircularIntArray, ignore when numOfElements * is less than or equals to 0. * * @param numOfElements Number of integers to remove. * @throws ArrayIndexOutOfBoundsException if numOfElements is larger than * {@link #size()} */ public void removeFromEnd(int numOfElements) { if (numOfElements <= 0) { return; } if (numOfElements > size()) { throw new ArrayIndexOutOfBoundsException(); } mTail = (mTail - numOfElements) & mCapacityBitmask; } /** * Get first integer of the CircularIntArray. * * @return The first integer. * @throws {@link ArrayIndexOutOfBoundsException} if CircularIntArray is empty. */ public int getFirst() { if (mHead == mTail) throw new ArrayIndexOutOfBoundsException(); return mElements[mHead]; } /** * Get last integer of the CircularIntArray. * * @return The last integer. * @throws {@link ArrayIndexOutOfBoundsException} if CircularIntArray is empty. */ public int getLast() { if (mHead == mTail) throw new ArrayIndexOutOfBoundsException(); return mElements[(mTail - 1) & mCapacityBitmask]; } /** * Get nth (0 <= n <= size()-1) integer of the CircularIntArray. * * @param n The zero based element index in the CircularIntArray. * @return The nth integer. * @throws {@link ArrayIndexOutOfBoundsException} if n < 0 or n >= size(). */ public int get(int n) { if (n < 0 || n >= size()) throw new ArrayIndexOutOfBoundsException(); return mElements[(mHead + n) & mCapacityBitmask]; } /** * Get number of integers in the CircularIntArray. * * @return Number of integers in the CircularIntArray. */ public int size() { return (mTail - mHead) & mCapacityBitmask; } /** * Return true if size() is 0. * * @return true if size() is 0. */ public boolean isEmpty() { return mHead == mTail; } }
{'content_hash': '5de29a293dd62a1b2157c2aca1c5eb63', 'timestamp': '', 'source': 'github', 'line_count': 205, 'max_line_length': 99, 'avg_line_length': 30.053658536585367, 'alnum_prop': 0.5895146891738354, 'repo_name': 'BruceHurrican/studydemo', 'id': '455f830006b11942766705e178c880d6b7e0590c', 'size': '6769', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'libs_src/v4src/java/android/support/v4/util/CircularIntArray.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '9548'}, {'name': 'HTML', 'bytes': '28664'}, {'name': 'Java', 'bytes': '3976024'}, {'name': 'JavaScript', 'bytes': '199067'}]}