text
stringlengths
2
1.04M
meta
dict
// This file defines the contexts used during XLA compilation. #ifndef TENSORFLOW_COMPILER_TF2XLA_XLA_CONTEXT_H_ #define TENSORFLOW_COMPILER_TF2XLA_XLA_CONTEXT_H_ #include <vector> #include "tensorflow/compiler/tf2xla/xla_expression.h" #include "tensorflow/compiler/tf2xla/xla_helpers.h" #include "tensorflow/compiler/xla/client/xla_builder.h" #include "tensorflow/compiler/xla/client/xla_computation.h" #include "tensorflow/compiler/xla/status_macros.h" #include "tensorflow/compiler/xla/xla_data.pb.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/resource_mgr.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/platform/macros.h" namespace tensorflow { class XlaOpKernelContext; class XlaCompiler; // The XlaContext is the data structure that holds the state of an XLA // compilation, that is accessible from OpKernelContexts when compiling a // subgraph of Ops using XLA. class XlaContext : public ResourceBase { public: // Retrieves the XlaContext of the current compilation. static XlaContext& Get(const OpKernelContext* ctx); // Creates a new XlaContext. See the documentation on the class data fields // for descriptions of the arguments. XlaContext(XlaCompiler* compiler, xla::XlaBuilder* builder, const Graph* graph); // Virtual method defined by ResourceBase. string DebugString() const override; XlaCompiler* compiler() const { return compiler_; } const AbstractStackTrace* StackTraceForNodeName(const std::string& name) { const auto& it = stack_traces_.find(name); if (it != stack_traces_.end()) { return it->second.get(); } return nullptr; } // Returns the XlaBuilder that Ops use for compiling new expressions. xla::XlaBuilder* builder() { return builder_; } const std::vector<XlaExpression>& args() const { return args_; } void set_args(std::vector<XlaExpression> args); const std::vector<XlaExpression>& retvals() { return retvals_; } // Sets a return value. // Since we do not always know in advance how many return values there are, // grows the return values vector to size index+1 if it is smaller. void SetRetval(int index, const XlaExpression& expression); // Adds 'resource' to the set of resources owned by the context. XlaResource* AddResource(std::unique_ptr<XlaResource> resource); const std::vector<std::unique_ptr<XlaResource>>& resources() { return resources_; } // Get an XLA lambda to compute Max. This is cached in the // XlaContext since it may be used by multiple Ops. There is a // separate specialization of the computation for each DataType. const xla::XlaComputation* GetOrCreateMax(const DataType type); // Get an XLA lambda to compute Min. This is cached in the // XlaContext since it may be used by multiple Ops. There is a // separate specialization of the computation for each DataType. const xla::XlaComputation* GetOrCreateMin(const DataType type); // Get an XLA lambda to compute Add. This is cached in the // XlaContext since it may be used by multiple Ops. There is a // separate specialization of the computation for each DataType. const xla::XlaComputation* GetOrCreateAdd(const DataType type); // Get an XLA lambda to compute Mul. This is cached in the // XlaContext since it may be used by multiple Ops. There is a // separate specialization of the computation for each DataType. const xla::XlaComputation* GetOrCreateMul(const DataType type); // The name of the XlaContext resource during symbolic graph execution. static const char kXlaContextResourceName[]; Status RecordCollectiveReduceV2OpInfo(int group_key, int group_size) { if (!collective_reduce_info_) { collective_reduce_info_ = {group_key, group_size}; } else if (collective_reduce_info_->group_key != group_key || collective_reduce_info_->group_size != group_size) { return errors::InvalidArgument( "Only single configuration of CollectiveReduceV2Op is ", "supported in a given cluster. Recorded group_key=", collective_reduce_info_->group_key, " attempting to insert group_key=", group_key); } return Status::OK(); } const absl::optional<XlaCompilationResult::CollectiveReduceV2OpInfo>& GetCollectiveReduceV2OpInfo() { return collective_reduce_info_; } private: XlaCompiler* const compiler_; // The XlaBuilder used to construct the subgraph's compiled representation. xla::XlaBuilder* builder_; // Stack traces for the graph used for compilation. StackTracesMap stack_traces_; // Arguments to the Tensorflow graph, indexed by _Arg index. // Includes both compile-time constant arguments and runtime parameters. std::vector<XlaExpression> args_; // Return values of the Tensorflow graph, indexed by _Retval index. std::vector<XlaExpression> retvals_; // Holds ownership of resources. The resources are not ordered. std::vector<std::unique_ptr<XlaResource>> resources_; // Information about encountered CollectiveReduceV2OpInfo ops. We allow only a // single configuration per cluster. absl::optional<XlaCompilationResult::CollectiveReduceV2OpInfo> collective_reduce_info_; // Cache of prebuilt computations indexed by their type. using ComputationMap = std::map<DataType, xla::XlaComputation>; // Finds the value for the given type in out map if it already // exists or makes a new value with create function and keeps it the // map. The returned value != nullptr and is owned by the map. const xla::XlaComputation* LookupOrCreate( DataType type, ComputationMap* out, const std::function<xla::XlaComputation()>& create); // Cached computation to compute Max of two elements, specialized by type. ComputationMap max_func_; // Cached computation to compute Min of two elements, specialized by type. ComputationMap min_func_; // Cached computation to compute Sum of two elements, specialized by type. ComputationMap add_func_; // Cached computation to compute Mul of two elements, specialized by type. ComputationMap mul_func_; // Cached computation to compute Sigmoid of an element, specialized by type. ComputationMap sigmoid_func_; TF_DISALLOW_COPY_AND_ASSIGN(XlaContext); }; } // namespace tensorflow #endif // TENSORFLOW_COMPILER_TF2XLA_XLA_CONTEXT_H_
{ "content_hash": "030daf8c82bcb3facc5cfe02d6c13630", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 80, "avg_line_length": 37.94642857142857, "alnum_prop": 0.7374117647058823, "repo_name": "frreiss/tensorflow-fred", "id": "b22315a6105a5d6b906e013b1e71f43acb18f357", "size": "7043", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tensorflow/compiler/tf2xla/xla_context.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "6729" }, { "name": "Batchfile", "bytes": "49527" }, { "name": "C", "bytes": "871761" }, { "name": "C#", "bytes": "8562" }, { "name": "C++", "bytes": "79093233" }, { "name": "CMake", "bytes": "6500" }, { "name": "Dockerfile", "bytes": "110545" }, { "name": "Go", "bytes": "1852128" }, { "name": "HTML", "bytes": "4686483" }, { "name": "Java", "bytes": "961600" }, { "name": "Jupyter Notebook", "bytes": "549457" }, { "name": "LLVM", "bytes": "6536" }, { "name": "MLIR", "bytes": "1644156" }, { "name": "Makefile", "bytes": "62398" }, { "name": "Objective-C", "bytes": "116558" }, { "name": "Objective-C++", "bytes": "303063" }, { "name": "PHP", "bytes": "20523" }, { "name": "Pascal", "bytes": "3982" }, { "name": "Pawn", "bytes": "18876" }, { "name": "Perl", "bytes": "7536" }, { "name": "Python", "bytes": "40003007" }, { "name": "RobotFramework", "bytes": "891" }, { "name": "Roff", "bytes": "2472" }, { "name": "Ruby", "bytes": "7464" }, { "name": "Shell", "bytes": "681596" }, { "name": "Smarty", "bytes": "34740" }, { "name": "Swift", "bytes": "62814" }, { "name": "Vim Snippet", "bytes": "58" } ], "symlink_target": "" }
<?php namespace Saxulum\PhpDocGenerator; /** * @link http://www.phpdoc.org/docs/latest/references/phpdoc/tags/since.html */ class SinceRow extends AbstractRow { /** * @param string $version * @param string|null $description */ public function __construct($version, $description = null) { $this->addPart($version); $this->addPart($description); } /** * @return string */ public function getName() { return 'since'; } }
{ "content_hash": "639491fbd7d29ee0a1b5419fa3d047e2", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 76, "avg_line_length": 18.85185185185185, "alnum_prop": 0.5834970530451866, "repo_name": "saxulum/saxulum-phpdoc-generator", "id": "e3d18ce05e2f54d2c8299d7cc0a18eb73d4f5d12", "size": "509", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/SinceRow.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "37267" } ], "symlink_target": "" }
import React, { Component } from 'react' import { Button, Confirm } from 'shengnian-ui-react' class ConfirmExampleConfirm extends Component { state = { open: false } show = () => this.setState({ open: true }) handleConfirm = () => this.setState({ open: false }) handleCancel = () => this.setState({ open: false }) render() { return ( <div> <Button onClick={this.show}>Show</Button> <Confirm open={this.state.open} onCancel={this.handleCancel} onConfirm={this.handleConfirm} /> </div> ) } } export default ConfirmExampleConfirm
{ "content_hash": "9394fb14309faf29698bab1bfbcb3530", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 54, "avg_line_length": 24.68, "alnum_prop": 0.6029173419773096, "repo_name": "shengnian/shengnian-ui-react", "id": "5817bbd34f224eb0b5c730ae2d8ec67f6c545f52", "size": "617", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/app/Examples/addons/Confirm/Types/ConfirmExampleConfirm.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1233" }, { "name": "JavaScript", "bytes": "1168671" }, { "name": "TypeScript", "bytes": "116" } ], "symlink_target": "" }
using namespace std; namespace Wrench { class WidgetNode : public ModelNode { protected: function<void(WidgetNode*, Node*, const Vector2 &mousePos)> onClickEvent; //this, caller function<void(WidgetNode*, Node*, const Vector2 &mousePos)> onHoverEvent; //this, caller public: WidgetNode(Scene *nScene, const Vector3 &nPosition, const Vector3 &nOrientation, float nScale, Model *nModel); virtual void SetOnClick(function<void(WidgetNode*, Node*, const Vector2 &mousePos)> f); virtual void SetOnHover(function<void(WidgetNode*, Node*, const Vector2 &mousePos)> f); virtual void OnClick(Node *caller, const Vector2 &mousePos); virtual void OnHover(Node *caller, const Vector2 &mousePos); }; } #endif
{ "content_hash": "425c435f5256449172a74466c0d69bed", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 112, "avg_line_length": 32.72727272727273, "alnum_prop": 0.7472222222222222, "repo_name": "SoundAxis/Wrench.2014", "id": "1e1aeacca18618a7997fd0d6fe7125d3a12b6294", "size": "809", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Wrench.2014/WidgetNode.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "2323579" }, { "name": "C++", "bytes": "388377" }, { "name": "Objective-C", "bytes": "14936" } ], "symlink_target": "" }
title: aeg14 type: products image: /img/Screen Shot 2017-05-09 at 11.56.54 AM.png heading: g14 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": "9f1f9445d983619e1e8bb6ee1df8e18f", "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": "c94f24c14314b4c350d43b7b7b47ba156436ad1f", "size": "339", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "site/content/pages2/aeg14.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "94394" }, { "name": "HTML", "bytes": "18889" }, { "name": "JavaScript", "bytes": "10014" } ], "symlink_target": "" }
import { IBuffer, IBufferSet } from 'common/buffer/Types'; import { IAttributeData } from 'common/Types'; import { Buffer } from 'common/buffer/Buffer'; import { EventEmitter, IEvent } from 'common/EventEmitter'; import { IOptionsService, IBufferService } from 'common/services/Services'; import { Disposable } from 'common/Lifecycle'; /** * The BufferSet represents the set of two buffers used by xterm terminals (normal and alt) and * provides also utilities for working with them. */ export class BufferSet extends Disposable implements IBufferSet { private _normal!: Buffer; private _alt!: Buffer; private _activeBuffer!: Buffer; private readonly _onBufferActivate = this.register(new EventEmitter<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}>()); public readonly onBufferActivate = this._onBufferActivate.event; /** * Create a new BufferSet for the given terminal. */ constructor( private readonly _optionsService: IOptionsService, private readonly _bufferService: IBufferService ) { super(); this.reset(); this.register(this._optionsService.onSpecificOptionChange('scrollback', () => this.resize(this._bufferService.cols, this._bufferService.rows))); this.register(this._optionsService.onSpecificOptionChange('tabStopWidth', () => this.setupTabStops())); } public reset(): void { this._normal = new Buffer(true, this._optionsService, this._bufferService); this._normal.fillViewportRows(); // The alt buffer should never have scrollback. // See http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer this._alt = new Buffer(false, this._optionsService, this._bufferService); this._activeBuffer = this._normal; this._onBufferActivate.fire({ activeBuffer: this._normal, inactiveBuffer: this._alt }); this.setupTabStops(); } /** * Returns the alt Buffer of the BufferSet */ public get alt(): Buffer { return this._alt; } /** * Returns the currently active Buffer of the BufferSet */ public get active(): Buffer { return this._activeBuffer; } /** * Returns the normal Buffer of the BufferSet */ public get normal(): Buffer { return this._normal; } /** * Sets the normal Buffer of the BufferSet as its currently active Buffer */ public activateNormalBuffer(): void { if (this._activeBuffer === this._normal) { return; } this._normal.x = this._alt.x; this._normal.y = this._alt.y; // The alt buffer should always be cleared when we switch to the normal // buffer. This frees up memory since the alt buffer should always be new // when activated. this._alt.clearAllMarkers(); this._alt.clear(); this._activeBuffer = this._normal; this._onBufferActivate.fire({ activeBuffer: this._normal, inactiveBuffer: this._alt }); } /** * Sets the alt Buffer of the BufferSet as its currently active Buffer */ public activateAltBuffer(fillAttr?: IAttributeData): void { if (this._activeBuffer === this._alt) { return; } // Since the alt buffer is always cleared when the normal buffer is // activated, we want to fill it when switching to it. this._alt.fillViewportRows(fillAttr); this._alt.x = this._normal.x; this._alt.y = this._normal.y; this._activeBuffer = this._alt; this._onBufferActivate.fire({ activeBuffer: this._alt, inactiveBuffer: this._normal }); } /** * Resizes both normal and alt buffers, adjusting their data accordingly. * @param newCols The new number of columns. * @param newRows The new number of rows. */ public resize(newCols: number, newRows: number): void { this._normal.resize(newCols, newRows); this._alt.resize(newCols, newRows); this.setupTabStops(newCols); } /** * Setup the tab stops. * @param i The index to start setting up tab stops from. */ public setupTabStops(i?: number): void { this._normal.setupTabStops(i); this._alt.setupTabStops(i); } }
{ "content_hash": "bdb5cfbaeb27cad905005e883993532a", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 148, "avg_line_length": 31.045801526717558, "alnum_prop": 0.6796164248832063, "repo_name": "xtermjs/xterm.js", "id": "da902afffbc815b31a27282955bb4042b03be1f9", "size": "4155", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/common/buffer/BufferSet.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4632" }, { "name": "Dockerfile", "bytes": "804" }, { "name": "HTML", "bytes": "1631" }, { "name": "JavaScript", "bytes": "43841" }, { "name": "Procfile", "bytes": "38" }, { "name": "Python", "bytes": "2313" }, { "name": "Shell", "bytes": "1098" }, { "name": "TypeScript", "bytes": "2044766" } ], "symlink_target": "" }
<?php /** * @namespace */ namespace Zend\Validate\Barcode; /** * @see Zend_Validate_Barcode_AdapterAbstract */ require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Ean14 extends AdapterAbstract { /** * Allowed barcode lengths * @var integer */ protected $_length = 14; /** * Allowed barcode characters * @var string */ protected $_characters = '0123456789'; /** * Checksum function * @var string */ protected $_checksum = '_gtin'; }
{ "content_hash": "a41bd316b49f9f2e6151540810bed203", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 87, "avg_line_length": 19.102564102564102, "alnum_prop": 0.6174496644295302, "repo_name": "FbN/Zend-Framework-Namespaced-", "id": "120a4a0d02e39c8cc7fe865c87e33780129859a8", "size": "1489", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Zend/Validate/Barcode/Ean14.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "14877183" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "4c05efd681b2aa8fa56ab6e34f15f218", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "703fb64c4da7dc09943f08ccdfd217078449858b", "size": "176", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Rubus/Rubus obtusisepalus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>org.apache.maven.plugins.enforcer.test </groupId> <artifactId>snapshot-plugin-repositories</artifactId> <version>1.0-SNAPSHOT</version> </parent> <artifactId>snapshot-plugin-repositories-child</artifactId> </project>
{ "content_hash": "1ba1f4b682a25a10eccb4de6b1d6c1c5", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 204, "avg_line_length": 45.827586206896555, "alnum_prop": 0.7283671933784801, "repo_name": "kidaa/maven-enforcer", "id": "373776899bb109539374e6dd03cca14c39627d82", "size": "1329", "binary": false, "copies": "3", "ref": "refs/heads/trunk", "path": "enforcer-rules/src/test/resources/requireNoRepositories/snapshot-plugin-repositories/child/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1092" }, { "name": "Groovy", "bytes": "13723" }, { "name": "Java", "bytes": "529292" }, { "name": "Shell", "bytes": "1821" } ], "symlink_target": "" }
import sahara.plugins.mapr.versions.version_handler_factory as vhf import sahara.plugins.provisioning as p class MapRPlugin(p.ProvisioningPluginBase): title = 'MapR Hadoop Distribution' description = ('The MapR Distribution provides a full Hadoop stack that' ' includes the MapR File System (MapR-FS), MapReduce,' ' a complete Hadoop ecosystem, and the MapR Control System' ' user interface') hdfs_user = 'mapr' def _get_handler(self, hadoop_version): return vhf.VersionHandlerFactory.get().get_handler(hadoop_version) def get_title(self): return MapRPlugin.title def get_description(self): return MapRPlugin.description def get_hdfs_user(self): return MapRPlugin.hdfs_user def get_versions(self): return vhf.VersionHandlerFactory.get().get_versions() def get_node_processes(self, hadoop_version): return self._get_handler(hadoop_version).get_node_processes() def get_configs(self, hadoop_version): return self._get_handler(hadoop_version).get_configs() def configure_cluster(self, cluster): self._get_handler(cluster.hadoop_version).configure_cluster(cluster) def start_cluster(self, cluster): self._get_handler(cluster.hadoop_version).start_cluster(cluster) def validate(self, cluster): self._get_handler(cluster.hadoop_version).validate(cluster) def validate_scaling(self, cluster, existing, additional): v_handler = self._get_handler(cluster.hadoop_version) v_handler.validate_scaling(cluster, existing, additional) def scale_cluster(self, cluster, instances): v_handler = self._get_handler(cluster.hadoop_version) v_handler.scale_cluster(cluster, instances) def decommission_nodes(self, cluster, instances): v_handler = self._get_handler(cluster.hadoop_version) v_handler.decommission_nodes(cluster, instances) def get_oozie_server(self, cluster): v_handler = self._get_handler(cluster.hadoop_version) return v_handler.get_oozie_server(cluster) def get_name_node_uri(self, cluster): v_handler = self._get_handler(cluster.hadoop_version) return v_handler.get_name_node_uri(cluster) def get_oozie_server_uri(self, cluster): v_handler = self._get_handler(cluster.hadoop_version) return v_handler.get_oozie_server_uri(cluster) def get_resource_manager_uri(self, cluster): v_handler = self._get_handler(cluster.hadoop_version) return v_handler.get_resource_manager_uri(cluster) def get_edp_engine(self, cluster, job_type): v_handler = self._get_handler(cluster.hadoop_version) return v_handler.get_edp_engine(cluster, job_type)
{ "content_hash": "f75acd595f7d17843b0ed792d3625ab1", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 78, "avg_line_length": 38.31506849315068, "alnum_prop": 0.6875223453700393, "repo_name": "citrix-openstack-build/sahara", "id": "4f3216f2a5889f368cd7638be02dc67adcd29da0", "size": "3395", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "sahara/plugins/mapr/plugin.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "3609" }, { "name": "PigLatin", "bytes": "161" }, { "name": "Python", "bytes": "2064299" }, { "name": "Shell", "bytes": "16736" } ], "symlink_target": "" }
package com.github.anba.es6draft.ast; /** * Extension: Array and Generator Comprehension */ public abstract class ComprehensionQualifier extends AstNode { protected ComprehensionQualifier(long beginPosition, long endPosition) { super(beginPosition, endPosition); } }
{ "content_hash": "97ea1bb2ff24369e9647b2f24adf3548", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 76, "avg_line_length": 26.09090909090909, "alnum_prop": 0.7560975609756098, "repo_name": "jugglinmike/es6draft", "id": "e72aaebff900c099f114bc24ecd9af9f0309c6bb", "size": "461", "binary": false, "copies": "1", "ref": "refs/heads/personal", "path": "src/main/java/com/github/anba/es6draft/ast/ComprehensionQualifier.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "2024" }, { "name": "C++", "bytes": "74953" }, { "name": "Java", "bytes": "5202424" }, { "name": "JavaScript", "bytes": "1556378" }, { "name": "Shell", "bytes": "3484" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/home_background"> <Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorPrimary" android:elevation="3dp" android:logo="@mipmap/ic_logo" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <TextView style="@style/Base.TextAppearance.AppCompat.Title" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingEnd="16dp" android:paddingStart="16dp" android:text="@string/main_title" /> </Toolbar> <android.support.v4.view.ViewPager android:id="@+id/viewPager" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@+id/bottom_navigation" android:layout_below="@id/toolbar" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> <android.support.design.widget.BottomNavigationView android:id="@+id/bottom_navigation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" app:itemBackground="@color/colorPrimary" app:itemIconTint="@color/white" app:itemTextColor="@color/white" app:menu="@menu/bottom_navigation_main_menu" /> </RelativeLayout>
{ "content_hash": "e2aac86ed749364aeeb2cefc48d37f56", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 74, "avg_line_length": 38.333333333333336, "alnum_prop": 0.6585507246376812, "repo_name": "ivanTrogrlic/LeagueStats", "id": "46fd70a2f5571ddbb02a78f756c9c0c0a5d5f61a", "size": "1725", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/main_screen.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1717" }, { "name": "Kotlin", "bytes": "46552" } ], "symlink_target": "" }
<!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_45) on Fri Jan 31 11:37:38 CET 2014 --> <title>com.jogamp.opengl.math.geom (JOGL, NativeWindow and NEWT APIs)</title> <meta name="date" content="2014-01-31"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <h1 class="bar"><a href="../../../../../com/jogamp/opengl/math/geom/package-summary.html" target="classFrame">com.jogamp.opengl.math.geom</a></h1> <div class="indexContainer"> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="AABBox.html" title="class in com.jogamp.opengl.math.geom" target="classFrame">AABBox</a></li> <li><a href="Frustum.html" title="class in com.jogamp.opengl.math.geom" target="classFrame">Frustum</a></li> <li><a href="Frustum.Plane.html" title="class in com.jogamp.opengl.math.geom" target="classFrame">Frustum.Plane</a></li> </ul> <h2 title="Enums">Enums</h2> <ul title="Enums"> <li><a href="Frustum.Location.html" title="enum in com.jogamp.opengl.math.geom" target="classFrame">Frustum.Location</a></li> </ul> </div> </body> </html>
{ "content_hash": "49ebc75e26cde04bd5349a8ee8ac860f", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 146, "avg_line_length": 49, "alnum_prop": 0.683265306122449, "repo_name": "domiworks/TDA-Landscape-Generator", "id": "ca78d4f232123a2517857787d068b856c6ffa47f", "size": "1225", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jogl-2.0/javadoc/jogl/javadoc/com/jogamp/opengl/math/geom/package-frame.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "564574" } ], "symlink_target": "" }
import { OAuth2Client, JWT, Compute, UserRefreshClient, } from 'google-auth-library'; import { GoogleConfigurable, createAPIRequest, MethodOptions, GlobalOptions, BodyResponseCallback, APIRequestContext, } from 'googleapis-common'; import {GaxiosPromise} from 'gaxios'; // tslint:disable: no-any // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format // tslint:disable: no-namespace export namespace admin_reports_v1 { export interface Options extends GlobalOptions { version: 'reports_v1'; } interface StandardParameters { /** * Data format for the response. */ alt?: string; /** * Selector specifying which fields to include in a partial response. */ fields?: string; /** * API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ key?: string; /** * OAuth 2.0 token for the current user. */ oauth_token?: string; /** * Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** * An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */ quotaUser?: string; /** * Deprecated. Please use quotaUser instead. */ userIp?: string; } /** * Admin Reports API * * Fetches reports for the administrators of G Suite customers about the usage, collaboration, security, and risk for their users. * * @example * const {google} = require('googleapis'); * const admin = google.admin('reports_v1'); * * @namespace admin * @type {Function} * @version reports_v1 * @variation reports_v1 * @param {object=} options Options for Admin */ export class Admin { context: APIRequestContext; activities: Resource$Activities; channels: Resource$Channels; customerUsageReports: Resource$Customerusagereports; entityUsageReports: Resource$Entityusagereports; userUsageReport: Resource$Userusagereport; constructor(options: GlobalOptions, google?: GoogleConfigurable) { this.context = { _options: options || {}, google, }; this.activities = new Resource$Activities(this.context); this.channels = new Resource$Channels(this.context); this.customerUsageReports = new Resource$Customerusagereports( this.context ); this.entityUsageReports = new Resource$Entityusagereports(this.context); this.userUsageReport = new Resource$Userusagereport(this.context); } } /** * JSON template for a collection of activites. */ export interface Schema$Activities { /** * ETag of the resource. */ etag?: string | null; /** * Each record in read response. */ items?: Schema$Activity[]; /** * Kind of list response this is. */ kind?: string | null; /** * Token for retrieving the next page */ nextPageToken?: string | null; } /** * JSON template for the activity resource. */ export interface Schema$Activity { /** * User doing the action. */ actor?: { callerType?: string; email?: string; key?: string; profileId?: string; } | null; /** * ETag of the entry. */ etag?: string | null; /** * Activity events. */ events?: Array<{ name?: string; parameters?: Array<{ boolValue?: boolean; intValue?: string; messageValue?: {parameter?: Schema$NestedParameter[]}; multiIntValue?: string[]; multiMessageValue?: Array<{parameter?: Schema$NestedParameter[]}>; multiValue?: string[]; name?: string; value?: string; }>; type?: string; }> | null; /** * Unique identifier for each activity record. */ id?: { applicationName?: string; customerId?: string; time?: string; uniqueQualifier?: string; } | null; /** * IP Address of the user doing the action. */ ipAddress?: string | null; /** * Kind of resource this is. */ kind?: string | null; /** * Domain of source customer. */ ownerDomain?: string | null; } /** * An notification channel used to watch for resource changes. */ export interface Schema$Channel { /** * The address where notifications are delivered for this channel. */ address?: string | null; /** * Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. */ expiration?: string | null; /** * A UUID or similar unique string that identifies this channel. */ id?: string | null; /** * Identifies this as a notification channel used to watch for changes to a resource, which is &quot;api#channel&quot;. */ kind?: string | null; /** * Additional parameters controlling delivery channel behavior. Optional. */ params?: {[key: string]: string} | null; /** * A Boolean value to indicate whether payload is wanted. Optional. */ payload?: boolean | null; /** * An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. */ resourceId?: string | null; /** * A version-specific identifier for the watched resource. */ resourceUri?: string | null; /** * An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. */ token?: string | null; /** * The type of delivery mechanism used for this channel. */ type?: string | null; } /** * JSON template for a parameter used in various reports. */ export interface Schema$NestedParameter { /** * Boolean value of the parameter. */ boolValue?: boolean | null; /** * Integral value of the parameter. */ intValue?: string | null; /** * Multiple boolean values of the parameter. */ multiBoolValue?: boolean[] | null; /** * Multiple integral values of the parameter. */ multiIntValue?: string[] | null; /** * Multiple string values of the parameter. */ multiValue?: string[] | null; /** * The name of the parameter. */ name?: string | null; /** * String value of the parameter. */ value?: string | null; } /** * JSON template for a usage report. */ export interface Schema$UsageReport { /** * The date to which the record belongs. */ date?: string | null; /** * Information about the type of the item. */ entity?: { customerId?: string; entityId?: string; profileId?: string; type?: string; userEmail?: string; } | null; /** * ETag of the resource. */ etag?: string | null; /** * The kind of object. */ kind?: string | null; /** * Parameter value pairs for various applications. */ parameters?: Array<{ boolValue?: boolean; datetimeValue?: string; intValue?: string; msgValue?: Array<{[key: string]: any}>; name?: string; stringValue?: string; }> | null; } /** * JSON template for a collection of usage reports. */ export interface Schema$UsageReports { /** * ETag of the resource. */ etag?: string | null; /** * The kind of object. */ kind?: string | null; /** * Token for retrieving the next page */ nextPageToken?: string | null; /** * Various application parameter records. */ usageReports?: Schema$UsageReport[]; /** * Warnings if any. */ warnings?: Array<{ code?: string; data?: Array<{key?: string; value?: string}>; message?: string; }> | null; } export class Resource$Activities { context: APIRequestContext; constructor(context: APIRequestContext) { this.context = context; } /** * reports.activities.list * @desc Retrieves a list of activities for a specific customer and application. * @alias reports.activities.list * @memberOf! () * * @param {object} params Parameters for request * @param {string=} params.actorIpAddress IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. * @param {string} params.applicationName Application name for which the events are to be retrieved. * @param {string=} params.customerId Represents the customer for which the data is to be fetched. * @param {string=} params.endTime Return events which occurred at or before this time. * @param {string=} params.eventName Name of the event being queried. * @param {string=} params.filters Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... * @param {integer=} params.maxResults Number of activity records to be shown in each page. * @param {string=} params.orgUnitID the organizational unit's(OU) ID to filter activities from users belonging to a specific OU or one of its sub-OU(s) * @param {string=} params.pageToken Token to specify next page. * @param {string=} params.startTime Return events which occurred at or after this time. * @param {string} params.userKey Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ list( params?: Params$Resource$Activities$List, options?: MethodOptions ): GaxiosPromise<Schema$Activities>; list( params: Params$Resource$Activities$List, options: MethodOptions | BodyResponseCallback<Schema$Activities>, callback: BodyResponseCallback<Schema$Activities> ): void; list( params: Params$Resource$Activities$List, callback: BodyResponseCallback<Schema$Activities> ): void; list(callback: BodyResponseCallback<Schema$Activities>): void; list( paramsOrCallback?: | Params$Resource$Activities$List | BodyResponseCallback<Schema$Activities>, optionsOrCallback?: | MethodOptions | BodyResponseCallback<Schema$Activities>, callback?: BodyResponseCallback<Schema$Activities> ): void | GaxiosPromise<Schema$Activities> { let params = (paramsOrCallback || {}) as Params$Resource$Activities$List; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; params = {} as Params$Resource$Activities$List; options = {}; } if (typeof optionsOrCallback === 'function') { callback = optionsOrCallback; options = {}; } const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: ( rootUrl + '/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}' ).replace(/([^:]\/)\/+/g, '$1'), method: 'GET', }, options ), params, requiredParams: ['userKey', 'applicationName'], pathParams: ['applicationName', 'userKey'], context: this.context, }; if (callback) { createAPIRequest<Schema$Activities>(parameters, callback); } else { return createAPIRequest<Schema$Activities>(parameters); } } /** * reports.activities.watch * @desc Push changes to activities * @alias reports.activities.watch * @memberOf! () * * @param {object} params Parameters for request * @param {string=} params.actorIpAddress IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. * @param {string} params.applicationName Application name for which the events are to be retrieved. * @param {string=} params.customerId Represents the customer for which the data is to be fetched. * @param {string=} params.endTime Return events which occurred at or before this time. * @param {string=} params.eventName Name of the event being queried. * @param {string=} params.filters Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... * @param {integer=} params.maxResults Number of activity records to be shown in each page. * @param {string=} params.orgUnitID the organizational unit's(OU) ID to filter activities from users belonging to a specific OU or one of its sub-OU(s) * @param {string=} params.pageToken Token to specify next page. * @param {string=} params.startTime Return events which occurred at or after this time. * @param {string} params.userKey Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. * @param {().Channel} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ watch( params?: Params$Resource$Activities$Watch, options?: MethodOptions ): GaxiosPromise<Schema$Channel>; watch( params: Params$Resource$Activities$Watch, options: MethodOptions | BodyResponseCallback<Schema$Channel>, callback: BodyResponseCallback<Schema$Channel> ): void; watch( params: Params$Resource$Activities$Watch, callback: BodyResponseCallback<Schema$Channel> ): void; watch(callback: BodyResponseCallback<Schema$Channel>): void; watch( paramsOrCallback?: | Params$Resource$Activities$Watch | BodyResponseCallback<Schema$Channel>, optionsOrCallback?: MethodOptions | BodyResponseCallback<Schema$Channel>, callback?: BodyResponseCallback<Schema$Channel> ): void | GaxiosPromise<Schema$Channel> { let params = (paramsOrCallback || {}) as Params$Resource$Activities$Watch; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; params = {} as Params$Resource$Activities$Watch; options = {}; } if (typeof optionsOrCallback === 'function') { callback = optionsOrCallback; options = {}; } const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: ( rootUrl + '/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}/watch' ).replace(/([^:]\/)\/+/g, '$1'), method: 'POST', }, options ), params, requiredParams: ['userKey', 'applicationName'], pathParams: ['applicationName', 'userKey'], context: this.context, }; if (callback) { createAPIRequest<Schema$Channel>(parameters, callback); } else { return createAPIRequest<Schema$Channel>(parameters); } } } export interface Params$Resource$Activities$List extends StandardParameters { /** * Auth client or API Key for the request */ auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient; /** * IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. */ actorIpAddress?: string; /** * Application name for which the events are to be retrieved. */ applicationName?: string; /** * Represents the customer for which the data is to be fetched. */ customerId?: string; /** * Return events which occurred at or before this time. */ endTime?: string; /** * Name of the event being queried. */ eventName?: string; /** * Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... */ filters?: string; /** * Number of activity records to be shown in each page. */ maxResults?: number; /** * the organizational unit's(OU) ID to filter activities from users belonging to a specific OU or one of its sub-OU(s) */ orgUnitID?: string; /** * Token to specify next page. */ pageToken?: string; /** * Return events which occurred at or after this time. */ startTime?: string; /** * Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. */ userKey?: string; } export interface Params$Resource$Activities$Watch extends StandardParameters { /** * Auth client or API Key for the request */ auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient; /** * IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. */ actorIpAddress?: string; /** * Application name for which the events are to be retrieved. */ applicationName?: string; /** * Represents the customer for which the data is to be fetched. */ customerId?: string; /** * Return events which occurred at or before this time. */ endTime?: string; /** * Name of the event being queried. */ eventName?: string; /** * Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... */ filters?: string; /** * Number of activity records to be shown in each page. */ maxResults?: number; /** * the organizational unit's(OU) ID to filter activities from users belonging to a specific OU or one of its sub-OU(s) */ orgUnitID?: string; /** * Token to specify next page. */ pageToken?: string; /** * Return events which occurred at or after this time. */ startTime?: string; /** * Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. */ userKey?: string; /** * Request body metadata */ requestBody?: Schema$Channel; } export class Resource$Channels { context: APIRequestContext; constructor(context: APIRequestContext) { this.context = context; } /** * admin.channels.stop * @desc Stop watching resources through this channel * @alias admin.channels.stop * @memberOf! () * * @param {object} params Parameters for request * @param {().Channel} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ stop( params?: Params$Resource$Channels$Stop, options?: MethodOptions ): GaxiosPromise<void>; stop( params: Params$Resource$Channels$Stop, options: MethodOptions | BodyResponseCallback<void>, callback: BodyResponseCallback<void> ): void; stop( params: Params$Resource$Channels$Stop, callback: BodyResponseCallback<void> ): void; stop(callback: BodyResponseCallback<void>): void; stop( paramsOrCallback?: | Params$Resource$Channels$Stop | BodyResponseCallback<void>, optionsOrCallback?: MethodOptions | BodyResponseCallback<void>, callback?: BodyResponseCallback<void> ): void | GaxiosPromise<void> { let params = (paramsOrCallback || {}) as Params$Resource$Channels$Stop; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; params = {} as Params$Resource$Channels$Stop; options = {}; } if (typeof optionsOrCallback === 'function') { callback = optionsOrCallback; options = {}; } const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: ( rootUrl + '/admin/reports/v1/admin/reports_v1/channels/stop' ).replace(/([^:]\/)\/+/g, '$1'), method: 'POST', }, options ), params, requiredParams: [], pathParams: [], context: this.context, }; if (callback) { createAPIRequest<void>(parameters, callback); } else { return createAPIRequest<void>(parameters); } } } export interface Params$Resource$Channels$Stop extends StandardParameters { /** * Auth client or API Key for the request */ auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient; /** * Request body metadata */ requestBody?: Schema$Channel; } export class Resource$Customerusagereports { context: APIRequestContext; constructor(context: APIRequestContext) { this.context = context; } /** * reports.customerUsageReports.get * @desc Retrieves a report which is a collection of properties / statistics for a specific customer. * @alias reports.customerUsageReports.get * @memberOf! () * * @param {object} params Parameters for request * @param {string=} params.customerId Represents the customer for which the data is to be fetched. * @param {string} params.date Represents the date in yyyy-mm-dd format for which the data is to be fetched. * @param {string=} params.pageToken Token to specify next page. * @param {string=} params.parameters Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ get( params?: Params$Resource$Customerusagereports$Get, options?: MethodOptions ): GaxiosPromise<Schema$UsageReports>; get( params: Params$Resource$Customerusagereports$Get, options: MethodOptions | BodyResponseCallback<Schema$UsageReports>, callback: BodyResponseCallback<Schema$UsageReports> ): void; get( params: Params$Resource$Customerusagereports$Get, callback: BodyResponseCallback<Schema$UsageReports> ): void; get(callback: BodyResponseCallback<Schema$UsageReports>): void; get( paramsOrCallback?: | Params$Resource$Customerusagereports$Get | BodyResponseCallback<Schema$UsageReports>, optionsOrCallback?: | MethodOptions | BodyResponseCallback<Schema$UsageReports>, callback?: BodyResponseCallback<Schema$UsageReports> ): void | GaxiosPromise<Schema$UsageReports> { let params = (paramsOrCallback || {}) as Params$Resource$Customerusagereports$Get; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; params = {} as Params$Resource$Customerusagereports$Get; options = {}; } if (typeof optionsOrCallback === 'function') { callback = optionsOrCallback; options = {}; } const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: (rootUrl + '/admin/reports/v1/usage/dates/{date}').replace( /([^:]\/)\/+/g, '$1' ), method: 'GET', }, options ), params, requiredParams: ['date'], pathParams: ['date'], context: this.context, }; if (callback) { createAPIRequest<Schema$UsageReports>(parameters, callback); } else { return createAPIRequest<Schema$UsageReports>(parameters); } } } export interface Params$Resource$Customerusagereports$Get extends StandardParameters { /** * Auth client or API Key for the request */ auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient; /** * Represents the customer for which the data is to be fetched. */ customerId?: string; /** * Represents the date in yyyy-mm-dd format for which the data is to be fetched. */ date?: string; /** * Token to specify next page. */ pageToken?: string; /** * Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. */ parameters?: string; } export class Resource$Entityusagereports { context: APIRequestContext; constructor(context: APIRequestContext) { this.context = context; } /** * reports.entityUsageReports.get * @desc Retrieves a report which is a collection of properties / statistics for a set of objects. * @alias reports.entityUsageReports.get * @memberOf! () * * @param {object} params Parameters for request * @param {string=} params.customerId Represents the customer for which the data is to be fetched. * @param {string} params.date Represents the date in yyyy-mm-dd format for which the data is to be fetched. * @param {string} params.entityKey Represents the key of object for which the data should be filtered. * @param {string} params.entityType Type of object. Should be one of - gplus_communities. * @param {string=} params.filters Represents the set of filters including parameter operator value. * @param {integer=} params.maxResults Maximum number of results to return. Maximum allowed is 1000 * @param {string=} params.pageToken Token to specify next page. * @param {string=} params.parameters Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ get( params?: Params$Resource$Entityusagereports$Get, options?: MethodOptions ): GaxiosPromise<Schema$UsageReports>; get( params: Params$Resource$Entityusagereports$Get, options: MethodOptions | BodyResponseCallback<Schema$UsageReports>, callback: BodyResponseCallback<Schema$UsageReports> ): void; get( params: Params$Resource$Entityusagereports$Get, callback: BodyResponseCallback<Schema$UsageReports> ): void; get(callback: BodyResponseCallback<Schema$UsageReports>): void; get( paramsOrCallback?: | Params$Resource$Entityusagereports$Get | BodyResponseCallback<Schema$UsageReports>, optionsOrCallback?: | MethodOptions | BodyResponseCallback<Schema$UsageReports>, callback?: BodyResponseCallback<Schema$UsageReports> ): void | GaxiosPromise<Schema$UsageReports> { let params = (paramsOrCallback || {}) as Params$Resource$Entityusagereports$Get; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; params = {} as Params$Resource$Entityusagereports$Get; options = {}; } if (typeof optionsOrCallback === 'function') { callback = optionsOrCallback; options = {}; } const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: ( rootUrl + '/admin/reports/v1/usage/{entityType}/{entityKey}/dates/{date}' ).replace(/([^:]\/)\/+/g, '$1'), method: 'GET', }, options ), params, requiredParams: ['entityType', 'entityKey', 'date'], pathParams: ['date', 'entityKey', 'entityType'], context: this.context, }; if (callback) { createAPIRequest<Schema$UsageReports>(parameters, callback); } else { return createAPIRequest<Schema$UsageReports>(parameters); } } } export interface Params$Resource$Entityusagereports$Get extends StandardParameters { /** * Auth client or API Key for the request */ auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient; /** * Represents the customer for which the data is to be fetched. */ customerId?: string; /** * Represents the date in yyyy-mm-dd format for which the data is to be fetched. */ date?: string; /** * Represents the key of object for which the data should be filtered. */ entityKey?: string; /** * Type of object. Should be one of - gplus_communities. */ entityType?: string; /** * Represents the set of filters including parameter operator value. */ filters?: string; /** * Maximum number of results to return. Maximum allowed is 1000 */ maxResults?: number; /** * Token to specify next page. */ pageToken?: string; /** * Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. */ parameters?: string; } export class Resource$Userusagereport { context: APIRequestContext; constructor(context: APIRequestContext) { this.context = context; } /** * reports.userUsageReport.get * @desc Retrieves a report which is a collection of properties / statistics for a set of users. * @alias reports.userUsageReport.get * @memberOf! () * * @param {object} params Parameters for request * @param {string=} params.customerId Represents the customer for which the data is to be fetched. * @param {string} params.date Represents the date in yyyy-mm-dd format for which the data is to be fetched. * @param {string=} params.filters Represents the set of filters including parameter operator value. * @param {integer=} params.maxResults Maximum number of results to return. Maximum allowed is 1000 * @param {string=} params.orgUnitID the organizational unit's ID to filter usage parameters from users belonging to a specific OU or one of its sub-OU(s). * @param {string=} params.pageToken Token to specify next page. * @param {string=} params.parameters Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. * @param {string} params.userKey Represents the profile id or the user email for which the data should be filtered. * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ get( params?: Params$Resource$Userusagereport$Get, options?: MethodOptions ): GaxiosPromise<Schema$UsageReports>; get( params: Params$Resource$Userusagereport$Get, options: MethodOptions | BodyResponseCallback<Schema$UsageReports>, callback: BodyResponseCallback<Schema$UsageReports> ): void; get( params: Params$Resource$Userusagereport$Get, callback: BodyResponseCallback<Schema$UsageReports> ): void; get(callback: BodyResponseCallback<Schema$UsageReports>): void; get( paramsOrCallback?: | Params$Resource$Userusagereport$Get | BodyResponseCallback<Schema$UsageReports>, optionsOrCallback?: | MethodOptions | BodyResponseCallback<Schema$UsageReports>, callback?: BodyResponseCallback<Schema$UsageReports> ): void | GaxiosPromise<Schema$UsageReports> { let params = (paramsOrCallback || {}) as Params$Resource$Userusagereport$Get; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; params = {} as Params$Resource$Userusagereport$Get; options = {}; } if (typeof optionsOrCallback === 'function') { callback = optionsOrCallback; options = {}; } const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: ( rootUrl + '/admin/reports/v1/usage/users/{userKey}/dates/{date}' ).replace(/([^:]\/)\/+/g, '$1'), method: 'GET', }, options ), params, requiredParams: ['userKey', 'date'], pathParams: ['date', 'userKey'], context: this.context, }; if (callback) { createAPIRequest<Schema$UsageReports>(parameters, callback); } else { return createAPIRequest<Schema$UsageReports>(parameters); } } } export interface Params$Resource$Userusagereport$Get extends StandardParameters { /** * Auth client or API Key for the request */ auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient; /** * Represents the customer for which the data is to be fetched. */ customerId?: string; /** * Represents the date in yyyy-mm-dd format for which the data is to be fetched. */ date?: string; /** * Represents the set of filters including parameter operator value. */ filters?: string; /** * Maximum number of results to return. Maximum allowed is 1000 */ maxResults?: number; /** * the organizational unit's ID to filter usage parameters from users belonging to a specific OU or one of its sub-OU(s). */ orgUnitID?: string; /** * Token to specify next page. */ pageToken?: string; /** * Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. */ parameters?: string; /** * Represents the profile id or the user email for which the data should be filtered. */ userKey?: string; } }
{ "content_hash": "68ca7570a56820425c904d547fe1f611", "timestamp": "", "source": "github", "line_count": 1057, "max_line_length": 199, "avg_line_length": 33.253547776726585, "alnum_prop": 0.6317960681669464, "repo_name": "stems/google-api-nodejs-client", "id": "b5b6a58f19ffb65b5bc06b13d0d2145e29296f6f", "size": "35744", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/apis/admin/reports_v1.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1372" }, { "name": "HTML", "bytes": "18895" }, { "name": "JavaScript", "bytes": "3688209" }, { "name": "Python", "bytes": "1363" }, { "name": "Shell", "bytes": "9619" }, { "name": "TypeScript", "bytes": "44328664" } ], "symlink_target": "" }
using FoxySharp.Api; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.PlatformAbstractions; using System; namespace FoxySharp.Samples.Client { public class Program { public static void Main(string[] args) { // Load config var configBuilder = new ConfigurationBuilder() .SetBasePath(PlatformServices.Default.Application.ApplicationBasePath) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); var config = configBuilder.Build(); var foxyService = new FoxyCartClient( config.GetSection("FoxyCart")["ApiEndpoint"], config.GetSection("FoxyCart")["ClientId"], config.GetSection("FoxyCart")["ClientSecret"], config.GetSection("FoxyCart")["RefreshToken"]); var customers = foxyService.GetCustomers(); foreach (var customer in customers) { Console.WriteLine($"{customer.FirstName} {customer.LastName}"); } //var customer = foxyService.GetCustomer(customers.First().Id); //customer.DefaultBillingAddress.FirstName = customer.DefaultShippingAddress.FirstName = customer.FirstName; //customer.DefaultBillingAddress.LastName = customer.DefaultShippingAddress.LastName = customer.LastName; //foxyService.UpdateCustomer(customer); //var newCustomer = new FoxyCustomer() //{ // FirstName = "John", // LastName = "Doe", // Email = "john@doe.com", //}; //var created = foxyService.CreateCustomer(newCustomer); } } }
{ "content_hash": "487e5834b9bcc641ed74681720a31466", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 120, "avg_line_length": 35.40816326530612, "alnum_prop": 0.6040345821325649, "repo_name": "berhir/FoxySharp", "id": "908acede338154e6b1a3507b45f967e07bfd9418", "size": "1737", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/FoxySharp.Samples.Client/Program.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "63394" } ], "symlink_target": "" }
package com.amazonaws.services.elastictranscoder.model.transform; import java.util.Map; import java.util.Map.Entry; import com.amazonaws.services.elastictranscoder.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * CreatePresetResult JSON Unmarshaller */ public class CreatePresetResultJsonUnmarshaller implements Unmarshaller<CreatePresetResult, JsonUnmarshallerContext> { public CreatePresetResult unmarshall(JsonUnmarshallerContext context) throws Exception { CreatePresetResult createPresetResult = new CreatePresetResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) return null; while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Preset", targetDepth)) { context.nextToken(); createPresetResult.setPreset(PresetJsonUnmarshaller .getInstance().unmarshall(context)); } if (context.testExpression("Warning", targetDepth)) { context.nextToken(); createPresetResult.setWarning(StringJsonUnmarshaller .getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals( currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return createPresetResult; } private static CreatePresetResultJsonUnmarshaller instance; public static CreatePresetResultJsonUnmarshaller getInstance() { if (instance == null) instance = new CreatePresetResultJsonUnmarshaller(); return instance; } }
{ "content_hash": "01676aadcdff58263899774ca1502a17", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 73, "avg_line_length": 35.309859154929576, "alnum_prop": 0.6102911846828879, "repo_name": "trasa/aws-sdk-java", "id": "812aa01c09728a3baddee63c72c48710642fb929", "size": "3091", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/model/transform/CreatePresetResultJsonUnmarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "100011199" }, { "name": "Scilab", "bytes": "2354" } ], "symlink_target": "" }
import * as React from "react"; import { TodoEntry } from "../TodoEntry"; import { TodoFooter } from "../TodoFooter"; import { TodoOverview } from "../TodoOverview"; export class TodoApp extends React.Component { render() { return ( <div> <header className="header"> <h1>todos</h1> <TodoEntry /> </header> <TodoOverview /> <TodoFooter /> </div> ); } }
{ "content_hash": "596e509f68489ae820f195a57a328278", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 47, "avg_line_length": 19.636363636363637, "alnum_prop": 0.5509259259259259, "repo_name": "tdreyno/satelite", "id": "d0df2cba31c9a4cedc4b8024d20cf7ced8b367f3", "size": "432", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "demo/todomvc/src/components/TodoApp/TodoApp.tsx", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "491" }, { "name": "TypeScript", "bytes": "228279" } ], "symlink_target": "" }
namespace sync_file_system { namespace drive_backend { // This class wraps a part of RemoteChangeProcessor class to support weak // pointer. Each method wraps corresponding name method of // RemoteChangeProcessor. See comments in remote_change_processor.h // for details. class RemoteChangeProcessorWrapper : public base::SupportsWeakPtr<RemoteChangeProcessorWrapper> { public: explicit RemoteChangeProcessorWrapper( RemoteChangeProcessor* remote_change_processor); RemoteChangeProcessorWrapper(const RemoteChangeProcessorWrapper&) = delete; RemoteChangeProcessorWrapper& operator=(const RemoteChangeProcessorWrapper&) = delete; void PrepareForProcessRemoteChange( const storage::FileSystemURL& url, RemoteChangeProcessor::PrepareChangeCallback callback); void ApplyRemoteChange(const FileChange& change, const base::FilePath& local_path, const storage::FileSystemURL& url, SyncStatusCallback callback); void FinalizeRemoteSync(const storage::FileSystemURL& url, bool clear_local_changes, base::OnceClosure completion_callback); void RecordFakeLocalChange(const storage::FileSystemURL& url, const FileChange& change, SyncStatusCallback callback); private: raw_ptr<RemoteChangeProcessor> remote_change_processor_; base::SequenceChecker sequence_checker_; }; } // namespace drive_backend } // namespace sync_file_system #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_CHANGE_PROCESSOR_WRAPPER_H_
{ "content_hash": "db83ce4b4c900afa11f8d474dcc39ac5", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 91, "avg_line_length": 38.51162790697674, "alnum_prop": 0.7077294685990339, "repo_name": "scheib/chromium", "id": "3e9f726a628cd396658da0c52c8af1876049427a", "size": "2173", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
import { HashTable, Helpers } from "./helpers"; import { ConditionsParser } from "./conditionsParser"; import { FunctionFactory } from "./functionsfactory"; import { ProcessValue } from "./conditionProcessValue"; export class Operand { constructor(public origionalValue: any) {} public getValue(processValue: ProcessValue): any { if (Array.isArray(this.origionalValue)) { let res = []; for (let i = 0; i < this.origionalValue.length; i++) { let val = new Operand(this.origionalValue[i]); res.push(val.getValue(processValue)); } return res; } var res = this.getSimpleValue(this.origionalValue); if (res.isSimple) return res.value; var val = this.removeQuotesAndEscapes(this.origionalValue); if (processValue) { var name = this.getValueName(val); if (name) { if (!processValue.hasValue(name)) return null; val = processValue.getValue(name); return this.getSimpleValue(val).value; } } return val; } public get isBoolean() { return this.isBooleanValue(this.origionalValue); } public fillVariables(vars: Array<string>) { var name = this.getValueName(this.origionalValue); if (!!name) { vars.push(name); } } public toString(): string { var val = this.origionalValue; if (val && (!this.isNumeric(val) && !this.isBooleanValue(val))) val = "'" + val + "'"; return val; } private removeQuotesAndEscapes(val: string): string { if (val.length > 0 && (val[0] == "'" || val[0] == '"')) val = val.substr(1); var len = val.length; if (len > 0 && (val[len - 1] == "'" || val[len - 1] == '"')) val = val.substr(0, len - 1); if (val) { val = val.replace("\\'", "'"); val = val.replace('\\"', '"'); } return val; } private getValueName(val: any) { if (val.length < 3 || val[0] != "{" || val[val.length - 1] != "}") return null; return val.substr(1, val.length - 2); } private isBooleanValue(value: string): boolean { return ( value && (value.toLowerCase() === "true" || value.toLowerCase() === "false") ); } private isNumeric(value: string): boolean { if ( value && (value.indexOf("-") > -1 || value.indexOf("+") > 1 || value.indexOf("*") > -1 || value.indexOf("^") > -1 || value.indexOf("/") > -1 || value.indexOf("%") > -1) ) return false; var val = Number(value); if (isNaN(val)) return false; return isFinite(val); } private getSimpleValue(val: any): any { var res = { isSimple: false, value: val }; if (val === undefined || val === "undefined") { res.value = null; res.isSimple = true; return res; } if (!val || typeof val != "string") { res.isSimple = true; return res; } if (this.isNumeric(val)) { res.isSimple = true; if (val.indexOf("0x") == 0) { res.value = parseInt(val); } else { res.value = parseFloat(val); } return res; } if (this.isBooleanValue(val)) { res.value = val.toLowerCase() == "true"; res.isSimple = true; return res; } return res; } } export class FunctionOperand extends Operand { public parameters: Array<Operand> = new Array<Operand>(); constructor(public origionalValue: any) { super(origionalValue); } public getValue(processValue: ProcessValue) { var paramValues = []; for (var i = 0; i < this.parameters.length; i++) { paramValues.push(this.parameters[i].getValue(processValue)); } return FunctionFactory.Instance.run( this.origionalValue, paramValues, processValue.properties ); } public fillVariables(vars: Array<string>) { for (var i = 0; i < this.parameters.length; i++) { this.parameters[i].fillVariables(vars); } } public toString() { var res = this.origionalValue + "("; for (var i = 0; i < this.parameters.length; i++) { if (i > 0) res += ", "; res += this.parameters[i].toString(); } return res; } } export class ExpressionOperand extends Operand { public left: Operand; public right: Operand; public operator: string; constructor() { super(null); } public getValue(processValue: ProcessValue): any { if (!this.left) return null; if (!this.right) return this.left.getValue(processValue); var l = this.left.getValue(processValue); var r = this.right.getValue(processValue); if (Helpers.isValueEmpty(l)) l = 0; if (Helpers.isValueEmpty(r)) r = 0; if (this.operator == "+") { return l + r; } if (this.operator == "-") { return l - r; } if (this.operator == "*") { return l * r; } if (this.operator == "^") { return Math.pow(l, r); } if (this.operator == "/") { if (!r) return null; return l / r; } if (this.operator == "%") { if (!r) return null; return l % r; } return null; } public fillVariables(vars: Array<string>) { if (!!this.left) this.left.fillVariables(vars); if (!!this.right) this.right.fillVariables(vars); } public toString() { var res = this.left ? this.left.toString() : ""; res += " " + this.operator + " "; if (this.right) res += this.right.toString(); return res; } } export class ConditionOperand extends Operand { public root: ConditionNode; private processValue: ProcessValue; constructor(root: ConditionNode = null) { super(null); if (root) this.root = root; } public getValue(processValue: ProcessValue): any { if (!this.root) return false; this.processValue = processValue; return this.runNode(this.root); } public fillVariables(vars: Array<string>) { if (!!this.root) { this.root.fillVariables(vars); } } public toString(): string { return this.root ? this.root.toString() : ""; } private runNode(node: ConditionNode): boolean { var onFirstFail = node.connective == "and"; for (var i = 0; i < node.children.length; i++) { var res = this.runNodeCondition(node.children[i]); if (!res && onFirstFail) return node.isNot; if (res && !onFirstFail) return !node.isNot; } return !node.isNot ? onFirstFail : !onFirstFail; } private runNodeCondition(value: any): boolean { if (value["children"]) return this.runNode(value); if (value["left"]) return this.runCondition(value); return false; } private runCondition(condition: Condition): boolean { return condition.performExplicit( condition.left, condition.right, this.processValue ); } } export class Condition { static operatorsValue: HashTable<Function> = null; static get operators() { if (Condition.operatorsValue != null) return Condition.operatorsValue; Condition.operatorsValue = { empty: function(left: any, right: any) { if (left == null) return true; return !left; }, notempty: function(left: any, right: any) { if (left == null) return false; return !!left; }, equal: function(left: any, right: any) { return Helpers.isTwoValueEquals(left, right, true); }, notequal: function(left: any, right: any) { return !Helpers.isTwoValueEquals(left, right, true); }, contains: function(left: any, right: any) { return Condition.operatorsValue.containsCore(left, right, true); }, notcontains: function(left: any, right: any) { if (!left && !Helpers.isValueEmpty(right)) return true; return Condition.operatorsValue.containsCore(left, right, false); }, containsCore: function(left: any, right: any, isContains: any) { if (!left) return false; if (!left.length) { left = left.toString(); } if (typeof left === "string" || left instanceof String) { if (!right) return false; right = right.toString(); var found = left.indexOf(right) > -1; return isContains ? found : !found; } var rightArray = Array.isArray(right) ? right : [right]; for (var rIndex = 0; rIndex < rightArray.length; rIndex++) { var i = 0; right = rightArray[rIndex]; for (; i < left.length; i++) { if (left[i] == right) break; } if (i == left.length) return !isContains; } return isContains; }, greater: function(left: any, right: any) { if (left == null || right == null) return false; return left > right; }, less: function(left: any, right: any) { if (left == null || right == null) return false; return left < right; }, greaterorequal: function(left: any, right: any) { if (left == null || right == null) return false; return left >= right; }, lessorequal: function(left: any, right: any) { if (left == null || right == null) return false; return left <= right; } }; return Condition.operatorsValue; } public static getOperator(opName: string): any { return Condition.operators[opName]; } public static setOperator( opName: string, func: (left: any, right: any) => boolean ) { Condition.operators[opName] = func; } public static isCorrectOperator(opName: string): boolean { if (!opName) return false; opName = opName.toLowerCase(); return Condition.operators[opName] != undefined; } public static isNoRightOperation(op: string) { return op == "empty" || op == "notempty"; } private opValue: string = "equal"; private leftValue: Operand = null; private rightValue: Operand = null; public get left(): Operand { return this.leftValue; } public set left(val: Operand) { this.leftValue = val; } public get right(): Operand { return this.rightValue; } public set right(val: Operand) { this.rightValue = val; } public get operator(): string { return this.opValue; } public set operator(value: string) { if (!value) return; value = value.toLowerCase(); if (!Condition.operators[value]) return; this.opValue = value; } public perform( left: any = null, right: any = null, processValue: ProcessValue = null ): boolean { if (!left) left = this.left; if (!right) right = this.right; return this.performExplicit(left, right, processValue); } public performExplicit( left: any, right: any, processValue: ProcessValue ): boolean { var leftValue = left ? left.getValue(processValue) : null; if (!right && (leftValue === true || leftValue === false)) return leftValue; var rightValue = right ? right.getValue(processValue) : null; return Condition.operators[this.operator](leftValue, rightValue); } public fillVariables(vars: Array<string>) { if (this.left) this.left.fillVariables(vars); if (this.right) this.right.fillVariables(vars); } public toString(): string { if (!this.right || !this.operator) return ""; var left = this.left.toString(); var res = left + " " + this.operationToString(); if (Condition.isNoRightOperation(this.operator)) return res; var right = this.right.toString(); return res + " " + right; } private operationToString(): string { var op = this.operator; if (op == "equal") return "="; if (op == "notequal") return "!="; if (op == "greater") return ">"; if (op == "less") return "<"; if (op == "greaterorequal") return ">="; if (op == "lessorequal") return "<="; return op; } } export class ConditionNode { private connectiveValue: string = "and"; public isNot: boolean = false; public children: Array<any> = []; public constructor() {} public get connective(): string { return this.connectiveValue; } public set connective(value: string) { if (!value) return; value = value.toLowerCase(); if (value == "&" || value == "&&") value = "and"; if (value == "|" || value == "||") value = "or"; if (value != "and" && value != "or") return; this.connectiveValue = value; } public get isEmpty() { return this.children.length == 0; } public clear() { this.children = []; this.connective = "and"; } public getVariables(): Array<string> { var vars: Array<any> = []; this.fillVariables(vars); return vars; } public fillVariables(vars: Array<string>) { for (var i = 0; i < this.children.length; i++) { this.children[i].fillVariables(vars); } } public toString(): string { if (this.isEmpty) return ""; var res = ""; for (var i = 0; i < this.children.length; i++) { var child = this.children[i]; var nodeText = child.toString(); if (child.children && child.children.length > 0) { nodeText = "(" + nodeText + ")"; } if (nodeText) { if (res) res += " " + this.connective + " "; res += nodeText; } } return res; } } export class ExpressionRunner { private expressionValue: string; private processValue: ProcessValue; private operand: Operand; public constructor(expression: string) { this.expression = expression; this.processValue = new ProcessValue(); } public get expression(): string { return this.expressionValue; } public set expression(value: string) { if (this.expression == value) return; this.expressionValue = value; this.operand = new ConditionsParser().parseExpression(this.expressionValue); } public canRun(): boolean { return !!this.operand; } public run(values: HashTable<any>, properties: HashTable<any> = null): any { if (!this.operand) return null; this.processValue.values = values; this.processValue.properties = properties; return this.operand.getValue(this.processValue); } } export class ConditionRunner { private expressionValue: string; private root: ConditionNode; public constructor(expression: string) { this.root = new ConditionNode(); this.expression = expression; } public get expression(): string { return this.expressionValue; } public set expression(value: string) { if (this.expression == value) return; this.expressionValue = value; new ConditionsParser().parse(this.expressionValue, this.root); } public getVariables(): Array<string> { return !!this.root ? this.root.getVariables() : []; } public run( values: HashTable<any>, properties: HashTable<any> = null ): boolean { var condition = new ConditionOperand(this.root); var processValue = new ProcessValue(); processValue.values = values; processValue.properties = properties; return <boolean>condition.getValue(processValue); } }
{ "content_hash": "69eee1f1729f94a89289f5563d13ce30", "timestamp": "", "source": "github", "line_count": 484, "max_line_length": 80, "avg_line_length": 30.65082644628099, "alnum_prop": 0.6038422649140546, "repo_name": "dmitrykurmanov/surveyjs", "id": "0794999cf83364c58fb2997e52f57ad53e8f8a5a", "size": "14835", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/conditions.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "15873" }, { "name": "HTML", "bytes": "35470" }, { "name": "JavaScript", "bytes": "159568" }, { "name": "Shell", "bytes": "523" }, { "name": "TypeScript", "bytes": "1550045" }, { "name": "Vue", "bytes": "52554" } ], "symlink_target": "" }
package de.adorsys.cse.example.client.crypto.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @ApiModel("Request to decrypt a secret transferred by RSA-encrypted JWT-token") public class JWEDecryptRequest { private String encryptedJWT; private String privateKey; @ApiModelProperty("Encrypted JWT with some secrets") public String getEncryptedJWT() { return encryptedJWT; } public void setEncryptedJWT(String encryptedJWT) { this.encryptedJWT = encryptedJWT; } @ApiModelProperty("Private key in base64-encoded X.509 format") public String getPrivateKey() { return privateKey; } public void setPrivateKey(String privateKey) { this.privateKey = privateKey; } }
{ "content_hash": "6f82c74f2d9941a120b8ecf199bee69b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 79, "avg_line_length": 28.178571428571427, "alnum_prop": 0.7249683143219265, "repo_name": "adorsys/secure-key-storage", "id": "0cf4cef30d9188590919b4863c42423a57e9f185", "size": "789", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "client-side-encryption/cse-java-server/cse-java-server-example/src/main/java/de/adorsys/cse/example/client/crypto/bean/JWEDecryptRequest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "245358" }, { "name": "Shell", "bytes": "14622" } ], "symlink_target": "" }
require "test_helper" require "gds_api/account_api" require "gds_api/test_helpers/account_api" describe GdsApi::AccountApi do include GdsApi::TestHelpers::AccountApi let(:api_client) { GdsApi::AccountApi.new(Plek.find("account-api")) } let(:session_id) { "session-id" } let(:new_session_id) { "new-session-id" } describe "#get_sign_in_url" do it "gives an auth URI" do stub_account_api_get_sign_in_url(auth_uri: "https://www.example.com") assert_equal("https://www.example.com", api_client.get_sign_in_url.to_hash["auth_uri"]) end end describe "#validate_auth_response" do it "gives a session ID if the auth response validates" do stub_account_api_validates_auth_response(code: "foo", state: "bar") assert(!api_client.validate_auth_response(code: "foo", state: "bar")["govuk_account_session"].nil?) end it "returns the cookie & feedback consents" do stub_account_api_validates_auth_response(code: "foo", state: "bar", cookie_consent: true, feedback_consent: false) response = api_client.validate_auth_response(code: "foo", state: "bar") assert_equal(true, response["cookie_consent"]) assert_equal(false, response["feedback_consent"]) end it "throws a 401 if the auth response does not validate" do stub_account_api_rejects_auth_response(code: "foo", state: "bar") assert_raises GdsApi::HTTPUnauthorized do api_client.validate_auth_response(code: "foo", state: "bar") end end end describe "#get_end_session_url" do it "gives an end-session URI" do stub_account_api_get_end_session_url(end_session_uri: "https://www.example.com/end-session") assert_equal("https://www.example.com/end-session", api_client.get_end_session_url.to_hash["end_session_uri"]) end it "passes the GOVUK-Account-Session" do stub_account_api_get_end_session_url(govuk_account_session: session_id, end_session_uri: "https://www.example.com/end-session") assert_equal("https://www.example.com/end-session", api_client.get_end_session_url(govuk_account_session: session_id).to_hash["end_session_uri"]) end end describe "#get_user" do it "gets the user's information" do stub_account_api_user_info( mfa: true, email: "user@gov.uk", email_verified: false, services: { register_to_become_a_wizard: "yes" }, new_govuk_account_session: new_session_id, ) assert_equal(true, api_client.get_user(govuk_account_session: session_id)["mfa"]) assert_equal("user@gov.uk", api_client.get_user(govuk_account_session: session_id)["email"]) assert_equal(false, api_client.get_user(govuk_account_session: session_id)["email_verified"]) assert_equal("yes", api_client.get_user(govuk_account_session: session_id)["services"]["register_to_become_a_wizard"]) end it "stubs a single service" do stub_account_api_user_info_service_state(service: "register_to_become_a_wizard", service_state: "yes_but_must_reauthenticate") assert_equal("yes_but_must_reauthenticate", api_client.get_user(govuk_account_session: session_id)["services"]["register_to_become_a_wizard"]) end end describe "#match_user_by_email" do it "returns `match: true` if the user matches" do stub_account_api_match_user_by_email_matches(email: "foo@bar.baz") assert_equal(true, api_client.match_user_by_email(govuk_account_session: session_id, email: "foo@bar.baz")["match"]) end it "returns `match: false` if the user does not match" do stub_account_api_match_user_by_email_does_not_match(email: "foo@bar.baz") assert_equal(false, api_client.match_user_by_email(govuk_account_session: session_id, email: "foo@bar.baz")["match"]) end it "throws a 404 if the user cannot be found" do stub_account_api_match_user_by_email_does_not_exist(email: "foo@bar.baz") assert_raises GdsApi::HTTPNotFound do assert_equal(false, api_client.match_user_by_email(govuk_account_session: session_id, email: "foo@bar.baz")) end end end describe "#delete_user_by_subject_identifier" do it "returns 204 if the account is successfully deleted" do stub_account_api_delete_user_by_subject_identifier(subject_identifier: "sid") assert_equal(204, api_client.delete_user_by_subject_identifier(subject_identifier: "sid").code) end it "returns 404 if the user cannot be found" do stub_account_api_delete_user_by_subject_identifier_does_not_exist(subject_identifier: "sid") assert_raises GdsApi::HTTPNotFound do api_client.delete_user_by_subject_identifier(subject_identifier: "sid") end end end describe "#update_user_by_subject_identifier" do it "updates the user's email attributes" do stub_update_user_by_subject_identifier(subject_identifier: "sid", email_verified: true, old_email: "email@example.com") assert_equal({ "sub" => "sid", "email" => "email@example.com", "email_verified" => true }, api_client.update_user_by_subject_identifier(subject_identifier: "sid", email_verified: true).to_hash) end end describe "email subscriptions" do describe "#get_email_subscription" do it "returns the subscription details if it exists" do stub_account_api_get_email_subscription(name: "foo") assert(!api_client.get_email_subscription(name: "foo", govuk_account_session: session_id)["email_subscription"].nil?) end it "throws a 404 if it does not exist" do stub_account_api_get_email_subscription_does_not_exist(name: "foo") assert_raises GdsApi::HTTPNotFound do api_client.get_email_subscription(name: "foo", govuk_account_session: session_id) end end end describe "#put_email_subscription" do it "returns the new subscription details" do stub_account_api_put_email_subscription(name: "foo", topic_slug: "slug") assert(!api_client.put_email_subscription(name: "foo", topic_slug: "slug", govuk_account_session: session_id)["email_subscription"].nil?) end end describe "#delete_email_subscription" do it "returns no content if it exists" do stub_account_api_delete_email_subscription(name: "foo") assert_equal(204, api_client.delete_email_subscription(name: "foo", govuk_account_session: session_id).code) end it "throws a 404 if it does not exist" do stub_account_api_delete_email_subscription_does_not_exist(name: "foo") assert_raises GdsApi::HTTPNotFound do api_client.delete_email_subscription(name: "foo", govuk_account_session: session_id) end end end end describe "attributes" do describe "#get_attributes" do describe "attributes exist" do before { stub_account_api_has_attributes(attributes: attributes.keys, values: attributes, new_govuk_account_session: new_session_id) } let(:attributes) { { "foo" => { "bar" => %w[baz] } } } it "returns the attribute values" do assert(api_client.get_attributes(attributes: attributes.keys, govuk_account_session: session_id)["values"] == attributes) end it "returns the new session value" do assert_equal(new_session_id, api_client.get_attributes(attributes: attributes.keys, govuk_account_session: session_id)["govuk_account_session"]) end end end describe "#set_attributes" do it "returns a new session when setting attributes" do stub_account_api_set_attributes(attributes: { foo: %w[bar] }, new_govuk_account_session: new_session_id) assert_equal(new_session_id, api_client.set_attributes(govuk_account_session: session_id, attributes: { foo: %w[bar] }).to_hash["govuk_account_session"]) end end end describe "the user is not logged in or their session is invalid" do it "throws a 401 if the user checks their information" do stub_account_api_unauthorized_user_info assert_raises GdsApi::HTTPUnauthorized do api_client.get_user(govuk_account_session: session_id) end end it "throws a 401 if the user gets their attributes" do stub_account_api_unauthorized_has_attributes(attributes: %w[foo bar baz]) assert_raises GdsApi::HTTPUnauthorized do api_client.get_attributes(attributes: %w[foo bar baz], govuk_account_session: session_id) end end it "throws a 401 if the user updates their attributes" do stub_account_api_unauthorized_set_attributes(attributes: { foo: %w[bar baz] }) assert_raises GdsApi::HTTPUnauthorized do api_client.set_attributes(attributes: { foo: %w[bar baz] }, govuk_account_session: session_id) end end it "throws a 401 if the user gets an email subscription" do stub_account_api_unauthorized_get_email_subscription(name: "foo") assert_raises GdsApi::HTTPUnauthorized do api_client.get_email_subscription(name: "foo", govuk_account_session: session_id) end end it "throws a 401 if the user updates an email subscription" do stub_account_api_unauthorized_put_email_subscription(name: "foo") assert_raises GdsApi::HTTPUnauthorized do api_client.put_email_subscription(name: "foo", topic_slug: "slug", govuk_account_session: session_id) end end it "throws a 401 if the user deletes an email subscription" do stub_account_api_unauthorized_delete_email_subscription(name: "foo") assert_raises GdsApi::HTTPUnauthorized do api_client.delete_email_subscription(name: "foo", govuk_account_session: session_id) end end end describe "the user is logged in without MFA when it's needed" do it "throws a 403 if the user gets their attributes" do stub_account_api_forbidden_has_attributes(attributes: %w[foo bar baz]) assert_raises GdsApi::HTTPForbidden do api_client.get_attributes(attributes: %w[foo bar baz], govuk_account_session: session_id) end end it "throws a 403 if the user updates their attributes" do stub_account_api_forbidden_set_attributes(attributes: { foo: %w[bar baz] }) assert_raises GdsApi::HTTPForbidden do api_client.set_attributes(attributes: { foo: %w[bar baz] }, govuk_account_session: session_id) end end end end
{ "content_hash": "7dd5c47fbc767fc6d0cf96b9743a47da", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 199, "avg_line_length": 44.05106382978723, "alnum_prop": 0.6856646058732612, "repo_name": "alphagov/gds-api-adapters", "id": "59d56b8f08824a62ba898724abc323c122272fe3", "size": "10352", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "test/account_api_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "577533" } ], "symlink_target": "" }
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) VERSION = `cat $(ROOT_DIR)/VERSION` ARCHIVE_NAME = '/tmp/retailcrm-'$(VERSION)'.ocmod.zip' .PHONY: test svn_clone: mkdir /tmp/svn_plugin_dir svn co $(SVNREPOURL) /tmp/svn_plugin_dir --username $(USERNAME) --password $(PASSWORD) --no-auth-cache svn_push: /tmp/svn_plugin_dir if [ ! -d "/tmp/svn_plugin_dir/tags/$(VERSION)" ]; then \ svn delete /tmp/svn_plugin_dir/trunk/*; \ rm -rf /tmp/svn_plugin_dir/trunk/*; \ cp -R $(ROOT_DIR)/src/* /tmp/svn_plugin_dir/trunk; \ svn copy /tmp/svn_plugin_dir/trunk /tmp/svn_plugin_dir/tags/$(VERSION) --username $(USERNAME) --password $(PASSWORD) --no-auth-cache; \ svn add /tmp/svn_plugin_dir/trunk/* --force; \ svn add /tmp/svn_plugin_dir/tags/$(VERSION)/* --force; \ svn ci /tmp/svn_plugin_dir -m $(VERSION) --username $(USERNAME) --password $(PASSWORD) --no-auth-cache; \ fi remove_dir: rm -rf /tmp/svn_plugin_dir compile_pot: msgfmt resources/pot/retailcrm-ru_RU.pot -o src/languages/retailcrm-ru_RU.mo msgfmt resources/pot/retailcrm-es_ES.pot -o src/languages/retailcrm-es_ES.mo install: mkdir coverage bash tests/bin/install.sh $(DB_NAME) $(DB_USER) $(DB_HOST) $(DB_PASS) $(WP_VERSION) $(WC_VERSION) test: phpunit -c phpunit.xml.dist local_test: bash tests/bin/install.sh $(DB_NAME) $(DB_USER) $(DB_HOST) $(DB_PASS) $(WP_VERSION) $(WC_VERSION) phpunit -c phpunit.xml.dist run_tests: docker-compose --no-ansi up -d --build mysql docker-compose --no-ansi run --rm --no-deps app make local_test docker-compose stop coverage: wget https://phar.phpunit.de/phpcov-2.0.2.phar && php phpcov-2.0.2.phar merge coverage/ --clover coverage.xml build_archive: zip -r $(ARCHIVE_NAME) ./src/*
{ "content_hash": "08d7a48009520efc5a7bb846d227f4d8", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 137, "avg_line_length": 34.6, "alnum_prop": 0.684393063583815, "repo_name": "retailcrm/woocommerce-module", "id": "e3a8fede1088e5689e9b698603c3afb614e5e5ad", "size": "1730", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Makefile", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2750" }, { "name": "Dockerfile", "bytes": "1325" }, { "name": "JavaScript", "bytes": "21626" }, { "name": "Makefile", "bytes": "1730" }, { "name": "PHP", "bytes": "617102" }, { "name": "Shell", "bytes": "3431" } ], "symlink_target": "" }
/* */ System.register(["aurelia-metadata", "aurelia-loader", "aurelia-path"], function (_export) { "use strict"; var Origin, Loader, join, _prototypeProperties, _inherits, sys, DefaultLoader; function ensureOriginOnExports(executed, name) { var target = executed, key, exportedValue; if (target.__useDefault) { target = target["default"]; } Origin.set(target, new Origin(name, "default")); for (key in target) { exportedValue = target[key]; if (typeof exportedValue === "function") { Origin.set(exportedValue, new Origin(name, key)); } } return executed; } return { setters: [function (_aureliaMetadata) { Origin = _aureliaMetadata.Origin; }, function (_aureliaLoader) { Loader = _aureliaLoader.Loader; }, function (_aureliaPath) { join = _aureliaPath.join; }], execute: function () { _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; if (!window.System || !window.System["import"]) { sys = window.System = window.System || {}; sys.polyfilled = true; sys.map = {}; sys["import"] = function (moduleId) { return new Promise(function (resolve, reject) { require([moduleId], resolve, reject); }); }; sys.normalize = function (url) { return Promise.resolve(url); }; }Loader.createDefaultLoader = function () { return new DefaultLoader(); }; DefaultLoader = (function (Loader) { function DefaultLoader() { this.baseUrl = System.baseUrl; this.baseViewUrl = System.baseViewUrl || System.baseUrl; this.registry = {}; } _inherits(DefaultLoader, Loader); _prototypeProperties(DefaultLoader, null, { loadModule: { value: function loadModule(id, baseUrl) { var _this = this; baseUrl = baseUrl === undefined ? this.baseUrl : baseUrl; if (baseUrl && !id.startsWith(baseUrl)) { id = join(baseUrl, id); } return System.normalize(id).then(function (newId) { var existing = _this.registry[newId]; if (existing) { return existing; } return System["import"](newId).then(function (m) { _this.registry[newId] = m; return ensureOriginOnExports(m, newId); }); }); }, writable: true, enumerable: true, configurable: true }, loadAllModules: { value: function loadAllModules(ids) { var loads = [], i, ii, loader = this.loader; for (i = 0, ii = ids.length; i < ii; ++i) { loads.push(this.loadModule(ids[i])); } return Promise.all(loads); }, writable: true, enumerable: true, configurable: true }, loadTemplate: { value: function loadTemplate(url) { if (this.baseViewUrl && !url.startsWith(this.baseViewUrl)) { url = join(this.baseViewUrl, url); } return this.importTemplate(url); }, writable: true, enumerable: true, configurable: true } }); return DefaultLoader; })(Loader); _export("DefaultLoader", DefaultLoader); } }; });
{ "content_hash": "f0ca1dcd348dc3f7b0fe3f62043a7bda", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 110, "avg_line_length": 29.958904109589042, "alnum_prop": 0.522633744855967, "repo_name": "Maidan-hackaton/ua-tenders-aurelia", "id": "7e8ef6e31c934c4eeb7e89fec7a74b5d1c858418", "size": "4374", "binary": false, "copies": "7", "ref": "refs/heads/gh-pages", "path": "jspm_packages/github/aurelia/loader-default@0.4.1/system/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "120212" }, { "name": "CoffeeScript", "bytes": "2294" }, { "name": "HTML", "bytes": "6103" }, { "name": "JavaScript", "bytes": "4777507" }, { "name": "LiveScript", "bytes": "3914" }, { "name": "Makefile", "bytes": "880" } ], "symlink_target": "" }
module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jasmine: { unit: { src: 'public/js/**/*.js', options: { specs: [ 'test/**/*.test.js' ], vendor: [ 'public/vendor/angular/angular.js', 'public/vendor/angular-mocks/angular-mocks.js' ] } } } }); grunt.loadNpmTasks('grunt-recess'); grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.registerTask('default', ['jasmine']); };
{ "content_hash": "139b64f5878425cc3d7b564c101c949e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 52, "avg_line_length": 20.333333333333332, "alnum_prop": 0.5840163934426229, "repo_name": "cmartin417/ng-jumpstart", "id": "a5cb0920a038220a19e1281d18bbfec8e9818199", "size": "488", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Gruntfile.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "0" }, { "name": "JavaScript", "bytes": "3273" } ], "symlink_target": "" }
class DropCoronavirusLiveStreams < ActiveRecord::Migration[6.0] def change drop_table :coronavirus_live_streams do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "url", null: false t.string "formatted_stream_date" end end end
{ "content_hash": "a714334d0e4414465663404a3cd2e081", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 63, "avg_line_length": 30.2, "alnum_prop": 0.6788079470198676, "repo_name": "alphagov/collections-publisher", "id": "f389711828b607e92faa0eef0bc214704f8b3892", "size": "302", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "db/migrate/20210504120417_drop_coronavirus_live_streams.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "605" }, { "name": "HTML", "bytes": "116593" }, { "name": "JavaScript", "bytes": "3228" }, { "name": "Procfile", "bytes": "117" }, { "name": "Ruby", "bytes": "678121" }, { "name": "SCSS", "bytes": "11316" } ], "symlink_target": "" }
layout: post date: 2015-11-27 title: "Camille La Vie Beaded Mesh Two-Tone Dress Sleeveless Floor-Length Mermaid/Trumpet" category: Camille La Vie tags: [Camille La Vie,Mermaid/Trumpet,Spaghetti Straps,Floor-Length,Sleeveless] --- ### Camille La Vie Beaded Mesh Two-Tone Dress Just **$279.99** ### Sleeveless Floor-Length Mermaid/Trumpet <table><tr><td>BRANDS</td><td>Camille La Vie</td></tr><tr><td>Silhouette</td><td>Mermaid/Trumpet</td></tr><tr><td>Neckline</td><td>Spaghetti Straps</td></tr><tr><td>Hemline/Train</td><td>Floor-Length</td></tr><tr><td>Sleeve</td><td>Sleeveless</td></tr></table> <a href="https://www.readybrides.com/en/camille-la-vie/10191-camille-la-vie-beaded-mesh-two-tone-dress.html"><img src="//img.readybrides.com/23347/camille-la-vie-beaded-mesh-two-tone-dress.jpg" alt="Camille La Vie Beaded Mesh Two-Tone Dress" style="width:100%;" /></a> <!-- break --><a href="https://www.readybrides.com/en/camille-la-vie/10191-camille-la-vie-beaded-mesh-two-tone-dress.html"><img src="//img.readybrides.com/23346/camille-la-vie-beaded-mesh-two-tone-dress.jpg" alt="Camille La Vie Beaded Mesh Two-Tone Dress" style="width:100%;" /></a> Buy it: [https://www.readybrides.com/en/camille-la-vie/10191-camille-la-vie-beaded-mesh-two-tone-dress.html](https://www.readybrides.com/en/camille-la-vie/10191-camille-la-vie-beaded-mesh-two-tone-dress.html)
{ "content_hash": "32cfb1d4c19b5facf3a4c6174d0137bc", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 282, "avg_line_length": 97.35714285714286, "alnum_prop": 0.7351430667644901, "repo_name": "HOLEIN/HOLEIN.github.io", "id": "7a714faf1774f6d00daa209332c1f8094ed3ddf2", "size": "1367", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/2015-11-27-Camille-La-Vie-Beaded-Mesh-TwoTone-Dress-Sleeveless-FloorLength-MermaidTrumpet.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "83876" }, { "name": "HTML", "bytes": "14547" }, { "name": "Ruby", "bytes": "897" } ], "symlink_target": "" }
* `sudo apt-get install nodejs` - developed with version 6.11.0, npm version 3.10.10 * cd into repo and `npm install` ### develop * `npm start` ### production build * `npm run dist`
{ "content_hash": "2e3ce26c9eb276ad2c82b01682b6e3a4", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 84, "avg_line_length": 23, "alnum_prop": 0.6793478260869565, "repo_name": "adambreznicky/jerryshotrods", "id": "4f6c75401627688b344fe4d4754d1443f7b1a365", "size": "211", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "8092" }, { "name": "JavaScript", "bytes": "38034" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ar" version="2.0"> <defauEPCodec>UTF-8</defauEPCodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About EuphoricCoin</source> <translation>عن EuphoricCoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;EuphoricCoin&lt;/b&gt; version</source> <translation>نسخة &lt;b&gt;EuphoricCoin&lt;/b&gt;</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The EuphoricCoin developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>دفتر العناوين</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>أنقر على الماوس مرتين لتعديل عنوان</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>قم بعمل عنوان جديد</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>قم بنسخ القوانين المختارة لحافظة النظام</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your EuphoricCoin 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 type="unfinished"/> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a EuphoricCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified EuphoricCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;أمسح</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your EuphoricCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation type="unfinished"/> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>(no label)</source> <translation type="unfinished"/> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation type="unfinished"/> </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 EuphoricCoinS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation type="unfinished"/> </message> <message> <location line="-56"/> <source>EuphoricCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your EuphoricCoins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation type="unfinished"/> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation type="unfinished"/> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation type="unfinished"/> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation type="unfinished"/> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Quit application</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Show information about EuphoricCoin</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation type="unfinished"/> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation type="unfinished"/> </message> <message> <location line="-347"/> <source>Send coins to a EuphoricCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Modify configuration options for EuphoricCoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="-165"/> <location line="+530"/> <source>EuphoricCoin</source> <translation type="unfinished"/> </message> <message> <location line="-530"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>&amp;About EuphoricCoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign messages with your EuphoricCoin addresses to prove you own them</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified EuphoricCoin addresses</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>EuphoricCoin client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to EuphoricCoin network</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="-140"/> <source>Up to date</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation type="unfinished"/> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid EuphoricCoin address or malformed URI parameters.</source> <translation type="unfinished"/> </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 type="unfinished"/> </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 type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. EuphoricCoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>New sending address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid EuphoricCoin address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation type="unfinished"/> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>EuphoricCoin-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start EuphoricCoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start EuphoricCoin on system login</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the EuphoricCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the EuphoricCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting EuphoricCoin.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show EuphoricCoin addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation type="unfinished"/> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting EuphoricCoin.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the EuphoricCoin network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-124"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-78"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+107"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation type="unfinished"/> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start EuphoricCoin: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the EuphoricCoin-Qt help message to get a list with possible EuphoricCoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>EuphoricCoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>EuphoricCoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the EuphoricCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the EuphoricCoin RPC console.</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation type="unfinished"/> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a EuphoricCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Signature</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this EuphoricCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified EuphoricCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a EuphoricCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter EuphoricCoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The EuphoricCoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Amount</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></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 type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+43"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Received from</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation type="unfinished"/> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Today</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This week</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Last month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This year</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Range...</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>To yourself</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Other</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Min amount</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>ID</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>to</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>EuphoricCoin version</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Send command to -server or EuphoricCoind</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <source>List commands</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Options:</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Specify configuration file (default: EuphoricCoin.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Specify pid file (default: EuphoricCoind.pid)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"/> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9332 or testnet: 19332)</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation type="unfinished"/> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </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=EuphoricCoinrpc 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;EuphoricCoin Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. EuphoricCoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong EuphoricCoin will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>SSL options: (see the EuphoricCoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>System error: </source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"/> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"/> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation type="unfinished"/> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+165"/> <source>This help message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation type="unfinished"/> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of EuphoricCoin</source> <translation type="unfinished"/> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart EuphoricCoin to complete</source> <translation type="unfinished"/> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation type="unfinished"/> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation type="unfinished"/> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. EuphoricCoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation type="unfinished"/> </message> <message> <location line="-57"/> <source>Done loading</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <location line="-74"/> <source>Error</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> </context> </TS>
{ "content_hash": "0b3ab24f4a875aea0d677df5c8a54164", "timestamp": "", "source": "github", "line_count": 2917, "max_line_length": 395, "avg_line_length": 33.52108330476517, "alnum_prop": 0.5887340076292941, "repo_name": "EuphoricCoin/Euphoric-Coin", "id": "a03c414435171e06ec3298d9efd40c954b2a59b8", "size": "97881", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_ar.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "103297" }, { "name": "C++", "bytes": "2523408" }, { "name": "CSS", "bytes": "1127" }, { "name": "IDL", "bytes": "14712" }, { "name": "Objective-C", "bytes": "5864" }, { "name": "Python", "bytes": "69734" }, { "name": "Shell", "bytes": "9702" }, { "name": "TypeScript", "bytes": "5253205" } ], "symlink_target": "" }
package nl.cwi.pr.runtime; import java.util.concurrent.atomic.AtomicInteger; public class Context { // // FIELDS // private final AtomicInteger[] integers; // // CONSTRUCTORS // public Context(final int nPorts) { this.integers = new AtomicInteger[(nPorts / 32) + 1]; for (int i = 0; i < this.integers.length; i++) this.integers[i] = new AtomicInteger(); } // // METHODS // public void add(final int index, final int mask) { AtomicInteger integer = integers[index]; int bits = integer.get(); while (!integer.compareAndSet(bits, bits | mask)) bits = integer.get(); } public boolean contains(final int index, final int mask) { return mask == (integers[index].get() & mask); } public void remove(final int index, final int mask) { AtomicInteger integer = integers[index]; int current = integer.get(); while (!integer.compareAndSet(current, current & ~mask)) current = integer.get(); } }
{ "content_hash": "ee29edb804cfe27c8caffea9d37ae7ae", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 59, "avg_line_length": 22.272727272727273, "alnum_prop": 0.6428571428571429, "repo_name": "kasperdokter/Reo", "id": "ec3f803a5fc96f0486580ee4b9fc58394fb6bfe7", "size": "980", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "reo-runtime-java-lykos/src/main/java/nl/cwi/pr/runtime/Context.java", "mode": "33261", "license": "mit", "language": [ { "name": "ANTLR", "bytes": "11728" }, { "name": "Batchfile", "bytes": "1854" }, { "name": "C", "bytes": "49627" }, { "name": "HTML", "bytes": "5672" }, { "name": "Java", "bytes": "874850" }, { "name": "Shell", "bytes": "1539" } ], "symlink_target": "" }
 #include <aws/opensearch/model/DescribePackagesResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/UnreferencedParam.h> #include <utility> using namespace Aws::OpenSearchService::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribePackagesResult::DescribePackagesResult() { } DescribePackagesResult::DescribePackagesResult(const Aws::AmazonWebServiceResult<JsonValue>& result) { *this = result; } DescribePackagesResult& DescribePackagesResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("PackageDetailsList")) { Array<JsonView> packageDetailsListJsonList = jsonValue.GetArray("PackageDetailsList"); for(unsigned packageDetailsListIndex = 0; packageDetailsListIndex < packageDetailsListJsonList.GetLength(); ++packageDetailsListIndex) { m_packageDetailsList.push_back(packageDetailsListJsonList[packageDetailsListIndex].AsObject()); } } if(jsonValue.ValueExists("NextToken")) { m_nextToken = jsonValue.GetString("NextToken"); } return *this; }
{ "content_hash": "40d9f113c0edbb67202b44915a845a11", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 138, "avg_line_length": 27.41304347826087, "alnum_prop": 0.7755749405233942, "repo_name": "cedral/aws-sdk-cpp", "id": "0fde3b8b4de5eb1310581b682cb6db1a10c3a54f", "size": "1380", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-cpp-sdk-opensearch/source/model/DescribePackagesResult.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "294220" }, { "name": "C++", "bytes": "428637022" }, { "name": "CMake", "bytes": "862025" }, { "name": "Dockerfile", "bytes": "11688" }, { "name": "HTML", "bytes": "7904" }, { "name": "Java", "bytes": "352201" }, { "name": "Python", "bytes": "106761" }, { "name": "Shell", "bytes": "10891" } ], "symlink_target": "" }
<?php /** * Custom Variable Edit Form * * @category Mage * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_System_Variable_Edit_Form extends Mage_Adminhtml_Block_Widget_Form { /** * Getter * * @return Mage_Core_Model_Variable */ public function getVariable() { return Mage::registry('current_variable'); } /** * Prepare form before rendering HTML * * @return Mage_Adminhtml_Block_System_Variable_Edit_Form */ protected function _prepareForm() { $form = new Varien_Data_Form(array( 'id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post' )); $fieldset = $form->addFieldset('base', array( 'legend'=>Mage::helper('adminhtml')->__('Variable'), 'class'=>'fieldset-wide' )); $fieldset->addField('code', 'text', array( 'name' => 'code', 'label' => Mage::helper('adminhtml')->__('Variable Code'), 'title' => Mage::helper('adminhtml')->__('Variable Code'), 'required' => true, 'class' => 'validate-xml-identifier' )); $fieldset->addField('name', 'text', array( 'name' => 'name', 'label' => Mage::helper('adminhtml')->__('Variable Name'), 'title' => Mage::helper('adminhtml')->__('Variable Name'), 'required' => true )); $useDefault = false; if ($this->getVariable()->getId() && $this->getVariable()->getStoreId()) { $useDefault = !((bool)$this->getVariable()->getStoreHtmlValue()); $this->getVariable()->setUseDefaultValue((int)$useDefault); $fieldset->addField('use_default_value', 'select', array( 'name' => 'use_default_value', 'label' => Mage::helper('adminhtml')->__('Use Default Variable Values'), 'title' => Mage::helper('adminhtml')->__('Use Default Variable Values'), 'onchange' => 'toggleValueElement(this);', 'values' => array( 0 => Mage::helper('adminhtml')->__('No'), 1 => Mage::helper('adminhtml')->__('Yes') ) )); } $fieldset->addField('html_value', 'textarea', array( 'name' => 'html_value', 'label' => Mage::helper('adminhtml')->__('Variable HTML Value'), 'title' => Mage::helper('adminhtml')->__('Variable HTML Value'), 'disabled' => $useDefault )); $fieldset->addField('plain_value', 'textarea', array( 'name' => 'plain_value', 'label' => Mage::helper('adminhtml')->__('Variable Plain Value'), 'title' => Mage::helper('adminhtml')->__('Variable Plain Value'), 'disabled' => $useDefault )); $form->setValues($this->getVariable()->getData()) ->addFieldNameSuffix('variable') ->setUseContainer(true); $this->setForm($form); return parent::_prepareForm(); } }
{ "content_hash": "11da9c11ab8ab67e66b037da18a0ed92", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 93, "avg_line_length": 34.276595744680854, "alnum_prop": 0.5012414649286158, "repo_name": "5452/durex", "id": "780c46695efddfe6fd9a62a2bbc9a158b3a72647", "size": "4180", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ActionScript", "bytes": "19946" }, { "name": "CSS", "bytes": "2190550" }, { "name": "JavaScript", "bytes": "1290492" }, { "name": "PHP", "bytes": "102689019" }, { "name": "Shell", "bytes": "642" }, { "name": "XSLT", "bytes": "2066" } ], "symlink_target": "" }
class CreateCities < ActiveRecord::Migration def change create_table :cities do |t| t.string :name t.string :code t.string :address t.integer :country_id t.timestamps end City.create name: 'city1', code: 'city1', address: 'city1_address', country_id: 1 City.create name: 'city2', code: 'city2', address: 'city2_address', country_id: 2 end end
{ "content_hash": "c05dada1b6bbe9c46a771b5332168b1c", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 85, "avg_line_length": 28.357142857142858, "alnum_prop": 0.6397984886649875, "repo_name": "frsnic/active-hash-example", "id": "86a368e3beb417da9aefde4b6d67a73497b18132", "size": "397", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/migrate/20160626142916_create_cities.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "683" }, { "name": "HTML", "bytes": "4895" }, { "name": "JavaScript", "bytes": "664" }, { "name": "Ruby", "bytes": "22267" } ], "symlink_target": "" }
package org.estatio.module.lease.integtests.amendments; import java.math.BigDecimal; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; import javax.inject.Inject; import org.assertj.core.api.Assertions; import org.joda.time.LocalDate; import org.junit.Before; import org.junit.Test; import org.apache.isis.applib.fixturescripts.FixtureResult; import org.apache.isis.applib.fixturescripts.FixtureScript; import org.apache.isis.applib.services.registry.ServiceRegistry2; import org.apache.isis.applib.value.Blob; import org.estatio.module.asset.dom.Property; import org.estatio.module.asset.fixtures.property.enums.Property_enum; import org.estatio.module.lease.dom.Lease; import org.estatio.module.lease.dom.amendments.LeaseAmendment; import org.estatio.module.lease.dom.amendments.LeaseAmendmentItem; import org.estatio.module.lease.dom.amendments.LeaseAmendmentItemForDiscount; import org.estatio.module.lease.dom.amendments.LeaseAmendmentItemForFrequencyChange; import org.estatio.module.lease.dom.amendments.LeaseAmendmentItemType; import org.estatio.module.lease.dom.amendments.LeaseAmendmentManager; import org.estatio.module.lease.dom.amendments.LeaseAmendmentRepository; import org.estatio.module.lease.dom.amendments.LeaseAmendmentState; import org.estatio.module.lease.dom.amendments.LeaseAmendmentTemplate; import org.estatio.module.lease.dom.amendments.Property_maintainLeaseAmendments; import org.estatio.module.lease.fixtures.imports.LeaseAmendmentImportFixture; import org.estatio.module.lease.fixtures.imports.LeaseAmendmentImportFixture2; import org.estatio.module.lease.fixtures.lease.enums.Lease_enum; import org.estatio.module.lease.fixtures.leaseitems.enums.LeaseItemForRent_enum; import org.estatio.module.lease.fixtures.leaseitems.enums.LeaseItemForServiceCharge_enum; import org.estatio.module.lease.integtests.LeaseModuleIntegTestAbstract; import static org.estatio.module.lease.dom.InvoicingFrequency.MONTHLY_IN_ADVANCE; import static org.estatio.module.lease.dom.InvoicingFrequency.QUARTERLY_IN_ADVANCE; public class LeaseAmendmentImport_IntegTest extends LeaseModuleIntegTestAbstract { List<FixtureResult> fixtureResults; @Before public void setupData() { runFixtureScript(new FixtureScript() { @Override protected void execute(ExecutionContext executionContext) { executionContext.executeChild(this, new LeaseAmendmentImportFixture()); executionContext.executeChild(this, new LeaseAmendmentImportFixture2()); executionContext.executeChild(this, Lease_enum.OxfTopModel001Gb.builder()); executionContext.executeChild(this, LeaseItemForRent_enum.OxfTopModel001Gb.builder()); executionContext.executeChild(this, LeaseItemForServiceCharge_enum.OxfTopModel001Gb.builder()); executionContext.executeChild(this, Lease_enum.OxfMediaX002Gb.builder()); executionContext.executeChild(this, LeaseItemForRent_enum.OxfMediaX002Gb.builder()); executionContext.executeChild(this, LeaseItemForServiceCharge_enum.OxfMediaX002Gb.builder()); executionContext.executeChild(this, Lease_enum.OxfMiracl005Gb.builder()); executionContext.executeChild(this, LeaseItemForRent_enum.OxfMiracl005Gb.builder()); executionContext.executeChild(this, LeaseItemForServiceCharge_enum.OxfMiracl005Gb.builder()); executionContext.executeChild(this, Lease_enum.OxfPoison003Gb.builder()); executionContext.executeChild(this, LeaseItemForRent_enum.OxfPoison003Gb.builder()); executionContext.executeChild(this, LeaseItemForServiceCharge_enum.OxfPoison003Gb.builder()); fixtureResults = executionContext.getResults(); } }); } @Test public void import_leaseamendments_test() throws Exception { // given Blob excelSheet = (Blob) fixtureResults.get(0).getObject(); Assertions.assertThat(excelSheet).isNotNull(); Blob excelSheet2 = (Blob) fixtureResults.get(1).getObject(); Assertions.assertThat(excelSheet2).isNotNull(); Property oxf = Property_enum.OxfGb.findUsing(serviceRegistry); Assertions.assertThat(leaseAmendmentRepository.findByTemplate(LeaseAmendmentTemplate.DEMO_TYPE2)).isEmpty(); // when final LeaseAmendmentManager manager = mixin(Property_maintainLeaseAmendments.class, oxf) .$$(LeaseAmendmentTemplate.DEMO_TYPE2,null); serviceRegistry2.injectServicesInto(manager); manager.importAmendments(excelSheet); // then Assertions.assertThat(leaseAmendmentRepository.findByTemplate(LeaseAmendmentTemplate.DEMO_TYPE2)).hasSize(4); final Lease topmodelLease = Lease_enum.OxfTopModel001Gb.findUsing(serviceRegistry); final LeaseAmendment amendmentForTopmodel = leaseAmendmentRepository.findUnique(topmodelLease, LeaseAmendmentTemplate.DEMO_TYPE2); Assertions.assertThat(amendmentForTopmodel.getState()).isEqualTo(LeaseAmendmentState.APPLY); Assertions.assertThat(amendmentForTopmodel.getStartDate()).isEqualTo(new LocalDate(2020,6,1)); Assertions.assertThat(amendmentForTopmodel.getDateSigned()).isNull(); Assertions.assertThat(amendmentForTopmodel.getItems()).hasSize(1); final LeaseAmendmentItemForDiscount amendmentItemForTopmodel = (LeaseAmendmentItemForDiscount) amendmentForTopmodel.getItems().first(); Assertions.assertThat(amendmentItemForTopmodel.getManualDiscountAmount()).isEqualTo(new BigDecimal("-3500.12")); Assertions.assertThat(amendmentItemForTopmodel.getStartDate()).isEqualTo(new LocalDate(2020,7,2)); Assertions.assertThat(amendmentItemForTopmodel.getEndDate()).isEqualTo(new LocalDate(2020,8,30)); final Lease poisonLease = Lease_enum.OxfPoison003Gb.findUsing(serviceRegistry); final LeaseAmendment amendmentForPoison = leaseAmendmentRepository.findUnique(poisonLease, LeaseAmendmentTemplate.DEMO_TYPE2); Assertions.assertThat(amendmentForPoison.getState()).isEqualTo(LeaseAmendmentState.SIGNED); Assertions.assertThat(amendmentForPoison.getStartDate()).isEqualTo(new LocalDate(2020,7,1)); Assertions.assertThat(amendmentForPoison.getDateSigned()).isEqualTo(new LocalDate(2020,6, 20)); Assertions.assertThat(amendmentForPoison.getItems()).hasSize(4); final LeaseAmendmentItemForDiscount firstPoisonAmendmentItem = (LeaseAmendmentItemForDiscount) amendmentForPoison.findItemsOfType( LeaseAmendmentItemType.DISCOUNT).stream().sorted(Comparator.comparing(LeaseAmendmentItem::getStartDate)).collect( Collectors.toList()).get(0); final LeaseAmendmentItemForDiscount secondPoisonAmendmentItem = (LeaseAmendmentItemForDiscount) amendmentForPoison.findItemsOfType( LeaseAmendmentItemType.DISCOUNT).stream().sorted(Comparator.comparing(LeaseAmendmentItem::getStartDate)).collect( Collectors.toList()).get(1); final LeaseAmendmentItemForDiscount thirdPoisonAmendmentItem = (LeaseAmendmentItemForDiscount) amendmentForPoison.findItemsOfType( LeaseAmendmentItemType.DISCOUNT).stream().sorted(Comparator.comparing(LeaseAmendmentItem::getStartDate)).collect( Collectors.toList()).get(2); final LeaseAmendmentItemForFrequencyChange lastPoisonAmendmentItem = (LeaseAmendmentItemForFrequencyChange) amendmentForPoison.getItems().last(); Assertions.assertThat(firstPoisonAmendmentItem.getManualDiscountAmount()).isNull(); Assertions.assertThat(firstPoisonAmendmentItem.getDiscountPercentage()).isEqualTo(new BigDecimal("100.0")); Assertions.assertThat(firstPoisonAmendmentItem.getStartDate()).isEqualTo(new LocalDate(2020,7,1)); Assertions.assertThat(firstPoisonAmendmentItem.getEndDate()).isEqualTo(new LocalDate(2020,8,31)); Assertions.assertThat(secondPoisonAmendmentItem.getManualDiscountAmount()).isNull(); Assertions.assertThat(secondPoisonAmendmentItem.getDiscountPercentage()).isEqualTo(new BigDecimal("50.0")); Assertions.assertThat(secondPoisonAmendmentItem.getStartDate()).isEqualTo(new LocalDate(2020,9,1)); Assertions.assertThat(secondPoisonAmendmentItem.getEndDate()).isEqualTo(new LocalDate(2020,9,30)); Assertions.assertThat(thirdPoisonAmendmentItem.getManualDiscountAmount()).isNull(); Assertions.assertThat(thirdPoisonAmendmentItem.getDiscountPercentage()).isEqualTo(new BigDecimal("25.0")); Assertions.assertThat(thirdPoisonAmendmentItem.getStartDate()).isEqualTo(new LocalDate(2020,10,1)); Assertions.assertThat(thirdPoisonAmendmentItem.getEndDate()).isEqualTo(new LocalDate(2020,10,31)); Assertions.assertThat(lastPoisonAmendmentItem.getAmendedInvoicingFrequency()).isEqualTo(MONTHLY_IN_ADVANCE); Assertions.assertThat(lastPoisonAmendmentItem.getInvoicingFrequencyOnLease()).isEqualTo(QUARTERLY_IN_ADVANCE); Assertions.assertThat(lastPoisonAmendmentItem.getStartDate()).isEqualTo(new LocalDate(2020,7,1)); Assertions.assertThat(lastPoisonAmendmentItem.getEndDate()).isEqualTo(new LocalDate(2020,12,31)); final Lease miracleLease = Lease_enum.OxfMiracl005Gb.findUsing(serviceRegistry); final LeaseAmendment amendmentForMiracle = leaseAmendmentRepository.findUnique(miracleLease, LeaseAmendmentTemplate.DEMO_TYPE2); Assertions.assertThat(amendmentForMiracle.getState()).isEqualTo(LeaseAmendmentState.PROPOSED); Assertions.assertThat(amendmentForMiracle.getStartDate()).isEqualTo(new LocalDate(2020,7,1)); Assertions.assertThat(amendmentForMiracle.getDateSigned()).isNull(); Assertions.assertThat(amendmentForMiracle.getItems()).hasSize(2); final LeaseAmendmentItemForDiscount firstMiracleAmendmentItem = (LeaseAmendmentItemForDiscount) amendmentForMiracle.getItems().first(); Assertions.assertThat(firstMiracleAmendmentItem.getManualDiscountAmount()).isNull(); Assertions.assertThat(firstMiracleAmendmentItem.getDiscountPercentage()).isEqualTo(new BigDecimal("55.55")); Assertions.assertThat(firstMiracleAmendmentItem.getStartDate()).isEqualTo(new LocalDate(2020,7,1)); Assertions.assertThat(firstMiracleAmendmentItem.getEndDate()).isEqualTo(new LocalDate(2020,8,31)); final Lease mediaLease = Lease_enum.OxfMediaX002Gb.findUsing(serviceRegistry); final LeaseAmendment amendmentForMedia = leaseAmendmentRepository.findUnique(mediaLease, LeaseAmendmentTemplate.DEMO_TYPE2); Assertions.assertThat(amendmentForMedia.getState()).isEqualTo(LeaseAmendmentState.PROPOSED); Assertions.assertThat(amendmentForMedia.getDateSigned()).isNull(); Assertions.assertThat(amendmentForMedia.getItems()).isEmpty(); // and when manager.importAmendments(excelSheet2); // then Assertions.assertThat(leaseAmendmentRepository.findByTemplate(LeaseAmendmentTemplate.DEMO_TYPE2)).hasSize(4); Assertions.assertThat(amendmentForTopmodel.getState()).isEqualTo(LeaseAmendmentState.APPLY); Assertions.assertThat(amendmentForTopmodel.getStartDate()).isEqualTo(new LocalDate(2020,6,1)); Assertions.assertThat(amendmentForTopmodel.getDateSigned()).isNull(); Assertions.assertThat(amendmentForTopmodel.getItems()).hasSize(1); final LeaseAmendmentItemForDiscount amendmentItemForTopmodel2 = (LeaseAmendmentItemForDiscount) amendmentForTopmodel.getItems().first(); Assertions.assertThat(amendmentItemForTopmodel2.getManualDiscountAmount()).isEqualTo(new BigDecimal("-3500.12")); Assertions.assertThat(amendmentItemForTopmodel2.getStartDate()).isEqualTo(new LocalDate(2020,7,2)); Assertions.assertThat(amendmentItemForTopmodel2.getEndDate()).isEqualTo(new LocalDate(2020,8,30)); Assertions.assertThat(amendmentForPoison.getState()).isEqualTo(LeaseAmendmentState.SIGNED); // AND NOT REFUSED as suggested in sheet2 Assertions.assertThat(amendmentForPoison.getDateRefused()).isNull(); Assertions.assertThat(amendmentForPoison.getStartDate()).isEqualTo(new LocalDate(2020,7,1)); Assertions.assertThat(amendmentForPoison.getDateSigned()).isEqualTo(new LocalDate(2020,6, 20)); Assertions.assertThat(amendmentForPoison.getItems()).hasSize(4); final LeaseAmendmentItemForDiscount firstPoisonAmendmentItem2 = (LeaseAmendmentItemForDiscount) amendmentForPoison.findItemsOfType( LeaseAmendmentItemType.DISCOUNT).stream().sorted(Comparator.comparing(LeaseAmendmentItem::getStartDate)).collect( Collectors.toList()).get(0); final LeaseAmendmentItemForDiscount secondPoisonAmendmentItem2 = (LeaseAmendmentItemForDiscount) amendmentForPoison.findItemsOfType( LeaseAmendmentItemType.DISCOUNT).stream().sorted(Comparator.comparing(LeaseAmendmentItem::getStartDate)).collect( Collectors.toList()).get(1); final LeaseAmendmentItemForDiscount thirdPoisonAmendmentItem2 = (LeaseAmendmentItemForDiscount) amendmentForPoison.findItemsOfType( LeaseAmendmentItemType.DISCOUNT).stream().sorted(Comparator.comparing(LeaseAmendmentItem::getStartDate)).collect( Collectors.toList()).get(2); final LeaseAmendmentItemForFrequencyChange lastPoisonAmendmentItem2 = (LeaseAmendmentItemForFrequencyChange) amendmentForPoison.getItems().last(); Assertions.assertThat(firstPoisonAmendmentItem2.getManualDiscountAmount()).isNull(); Assertions.assertThat(firstPoisonAmendmentItem2.getDiscountPercentage()).isEqualTo(new BigDecimal("100.0")); Assertions.assertThat(firstPoisonAmendmentItem2.getStartDate()).isEqualTo(new LocalDate(2020,8,1)); Assertions.assertThat(firstPoisonAmendmentItem2.getEndDate()).isEqualTo(new LocalDate(2020,8,31)); Assertions.assertThat(secondPoisonAmendmentItem2.getManualDiscountAmount()).isNull(); Assertions.assertThat(secondPoisonAmendmentItem2.getDiscountPercentage()).isEqualTo(new BigDecimal("50.0")); Assertions.assertThat(secondPoisonAmendmentItem2.getStartDate()).isEqualTo(new LocalDate(2020,9,1)); Assertions.assertThat(secondPoisonAmendmentItem2.getEndDate()).isEqualTo(new LocalDate(2020,9,30)); Assertions.assertThat(thirdPoisonAmendmentItem2.getManualDiscountAmount()).isNull(); Assertions.assertThat(thirdPoisonAmendmentItem2.getDiscountPercentage()).isEqualTo(new BigDecimal("30.0")); Assertions.assertThat(thirdPoisonAmendmentItem2.getStartDate()).isEqualTo(new LocalDate(2020,10,1)); Assertions.assertThat(thirdPoisonAmendmentItem2.getEndDate()).isEqualTo(new LocalDate(2020,11,30)); Assertions.assertThat(lastPoisonAmendmentItem2.getAmendedInvoicingFrequency()).isEqualTo(MONTHLY_IN_ADVANCE); Assertions.assertThat(lastPoisonAmendmentItem2.getInvoicingFrequencyOnLease()).isEqualTo(QUARTERLY_IN_ADVANCE); Assertions.assertThat(lastPoisonAmendmentItem2.getStartDate()).isEqualTo(new LocalDate(2020,7,1)); Assertions.assertThat(lastPoisonAmendmentItem2.getEndDate()).isEqualTo(new LocalDate(2020,12,31)); Assertions.assertThat(amendmentForMiracle.getState()).isEqualTo(LeaseAmendmentState.SIGNED); Assertions.assertThat(amendmentForMiracle.getStartDate()).isEqualTo(new LocalDate(2020,7,1)); Assertions.assertThat(amendmentForMiracle.getDateSigned()).isEqualTo(new LocalDate(2020,7,21)); Assertions.assertThat(amendmentForMiracle.getItems()).hasSize(2); final LeaseAmendmentItemForDiscount firstMiracleAmendmentItem2 = (LeaseAmendmentItemForDiscount) amendmentForMiracle.getItems().first(); Assertions.assertThat(firstMiracleAmendmentItem2.getManualDiscountAmount()).isNull(); Assertions.assertThat(firstMiracleAmendmentItem2.getDiscountPercentage()).isEqualTo(new BigDecimal("60.0")); Assertions.assertThat(firstMiracleAmendmentItem2.getStartDate()).isEqualTo(new LocalDate(2020,7,2)); Assertions.assertThat(firstMiracleAmendmentItem2.getEndDate()).isEqualTo(new LocalDate(2020,8,30)); Assertions.assertThat(amendmentForMedia.getState()).isEqualTo(LeaseAmendmentState.REFUSED); Assertions.assertThat(amendmentForMedia.getDateRefused()).isEqualTo(new LocalDate(2020,6,22)); Assertions.assertThat(amendmentForMedia.getDateSigned()).isNull(); Assertions.assertThat(amendmentForMedia.getItems()).isEmpty(); } @Inject LeaseAmendmentRepository leaseAmendmentRepository; @Inject ServiceRegistry2 serviceRegistry2; }
{ "content_hash": "6dfe0b4209a1f2e75950f51240de3b83", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 154, "avg_line_length": 74.62053571428571, "alnum_prop": 0.7776847143284475, "repo_name": "estatio/estatio", "id": "04f7e27dd3057c2bbc770610a6cc17db0831f245", "size": "17355", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "estatioapp/app/src/test/java/org/estatio/module/lease/integtests/amendments/LeaseAmendmentImport_IntegTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "4016" }, { "name": "FreeMarker", "bytes": "122229" }, { "name": "HTML", "bytes": "61077" }, { "name": "Java", "bytes": "9066306" }, { "name": "JavaScript", "bytes": "1226" }, { "name": "Shell", "bytes": "2202" }, { "name": "TSQL", "bytes": "9363" } ], "symlink_target": "" }
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <title>NativeRuntimeLoader</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> <script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../../jquery/jquery-3.3.1.js"></script> <script type="text/javascript" src="../../../jquery/jquery-migrate-3.0.1.js"></script> <script type="text/javascript" src="../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="NativeRuntimeLoader"; } } catch(err) { } //--> var data = {"i0":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; var pathtoroot = "../../../"; var useModuleDirectories = true; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</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 class="aboutLanguage"><ul class="navList" style="font-size: 1.5em;"><li>Robolectric 4.9-SNAPSHOT | <a href="/" target="_top"><img src="http://robolectric.org/images/logo-with-bubbles-down.png" style="max-height: 18pt; vertical-align: sub;"/></a></li></ul></div> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </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> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a id="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <!-- ======== START OF CLASS DATA ======== --> <main role="main"> <div class="header"> <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.robolectric.pluginapi</a></div> <h2 title="Interface NativeRuntimeLoader" class="title">Interface NativeRuntimeLoader</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Known Implementing Classes:</dt> <dd><code><a href="../nativeruntime/DefaultNativeRuntimeLoader.html" title="class in org.robolectric.nativeruntime">DefaultNativeRuntimeLoader</a></code></dd> </dl> <hr> <pre>@Beta public interface <span class="typeNameLabel">NativeRuntimeLoader</span></pre> <div class="block">Loads the Robolectric native runtime. <p>By default, the native runtime shared library is loaded from Java resources. However, in some environments, there may be a faster and simpler way to load it.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colSecond" scope="col">Method</th> <th class="colLast" scope="col">Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ensureLoaded()">ensureLoaded</a></span>()</code></th> <td class="colLast">&nbsp;</td> </tr> </table> </li> </ul> </section> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a id="ensureLoaded()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>ensureLoaded</h4> <pre class="methodSignature">void&nbsp;ensureLoaded()</pre> </li> </ul> </li> </ul> </section> </li> </ul> </div> </div> </main> <!-- ========= END OF CLASS DATA ========= --> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</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 class="aboutLanguage"><ul class="navList" style="font-size: 1.5em;"><li>Robolectric 4.9-SNAPSHOT | <a href="/" target="_top"><img src="http://robolectric.org/images/logo-with-bubbles-down.png" style="max-height: 18pt; vertical-align: sub;"/></a></li></ul></div> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses.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> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a id="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> </footer> </body> </html>
{ "content_hash": "1197f2031a882238cea6ed8973cfe48e", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 391, "avg_line_length": 33.027027027027025, "alnum_prop": 0.6361935936404022, "repo_name": "robolectric/robolectric.github.io", "id": "78116e0da967dcec1055c1f9e738e7f3921b11db", "size": "8554", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "javadoc/4.8/org/robolectric/pluginapi/NativeRuntimeLoader.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "132673" }, { "name": "HTML", "bytes": "277730" }, { "name": "JavaScript", "bytes": "24371" }, { "name": "Ruby", "bytes": "1051" }, { "name": "SCSS", "bytes": "64100" }, { "name": "Shell", "bytes": "481" } ], "symlink_target": "" }
<?php use Core\BaseException; $DS = DIRECTORY_SEPARATOR; define('ROOT', __DIR__); if (!isset($loader)) { $loader = require_once ROOT . $DS . 'vendor' . $DS . 'autoload.php'; } if (isset($setupErrorHandler)) { set_error_handler( function ($code, $string, $errfile, $errline) { throw new BaseException($string, $code); }, E_ALL | E_STRICT ); } register_shutdown_function(function() { $error = error_get_last(); if ($error['type'] === E_ERROR) { file_put_contents('nohup.out', 'Crushed at '.date('Y-m-d H:i:s')); } }); error_reporting(E_ALL | E_STRICT); date_default_timezone_set('UTC'); setlocale(LC_CTYPE, "en_US.UTF8"); setlocale(LC_TIME, "en_US.UTF8"); $defaultEncoding = 'UTF-8'; mb_internal_encoding($defaultEncoding); mb_regex_encoding($defaultEncoding);
{ "content_hash": "63afd29309ca0e6941390ab39533b999", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 75, "avg_line_length": 22.62162162162162, "alnum_prop": 0.6105137395459976, "repo_name": "kryoz/sociochat", "id": "f878ced092231abf40340c545796c365818335a5", "size": "837", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "10353" }, { "name": "HTML", "bytes": "51292" }, { "name": "JavaScript", "bytes": "114725" }, { "name": "Nginx", "bytes": "4171" }, { "name": "PHP", "bytes": "479638" }, { "name": "Shell", "bytes": "71" } ], "symlink_target": "" }
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'PHP Password Library' copyright = u'2012, Ryan Chouinard' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '3.0' # The full version, including alpha/beta/rc tags. release = '3.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'PHPPasswordLibrarydoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'PHPPasswordLibrary.tex', u'PHP Password Library Documentation', u'Ryan Chouinard', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'phppasswordlibrary', u'PHP Password Library Documentation', [u'Ryan Chouinard'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'PHPPasswordLibrary', u'PHP Password Library Documentation', u'Ryan Chouinard', 'PHPPasswordLibrary', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote'
{ "content_hash": "062984c6834ee34d5f0b7f7624eb2c01", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 80, "avg_line_length": 32.39737991266376, "alnum_prop": 0.7044076021027093, "repo_name": "rchouinard/phpass-docs", "id": "53c2cd70cd504b3568df0808dc13128b61c3e760", "size": "7850", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/conf.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "7850" } ], "symlink_target": "" }
CREATE TABLE account ( id BIGSERIAL NOT NULL, version BIGINT, created TIMESTAMP WITH TIME ZONE, modified TIMESTAMP WITH TIME ZONE, username VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, CONSTRAINT pk_account PRIMARY KEY (id), CONSTRAINT unique_username UNIQUE(username), CONSTRAINT unique_email UNIQUE(email) );
{ "content_hash": "c732fcca93759dc1195cb3fdbb67ed9b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 46, "avg_line_length": 28.46153846153846, "alnum_prop": 0.754054054054054, "repo_name": "frostmonkey/phixyenteering-server", "id": "beb060446c110aef119af5f5b6d318bbd16d7ffc", "size": "370", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "src/main/resources/db/migration/V20161102131900__add_account_table.sql", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "153436" }, { "name": "PLSQL", "bytes": "62" }, { "name": "RAML", "bytes": "3651" }, { "name": "RobotFramework", "bytes": "11175" }, { "name": "Shell", "bytes": "4840" } ], "symlink_target": "" }
Hardware | New Media Development | Graphic and Digital Media | Artevelde University College Ghent
{ "content_hash": "72e0d3046c15d183ba535ada1c7e242b", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 97, "avg_line_length": 98, "alnum_prop": 0.8163265306122449, "repo_name": "gdmgent-1718-wot/Hardware", "id": "d76783ffe47a2c7ec8a67367b94e17693f13ec0f", "size": "109", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "44445" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "5268a5e7b66bd3ad8f3d57560b67ffb3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "115f221436440fd99d33a31d8e52467c53059656", "size": "179", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Oxalidales/Brunelliaceae/Brunellia/Brunellia pitayensis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php /* AcmeDemoBundle:Demo:contact.html.twig */ class __TwigTemplate_738a0a3f077155242cb26b9f6b0e42f203a0b34daf346c899b9ce9f786288ce8 extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); // line 1 try { $this->parent = $this->env->loadTemplate("AcmeDemoBundle::layout.html.twig"); } catch (Twig_Error_Loader $e) { $e->setTemplateFile($this->getTemplateName()); $e->setTemplateLine(1); throw $e; } $this->blocks = array( 'title' => array($this, 'block_title'), 'content' => array($this, 'block_content'), ); } protected function doGetParent(array $context) { return "AcmeDemoBundle::layout.html.twig"; } protected function doDisplay(array $context, array $blocks = array()) { $this->parent->display($context, array_merge($this->blocks, $blocks)); } // line 3 public function block_title($context, array $blocks = array()) { echo "Symfony - Contact form"; } // line 5 public function block_content($context, array $blocks = array()) { // line 6 echo " <form action=\""; echo $this->env->getExtension('routing')->getPath("_demo_contact"); echo "\" method=\"POST\" id=\"contact_form\"> "; // line 7 echo $this->env->getExtension('form')->renderer->searchAndRenderBlock((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), 'errors'); echo " "; // line 9 echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "email", array()), 'row'); echo " "; // line 10 echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "message", array()), 'row'); echo " "; // line 12 echo $this->env->getExtension('form')->renderer->searchAndRenderBlock((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), 'rest'); echo " <input type=\"submit\" value=\"Send\" class=\"symfony-button-grey\" /> </form> "; } public function getTemplateName() { return "AcmeDemoBundle:Demo:contact.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 65 => 12, 60 => 10, 56 => 9, 51 => 7, 46 => 6, 43 => 5, 37 => 3, 11 => 1,); } }
{ "content_hash": "89405b673597e21f8d34d7bfcd66a2fc", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 210, "avg_line_length": 32.22093023255814, "alnum_prop": 0.5626127751714183, "repo_name": "orlk/hopitrepo", "id": "3c4cc1f5b6dd3615ac67cf4e36e1d3cb06322a35", "size": "2771", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/cache/dev/twig/73/8a/0a3f077155242cb26b9f6b0e42f203a0b34daf346c899b9ce9f786288ce8.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3073" }, { "name": "Batchfile", "bytes": "373" }, { "name": "CSS", "bytes": "102659" }, { "name": "HTML", "bytes": "155478" }, { "name": "JavaScript", "bytes": "130336" }, { "name": "PHP", "bytes": "257295" }, { "name": "Shell", "bytes": "593" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.opentosca.driver</groupId> <artifactId>java</artifactId> <version>1.0</version> <relativePath>../pom.xml</relativePath> </parent> <artifactId>driver-mqtt</artifactId> <dependencies> <dependency> <groupId>org.eclipse.paho</groupId> <artifactId>org.eclipse.paho.client.mqttv3</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>org.opentosca.driver</groupId> <artifactId>driver-manager</artifactId> <version>1.0</version> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-shade-plugin</artifactId> </plugin> </plugins> </build> </project>
{ "content_hash": "7b9e4fab35f0eb27de5218b1a09bb409", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 105, "avg_line_length": 30.63157894736842, "alnum_prop": 0.5807560137457045, "repo_name": "miwurster/opentosca-driver-injection", "id": "05fa1e7ad988c80a3523d8269a7ac2d5166948c8", "size": "1164", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java/driver-mqtt/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "20917" }, { "name": "Python", "bytes": "11184" } ], "symlink_target": "" }
class AddInfoToUsers < ActiveRecord::Migration def change add_column :users, :name, :string add_column :users, :nickname, :string end end
{ "content_hash": "a6a21c344f30f37577011f588b51c8d0", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 46, "avg_line_length": 25, "alnum_prop": 0.7133333333333334, "repo_name": "gde-unicamp/gde", "id": "77a6459e0c7b9dab957c0e1794c3952acd95ed26", "size": "150", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "db/migrate/20140816051820_add_info_to_users.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "160833" }, { "name": "HTML", "bytes": "13955" }, { "name": "JavaScript", "bytes": "91" }, { "name": "Ruby", "bytes": "88569" } ], "symlink_target": "" }
/*************************************************************************/ /* script_editor_debugger.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* 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. */ /*************************************************************************/ #include "script_editor_debugger.h" #include "editor_node.h" #include "editor_profiler.h" #include "editor_settings.h" #include "main/performance.h" #include "project_settings.h" #include "property_editor.h" #include "scene/gui/dialogs.h" #include "scene/gui/label.h" #include "scene/gui/line_edit.h" #include "scene/gui/margin_container.h" #include "scene/gui/rich_text_label.h" #include "scene/gui/separator.h" #include "scene/gui/split_container.h" #include "scene/gui/tab_container.h" #include "scene/gui/texture_button.h" #include "scene/gui/tree.h" #include "scene/resources/packed_scene.h" #include "ustring.h" class ScriptEditorDebuggerVariables : public Object { GDCLASS(ScriptEditorDebuggerVariables, Object); List<PropertyInfo> props; Map<StringName, Variant> values; protected: bool _set(const StringName &p_name, const Variant &p_value) { return false; } bool _get(const StringName &p_name, Variant &r_ret) const { if (!values.has(p_name)) return false; r_ret = values[p_name]; return true; } void _get_property_list(List<PropertyInfo> *p_list) const { for (const List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) p_list->push_back(E->get()); } public: void clear() { props.clear(); values.clear(); } String get_var_value(const String &p_var) const { for (Map<StringName, Variant>::Element *E = values.front(); E; E = E->next()) { String v = E->key().operator String().get_slice("/", 1); if (v == p_var) return E->get(); } return ""; } void add_property(const String &p_name, const Variant &p_value, const PropertyHint &p_hint, const String p_hint_string) { PropertyInfo pinfo; pinfo.name = p_name; pinfo.type = p_value.get_type(); pinfo.hint = p_hint; pinfo.hint_string = p_hint_string; props.push_back(pinfo); values[p_name] = p_value; } void update() { _change_notify(); } ScriptEditorDebuggerVariables() { } }; class ScriptEditorDebuggerInspectedObject : public Object { GDCLASS(ScriptEditorDebuggerInspectedObject, Object); protected: bool _set(const StringName &p_name, const Variant &p_value) { if (!prop_values.has(p_name) || String(p_name).begins_with("Constants/")) return false; emit_signal("value_edited", p_name, p_value); prop_values[p_name] = p_value; return true; } bool _get(const StringName &p_name, Variant &r_ret) const { if (!prop_values.has(p_name)) return false; r_ret = prop_values[p_name]; return true; } void _get_property_list(List<PropertyInfo> *p_list) const { p_list->clear(); //sorry, no want category for (const List<PropertyInfo>::Element *E = prop_list.front(); E; E = E->next()) { p_list->push_back(E->get()); } } static void _bind_methods() { ClassDB::bind_method(D_METHOD("get_title"), &ScriptEditorDebuggerInspectedObject::get_title); ClassDB::bind_method(D_METHOD("get_variant"), &ScriptEditorDebuggerInspectedObject::get_variant); ClassDB::bind_method(D_METHOD("clear"), &ScriptEditorDebuggerInspectedObject::clear); ClassDB::bind_method(D_METHOD("get_remote_object_id"), &ScriptEditorDebuggerInspectedObject::get_remote_object_id); ADD_SIGNAL(MethodInfo("value_edited")); } public: String type_name; ObjectID remote_object_id; List<PropertyInfo> prop_list; Map<StringName, Variant> prop_values; ObjectID get_remote_object_id() { return remote_object_id; } String get_title() { if (remote_object_id) return TTR("Remote ") + String(type_name) + ": " + itos(remote_object_id); else return "<null>"; } Variant get_variant(const StringName &p_name) { Variant var; _get(p_name, var); return var; } void clear() { prop_list.clear(); prop_values.clear(); } void update() { _change_notify(); } void update_single(const char *p_prop) { _change_notify(p_prop); } ScriptEditorDebuggerInspectedObject() { remote_object_id = 0; } }; void ScriptEditorDebugger::debug_copy() { String msg = reason->get_text(); if (msg == "") return; OS::get_singleton()->set_clipboard(msg); } void ScriptEditorDebugger::debug_next() { ERR_FAIL_COND(!breaked); ERR_FAIL_COND(connection.is_null()); ERR_FAIL_COND(!connection->is_connected_to_host()); Array msg; msg.push_back("next"); ppeer->put_var(msg); stack_dump->clear(); inspector->edit(NULL); } void ScriptEditorDebugger::debug_step() { ERR_FAIL_COND(!breaked); ERR_FAIL_COND(connection.is_null()); ERR_FAIL_COND(!connection->is_connected_to_host()); Array msg; msg.push_back("step"); ppeer->put_var(msg); stack_dump->clear(); inspector->edit(NULL); } void ScriptEditorDebugger::debug_break() { ERR_FAIL_COND(breaked); ERR_FAIL_COND(connection.is_null()); ERR_FAIL_COND(!connection->is_connected_to_host()); Array msg; msg.push_back("break"); ppeer->put_var(msg); } void ScriptEditorDebugger::debug_continue() { ERR_FAIL_COND(!breaked); ERR_FAIL_COND(connection.is_null()); ERR_FAIL_COND(!connection->is_connected_to_host()); OS::get_singleton()->enable_for_stealing_focus(EditorNode::get_singleton()->get_child_process_id()); Array msg; msg.push_back("continue"); ppeer->put_var(msg); } void ScriptEditorDebugger::_scene_tree_folded(Object *obj) { if (updating_scene_tree) { return; } TreeItem *item = Object::cast_to<TreeItem>(obj); if (!item) return; ObjectID id = item->get_metadata(0); if (item->is_collapsed()) { unfold_cache.erase(id); } else { unfold_cache.insert(id); } } void ScriptEditorDebugger::_scene_tree_selected() { if (updating_scene_tree) { return; } TreeItem *item = inspect_scene_tree->get_selected(); if (!item) { return; } inspected_object_id = item->get_metadata(0); Array msg; msg.push_back("inspect_object"); msg.push_back(inspected_object_id); ppeer->put_var(msg); } void ScriptEditorDebugger::_scene_tree_rmb_selected(const Vector2 &p_position) { TreeItem *item = inspect_scene_tree->get_item_at_position(p_position); if (!item) return; item->select(0); item_menu->clear(); item_menu->add_icon_item(get_icon("CreateNewSceneFrom", "EditorIcons"), TTR("Save Branch as Scene"), ITEM_MENU_SAVE_REMOTE_NODE); item_menu->set_global_position(get_global_mouse_position()); item_menu->popup(); } void ScriptEditorDebugger::_file_selected(const String &p_file) { if (file_dialog->get_mode() == EditorFileDialog::MODE_SAVE_FILE) { Array msg; msg.push_back("save_node"); msg.push_back(inspected_object_id); msg.push_back(p_file); ppeer->put_var(msg); } } void ScriptEditorDebugger::_scene_tree_property_value_edited(const String &p_prop, const Variant &p_value) { Array msg; msg.push_back("set_object_property"); msg.push_back(inspected_object_id); msg.push_back(p_prop); msg.push_back(p_value); ppeer->put_var(msg); inspect_edited_object_timeout = 0.7; //avoid annoyance, don't request soon after editing } void ScriptEditorDebugger::_scene_tree_property_select_object(ObjectID p_object) { inspected_object_id = p_object; Array msg; msg.push_back("inspect_object"); msg.push_back(inspected_object_id); ppeer->put_var(msg); } void ScriptEditorDebugger::_scene_tree_request() { ERR_FAIL_COND(connection.is_null()); ERR_FAIL_COND(!connection->is_connected_to_host()); Array msg; msg.push_back("request_scene_tree"); ppeer->put_var(msg); } void ScriptEditorDebugger::_video_mem_request() { ERR_FAIL_COND(connection.is_null()); ERR_FAIL_COND(!connection->is_connected_to_host()); Array msg; msg.push_back("request_video_mem"); ppeer->put_var(msg); } Size2 ScriptEditorDebugger::get_minimum_size() const { Size2 ms = Control::get_minimum_size(); ms.y = MAX(ms.y, 250); return ms; } void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_data) { if (p_msg == "debug_enter") { Array msg; msg.push_back("get_stack_dump"); ppeer->put_var(msg); ERR_FAIL_COND(p_data.size() != 2); bool can_continue = p_data[0]; String error = p_data[1]; step->set_disabled(!can_continue); next->set_disabled(!can_continue); _set_reason_text(error, MESSAGE_ERROR); copy->set_disabled(false); breaked = true; dobreak->set_disabled(true); docontinue->set_disabled(false); emit_signal("breaked", true, can_continue); OS::get_singleton()->move_window_to_foreground(); if (error != "") { tabs->set_current_tab(0); } profiler->set_enabled(false); EditorNode::get_singleton()->get_pause_button()->set_pressed(true); EditorNode::get_singleton()->make_bottom_panel_item_visible(this); _clear_remote_objects(); } else if (p_msg == "debug_exit") { breaked = false; copy->set_disabled(true); step->set_disabled(true); next->set_disabled(true); reason->set_text(""); reason->set_tooltip(""); back->set_disabled(true); forward->set_disabled(true); dobreak->set_disabled(false); docontinue->set_disabled(true); emit_signal("breaked", false, false, Variant()); //tabs->set_current_tab(0); profiler->set_enabled(true); profiler->disable_seeking(); inspector->edit(NULL); EditorNode::get_singleton()->get_pause_button()->set_pressed(false); } else if (p_msg == "message:click_ctrl") { clicked_ctrl->set_text(p_data[0]); clicked_ctrl_type->set_text(p_data[1]); } else if (p_msg == "message:scene_tree") { inspect_scene_tree->clear(); Map<int, TreeItem *> lv; updating_scene_tree = true; for (int i = 0; i < p_data.size(); i += 4) { TreeItem *p; int level = p_data[i]; if (level == 0) { p = NULL; } else { ERR_CONTINUE(!lv.has(level - 1)); p = lv[level - 1]; } TreeItem *it = inspect_scene_tree->create_item(p); ObjectID id = ObjectID(p_data[i + 3]); it->set_text(0, p_data[i + 1]); if (has_icon(p_data[i + 2], "EditorIcons")) it->set_icon(0, get_icon(p_data[i + 2], "EditorIcons")); it->set_metadata(0, id); if (id == inspected_object_id) { TreeItem *cti = it->get_parent(); //ensure selected is always uncollapsed while (cti) { cti->set_collapsed(false); cti = cti->get_parent(); } it->select(0); } if (p) { if (!unfold_cache.has(id)) { it->set_collapsed(true); } } else { if (unfold_cache.has(id)) { //reverse for root it->set_collapsed(true); } } lv[level] = it; } updating_scene_tree = false; le_clear->set_disabled(false); le_set->set_disabled(false); } else if (p_msg == "message:inspect_object") { ScriptEditorDebuggerInspectedObject *debugObj = NULL; ObjectID id = p_data[0]; String type = p_data[1]; Array properties = p_data[2]; bool is_new_object = false; if (remote_objects.has(id)) { debugObj = remote_objects[id]; } else { debugObj = memnew(ScriptEditorDebuggerInspectedObject); debugObj->remote_object_id = id; debugObj->type_name = type; remote_objects[id] = debugObj; is_new_object = true; debugObj->connect("value_edited", this, "_scene_tree_property_value_edited"); } for (int i = 0; i < properties.size(); i++) { Array prop = properties[i]; if (prop.size() != 6) continue; PropertyInfo pinfo; pinfo.name = prop[0]; pinfo.type = Variant::Type(int(prop[1])); pinfo.hint = PropertyHint(int(prop[2])); pinfo.hint_string = prop[3]; pinfo.usage = PropertyUsageFlags(int(prop[4])); Variant var = prop[5]; String hint_string = pinfo.hint_string; if (hint_string.begins_with("RES:") && hint_string != "RES:") { String path = hint_string.substr(4, hint_string.length()); var = ResourceLoader::load(path); } if (is_new_object) { //don't update.. it's the same, instead refresh debugObj->prop_list.push_back(pinfo); } debugObj->prop_values[pinfo.name] = var; } if (editor->get_editor_history()->get_current() != debugObj->get_instance_id()) { editor->push_item(debugObj, ""); } else { debugObj->update(); } } else if (p_msg == "message:video_mem") { vmem_tree->clear(); TreeItem *root = vmem_tree->create_item(); int total = 0; for (int i = 0; i < p_data.size(); i += 4) { TreeItem *it = vmem_tree->create_item(root); String type = p_data[i + 1]; int bytes = p_data[i + 3].operator int(); it->set_text(0, p_data[i + 0]); //path it->set_text(1, type); //type it->set_text(2, p_data[i + 2]); //type it->set_text(3, String::humanize_size(bytes)); //type total += bytes; if (has_icon(type, "EditorIcons")) it->set_icon(0, get_icon(type, "EditorIcons")); } vmem_total->set_tooltip(TTR("Bytes:") + " " + itos(total)); vmem_total->set_text(String::humanize_size(total)); } else if (p_msg == "stack_dump") { stack_dump->clear(); TreeItem *r = stack_dump->create_item(); for (int i = 0; i < p_data.size(); i++) { Dictionary d = p_data[i]; ERR_CONTINUE(!d.has("function")); ERR_CONTINUE(!d.has("file")); ERR_CONTINUE(!d.has("line")); ERR_CONTINUE(!d.has("id")); TreeItem *s = stack_dump->create_item(r); d["frame"] = i; s->set_metadata(0, d); //String line = itos(i)+" - "+String(d["file"])+":"+itos(d["line"])+" - at func: "+d["function"]; String line = itos(i) + " - " + String(d["file"]) + ":" + itos(d["line"]); s->set_text(0, line); if (i == 0) s->select(0); } } else if (p_msg == "stack_frame_vars") { variables->clear(); int ofs = 0; int mcount = p_data[ofs]; ofs++; for (int i = 0; i < mcount; i++) { String n = p_data[ofs + i * 2 + 0]; Variant v = p_data[ofs + i * 2 + 1]; PropertyHint h = PROPERTY_HINT_NONE; String hs = String(); if (n.begins_with("*")) { n = n.substr(1, n.length()); h = PROPERTY_HINT_OBJECT_ID; String s = v; s = s.replace("[", ""); hs = s.get_slice(":", 0); v = s.get_slice(":", 1).to_int(); } variables->add_property("Locals/" + n, v, h, hs); } ofs += mcount * 2; mcount = p_data[ofs]; ofs++; for (int i = 0; i < mcount; i++) { String n = p_data[ofs + i * 2 + 0]; Variant v = p_data[ofs + i * 2 + 1]; PropertyHint h = PROPERTY_HINT_NONE; String hs = String(); if (n.begins_with("*")) { n = n.substr(1, n.length()); h = PROPERTY_HINT_OBJECT_ID; String s = v; s = s.replace("[", ""); hs = s.get_slice(":", 0); v = s.get_slice(":", 1).to_int(); } variables->add_property("Members/" + n, v, h, hs); } ofs += mcount * 2; mcount = p_data[ofs]; ofs++; for (int i = 0; i < mcount; i++) { String n = p_data[ofs + i * 2 + 0]; Variant v = p_data[ofs + i * 2 + 1]; PropertyHint h = PROPERTY_HINT_NONE; String hs = String(); if (n.begins_with("*")) { n = n.substr(1, n.length()); h = PROPERTY_HINT_OBJECT_ID; String s = v; s = s.replace("[", ""); hs = s.get_slice(":", 0); v = s.get_slice(":", 1).to_int(); } variables->add_property("Globals/" + n, v, h, hs); } variables->update(); inspector->edit(variables); } else if (p_msg == "output") { //OUT for (int i = 0; i < p_data.size(); i++) { String t = p_data[i]; //LOG if (!EditorNode::get_log()->is_visible()) { if (EditorNode::get_singleton()->are_bottom_panels_hidden()) { if (EDITOR_GET("run/output/always_open_output_on_play")) { EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorNode::get_log()); } } } EditorNode::get_log()->add_message(t); } } else if (p_msg == "performance") { Array arr = p_data[0]; Vector<float> p; p.resize(arr.size()); for (int i = 0; i < arr.size(); i++) { p.write[i] = arr[i]; if (i < perf_items.size()) { float v = p[i]; String vs = rtos(v); String tt = vs; switch (Performance::MonitorType((int)perf_items[i]->get_metadata(1))) { case Performance::MONITOR_TYPE_MEMORY: { // for the time being, going above GBs is a bad sign. String unit = "B"; if ((int)v > 1073741824) { unit = "GB"; v /= 1073741824.0; } else if ((int)v > 1048576) { unit = "MB"; v /= 1048576.0; } else if ((int)v > 1024) { unit = "KB"; v /= 1024.0; } tt += " bytes"; vs = String::num(v, 2) + " " + unit; } break; case Performance::MONITOR_TYPE_TIME: { tt += " seconds"; vs += " s"; } break; default: { tt += " " + perf_items[i]->get_text(0); } break; } perf_items[i]->set_text(1, vs); perf_items[i]->set_tooltip(1, tt); if (p[i] > perf_max[i]) perf_max.write[i] = p[i]; } } perf_history.push_front(p); perf_draw->update(); } else if (p_msg == "error") { Array err = p_data[0]; Array vals; vals.push_back(err[0]); vals.push_back(err[1]); vals.push_back(err[2]); vals.push_back(err[3]); bool warning = err[9]; bool e; String time = String("%d:%02d:%02d:%04d").sprintf(vals, &e); String txt = time + " - " + (err[8].is_zero() ? String(err[7]) : String(err[8])); String tooltip = TTR("Type:") + String(warning ? TTR("Warning") : TTR("Error")); tooltip += "\n" + TTR("Description:") + " " + String(err[8]); tooltip += "\n" + TTR("Time:") + " " + time; tooltip += "\nC " + TTR("Error:") + " " + String(err[7]); tooltip += "\nC " + TTR("Source:") + " " + String(err[5]) + ":" + String(err[6]); tooltip += "\nC " + TTR("Function:") + " " + String(err[4]); error_list->add_item(txt, EditorNode::get_singleton()->get_gui_base()->get_icon(warning ? "Warning" : "Error", "EditorIcons")); error_list->set_item_tooltip(error_list->get_item_count() - 1, tooltip); int scc = p_data[1]; Array stack; stack.resize(scc); for (int i = 0; i < scc; i++) { stack[i] = p_data[2 + i]; } error_list->set_item_metadata(error_list->get_item_count() - 1, stack); error_count++; } else if (p_msg == "profile_sig") { //cache a signature profiler_signature[p_data[1]] = p_data[0]; } else if (p_msg == "profile_frame" || p_msg == "profile_total") { EditorProfiler::Metric metric; metric.valid = true; metric.frame_number = p_data[0]; metric.frame_time = p_data[1]; metric.idle_time = p_data[2]; metric.physics_time = p_data[3]; metric.physics_frame_time = p_data[4]; int frame_data_amount = p_data[6]; int frame_function_amount = p_data[7]; if (frame_data_amount) { EditorProfiler::Metric::Category frame_time; frame_time.signature = "category_frame_time"; frame_time.name = "Frame Time"; frame_time.total_time = metric.frame_time; EditorProfiler::Metric::Category::Item item; item.calls = 1; item.line = 0; item.name = "Physics Time"; item.total = metric.physics_time; item.self = item.total; item.signature = "physics_time"; frame_time.items.push_back(item); item.name = "Idle Time"; item.total = metric.idle_time; item.self = item.total; item.signature = "idle_time"; frame_time.items.push_back(item); item.name = "Physics Frame Time"; item.total = metric.physics_frame_time; item.self = item.total; item.signature = "physics_frame_time"; frame_time.items.push_back(item); metric.categories.push_back(frame_time); } int idx = 8; for (int i = 0; i < frame_data_amount; i++) { EditorProfiler::Metric::Category c; String name = p_data[idx++]; Array values = p_data[idx++]; c.name = name.capitalize(); c.items.resize(values.size() / 2); c.total_time = 0; c.signature = "categ::" + name; for (int i = 0; i < values.size(); i += 2) { EditorProfiler::Metric::Category::Item item; item.calls = 1; item.line = 0; item.name = values[i]; item.self = values[i + 1]; item.total = item.self; item.signature = "categ::" + name + "::" + item.name; item.name = item.name.capitalize(); c.total_time += item.total; c.items.write[i / 2] = item; } metric.categories.push_back(c); } EditorProfiler::Metric::Category funcs; funcs.total_time = p_data[5]; //script time funcs.items.resize(frame_function_amount); funcs.name = "Script Functions"; funcs.signature = "script_functions"; for (int i = 0; i < frame_function_amount; i++) { int signature = p_data[idx++]; int calls = p_data[idx++]; float total = p_data[idx++]; float self = p_data[idx++]; EditorProfiler::Metric::Category::Item item; if (profiler_signature.has(signature)) { item.signature = profiler_signature[signature]; String name = profiler_signature[signature]; Vector<String> strings = name.split("::"); if (strings.size() == 3) { item.name = strings[2]; item.script = strings[0]; item.line = strings[1].to_int(); } } else { item.name = "SigErr " + itos(signature); } item.calls = calls; item.self = self; item.total = total; funcs.items.write[i] = item; } metric.categories.push_back(funcs); if (p_msg == "profile_frame") profiler->add_frame_metric(metric, false); else profiler->add_frame_metric(metric, true); } else if (p_msg == "kill_me") { editor->call_deferred("stop_child_process"); } } void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType p_type) { switch (p_type) { case MESSAGE_ERROR: reason->add_color_override("font_color", get_color("error_color", "Editor")); break; case MESSAGE_WARNING: reason->add_color_override("font_color", get_color("warning_color", "Editor")); break; default: reason->add_color_override("font_color", get_color("success_color", "Editor")); } reason->set_text(p_reason); reason->set_tooltip(p_reason.word_wrap(80)); } void ScriptEditorDebugger::_performance_select() { perf_draw->update(); } void ScriptEditorDebugger::_performance_draw() { Vector<int> which; for (int i = 0; i < perf_items.size(); i++) { if (perf_items[i]->is_checked(0)) which.push_back(i); } Ref<Font> graph_font = get_font("font", "TextEdit"); if (which.empty()) { perf_draw->draw_string(graph_font, Point2(0, graph_font->get_ascent()), TTR("Pick one or more items from the list to display the graph."), get_color("font_color", "Label"), perf_draw->get_size().x); return; } Ref<StyleBox> graph_sb = get_stylebox("normal", "TextEdit"); int cols = Math::ceil(Math::sqrt((float)which.size())); int rows = Math::ceil((float)which.size() / cols); if (which.size() == 1) rows = 1; int margin = 3; int point_sep = 5; Size2i s = Size2i(perf_draw->get_size()) / Size2i(cols, rows); for (int i = 0; i < which.size(); i++) { Point2i p(i % cols, i / cols); Rect2i r(p * s, s); r.position += Point2(margin, margin); r.size -= Point2(margin, margin) * 2.0; perf_draw->draw_style_box(graph_sb, r); r.position += graph_sb->get_offset(); r.size -= graph_sb->get_minimum_size(); int pi = which[i]; Color c = get_color("accent_color", "Editor"); float h = (float)which[i] / (float)(perf_items.size()); c.set_hsv(Math::fmod(h + 0.4, 0.9), c.get_s() * 0.9, c.get_v() * 1.4); c.a = 0.6; perf_draw->draw_string(graph_font, r.position + Point2(0, graph_font->get_ascent()), perf_items[pi]->get_text(0), c, r.size.x); c.a = 0.9; perf_draw->draw_string(graph_font, r.position + Point2(0, graph_font->get_ascent() + graph_font->get_height()), perf_items[pi]->get_text(1), c, r.size.y); float spacing = point_sep / float(cols); float from = r.size.width; List<Vector<float> >::Element *E = perf_history.front(); float prev = -1; while (from >= 0 && E) { float m = perf_max[pi]; if (m == 0) m = 0.00001; float h = E->get()[pi] / m; h = (1.0 - h) * r.size.y; c.a = 0.7; if (E != perf_history.front()) perf_draw->draw_line(r.position + Point2(from, h), r.position + Point2(from + spacing, prev), c, 2.0); prev = h; E = E->next(); from -= spacing; } } } void ScriptEditorDebugger::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { inspector->edit(variables); copy->set_icon(get_icon("ActionCopy", "EditorIcons")); step->set_icon(get_icon("DebugStep", "EditorIcons")); next->set_icon(get_icon("DebugNext", "EditorIcons")); back->set_icon(get_icon("Back", "EditorIcons")); forward->set_icon(get_icon("Forward", "EditorIcons")); dobreak->set_icon(get_icon("Pause", "EditorIcons")); docontinue->set_icon(get_icon("DebugContinue", "EditorIcons")); //scene_tree_refresh->set_icon( get_icon("Reload","EditorIcons")); le_set->connect("pressed", this, "_live_edit_set"); le_clear->connect("pressed", this, "_live_edit_clear"); error_list->connect("item_selected", this, "_error_selected"); error_stack->connect("item_selected", this, "_error_stack_selected"); vmem_refresh->set_icon(get_icon("Reload", "EditorIcons")); reason->add_color_override("font_color", get_color("error_color", "Editor")); bool enable_rl = EditorSettings::get_singleton()->get("docks/scene_tree/draw_relationship_lines"); Color rl_color = EditorSettings::get_singleton()->get("docks/scene_tree/relationship_line_color"); if (enable_rl) { inspect_scene_tree->add_constant_override("draw_relationship_lines", 1); inspect_scene_tree->add_color_override("relationship_line_color", rl_color); } else inspect_scene_tree->add_constant_override("draw_relationship_lines", 0); } break; case NOTIFICATION_PROCESS: { if (connection.is_valid()) { inspect_scene_tree_timeout -= get_process_delta_time(); if (inspect_scene_tree_timeout < 0) { inspect_scene_tree_timeout = EditorSettings::get_singleton()->get("debugger/remote_scene_tree_refresh_interval"); if (inspect_scene_tree->is_visible_in_tree()) { _scene_tree_request(); } } inspect_edited_object_timeout -= get_process_delta_time(); if (inspect_edited_object_timeout < 0) { inspect_edited_object_timeout = EditorSettings::get_singleton()->get("debugger/remote_inspect_refresh_interval"); if (inspected_object_id) { if (ScriptEditorDebuggerInspectedObject *obj = Object::cast_to<ScriptEditorDebuggerInspectedObject>(ObjectDB::get_instance(editor->get_editor_history()->get_current()))) { if (obj->remote_object_id == inspected_object_id) { //take the chance and re-inspect selected object Array msg; msg.push_back("inspect_object"); msg.push_back(inspected_object_id); ppeer->put_var(msg); } } } } } if (error_count != last_error_count) { if (error_count == 0) { error_split->set_name(TTR("Errors")); debugger_button->set_text(TTR("Debugger")); debugger_button->set_icon(Ref<Texture>()); tabs->set_tab_icon(error_split->get_index(), Ref<Texture>()); } else { error_split->set_name(TTR("Errors") + " (" + itos(error_count) + ")"); debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count) + ")"); debugger_button->set_icon(get_icon("Error", "EditorIcons")); tabs->set_tab_icon(error_split->get_index(), get_icon("Error", "EditorIcons")); } last_error_count = error_count; } if (connection.is_null()) { if (server->is_connection_available()) { connection = server->take_connection(); if (connection.is_null()) break; EditorNode::get_log()->add_message("** Debug Process Started **"); ppeer->set_stream_peer(connection); //EditorNode::get_singleton()->make_bottom_panel_item_visible(this); //emit_signal("show_debugger",true); dobreak->set_disabled(false); tabs->set_current_tab(0); _set_reason_text(TTR("Child Process Connected"), MESSAGE_SUCCESS); profiler->clear(); inspect_scene_tree->clear(); le_set->set_disabled(true); le_clear->set_disabled(false); error_list->clear(); error_stack->clear(); error_count = 0; profiler_signature.clear(); //live_edit_root->set_text("/root"); EditorNode::get_singleton()->get_pause_button()->set_pressed(false); EditorNode::get_singleton()->get_pause_button()->set_disabled(false); update_live_edit_root(); if (profiler->is_profiling()) { _profiler_activate(true); } } else { break; } }; if (!connection->is_connected_to_host()) { stop(); editor->notify_child_process_exited(); //somehow, exited break; }; if (ppeer->get_available_packet_count() <= 0) { break; }; const uint64_t until = OS::get_singleton()->get_ticks_msec() + 20; while (ppeer->get_available_packet_count() > 0) { if (pending_in_queue) { int todo = MIN(ppeer->get_available_packet_count(), pending_in_queue); for (int i = 0; i < todo; i++) { Variant cmd; Error ret = ppeer->get_var(cmd); if (ret != OK) { stop(); ERR_FAIL_COND(ret != OK); } message.push_back(cmd); pending_in_queue--; } if (pending_in_queue == 0) { _parse_message(message_type, message); message.clear(); } } else { if (ppeer->get_available_packet_count() >= 2) { Variant cmd; Error ret = ppeer->get_var(cmd); if (ret != OK) { stop(); ERR_FAIL_COND(ret != OK); } if (cmd.get_type() != Variant::STRING) { stop(); ERR_FAIL_COND(cmd.get_type() != Variant::STRING); } message_type = cmd; //print_line("GOT: "+message_type); ret = ppeer->get_var(cmd); if (ret != OK) { stop(); ERR_FAIL_COND(ret != OK); } if (cmd.get_type() != Variant::INT) { stop(); ERR_FAIL_COND(cmd.get_type() != Variant::INT); } pending_in_queue = cmd; if (pending_in_queue == 0) { _parse_message(message_type, Array()); message.clear(); } } else { break; } } if (OS::get_singleton()->get_ticks_msec() > until) break; } } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); tabs->add_style_override("tab_fg", editor->get_gui_base()->get_stylebox("DebuggerTabFG", "EditorStyles")); tabs->add_style_override("tab_bg", editor->get_gui_base()->get_stylebox("DebuggerTabBG", "EditorStyles")); tabs->set_margin(MARGIN_LEFT, -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); tabs->set_margin(MARGIN_RIGHT, EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); bool enable_rl = EditorSettings::get_singleton()->get("docks/scene_tree/draw_relationship_lines"); Color rl_color = EditorSettings::get_singleton()->get("docks/scene_tree/relationship_line_color"); if (enable_rl) { inspect_scene_tree->add_constant_override("draw_relationship_lines", 1); inspect_scene_tree->add_color_override("relationship_line_color", rl_color); } else inspect_scene_tree->add_constant_override("draw_relationship_lines", 0); copy->set_icon(get_icon("ActionCopy", "EditorIcons")); step->set_icon(get_icon("DebugStep", "EditorIcons")); next->set_icon(get_icon("DebugNext", "EditorIcons")); back->set_icon(get_icon("Back", "EditorIcons")); forward->set_icon(get_icon("Forward", "EditorIcons")); dobreak->set_icon(get_icon("Pause", "EditorIcons")); docontinue->set_icon(get_icon("DebugContinue", "EditorIcons")); vmem_refresh->set_icon(get_icon("Reload", "EditorIcons")); } break; } } void ScriptEditorDebugger::start() { stop(); if (is_visible_in_tree()) { EditorNode::get_singleton()->make_bottom_panel_item_visible(this); } perf_history.clear(); for (int i = 0; i < Performance::MONITOR_MAX; i++) { perf_max.write[i] = 0; } int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port"); if (server->listen(remote_port) != OK) { EditorNode::get_log()->add_message(String("Error listening on port ") + itos(remote_port), true); return; } EditorNode::get_singleton()->get_scene_tree_dock()->show_tab_buttons(); auto_switch_remote_scene_tree = (bool)EditorSettings::get_singleton()->get("debugger/auto_switch_to_remote_scene_tree"); if (auto_switch_remote_scene_tree) { EditorNode::get_singleton()->get_scene_tree_dock()->show_remote_tree(); } set_process(true); breaked = false; } void ScriptEditorDebugger::pause() { } void ScriptEditorDebugger::unpause() { } void ScriptEditorDebugger::stop() { set_process(false); breaked = false; server->stop(); ppeer->set_stream_peer(Ref<StreamPeer>()); if (connection.is_valid()) { EditorNode::get_log()->add_message("** Debug Process Stopped **"); connection.unref(); } pending_in_queue = 0; message.clear(); node_path_cache.clear(); res_path_cache.clear(); profiler_signature.clear(); le_clear->set_disabled(false); le_set->set_disabled(true); profiler->set_enabled(true); inspect_scene_tree->clear(); EditorNode::get_singleton()->get_pause_button()->set_pressed(false); EditorNode::get_singleton()->get_pause_button()->set_disabled(true); EditorNode::get_singleton()->get_scene_tree_dock()->hide_remote_tree(); EditorNode::get_singleton()->get_scene_tree_dock()->hide_tab_buttons(); Node *node = editor->get_scene_tree_dock()->get_tree_editor()->get_selected(); editor->push_item(node); if (hide_on_stop) { if (is_visible_in_tree()) EditorNode::get_singleton()->hide_bottom_panel(); emit_signal("show_debugger", false); } } void ScriptEditorDebugger::_profiler_activate(bool p_enable) { if (!connection.is_valid()) return; if (p_enable) { profiler_signature.clear(); Array msg; msg.push_back("start_profiling"); int max_funcs = EditorSettings::get_singleton()->get("debugger/profiler_frame_max_functions"); max_funcs = CLAMP(max_funcs, 16, 512); msg.push_back(max_funcs); ppeer->put_var(msg); print_line("BEGIN PROFILING!"); } else { Array msg; msg.push_back("stop_profiling"); ppeer->put_var(msg); print_line("END PROFILING!"); } } void ScriptEditorDebugger::_profiler_seeked() { if (!connection.is_valid() || !connection->is_connected_to_host()) return; if (breaked) return; debug_break(); } void ScriptEditorDebugger::_stack_dump_frame_selected() { TreeItem *ti = stack_dump->get_selected(); if (!ti) return; Dictionary d = ti->get_metadata(0); stack_script = ResourceLoader::load(d["file"]); emit_signal("goto_script_line", stack_script, int(d["line"]) - 1); stack_script.unref(); if (connection.is_valid() && connection->is_connected_to_host()) { Array msg; msg.push_back("get_stack_frame_vars"); msg.push_back(d["frame"]); ppeer->put_var(msg); } else { inspector->edit(NULL); } } void ScriptEditorDebugger::_output_clear() { //output->clear(); //output->push_color(Color(0,0,0)); } String ScriptEditorDebugger::get_var_value(const String &p_var) const { if (!breaked) return String(); return variables->get_var_value(p_var); } int ScriptEditorDebugger::_get_node_path_cache(const NodePath &p_path) { const int *r = node_path_cache.getptr(p_path); if (r) return *r; last_path_id++; node_path_cache[p_path] = last_path_id; Array msg; msg.push_back("live_node_path"); msg.push_back(p_path); msg.push_back(last_path_id); ppeer->put_var(msg); return last_path_id; } int ScriptEditorDebugger::_get_res_path_cache(const String &p_path) { Map<String, int>::Element *E = res_path_cache.find(p_path); if (E) return E->get(); last_path_id++; res_path_cache[p_path] = last_path_id; Array msg; msg.push_back("live_res_path"); msg.push_back(p_path); msg.push_back(last_path_id); ppeer->put_var(msg); return last_path_id; } void ScriptEditorDebugger::_method_changed(Object *p_base, const StringName &p_name, VARIANT_ARG_DECLARE) { if (!p_base || !live_debug || !connection.is_valid() || !editor->get_edited_scene()) return; Node *node = Object::cast_to<Node>(p_base); VARIANT_ARGPTRS for (int i = 0; i < VARIANT_ARG_MAX; i++) { //no pointers, sorry if (argptr[i] && (argptr[i]->get_type() == Variant::OBJECT || argptr[i]->get_type() == Variant::_RID)) return; } if (node) { NodePath path = editor->get_edited_scene()->get_path_to(node); int pathid = _get_node_path_cache(path); Array msg; msg.push_back("live_node_call"); msg.push_back(pathid); msg.push_back(p_name); for (int i = 0; i < VARIANT_ARG_MAX; i++) { //no pointers, sorry msg.push_back(*argptr[i]); } ppeer->put_var(msg); return; } Resource *res = Object::cast_to<Resource>(p_base); if (res && res->get_path() != String()) { String respath = res->get_path(); int pathid = _get_res_path_cache(respath); Array msg; msg.push_back("live_res_call"); msg.push_back(pathid); msg.push_back(p_name); for (int i = 0; i < VARIANT_ARG_MAX; i++) { //no pointers, sorry msg.push_back(*argptr[i]); } ppeer->put_var(msg); return; } //print_line("method"); } void ScriptEditorDebugger::_property_changed(Object *p_base, const StringName &p_property, const Variant &p_value) { if (!p_base || !live_debug || !connection.is_valid() || !editor->get_edited_scene()) return; Node *node = Object::cast_to<Node>(p_base); if (node) { NodePath path = editor->get_edited_scene()->get_path_to(node); int pathid = _get_node_path_cache(path); if (p_value.is_ref()) { Ref<Resource> res = p_value; if (res.is_valid() && res->get_path() != String()) { Array msg; msg.push_back("live_node_prop_res"); msg.push_back(pathid); msg.push_back(p_property); msg.push_back(res->get_path()); ppeer->put_var(msg); } } else { Array msg; msg.push_back("live_node_prop"); msg.push_back(pathid); msg.push_back(p_property); msg.push_back(p_value); ppeer->put_var(msg); } return; } Resource *res = Object::cast_to<Resource>(p_base); if (res && res->get_path() != String()) { String respath = res->get_path(); int pathid = _get_res_path_cache(respath); if (p_value.is_ref()) { Ref<Resource> res = p_value; if (res.is_valid() && res->get_path() != String()) { Array msg; msg.push_back("live_res_prop_res"); msg.push_back(pathid); msg.push_back(p_property); msg.push_back(res->get_path()); ppeer->put_var(msg); } } else { Array msg; msg.push_back("live_res_prop"); msg.push_back(pathid); msg.push_back(p_property); msg.push_back(p_value); ppeer->put_var(msg); } return; } //print_line("prop"); } void ScriptEditorDebugger::_method_changeds(void *p_ud, Object *p_base, const StringName &p_name, VARIANT_ARG_DECLARE) { ScriptEditorDebugger *sed = (ScriptEditorDebugger *)p_ud; sed->_method_changed(p_base, p_name, VARIANT_ARG_PASS); } void ScriptEditorDebugger::_property_changeds(void *p_ud, Object *p_base, const StringName &p_property, const Variant &p_value) { ScriptEditorDebugger *sed = (ScriptEditorDebugger *)p_ud; sed->_property_changed(p_base, p_property, p_value); } void ScriptEditorDebugger::set_live_debugging(bool p_enable) { live_debug = p_enable; } void ScriptEditorDebugger::_live_edit_set() { if (!connection.is_valid()) return; TreeItem *ti = inspect_scene_tree->get_selected(); if (!ti) return; String path; while (ti) { String lp = ti->get_text(0); path = "/" + lp + path; ti = ti->get_parent(); } NodePath np = path; editor->get_editor_data().set_edited_scene_live_edit_root(np); update_live_edit_root(); } void ScriptEditorDebugger::_live_edit_clear() { NodePath np = NodePath("/root"); editor->get_editor_data().set_edited_scene_live_edit_root(np); update_live_edit_root(); } void ScriptEditorDebugger::update_live_edit_root() { NodePath np = editor->get_editor_data().get_edited_scene_live_edit_root(); if (connection.is_valid()) { Array msg; msg.push_back("live_set_root"); msg.push_back(np); if (editor->get_edited_scene()) msg.push_back(editor->get_edited_scene()->get_filename()); else msg.push_back(""); ppeer->put_var(msg); } live_edit_root->set_text(np); } void ScriptEditorDebugger::live_debug_create_node(const NodePath &p_parent, const String &p_type, const String &p_name) { if (live_debug && connection.is_valid()) { Array msg; msg.push_back("live_create_node"); msg.push_back(p_parent); msg.push_back(p_type); msg.push_back(p_name); ppeer->put_var(msg); } } void ScriptEditorDebugger::live_debug_instance_node(const NodePath &p_parent, const String &p_path, const String &p_name) { if (live_debug && connection.is_valid()) { Array msg; msg.push_back("live_instance_node"); msg.push_back(p_parent); msg.push_back(p_path); msg.push_back(p_name); ppeer->put_var(msg); } } void ScriptEditorDebugger::live_debug_remove_node(const NodePath &p_at) { if (live_debug && connection.is_valid()) { Array msg; msg.push_back("live_remove_node"); msg.push_back(p_at); ppeer->put_var(msg); } } void ScriptEditorDebugger::live_debug_remove_and_keep_node(const NodePath &p_at, ObjectID p_keep_id) { if (live_debug && connection.is_valid()) { Array msg; msg.push_back("live_remove_and_keep_node"); msg.push_back(p_at); msg.push_back(p_keep_id); ppeer->put_var(msg); } } void ScriptEditorDebugger::live_debug_restore_node(ObjectID p_id, const NodePath &p_at, int p_at_pos) { if (live_debug && connection.is_valid()) { Array msg; msg.push_back("live_restore_node"); msg.push_back(p_id); msg.push_back(p_at); msg.push_back(p_at_pos); ppeer->put_var(msg); } } void ScriptEditorDebugger::live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name) { if (live_debug && connection.is_valid()) { Array msg; msg.push_back("live_duplicate_node"); msg.push_back(p_at); msg.push_back(p_new_name); ppeer->put_var(msg); } } void ScriptEditorDebugger::live_debug_reparent_node(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos) { if (live_debug && connection.is_valid()) { Array msg; msg.push_back("live_reparent_node"); msg.push_back(p_at); msg.push_back(p_new_place); msg.push_back(p_new_name); msg.push_back(p_at_pos); ppeer->put_var(msg); } } void ScriptEditorDebugger::set_breakpoint(const String &p_path, int p_line, bool p_enabled) { if (connection.is_valid()) { Array msg; msg.push_back("breakpoint"); msg.push_back(p_path); msg.push_back(p_line); msg.push_back(p_enabled); ppeer->put_var(msg); } } void ScriptEditorDebugger::reload_scripts() { if (connection.is_valid()) { Array msg; msg.push_back("reload_scripts"); ppeer->put_var(msg); } } void ScriptEditorDebugger::_error_selected(int p_idx) { error_stack->clear(); Array st = error_list->get_item_metadata(p_idx); for (int i = 0; i < st.size(); i += 3) { String script = st[i]; String func = st[i + 1]; int line = st[i + 2]; Array md; md.push_back(st[i]); md.push_back(st[i + 1]); md.push_back(st[i + 2]); String str = func; String tooltip_str = TTR("Function:") + " " + func; if (script.length() > 0) { str += " in " + script.get_file(); tooltip_str = TTR("File:") + " " + script + "\n" + tooltip_str; if (line > 0) { str += ":line " + itos(line); tooltip_str += "\n" + TTR("Line:") + " " + itos(line); } } error_stack->add_item(str); error_stack->set_item_metadata(error_stack->get_item_count() - 1, md); error_stack->set_item_tooltip(error_stack->get_item_count() - 1, tooltip_str); } } void ScriptEditorDebugger::_error_stack_selected(int p_idx) { Array arr = error_stack->get_item_metadata(p_idx); if (arr.size() != 3) return; Ref<Script> s = ResourceLoader::load(arr[0]); emit_signal("goto_script_line", s, int(arr[2]) - 1); } void ScriptEditorDebugger::set_hide_on_stop(bool p_hide) { hide_on_stop = p_hide; } bool ScriptEditorDebugger::get_debug_with_external_editor() const { return enable_external_editor; } void ScriptEditorDebugger::set_debug_with_external_editor(bool p_enabled) { enable_external_editor = p_enabled; } Ref<Script> ScriptEditorDebugger::get_dump_stack_script() const { return stack_script; } void ScriptEditorDebugger::_paused() { ERR_FAIL_COND(connection.is_null()); ERR_FAIL_COND(!connection->is_connected_to_host()); if (!breaked && EditorNode::get_singleton()->get_pause_button()->is_pressed()) { debug_break(); } if (breaked && !EditorNode::get_singleton()->get_pause_button()->is_pressed()) { debug_continue(); } } void ScriptEditorDebugger::_set_remote_object(ObjectID p_id, ScriptEditorDebuggerInspectedObject *p_obj) { if (remote_objects.has(p_id)) memdelete(remote_objects[p_id]); remote_objects[p_id] = p_obj; } void ScriptEditorDebugger::_clear_remote_objects() { for (Map<ObjectID, ScriptEditorDebuggerInspectedObject *>::Element *E = remote_objects.front(); E; E = E->next()) { if (editor->get_editor_history()->get_current() == E->value()->get_instance_id()) { editor->push_item(NULL); } memdelete(E->value()); } remote_objects.clear(); } void ScriptEditorDebugger::_clear_errors_list() { error_list->clear(); error_count = 0; _notification(NOTIFICATION_PROCESS); } // Right click on specific file(s) or folder(s). void ScriptEditorDebugger::_error_list_item_rmb_selected(int p_item, const Vector2 &p_pos) { item_menu->clear(); item_menu->set_size(Size2(1, 1)); // Allow specific actions only on one item. bool single_item_selected = error_list->get_selected_items().size() == 1; if (single_item_selected) { item_menu->add_icon_item(get_icon("ActionCopy", "EditorIcons"), TTR("Copy Error"), ITEM_MENU_COPY_ERROR); } if (item_menu->get_item_count() > 0) { item_menu->set_position(error_list->get_global_position() + p_pos); item_menu->popup(); } } void ScriptEditorDebugger::_item_menu_id_pressed(int p_option) { switch (p_option) { case ITEM_MENU_COPY_ERROR: { String title = error_list->get_item_text(error_list->get_current()); String desc = error_list->get_item_tooltip(error_list->get_current()); OS::get_singleton()->set_clipboard(title + "\n----------\n" + desc); } break; case ITEM_MENU_SAVE_REMOTE_NODE: { file_dialog->set_access(EditorFileDialog::ACCESS_RESOURCES); file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); List<String> extensions; Ref<PackedScene> sd = memnew(PackedScene); ResourceSaver::get_recognized_extensions(sd, &extensions); file_dialog->clear_filters(); for (int i = 0; i < extensions.size(); i++) { file_dialog->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper()); } file_dialog->popup_centered_ratio(); } break; } } void ScriptEditorDebugger::_bind_methods() { ClassDB::bind_method(D_METHOD("_stack_dump_frame_selected"), &ScriptEditorDebugger::_stack_dump_frame_selected); ClassDB::bind_method(D_METHOD("debug_copy"), &ScriptEditorDebugger::debug_copy); ClassDB::bind_method(D_METHOD("debug_next"), &ScriptEditorDebugger::debug_next); ClassDB::bind_method(D_METHOD("debug_step"), &ScriptEditorDebugger::debug_step); ClassDB::bind_method(D_METHOD("debug_break"), &ScriptEditorDebugger::debug_break); ClassDB::bind_method(D_METHOD("debug_continue"), &ScriptEditorDebugger::debug_continue); ClassDB::bind_method(D_METHOD("_output_clear"), &ScriptEditorDebugger::_output_clear); ClassDB::bind_method(D_METHOD("_performance_draw"), &ScriptEditorDebugger::_performance_draw); ClassDB::bind_method(D_METHOD("_performance_select"), &ScriptEditorDebugger::_performance_select); ClassDB::bind_method(D_METHOD("_scene_tree_request"), &ScriptEditorDebugger::_scene_tree_request); ClassDB::bind_method(D_METHOD("_video_mem_request"), &ScriptEditorDebugger::_video_mem_request); ClassDB::bind_method(D_METHOD("_live_edit_set"), &ScriptEditorDebugger::_live_edit_set); ClassDB::bind_method(D_METHOD("_live_edit_clear"), &ScriptEditorDebugger::_live_edit_clear); ClassDB::bind_method(D_METHOD("_error_selected"), &ScriptEditorDebugger::_error_selected); ClassDB::bind_method(D_METHOD("_error_stack_selected"), &ScriptEditorDebugger::_error_stack_selected); ClassDB::bind_method(D_METHOD("_profiler_activate"), &ScriptEditorDebugger::_profiler_activate); ClassDB::bind_method(D_METHOD("_profiler_seeked"), &ScriptEditorDebugger::_profiler_seeked); ClassDB::bind_method(D_METHOD("_clear_errors_list"), &ScriptEditorDebugger::_clear_errors_list); ClassDB::bind_method(D_METHOD("_error_list_item_rmb_selected"), &ScriptEditorDebugger::_error_list_item_rmb_selected); ClassDB::bind_method(D_METHOD("_item_menu_id_pressed"), &ScriptEditorDebugger::_item_menu_id_pressed); ClassDB::bind_method(D_METHOD("_paused"), &ScriptEditorDebugger::_paused); ClassDB::bind_method(D_METHOD("_scene_tree_selected"), &ScriptEditorDebugger::_scene_tree_selected); ClassDB::bind_method(D_METHOD("_scene_tree_folded"), &ScriptEditorDebugger::_scene_tree_folded); ClassDB::bind_method(D_METHOD("_scene_tree_rmb_selected"), &ScriptEditorDebugger::_scene_tree_rmb_selected); ClassDB::bind_method(D_METHOD("_file_selected"), &ScriptEditorDebugger::_file_selected); ClassDB::bind_method(D_METHOD("live_debug_create_node"), &ScriptEditorDebugger::live_debug_create_node); ClassDB::bind_method(D_METHOD("live_debug_instance_node"), &ScriptEditorDebugger::live_debug_instance_node); ClassDB::bind_method(D_METHOD("live_debug_remove_node"), &ScriptEditorDebugger::live_debug_remove_node); ClassDB::bind_method(D_METHOD("live_debug_remove_and_keep_node"), &ScriptEditorDebugger::live_debug_remove_and_keep_node); ClassDB::bind_method(D_METHOD("live_debug_restore_node"), &ScriptEditorDebugger::live_debug_restore_node); ClassDB::bind_method(D_METHOD("live_debug_duplicate_node"), &ScriptEditorDebugger::live_debug_duplicate_node); ClassDB::bind_method(D_METHOD("live_debug_reparent_node"), &ScriptEditorDebugger::live_debug_reparent_node); ClassDB::bind_method(D_METHOD("_scene_tree_property_select_object"), &ScriptEditorDebugger::_scene_tree_property_select_object); ClassDB::bind_method(D_METHOD("_scene_tree_property_value_edited"), &ScriptEditorDebugger::_scene_tree_property_value_edited); ADD_SIGNAL(MethodInfo("goto_script_line")); ADD_SIGNAL(MethodInfo("breaked", PropertyInfo(Variant::BOOL, "reallydid"), PropertyInfo(Variant::BOOL, "can_debug"))); ADD_SIGNAL(MethodInfo("show_debugger", PropertyInfo(Variant::BOOL, "reallydid"))); } ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { ppeer = Ref<PacketPeerStream>(memnew(PacketPeerStream)); ppeer->set_input_buffer_max_size(1024 * 1024 * 8); //8mb should be enough editor = p_editor; editor->get_inspector()->connect("object_id_selected", this, "_scene_tree_property_select_object"); tabs = memnew(TabContainer); tabs->set_tab_align(TabContainer::ALIGN_LEFT); tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); tabs->add_style_override("tab_fg", editor->get_gui_base()->get_stylebox("DebuggerTabFG", "EditorStyles")); tabs->add_style_override("tab_bg", editor->get_gui_base()->get_stylebox("DebuggerTabBG", "EditorStyles")); tabs->set_anchors_and_margins_preset(Control::PRESET_WIDE); tabs->set_margin(MARGIN_LEFT, -editor->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); tabs->set_margin(MARGIN_RIGHT, editor->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); add_child(tabs); { //debugger VBoxContainer *vbc = memnew(VBoxContainer); vbc->set_name(TTR("Debugger")); //tabs->add_child(vbc); Control *dbg = vbc; HBoxContainer *hbc = memnew(HBoxContainer); vbc->add_child(hbc); reason = memnew(Label); reason->set_text(""); hbc->add_child(reason); reason->set_h_size_flags(SIZE_EXPAND_FILL); reason->set_autowrap(true); reason->set_max_lines_visible(3); reason->set_mouse_filter(Control::MOUSE_FILTER_PASS); hbc->add_child(memnew(VSeparator)); copy = memnew(ToolButton); hbc->add_child(copy); copy->set_tooltip(TTR("Copy Error")); copy->connect("pressed", this, "debug_copy"); hbc->add_child(memnew(VSeparator)); step = memnew(ToolButton); hbc->add_child(step); step->set_tooltip(TTR("Step Into")); step->connect("pressed", this, "debug_step"); next = memnew(ToolButton); hbc->add_child(next); next->set_tooltip(TTR("Step Over")); next->connect("pressed", this, "debug_next"); hbc->add_child(memnew(VSeparator)); dobreak = memnew(ToolButton); hbc->add_child(dobreak); dobreak->set_tooltip(TTR("Break")); dobreak->connect("pressed", this, "debug_break"); docontinue = memnew(ToolButton); hbc->add_child(docontinue); docontinue->set_tooltip(TTR("Continue")); docontinue->connect("pressed", this, "debug_continue"); back = memnew(Button); hbc->add_child(back); back->set_tooltip(TTR("Inspect Previous Instance")); back->hide(); forward = memnew(Button); hbc->add_child(forward); forward->set_tooltip(TTR("Inspect Next Instance")); forward->hide(); HSplitContainer *sc = memnew(HSplitContainer); vbc->add_child(sc); sc->set_v_size_flags(SIZE_EXPAND_FILL); stack_dump = memnew(Tree); stack_dump->set_allow_reselect(true); stack_dump->set_columns(1); stack_dump->set_column_titles_visible(true); stack_dump->set_column_title(0, TTR("Stack Frames")); stack_dump->set_h_size_flags(SIZE_EXPAND_FILL); stack_dump->set_hide_root(true); stack_dump->connect("cell_selected", this, "_stack_dump_frame_selected"); sc->add_child(stack_dump); inspector = memnew(PropertyEditor); inspector->set_h_size_flags(SIZE_EXPAND_FILL); inspector->hide_top_label(); inspector->get_property_tree()->set_column_title(0, TTR("Variable")); inspector->set_enable_capitalize_paths(false); inspector->set_read_only(true); inspector->connect("object_id_selected", this, "_scene_tree_property_select_object"); sc->add_child(inspector); server = TCP_Server::create_ref(); pending_in_queue = 0; variables = memnew(ScriptEditorDebuggerVariables); breaked = false; tabs->add_child(dbg); } { //errors error_split = memnew(HSplitContainer); VBoxContainer *errvb = memnew(VBoxContainer); HBoxContainer *errhb = memnew(HBoxContainer); errvb->set_h_size_flags(SIZE_EXPAND_FILL); Label *velb = memnew(Label(TTR("Errors:"))); velb->set_h_size_flags(SIZE_EXPAND_FILL); errhb->add_child(velb); clearbutton = memnew(Button); clearbutton->set_text(TTR("Clear")); clearbutton->connect("pressed", this, "_clear_errors_list"); errhb->add_child(clearbutton); errvb->add_child(errhb); error_list = memnew(ItemList); error_list->set_v_size_flags(SIZE_EXPAND_FILL); error_list->set_h_size_flags(SIZE_EXPAND_FILL); error_list->connect("item_rmb_selected", this, "_error_list_item_rmb_selected"); error_list->set_allow_rmb_select(true); error_list->set_autoscroll_to_bottom(true); item_menu = memnew(PopupMenu); item_menu->connect("id_pressed", this, "_item_menu_id_pressed"); error_list->add_child(item_menu); errvb->add_child(error_list); error_split->add_child(errvb); errvb = memnew(VBoxContainer); errvb->set_h_size_flags(SIZE_EXPAND_FILL); error_stack = memnew(ItemList); errvb->add_margin_child(TTR("Stack Trace (if applicable):"), error_stack, true); error_split->add_child(errvb); error_split->set_name(TTR("Errors")); tabs->add_child(error_split); } { // remote scene tree inspect_scene_tree = memnew(Tree); EditorNode::get_singleton()->get_scene_tree_dock()->add_remote_tree_editor(inspect_scene_tree); EditorNode::get_singleton()->get_scene_tree_dock()->connect("remote_tree_selected", this, "_scene_tree_selected"); inspect_scene_tree->set_v_size_flags(SIZE_EXPAND_FILL); inspect_scene_tree->connect("cell_selected", this, "_scene_tree_selected"); inspect_scene_tree->connect("item_collapsed", this, "_scene_tree_folded"); inspect_scene_tree->set_allow_rmb_select(true); inspect_scene_tree->connect("item_rmb_selected", this, "_scene_tree_rmb_selected"); auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", false); inspect_scene_tree_timeout = EDITOR_DEF("debugger/remote_scene_tree_refresh_interval", 1.0); inspect_edited_object_timeout = EDITOR_DEF("debugger/remote_inspect_refresh_interval", 0.2); inspected_object_id = 0; updating_scene_tree = false; } { // File dialog file_dialog = memnew(EditorFileDialog); file_dialog->connect("file_selected", this, "_file_selected"); add_child(file_dialog); } { //profiler profiler = memnew(EditorProfiler); profiler->set_name(TTR("Profiler")); tabs->add_child(profiler); profiler->connect("enable_profiling", this, "_profiler_activate"); profiler->connect("break_request", this, "_profiler_seeked"); } { //monitors HSplitContainer *hsp = memnew(HSplitContainer); perf_monitors = memnew(Tree); perf_monitors->set_columns(2); perf_monitors->set_column_title(0, TTR("Monitor")); perf_monitors->set_column_title(1, TTR("Value")); perf_monitors->set_column_titles_visible(true); hsp->add_child(perf_monitors); perf_monitors->connect("item_edited", this, "_performance_select"); perf_draw = memnew(Control); perf_draw->connect("draw", this, "_performance_draw"); hsp->add_child(perf_draw); hsp->set_name(TTR("Monitors")); hsp->set_split_offset(340 * EDSCALE); tabs->add_child(hsp); perf_max.resize(Performance::MONITOR_MAX); Map<String, TreeItem *> bases; TreeItem *root = perf_monitors->create_item(); perf_monitors->set_hide_root(true); for (int i = 0; i < Performance::MONITOR_MAX; i++) { String n = Performance::get_singleton()->get_monitor_name(Performance::Monitor(i)); Performance::MonitorType mtype = Performance::get_singleton()->get_monitor_type(Performance::Monitor(i)); String base = n.get_slice("/", 0); String name = n.get_slice("/", 1); if (!bases.has(base)) { TreeItem *b = perf_monitors->create_item(root); b->set_text(0, base.capitalize()); b->set_editable(0, false); b->set_selectable(0, false); b->set_expand_right(0, true); bases[base] = b; } TreeItem *it = perf_monitors->create_item(bases[base]); it->set_metadata(1, mtype); it->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); it->set_editable(0, true); it->set_selectable(0, false); it->set_selectable(1, false); it->set_text(0, name.capitalize()); perf_items.push_back(it); perf_max.write[i] = 0; } } { //vmem inspect VBoxContainer *vmem_vb = memnew(VBoxContainer); HBoxContainer *vmem_hb = memnew(HBoxContainer); Label *vmlb = memnew(Label(TTR("List of Video Memory Usage by Resource:") + " ")); vmlb->set_h_size_flags(SIZE_EXPAND_FILL); vmem_hb->add_child(vmlb); vmem_hb->add_child(memnew(Label(TTR("Total:") + " "))); vmem_total = memnew(LineEdit); vmem_total->set_editable(false); vmem_total->set_custom_minimum_size(Size2(100, 1) * EDSCALE); vmem_hb->add_child(vmem_total); vmem_refresh = memnew(ToolButton); vmem_hb->add_child(vmem_refresh); vmem_vb->add_child(vmem_hb); vmem_refresh->connect("pressed", this, "_video_mem_request"); VBoxContainer *vmmc = memnew(VBoxContainer); vmem_tree = memnew(Tree); vmem_tree->set_v_size_flags(SIZE_EXPAND_FILL); vmem_tree->set_h_size_flags(SIZE_EXPAND_FILL); vmmc->add_child(vmem_tree); vmmc->set_v_size_flags(SIZE_EXPAND_FILL); vmem_vb->add_child(vmmc); vmem_vb->set_name(TTR("Video Mem")); vmem_tree->set_columns(4); vmem_tree->set_column_titles_visible(true); vmem_tree->set_column_title(0, TTR("Resource Path")); vmem_tree->set_column_expand(0, true); vmem_tree->set_column_expand(1, false); vmem_tree->set_column_title(1, TTR("Type")); vmem_tree->set_column_min_width(1, 100); vmem_tree->set_column_expand(2, false); vmem_tree->set_column_title(2, TTR("Format")); vmem_tree->set_column_min_width(2, 150); vmem_tree->set_column_expand(3, false); vmem_tree->set_column_title(3, TTR("Usage")); vmem_tree->set_column_min_width(3, 80); vmem_tree->set_hide_root(true); tabs->add_child(vmem_vb); } { // misc GridContainer *info_left = memnew(GridContainer); info_left->set_columns(2); info_left->set_name(TTR("Misc")); tabs->add_child(info_left); clicked_ctrl = memnew(LineEdit); clicked_ctrl->set_h_size_flags(SIZE_EXPAND_FILL); info_left->add_child(memnew(Label(TTR("Clicked Control:")))); info_left->add_child(clicked_ctrl); clicked_ctrl_type = memnew(LineEdit); info_left->add_child(memnew(Label(TTR("Clicked Control Type:")))); info_left->add_child(clicked_ctrl_type); live_edit_root = memnew(LineEdit); live_edit_root->set_h_size_flags(SIZE_EXPAND_FILL); { HBoxContainer *lehb = memnew(HBoxContainer); Label *l = memnew(Label(TTR("Live Edit Root:"))); info_left->add_child(l); lehb->add_child(live_edit_root); le_set = memnew(Button(TTR("Set From Tree"))); lehb->add_child(le_set); le_clear = memnew(Button(TTR("Clear"))); lehb->add_child(le_clear); info_left->add_child(lehb); le_set->set_disabled(true); le_clear->set_disabled(true); } } msgdialog = memnew(AcceptDialog); add_child(msgdialog); p_editor->get_undo_redo()->set_method_notify_callback(_method_changeds, this); p_editor->get_undo_redo()->set_property_notify_callback(_property_changeds, this); live_debug = false; last_path_id = false; error_count = 0; hide_on_stop = true; enable_external_editor = false; last_error_count = 0; EditorNode::get_singleton()->get_pause_button()->connect("pressed", this, "_paused"); } ScriptEditorDebugger::~ScriptEditorDebugger() { //inspector->edit(NULL); memdelete(variables); ppeer->set_stream_peer(Ref<StreamPeer>()); server->stop(); _clear_remote_objects(); }
{ "content_hash": "f90bb7ce4a9c66fdca8e4fd7bb38111c", "timestamp": "", "source": "github", "line_count": 2181, "max_line_length": 200, "avg_line_length": 29.261806510774875, "alnum_prop": 0.6450485741146976, "repo_name": "RandomShaper/godot", "id": "e483fde4bcfa3bf71ba00bf368d53c41098e2d30", "size": "63820", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "editor/script_editor_debugger.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "50004" }, { "name": "C#", "bytes": "210398" }, { "name": "C++", "bytes": "21200242" }, { "name": "GLSL", "bytes": "1271" }, { "name": "Java", "bytes": "493677" }, { "name": "JavaScript", "bytes": "15889" }, { "name": "Makefile", "bytes": "451" }, { "name": "Objective-C", "bytes": "2645" }, { "name": "Objective-C++", "bytes": "185290" }, { "name": "Python", "bytes": "332071" }, { "name": "Shell", "bytes": "20062" } ], "symlink_target": "" }
module Auto class AutoJournalParam attr_reader :auto_journal_type attr_reader :user def initialize( auto_journal_type, user = nil ) @auto_journal_type = auto_journal_type.to_i @user = user end end end
{ "content_hash": "d756d7d9ce310512929c6e903206f643", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 51, "avg_line_length": 20.916666666666668, "alnum_prop": 0.6175298804780877, "repo_name": "hybitz/hyacc", "id": "9f4221ab1458b1ad47ccbff3758c382c96af0f9a", "size": "251", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/auto/auto_journal_param.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1748" }, { "name": "Gherkin", "bytes": "44693" }, { "name": "HTML", "bytes": "516193" }, { "name": "JavaScript", "bytes": "41984" }, { "name": "Ruby", "bytes": "960182" }, { "name": "SCSS", "bytes": "14262" } ], "symlink_target": "" }
var GroupsAdapter, Store; var maxLength = -1; var lengths = Ember.A([]); module("unit/adapters/rest_adapter/group_records_for_find_many_test - DS.RESTAdapter#groupRecordsForFindMany", { setup: function() { GroupsAdapter = DS.RESTAdapter.extend({ coalesceFindRequests: true, find: function(store, type, id, snapshot) { return Ember.RSVP.Promise.resolve({ id: id }); }, ajax: function(url, type, options) { var queryString = options.data.ids.map(function(i) { return encodeURIComponent('ids[]') + '=' + encodeURIComponent(i); }).join('&'); var fullUrl = url + '?' + queryString; maxLength = this.get('maxURLLength'); lengths.push(fullUrl.length); var testRecords = options.data.ids.map(function(id) { return { id: id }; }); return Ember.RSVP.Promise.resolve({ 'testRecords' : testRecords }); } }); Store = createStore({ adapter: GroupsAdapter, testRecord: DS.Model.extend() }); } }); test('groupRecordsForFindMany - findMany', function() { Ember.run(function() { for (var i = 1; i <= 1024; i++) { Store.find('testRecord', i); } }); ok(lengths.every(function(len) { return len <= maxLength; }), "Some URLs are longer than " + maxLength + " chars"); });
{ "content_hash": "604f0e37115469fb7f2907e44a0632fb", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 112, "avg_line_length": 25.923076923076923, "alnum_prop": 0.5927299703264095, "repo_name": "mphasize/data", "id": "d59b6cb03611e949580962b1a73436f32ae882f8", "size": "1348", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "packages/ember-data/tests/unit/adapters/rest-adapter/group-records-for-find-many-test.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "3413" }, { "name": "JavaScript", "bytes": "1193678" }, { "name": "Ruby", "bytes": "1108" }, { "name": "Shell", "bytes": "4690" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "f81d51ed25360296359b1aa7e9b38db5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "17cbcb4e140e100f7c280f6aa74f7a27507440bd", "size": "179", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Portulacaceae/Portulaca/Portulaca macbridei/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package org.apache.jasper.tagplugins.jstl.core; import org.apache.jasper.compiler.tagplugin.TagPlugin; import org.apache.jasper.compiler.tagplugin.TagPluginContext; public final class When implements TagPlugin { @Override public void doTag(TagPluginContext ctxt) { // Get the parent context to determine if this is the first <c:when> TagPluginContext parentContext = ctxt.getParentContext(); if (parentContext == null) { ctxt.dontUseTagPlugin(); return; } if ("true".equals(parentContext.getPluginAttribute("hasBeenHere"))) { ctxt.generateJavaSource("} else if("); // See comment below for the reason we generate the extra "}" here. } else { ctxt.generateJavaSource("if("); parentContext.setPluginAttribute("hasBeenHere", "true"); } ctxt.generateAttribute("test"); ctxt.generateJavaSource("){"); ctxt.generateBody(); // We don't generate the closing "}" for the "if" here because there // may be whitespaces in between <c:when>'s. Instead we delay // generating it until the next <c:when> or <c:otherwise> or // <c:choose> } }
{ "content_hash": "3120ec745f34c157ebd849964360bdc8", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 79, "avg_line_length": 35.054054054054056, "alnum_prop": 0.6006168080185043, "repo_name": "pistolove/sourcecode4junit", "id": "261d5d79a7b35c2eb0e1330f292a204fe40203f1", "size": "2116", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source4Tomcat/src/org/apache/jasper/tagplugins/jstl/core/When.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "138676" }, { "name": "Java", "bytes": "12340988" } ], "symlink_target": "" }
include(CMakeParseArguments) include(Analyzers) get_filename_component(CLANG_TIDY_EXE_HINT "${CMAKE_CXX_COMPILER}" PATH) find_program(CLANG_TIDY_EXE NAMES clang-tidy clang-tidy-5.0 clang-tidy-4.0 clang-tidy-3.9 clang-tidy-3.8 clang-tidy-3.7 clang-tidy-3.6 clang-tidy-3.5 HINTS ${CLANG_TIDY_EXE_HINT} PATH_SUFFIXES compiler/bin PATHS /opt/rocm/llvm/bin /usr/local/opt/llvm/bin ) function(find_clang_tidy_version VAR) execute_process(COMMAND ${CLANG_TIDY_EXE} -version OUTPUT_VARIABLE VERSION_OUTPUT) separate_arguments(VERSION_OUTPUT_LIST UNIX_COMMAND "${VERSION_OUTPUT}") list(FIND VERSION_OUTPUT_LIST "version" VERSION_INDEX) if(VERSION_INDEX GREATER 0) math(EXPR VERSION_INDEX "${VERSION_INDEX} + 1") list(GET VERSION_OUTPUT_LIST ${VERSION_INDEX} VERSION) set(${VAR} ${VERSION} PARENT_SCOPE) else() set(${VAR} "0.0" PARENT_SCOPE) endif() endfunction() if( NOT CLANG_TIDY_EXE ) message( STATUS "Clang tidy not found" ) set(CLANG_TIDY_VERSION "0.0") else() find_clang_tidy_version(CLANG_TIDY_VERSION) message( STATUS "Clang tidy found: ${CLANG_TIDY_VERSION}") endif() set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CLANG_TIDY_FIXIT_DIR ${CMAKE_BINARY_DIR}/fixits) file(MAKE_DIRECTORY ${CLANG_TIDY_FIXIT_DIR}) set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${CLANG_TIDY_FIXIT_DIR}) macro(enable_clang_tidy) set(options ANALYZE_TEMPORARY_DTORS ALL) set(oneValueArgs HEADER_FILTER) set(multiValueArgs CHECKS ERRORS EXTRA_ARGS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) string(REPLACE ";" "," CLANG_TIDY_CHECKS "${PARSE_CHECKS}") string(REPLACE ";" "," CLANG_TIDY_ERRORS "${PARSE_ERRORS}") set(CLANG_TIDY_EXTRA_ARGS) foreach(ARG ${PARSE_EXTRA_ARGS}) list(APPEND CLANG_TIDY_EXTRA_ARGS "-extra-arg=${ARG}") endforeach() set(CLANG_TIDY_ALL) if(PARSE_ALL) set(CLANG_TIDY_ALL ALL) endif() message(STATUS "Clang tidy checks: ${CLANG_TIDY_CHECKS}") if (${PARSE_ANALYZE_TEMPORARY_DTORS}) set(CLANG_TIDY_ANALYZE_TEMPORARY_DTORS "-analyze-temporary-dtors") endif() if (${CLANG_TIDY_VERSION} VERSION_LESS "3.9.0") set(CLANG_TIDY_ERRORS_ARG "") else() set(CLANG_TIDY_ERRORS_ARG "-warnings-as-errors='${CLANG_TIDY_ERRORS}'") endif() if (${CLANG_TIDY_VERSION} VERSION_LESS "3.9.0") set(CLANG_TIDY_QUIET_ARG "") else() set(CLANG_TIDY_QUIET_ARG "-quiet") endif() if(PARSE_HEADER_FILTER) string(REPLACE "$" "$$" CLANG_TIDY_HEADER_FILTER "${PARSE_HEADER_FILTER}") else() set(CLANG_TIDY_HEADER_FILTER ".*") endif() set(CLANG_TIDY_COMMAND ${CLANG_TIDY_EXE} ${CLANG_TIDY_QUIET_ARG} -p ${CMAKE_BINARY_DIR} -checks='${CLANG_TIDY_CHECKS}' ${CLANG_TIDY_ERRORS_ARG} ${CLANG_TIDY_EXTRA_ARGS} ${CLANG_TIDY_ANALYZE_TEMPORARY_DTORS} -header-filter='${CLANG_TIDY_HEADER_FILTER}' # Uncomment next line to save fixts in the fixits/ directory under the build directory. # You can apply them by /opt/rocm/llvm/bin/clang-apply-replacements fixits/ # -fix-errors ) add_custom_target(tidy ${CLANG_TIDY_ALL}) mark_as_analyzer(tidy) add_custom_target(tidy-base) add_custom_target(tidy-make-fixit-dir COMMAND ${CMAKE_COMMAND} -E make_directory ${CLANG_TIDY_FIXIT_DIR}) add_custom_target(tidy-rm-fixit-dir COMMAND ${CMAKE_COMMAND} -E remove_directory ${CLANG_TIDY_FIXIT_DIR}) add_dependencies(tidy-make-fixit-dir tidy-rm-fixit-dir) add_dependencies(tidy-base tidy-make-fixit-dir) endmacro() function(clang_tidy_check TARGET) get_target_property(SOURCES ${TARGET} SOURCES) # TODO: Use generator expressions instead # COMMAND ${CLANG_TIDY_COMMAND} $<TARGET_PROPERTY:${TARGET},SOURCES> # COMMAND ${CLANG_TIDY_COMMAND} $<JOIN:$<TARGET_PROPERTY:${TARGET},SOURCES>, > foreach(SOURCE ${SOURCES}) if((NOT "${SOURCE}" MATCHES "(h|hpp|hxx)$") AND (NOT "${SOURCE}" MATCHES "TARGET_OBJECTS")) string(MAKE_C_IDENTIFIER "${SOURCE}" tidy_file) set(tidy_target tidy-target-${TARGET}-${tidy_file}) add_custom_target(${tidy_target} # for some targets clang-tidy not able to get information from .clang-tidy DEPENDS ${SOURCE} COMMAND ${CLANG_TIDY_COMMAND} "-config=\{CheckOptions: \[\{key: bugprone-reserved-identifier.AllowedIdentifiers,value: __HIP_PLATFORM_HCC__\; __HIP_ROCclr__\}\]\}" ${SOURCE} "-export-fixes=${CLANG_TIDY_FIXIT_DIR}/${TARGET}-${tidy_file}.yaml" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "clang-tidy: Running clang-tidy on target ${SOURCE}..." ) add_dependencies(${tidy_target} ${TARGET}) add_dependencies(${tidy_target} tidy-base) add_dependencies(tidy ${tidy_target}) endif() endforeach() endfunction()
{ "content_hash": "5cc7a6c33c63b741e7d4b93af2474e71", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 257, "avg_line_length": 36.92805755395683, "alnum_prop": 0.6407558932398207, "repo_name": "ROCmSoftwarePlatform/MIOpen", "id": "fc3eb75315cb53dc100983cfdb88d5a2213504a3", "size": "6422", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "cmake/ClangTidy.cmake", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "247851665" }, { "name": "C", "bytes": "2958037" }, { "name": "C++", "bytes": "11854384" }, { "name": "CMake", "bytes": "444890" }, { "name": "Dockerfile", "bytes": "8624" }, { "name": "NASL", "bytes": "5071799" }, { "name": "PHP", "bytes": "6215" }, { "name": "Python", "bytes": "2039" }, { "name": "Shell", "bytes": "18933" } ], "symlink_target": "" }
FROM colstrom/python RUN apk-install gcc musl-dev python3-dev \ && pip install bpython \ && apk del gcc musl-dev python3-dev \ && rm -rf /root/.cache ENTRYPOINT ["bpython"]
{ "content_hash": "88753f0aab77ff7427e1cb5a22d432b8", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 42, "avg_line_length": 23.375, "alnum_prop": 0.6631016042780749, "repo_name": "colstrom/docker-bpython", "id": "97c2446e7d4e307540126b1c634ecfeba87eb685", "size": "187", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Dockerfile", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/root_layout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".chatroom.ui.ChatRoomFragment"> <FrameLayout android:id="@+id/message_list_container" android:layout_width="0dp" android:layout_height="0dp" app:layout_constraintBottom_toTopOf="@id/text_typing_status" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/text_connection_status"> <include android:id="@+id/layout_message_list" layout="@layout/message_list" android:layout_width="match_parent" android:layout_height="match_parent" /> </FrameLayout> <ImageView android:id="@+id/image_chat_icon" android:layout_width="100dp" android:layout_height="100dp" android:src="@drawable/ic_chat_black_24dp" android:tint="@color/icon_grey" app:layout_constraintBottom_toTopOf="@id/text_chat_title" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_chainStyle="packed" /> <TextView android:id="@+id/text_chat_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="24dp" android:text="@string/msg_no_chat_title" android:textColor="@color/colorSecondaryText" android:textSize="20sp" android:textStyle="bold" app:layout_constraintBottom_toTopOf="@id/text_chat_description" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/image_chat_icon" /> <TextView android:id="@+id/text_chat_description" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" android:text="@string/msg_no_chat_description" android:textAlignment="center" android:textColor="@color/colorSecondaryTextLight" android:textSize="16sp" app:layout_constraintBottom_toTopOf="@id/layout_message_composer" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/text_chat_title" /> <androidx.constraintlayout.widget.Group android:id="@+id/empty_chat_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" app:constraint_referenced_ids="image_chat_icon, text_chat_title, text_chat_description" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:visibility="visible" /> <chat.rocket.android.suggestions.ui.SuggestionsView android:id="@+id/suggestions_view" android:layout_width="0dp" android:layout_height="wrap_content" android:background="@color/suggestion_background_color" app:layout_constraintBottom_toTopOf="@id/layout_message_composer" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> <TextView android:id="@+id/text_typing_status" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="16dp" android:layout_marginTop="16dp" android:layout_marginEnd="16dp" android:layout_marginBottom="5dp" android:maxLines="2" android:visibility="gone" app:layout_constraintBottom_toTopOf="@id/layout_message_composer" app:layout_constraintEnd_toStartOf="parent" /> <include android:id="@+id/layout_message_composer" layout="@layout/message_composer" android:layout_width="0dp" android:layout_height="wrap_content" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> <View android:id="@+id/view_dim" android:layout_width="0dp" android:layout_height="0dp" android:background="@color/colorDim" android:visibility="gone" app:layout_constraintBottom_toTopOf="@id/layout_message_composer" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <include android:id="@+id/layout_message_attachment_options" layout="@layout/message_attachment_options" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="5dp" android:visibility="gone" app:layout_constraintBottom_toTopOf="@id/layout_message_composer" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> <TextView android:id="@+id/text_connection_status" android:layout_width="0dp" android:layout_height="32dp" android:alpha="0" android:background="@color/colorPrimary" android:elevation="4dp" android:gravity="center" android:textAppearance="@style/TextAppearance.AppCompat.Body2" android:textColor="@color/colorWhite" android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:alpha="1" tools:text="connected" tools:visibility="visible" /> <com.wang.avi.AVLoadingIndicatorView android:id="@+id/view_loading" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" app:indicatorColor="@color/colorBlack" app:indicatorName="BallPulseIndicator" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:visibility="visible" /> </androidx.constraintlayout.widget.ConstraintLayout>
{ "content_hash": "eb48d7d431bd1cd2478c49d97d532f5f", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 109, "avg_line_length": 41.31055900621118, "alnum_prop": 0.6717786798977597, "repo_name": "RocketChat/Rocket.Chat.Android", "id": "410119c25f5143751eb2ec4934d9a0c136985f7f", "size": "6651", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "app/src/main/res/layout/fragment_chat_room.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Kotlin", "bytes": "1201117" }, { "name": "Shell", "bytes": "2938" } ], "symlink_target": "" }
<!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_92) on Mon May 01 10:01:21 CEST 2017 --> <title>models</title> <meta name="date" content="2017-05-01"> <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="models"; } } 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 class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></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><a href="../jobs/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../utils/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../index.html?models/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.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"> <h1 title="Package" class="title">Package&nbsp;models</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../models/DestinationBean.html" title="class in models">DestinationBean</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../models/ListBean.html" title="class in models">ListBean</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../models/SkiResortBean.html" title="class in models">SkiResortBean</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../models/SlopeCountsBean.html" title="class in models">SlopeCountsBean</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../models/UserBean.html" title="class in models">UserBean</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Summary table, listing enums, and an explanation"> <caption><span>Enum Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Enum</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../models/DestinationBean.Destination&{'type'}.html" title="enum in models">DestinationBean.Destination&{'type'}</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../models/ListBean.List&{'type'}.html" title="enum in models">ListBean.List&{'type'}</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </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 class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></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><a href="../jobs/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../utils/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../index.html?models/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.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": "fda1add925eee9fef4be02203d9cb0bb", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 151, "avg_line_length": 33.51977401129943, "alnum_prop": 0.6441934940165178, "repo_name": "chvrga/outdoor-explorer", "id": "e2b84d385183834220475fa6e4aca98f3c159aac", "size": "5933", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java/box/doc/models/package-summary.html", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "4720" }, { "name": "C", "bytes": "76128" }, { "name": "C++", "bytes": "31284" }, { "name": "CSS", "bytes": "107401" }, { "name": "HTML", "bytes": "1754737" }, { "name": "Java", "bytes": "2441299" }, { "name": "JavaScript", "bytes": "1405163" }, { "name": "PLpgSQL", "bytes": "1377" }, { "name": "Python", "bytes": "8991412" }, { "name": "Ruby", "bytes": "295601" }, { "name": "Shell", "bytes": "7499" }, { "name": "XQuery", "bytes": "544017" }, { "name": "XSLT", "bytes": "1099" } ], "symlink_target": "" }
import diff from 'virtual-dom/diff' import patch from 'virtual-dom/patch' import refsStack from './refs-stack' export default function performElementUpdate (component) { let oldVirtualElement = component.virtualElement let newVirtualElement = component.render() refsStack.push(component.refs) patch(component.element, diff(oldVirtualElement, newVirtualElement)) refsStack.pop() component.virtualElement = newVirtualElement }
{ "content_hash": "95743f016127ebd1a5fc9143985aafb0", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 70, "avg_line_length": 36.5, "alnum_prop": 0.8013698630136986, "repo_name": "smashwilson/etch", "id": "b90c056da789a072505ee2e91f1f33a497a0cdae", "size": "438", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/perform-element-update.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "21191" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "5c66fa375f3b89e65385bb004fb774c9", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "767aea4dc81390a3ed54e354bcc35e0752c1f60d", "size": "180", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Orobanchaceae/Rhinanthus/Rhinanthus carinthiacus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" #include "SchemeHandlerWrapper.h" #include "Internals/MCefRefPtr.h" using namespace System; using namespace System::Collections::Specialized; using namespace System::IO; namespace CefSharp { class SchemeHandlerWrapper; public ref class SchemeHandlerResponse : ISchemeHandlerResponse { internal: MCefRefPtr<SchemeHandlerWrapper> _schemeHandlerWrapper; void OnRequestCompleted(); public: /// <summary> /// A Stream with the response data. If the request didn't return any response, leave this property as null. /// </summary> virtual property Stream^ ResponseStream; virtual property String^ MimeType; virtual property NameValueCollection^ ResponseHeaders; /// <summary> /// The status code of the response. Unless set, the default value used is 200 /// (corresponding to HTTP status OK). /// </summary> virtual property int StatusCode; /// <summary> /// The length of the response contents. Defaults to -1, which means unknown length /// and causes CefSharp to read the response stream in pieces. Thus, setting a length /// is optional but allows for more optimal response reading. /// </summary> virtual property int ContentLength; /// <summary> /// URL to redirect to (leave empty to not redirect). /// </summary> virtual property String^ RedirectUrl; /// <summary> /// Set to true to close the response stream once it has been read. The default value /// is false in order to preserve the old CefSharp behavior of not closing the stream. /// </summary> virtual property bool CloseStream; SchemeHandlerResponse(SchemeHandlerWrapper* schemeHandlerWrapper) { ContentLength = -1; _schemeHandlerWrapper = schemeHandlerWrapper; } void ReleaseSchemeHandlerWrapper() { _schemeHandlerWrapper = nullptr; } }; };
{ "content_hash": "18288eaa7d5bb7e632685a006d1637f0", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 116, "avg_line_length": 32.68115942028985, "alnum_prop": 0.6523281596452328, "repo_name": "rover886/CefSharp", "id": "b87174b8aa6d83a1373f164e8009bd3a53097985", "size": "2258", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CefSharp.Core/SchemeHandlerResponse.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C#", "bytes": "381423" }, { "name": "C++", "bytes": "189482" }, { "name": "CSS", "bytes": "92244" }, { "name": "HTML", "bytes": "21151" }, { "name": "JavaScript", "bytes": "2393" }, { "name": "PowerShell", "bytes": "9104" }, { "name": "Shell", "bytes": "335" }, { "name": "XML", "bytes": "138904" } ], "symlink_target": "" }
FROM balenalib/orange-pi-one-ubuntu:hirsute-run ENV GO_VERSION 1.17.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 "e4f33e7e78f96024d30ff6bf8d2b86329fc04df1b411a8bd30a82dbe60f408ba 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/613d8e9ca8540f29a43fddf658db56a8d826fffe/scripts/assets/tests/test-stack@golang.sh" \ && echo "Running test-stack@golang" \ && chmod +x test-stack@golang.sh \ && bash test-stack@golang.sh \ && rm -rf test-stack@golang.sh 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 hirsute \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.17.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": "e0675b309275d15f7de88a03c12e5ad8", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 673, "avg_line_length": 50.82608695652174, "alnum_prop": 0.7065868263473054, "repo_name": "resin-io-library/base-images", "id": "4d24f5c3b10eb869d3f2e069af8201182e43d56f", "size": "2359", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/golang/orange-pi-one/ubuntu/hirsute/1.17.7/run/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "71234697" }, { "name": "JavaScript", "bytes": "13096" }, { "name": "Shell", "bytes": "12051936" }, { "name": "Smarty", "bytes": "59789" } ], "symlink_target": "" }
template <typename Obj> class KDNode; template <typename Obj> class KdTree{ public: // KdTree(void):root(nullptr){} void buildTree(const std::vector<Obj>& v, int depth, const BoundingBox& bounds); void delete_tree(KDNode<Obj>* node); void delete_tree(){delete_tree(root);} bool intersect(ray& r, isect& i) const; bool intersectLocal(ray& r, isect& i) const; void verify_objectsR(KDNode<Obj>* node, std::list<Obj>& mList); bool verify_objects(void); ~KdTree(void){delete_tree(root);} private: KDNode<Obj>* root; std::list<Obj> data; int _depth; // std::vector<Obj> data; }; class equivalentPlanes{ public: bool operator()(double x, double y){ return fabs(x-y) <= RAY_EPSILON; } }; template <typename Obj> class KDNode{ public: BoundingBox _bounds; KDNode* _left; KDNode* _right; double _t; // KDNode(void):_left(nullptr), _right(nullptr){} bool intersect(ray& r, isect& i) const; bool intersectLocal(ray& r, isect& i) const; bool isLeaf(void) const {return (_left == nullptr && _right == nullptr);} bool hasGeometry(void) const {return _geometry_p.size() > 0;} // Axis is chosen as axis = depth % 3; // KDNode<Obj>* buildTree(const std::list<Obj>& objs, int depth ) const; std::list<Obj> _geometry_p; private: }; const int KDMinObjCount = 10; template<typename Obj> struct compareBB{ int ax; compareBB(int axis): ax(axis){} bool operator()(Obj i, Obj j) { Vec3d bi = i->getBoundingBox().getMin(); Vec3d bj = j->getBoundingBox().getMin(); return (bi[ax]<bj[ax]); } }; template<typename Obj> struct compareBBU{ int ax; double t; compareBBU(int axis, double _t): ax(axis), t(_t){} bool operator()(Obj i) { Vec3d bi = i->getBoundingBox().getMin(); return (bi[ax]<t + RAY_EPSILON); } }; template <typename Obj> double getOptimalSplittingPlane(KDNode<Obj>* node, int depth, const std::list<Obj>& geomList) { int axis = depth % 3; std::list<double> SplittingPlanes; for(auto& geom: geomList){ SplittingPlanes.push_back(geom->getBoundingBox().getMin()[axis]); SplittingPlanes.push_back(geom->getBoundingBox().getMax()[axis]); } SplittingPlanes.sort(); SplittingPlanes.unique(equivalentPlanes()); BoundingBox leftBox; double bestT = -1; double bestCost = std::numeric_limits<double>::max(); double boundingAreaInv = 1/node->_bounds.area(); int leftCount = 0; int rightCount = 0; double lArea = 0.0; double rArea = 0.0; BoundingBox lb = node->_bounds; BoundingBox rb = node->_bounds; double areaTempL; double areaTempR; // auto it = node->_geometry_p.begin(); for(auto& t: SplittingPlanes){ leftCount = 0; rightCount = 0; lArea = 0.0; rArea = 0.0; // BoundingBox lb = node->_bounds; // BoundingBox rb = node->_bounds; lb.setMax(axis, t); rb.setMin(axis, t); lArea = lb.area(); rArea = rb.area(); //NOTE Check this for safety, there might be FP error // in calculating before and after for(auto& geom: geomList){ BoundingBox bb = geom->getBoundingBox(); if(bb.getMin()[axis] < t){ leftCount++; // lArea += areaTempL; // lb.merge() } if(bb.getMax()[axis] > t){ rightCount++; // rArea += areaTempR; } } //Now have the Areas, and counts double splitCost = 0.3 + (lArea*leftCount + rArea*rightCount)*boundingAreaInv; if(splitCost < bestCost){ bestCost = splitCost; bestT = t; } }// end Outter For loop node->_t = bestT; return bestT; } // template <typename Obj> // KDNode<Obj>* KDNode<Obj>::buildTree(const std::list<Obj>& objs, int depth) const { template <typename Obj> KDNode<Obj>* KdTreeFactory(std::list<Obj>& objs, int depth, const BoundingBox& _bounds) { int axis = depth % 3; KDNode<Obj>* node = new KDNode<Obj>(); // node->_geometry_p = objs; node->_left = nullptr; node->_right = nullptr; node->_bounds = _bounds; if (objs.size() == 0){ //Dead Leaf return node; } //Now make sure the list is sorted across whatever axis we are dealing with objs.sort(compareBB<Obj>(axis)); //Make Leaf if(objs.size() < KDMinObjCount){ node->_geometry_p = objs; return node; } //If we have a non empty set and the depth is zero //return if(depth == 0){ node->_geometry_p = objs; return node; } double t = getOptimalSplittingPlane(node, depth, objs); // double t = (_bounds.getMax()[axis] - _bounds.getMin()[axis])/2.0; //Dumb median split // std::list<Obj> leftList; // std::list<Obj> rightList; BoundingBox LeftBox = node->_bounds; BoundingBox RightBox = node->_bounds; LeftBox.setMax(axis, t); RightBox.setMin(axis, t); // for(auto& object: objs){ auto objsBegin = objs.begin(); auto objsEnd = objs.end(); auto leftBegin = objsBegin; auto leftEnd = objsBegin; auto rightBegin = objsEnd; auto rightEnd = objsEnd; std::list<Obj> leftList; std::list<Obj> rightList; //Remember, objects are sorted by their minimum side rightBegin = std::partition(objs.begin(), objs.end(), compareBBU<Obj>(axis,t)); // for(auto& object: objs){ // for(auto object = objsBegin; object != objsEnd; object++){ // auto byteme = object; // bool lInt, rInt; // int mCase = 0; // if(lInt = LeftBox.intersects((*object)->getBoundingBox())) mCase += 1;//leftList.push_back(object); // if(rInt = RightBox.intersects((*object)->getBoundingBox())) mCase += 2;//rightList.push_back(object); // // if(!lInt && !rInt){ // // leftList.push_back(object); // // rightList.push_back(object); // // } // switch(mCase){ // case 1: //Left only // leftList.splice(leftList.begin(), objs, object, byteme++); // break; // case 2: //Right Only // rightList.splice(leftList.begin(), objs, object, byteme++); // break; // default: // rightList.push_back(*object); // leftList.splice(leftList.begin(), objs, object, byteme++); // break; // } // } leftList.splice(leftList.end(), objs, leftBegin, rightBegin); rightList.splice(rightList.end(), objs, rightBegin, rightEnd); node->_left = KdTreeFactory(leftList, depth - 1, LeftBox); node->_right = KdTreeFactory(rightList, depth - 1, RightBox); return node; } template <typename Obj> void KdTree<Obj>::delete_tree(KDNode<Obj>* node){ if(node != nullptr){ // if(node->_left != ) delete_tree(node->_left); delete_tree(node->_right); delete(node); } } template <typename Obj> bool KdTree<Obj>::verify_objects(void){ std::list<Obj> mThings; verify_objectsR(root, mThings); mThings.sort(); mThings.unique(); data.sort(); std::cout << mThings.size(); return mThings.size() == data.size(); } template <typename Obj> void KdTree<Obj>::verify_objectsR(KDNode<Obj>* node, std::list<Obj>& mList){ if(node != nullptr){ if(node->isLeaf()){ for(auto& damnThing: node->_geometry_p){ mList.push_back(damnThing); } return; } verify_objectsR(node->_left, mList); verify_objectsR(node->_right, mList); } return; } template <typename Obj> void KdTree<Obj>::buildTree(const std::vector<Obj>& v, int depth,const BoundingBox& bounds){ // std::list<Obj> tmp(v.begin(), v.end()); // data = tmp; std::copy(v.begin(), v.end(), std::back_inserter(data)); _depth = depth; root = KdTreeFactory(data, depth, bounds); } template <typename Obj> bool Intersect(KDNode<Obj>* node, ray& r, isect& i, int depth){ double tMin; double tMax; Vec3d R0 = r.getPosition(); Vec3d Rd = r.getDirection(); bool have_one = false; int axis = depth % 3; if(node != nullptr){ // If it is a leaf and Not empty if(node->isLeaf()){ if(node->hasGeometry()) return node->intersect(r,i); else return false; } if(node->_bounds.intersect(r, tMin, tMax)){ //Get who is near and who is far // double vd = Rd[axis]; // double v = node->_t - R0[axis]; // double ts = v/vd; double s = node->_t; double a = r.at(tMin)[axis]; double b = r.at(tMax)[axis]; if(a <= s){ if(b < s){ have_one = Intersect(node->_left, r, i, depth-1); } else{ have_one = Intersect(node->_left, r, i, depth - 1); isect cur; if(Intersect(node->_right, r, cur, depth - 1)){ if(!have_one || (cur.t < i.t)){ i = cur; have_one = true; } } } } else{ if(b > s){ have_one = Intersect(node->_right, r, i, depth-1); } else{ have_one = Intersect(node->_right, r, i, depth - 1); isect cur; if(Intersect(node->_left, r, cur, depth - 1)){ if(!have_one || (cur.t < i.t)){ i = cur; have_one = true; } } } } } // If ray intersects node } //End if return have_one; } template <typename Obj> bool IntersectLocal(KDNode<Obj>* node, ray& r, isect& i, int depth){ double tMin; double tMax; Vec3d R0 = r.getPosition(); Vec3d Rd = r.getDirection(); bool have_one = false; int axis = depth % 3; if(node != nullptr){ // If it is a leaf and Not empty if(node->_bounds.intersect(r, tMin, tMax)){ if(node->isLeaf()){ if(node->hasGeometry()) return node->intersectLocal(r,i); else return false; } //Get who is near and who is far double vd = Rd[axis]; double v = node->_t - R0[axis]; double ts = v/vd; double s = node->_t; double a = r.at(tMin)[axis]; double b = r.at(tMax)[axis]; if(a <= s){ if(b < s){ have_one = IntersectLocal(node->_left, r, i, depth-1); } else{ have_one = IntersectLocal(node->_left, r, i, depth - 1); isect cur; if(IntersectLocal(node->_right, r, cur, depth - 1)){ if(!have_one || (cur.t < i.t)){ i = cur; have_one = true; } } } } else{ if(b > s){ have_one = IntersectLocal(node->_right, r, i, depth-1); } else{ have_one = IntersectLocal(node->_right, r, i, depth - 1); isect cur; if(IntersectLocal(node->_left, r, cur, depth - 1)){ if(!have_one || (cur.t < i.t)){ i = cur; have_one = true; } } } } } // If ray intersects node } //End if return have_one; } template<typename Obj> bool KDNode<Obj>::intersect(ray& r, isect& i) const { double tmin = 0.0; double tmax = 0.0; bool have_one = false; // typedef std::list<Obj>::const_iterator iter; using iter = typename std::list<Obj>::const_iterator; for(iter j = _geometry_p.begin(); j != _geometry_p.end(); ++j) { isect cur; if( (*j)->intersect(r, cur) ) { if(!have_one || (cur.t < i.t)) { i = cur; have_one = true; } } } if(!have_one) i.setT(1000.0); return have_one; } template<typename Obj> bool KDNode<Obj>::intersectLocal(ray& r, isect& i) const { double tmin = 0.0; double tmax = 0.0; bool have_one = false; // typedef std::list<Obj>::const_iterator iter; using iter = typename std::list<Obj>::const_iterator; for(iter j = _geometry_p.begin(); j != _geometry_p.end(); ++j) { isect cur; if( (*j)->intersectLocal(r, cur) ) { if(!have_one || (cur.t < i.t)) { i = cur; have_one = true; } } } if(!have_one) i.setT(1000.0); return have_one; } template<typename Obj> bool KdTree<Obj>::intersect(ray& r, isect& i) const { int depth = _depth; return Intersect(root, r, i, depth); } template<typename Obj> bool KdTree<Obj>::intersectLocal(ray& r, isect& i) const { int depth = _depth; return IntersectLocal(root, r, i, depth); } #endif
{ "content_hash": "27ea598b593b6d550499d9f8584623a3", "timestamp": "", "source": "github", "line_count": 449, "max_line_length": 108, "avg_line_length": 26.64587973273942, "alnum_prop": 0.582246740220662, "repo_name": "mbartling/photonMapper", "id": "cdb8a2fb505947215d55278a1e59c53687f3cf30", "size": "12135", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/scene/kdtree2.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1623" }, { "name": "C++", "bytes": "366787" }, { "name": "Python", "bytes": "50" }, { "name": "Shell", "bytes": "1002" } ], "symlink_target": "" }
Management system for bleepr ## Requirements * Python 2.7 * libjpeg (for Pillow) ## Installation * `pip install virtualenv` * `virtualenv venv` * `. venv/bin/activate` * `git clone https://github.com:bleepr/bleepr-manage` * `cd bleepr-manage` * `pip install -r requirements.txt` ## Running the app * `python -O app.py` - Or `python app.py` if you want to start in debug mode. ## TODO * Link frontend to API * Generate images through sync button * ~~Add overview portal~~ * Add analytics portal * ~~Add settings portal available only to admins~~ - ~~Management system and data exporter~~ * ~~Add user management portal~~ * ~~Add export button~~
{ "content_hash": "d9cafa8f06782d813a8785f4b2eadcd7", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 58, "avg_line_length": 20.5, "alnum_prop": 0.7027439024390244, "repo_name": "bleepr/bleepr-manage", "id": "f23bbecbaff9b8350cdb7860cbf1ba6f16940366", "size": "673", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2349" }, { "name": "HTML", "bytes": "16191" }, { "name": "Python", "bytes": "19275" } ], "symlink_target": "" }
class Other(object): def override(self): print "OTHER override()" def implicit(self): print "OTHER implicit()" def altered(self): print "OTHER altered()" class Child(object): def __init__(self): self.other = Other() def implicit(self): self.other.implicit() def override(self): print "CHILD override()" def altered(self): print "CHILD, BEFORE OTHER altered()" self.other.altered() print "CHILD, AFTER OTHER altered()" def main(): """Composition""" son = Child() # Creates an object son.implicit() son.override() son.altered() if __name__ == "__main__": main()
{ "content_hash": "f2d8a3e8f4d6a45baf0546961c3bbebc", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 45, "avg_line_length": 18.05128205128205, "alnum_prop": 0.5553977272727273, "repo_name": "arantebillywilson/python-snippets", "id": "b6f7bcdec8be80fb7901e52a836f22fdf6f675e2", "size": "907", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "py2/lpthw/ex44/ex44e.py", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1642" }, { "name": "Python", "bytes": "308382" } ], "symlink_target": "" }
<?php namespace yiiunit\framework\data; use yii\data\Sort; use yii\web\UrlManager; use yiiunit\TestCase; /** * @author Qiang Xue <qiang.xue@gmail.com> * @since 2.0 * * @group data */ class SortTest extends TestCase { protected function setUp() { parent::setUp(); $this->mockApplication(); } public function testGetOrders() { $sort = new Sort([ 'attributes' => [ 'age', 'name' => [ 'asc' => ['first_name' => SORT_ASC, 'last_name' => SORT_ASC], 'desc' => ['first_name' => SORT_DESC, 'last_name' => SORT_DESC], ], ], 'params' => [ 'sort' => 'age,-name', ], 'enableMultiSort' => true, ]); $orders = $sort->getOrders(); $this->assertCount(3, $orders); $this->assertEquals(SORT_ASC, $orders['age']); $this->assertEquals(SORT_DESC, $orders['first_name']); $this->assertEquals(SORT_DESC, $orders['last_name']); $sort->enableMultiSort = false; $orders = $sort->getOrders(true); $this->assertCount(1, $orders); $this->assertEquals(SORT_ASC, $orders['age']); } /** * @depends testGetOrders */ public function testGetAttributeOrders() { $sort = new Sort([ 'attributes' => [ 'age', 'name' => [ 'asc' => ['first_name' => SORT_ASC, 'last_name' => SORT_ASC], 'desc' => ['first_name' => SORT_DESC, 'last_name' => SORT_DESC], ], ], 'params' => [ 'sort' => 'age,-name', ], 'enableMultiSort' => true, ]); $orders = $sort->getAttributeOrders(); $this->assertCount(2, $orders); $this->assertEquals(SORT_ASC, $orders['age']); $this->assertEquals(SORT_DESC, $orders['name']); $sort->enableMultiSort = false; $orders = $sort->getAttributeOrders(true); $this->assertCount(1, $orders); $this->assertEquals(SORT_ASC, $orders['age']); } /** * @depends testGetAttributeOrders */ public function testGetAttributeOrder() { $sort = new Sort([ 'attributes' => [ 'age', 'name' => [ 'asc' => ['first_name' => SORT_ASC, 'last_name' => SORT_ASC], 'desc' => ['first_name' => SORT_DESC, 'last_name' => SORT_DESC], ], ], 'params' => [ 'sort' => 'age,-name', ], 'enableMultiSort' => true, ]); $this->assertEquals(SORT_ASC, $sort->getAttributeOrder('age')); $this->assertEquals(SORT_DESC, $sort->getAttributeOrder('name')); $this->assertNull($sort->getAttributeOrder('xyz')); } /** * @depends testGetAttributeOrders */ public function testSetAttributeOrders() { $sort = new Sort([ 'attributes' => [ 'age', 'name' => [ 'asc' => ['first_name' => SORT_ASC, 'last_name' => SORT_ASC], 'desc' => ['first_name' => SORT_DESC, 'last_name' => SORT_DESC], ], ], 'params' => [ 'sort' => 'age,-name', ], 'enableMultiSort' => true, ]); $orders = [ 'age' => SORT_DESC, 'name' => SORT_ASC, ]; $sort->setAttributeOrders($orders); $this->assertEquals($orders, $sort->getAttributeOrders()); $sort->enableMultiSort = false; $sort->setAttributeOrders($orders); $this->assertEquals(['age' => SORT_DESC], $sort->getAttributeOrders()); $sort->setAttributeOrders($orders, false); $this->assertEquals($orders, $sort->getAttributeOrders()); $orders = ['unexistingAttribute' => SORT_ASC]; $sort->setAttributeOrders($orders); $this->assertEquals([], $sort->getAttributeOrders()); $sort->setAttributeOrders($orders, false); $this->assertEquals($orders, $sort->getAttributeOrders()); } public function testCreateSortParam() { $sort = new Sort([ 'attributes' => [ 'age', 'name' => [ 'asc' => ['first_name' => SORT_ASC, 'last_name' => SORT_ASC], 'desc' => ['first_name' => SORT_DESC, 'last_name' => SORT_DESC], ], ], 'params' => [ 'sort' => 'age,-name', ], 'enableMultiSort' => true, 'route' => 'site/index', ]); $this->assertEquals('-age,-name', $sort->createSortParam('age')); $this->assertEquals('name,age', $sort->createSortParam('name')); } public function testCreateUrl() { $manager = new UrlManager([ 'baseUrl' => '/', 'ScriptUrl' => '/index.php', 'cache' => null, ]); $sort = new Sort([ 'attributes' => [ 'age', 'name' => [ 'asc' => ['first_name' => SORT_ASC, 'last_name' => SORT_ASC], 'desc' => ['first_name' => SORT_DESC, 'last_name' => SORT_DESC], ], ], 'params' => [ 'sort' => 'age,-name', ], 'enableMultiSort' => true, 'urlManager' => $manager, 'route' => 'site/index', ]); $this->assertEquals('/index.php?r=site%2Findex&sort=-age%2C-name', $sort->createUrl('age')); $this->assertEquals('/index.php?r=site%2Findex&sort=name%2Cage', $sort->createUrl('name')); } /** * @depends testCreateUrl */ public function testLink() { $this->mockApplication(); $manager = new UrlManager([ 'baseUrl' => '/', 'scriptUrl' => '/index.php', 'cache' => null, ]); $sort = new Sort([ 'attributes' => [ 'age', 'name' => [ 'asc' => ['first_name' => SORT_ASC, 'last_name' => SORT_ASC], 'desc' => ['first_name' => SORT_DESC, 'last_name' => SORT_DESC], ], ], 'params' => [ 'sort' => 'age,-name', ], 'enableMultiSort' => true, 'urlManager' => $manager, 'route' => 'site/index', ]); $this->assertEquals('<a class="asc" href="/index.php?r=site%2Findex&amp;sort=-age%2C-name" data-sort="-age,-name">Age</a>', $sort->link('age')); } public function testParseSortParam() { $sort = new CustomSort([ 'attributes' => [ 'age', 'name', ], 'params' => [ 'sort' => [ ['field' => 'age', 'dir' => 'asc'], ['field' => 'name', 'dir' => 'desc'], ], ], 'enableMultiSort' => true, ]); $this->assertEquals(SORT_ASC, $sort->getAttributeOrder('age')); $this->assertEquals(SORT_DESC, $sort->getAttributeOrder('name')); } /** * @depends testGetOrders * * @see https://github.com/yiisoft/yii2/pull/13260 */ public function testGetExpressionOrders() { $sort = new Sort([ 'attributes' => [ 'name' => [ 'asc' => '[[last_name]] ASC NULLS FIRST', 'desc' => '[[last_name]] DESC NULLS LAST', ], ], ]); $sort->params = ['sort' => '-name']; $orders = $sort->getOrders(); $this->assertEquals(1, count($orders)); $this->assertEquals('[[last_name]] DESC NULLS LAST', $orders[0]); $sort->params = ['sort' => 'name']; $orders = $sort->getOrders(true); $this->assertEquals(1, count($orders)); $this->assertEquals('[[last_name]] ASC NULLS FIRST', $orders[0]); } } class CustomSort extends Sort { protected function parseSortParam($params) { $attributes = []; foreach ($params as $item) { $attributes[] = ($item['dir'] == 'desc') ? '-' . $item['field'] : $item['field']; } return $attributes; } }
{ "content_hash": "7de2b4092aba6d1723997d1b87b21880", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 152, "avg_line_length": 30.07773851590106, "alnum_prop": 0.4473684210526316, "repo_name": "wbraganca/yii2", "id": "426b6b5caccda5d26266f5097712c229553cba6b", "size": "8656", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "tests/framework/data/SortTest.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "28" }, { "name": "Batchfile", "bytes": "1085" }, { "name": "CSS", "bytes": "20" }, { "name": "HTML", "bytes": "11952" }, { "name": "JavaScript", "bytes": "259267" }, { "name": "PHP", "bytes": "5996191" }, { "name": "PLSQL", "bytes": "17331" }, { "name": "Ruby", "bytes": "207" }, { "name": "Shell", "bytes": "5742" } ], "symlink_target": "" }
//$URL$ //$Id$ package de.dev.eth0.bitcointrader.ui; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceScreen; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockPreferenceActivity; import com.actionbarsherlock.view.MenuItem; import de.dev.eth0.bitcointrader.BitcoinTraderApplication; import de.dev.eth0.bitcointrader.Constants; import de.dev.eth0.bitcointrader.R; import de.schildbach.wallet.integration.android.BitcoinIntegration; /** * @author Alexander Muthmann */ public class AboutActivity extends SherlockPreferenceActivity { private static final String KEY_ABOUT_VERSION = "about_version"; private static final String KEY_ABOUT_AUTHOR = "about_author"; private static final String KEY_ABOUT_AUTHOR_TWITTER = "about_author_twitter"; private static final String KEY_ABOUT_AUTHOR_LICENSE = "about_license"; private static final String KEY_ABOUT_CREDITS_BITCOINWALLET = "about_credits_bitcoinwallet"; private static final String KEY_ABOUT_CREDITS_XCHANGE = "about_credits_xchange"; private static final String KEY_ABOUT_CREDITS_ZXING = "about_credits_zxing"; private static final String KEY_ABOUT_CREDITS_GRAPHVIEW = "about_credits_graphview"; private static final String KEY_ABOUT_DONATE = "about_donate"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.about); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); findPreference(KEY_ABOUT_VERSION).setSummary(((BitcoinTraderApplication)getApplication()).applicationVersionName()); findPreference(KEY_ABOUT_CREDITS_BITCOINWALLET).setSummary(Constants.CREDITS_BITCOINWALLET_URL); findPreference(KEY_ABOUT_CREDITS_XCHANGE).setSummary(Constants.CREDITS_XCHANGE_URL); findPreference(KEY_ABOUT_CREDITS_ZXING).setSummary(Constants.CREDITS_ZXING_URL); findPreference(KEY_ABOUT_CREDITS_GRAPHVIEW).setSummary(Constants.CREDITS_GRAPHVIEW_URL); findPreference(KEY_ABOUT_DONATE).setSummary(Constants.DONATION_ADDRESS); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; } return super.onOptionsItemSelected(item); } @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { String key = preference.getKey(); if (KEY_ABOUT_AUTHOR_TWITTER.equals(key)) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.AUTHOR_TWITTER_URL))); finish(); } else if (KEY_ABOUT_AUTHOR.equals(key)) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.AUTHOR_URL))); finish(); } else if (KEY_ABOUT_AUTHOR_LICENSE.equals(key)) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.AUTHOR_SOURCE_URL))); finish(); } else if (KEY_ABOUT_CREDITS_BITCOINWALLET.equals(key)) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.CREDITS_BITCOINWALLET_URL))); finish(); } else if (KEY_ABOUT_CREDITS_XCHANGE.equals(key)) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.CREDITS_XCHANGE_URL))); finish(); } else if (KEY_ABOUT_CREDITS_GRAPHVIEW.equals(key)) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.CREDITS_GRAPHVIEW_URL))); finish(); } else if (KEY_ABOUT_DONATE.equals(key)) { BitcoinIntegration.request(this, Constants.DONATION_ADDRESS); finish(); } return false; } }
{ "content_hash": "f6d3fa401a86995385041466d6ed36ce", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 120, "avg_line_length": 40.43157894736842, "alnum_prop": 0.7292371778182765, "repo_name": "deveth0/bitcointrader", "id": "4e9893958855526fd66c9a505d6f76e5d6b96c3a", "size": "3841", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "BitcoinTrader/src/de/dev/eth0/bitcointrader/ui/AboutActivity.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "14153" }, { "name": "Java", "bytes": "1720488" }, { "name": "Makefile", "bytes": "42374" }, { "name": "Shell", "bytes": "83" } ], "symlink_target": "" }
One of the common implementation patterns is to expose microservices via single entry point called API Gateway or Client Facade. The responsiblity of that component is to accept calls from external consumers, enforce security rules, perform authentication and authorization and when request is cleared it can call one or few microservices in a single transaction. Client Facades may also implement complex requests, combine multiple datasets and return then in a single transaction, push notifications via async mechanisms like Socket.IO or WebSockets. This framework is a part of [Pip.Services](https://github.com/pip-services/pip-services) project. It provides reusable primitives to quickly build sophisticated client facades via composition of multiple routes and middleware components. - **Services** - Main and partition (subpath) facade services - **Routes** - Abstract facade route class and few generic routes - **Errors** - Error simulation Quick Links: * [Downloads](https://github.com/pip-services/pip-services-facade-node/blob/master/doc/Downloads.md) * [API Reference](http://htmlpreview.github.io/?https://github.com/pip-services/pip-services-facade-node/blob/master/doc/api/index.html) * [Building and Testing](https://github.com/pip-services/pip-services-facade-node/blob/master/doc/Development.md) * [Contributing](https://github.com/pip-services/pip-services-facade-node/blob/master/doc/Development.md/#contrib) ## Acknowledgements The Node.js version of Pip.Services is created and maintained by **Sergey Seroukhov**
{ "content_hash": "3935ffee40ffed4fa3e07b6e18891d62", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 144, "avg_line_length": 68.1304347826087, "alnum_prop": 0.7887683471601787, "repo_name": "pip-services/pip-services-facade-node", "id": "dbd2330a63d08443f5b1579a88632061043607d9", "size": "1740", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33261", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "171" }, { "name": "PowerShell", "bytes": "278" }, { "name": "TypeScript", "bytes": "34037" } ], "symlink_target": "" }
from __future__ import absolute_import, unicode_literals from django.contrib import admin from physical.forms.environment_group import EnvironmentGroupForm class EnvironmentGroupAdmin(admin.ModelAdmin): form = EnvironmentGroupForm save_on_top = True search_fields = ('name',) list_display = ('name', 'group_environments') list_filter = ("environments",) filter_horizontal = ("environments",) def group_environments(self, obj): return ",".join(obj.environments.values_list('name', flat=True))
{ "content_hash": "de48c85b5429f3404a75c97a62c64a9a", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 72, "avg_line_length": 35.4, "alnum_prop": 0.71939736346516, "repo_name": "globocom/database-as-a-service", "id": "70b968b2697737c24a1cef0cceeead60b5bfcf79", "size": "555", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dbaas/physical/admin/environment_group.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "243568" }, { "name": "Dockerfile", "bytes": "1372" }, { "name": "HTML", "bytes": "310401" }, { "name": "JavaScript", "bytes": "988830" }, { "name": "Makefile", "bytes": "5199" }, { "name": "Python", "bytes": "9674426" }, { "name": "Shell", "bytes": "215115" } ], "symlink_target": "" }
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ function run_test() { // If we can't get the profiler component then assume gecko was // built without it and pass all the tests var profilerCc = Cc["@mozilla.org/tools/profiler;1"]; if (!profilerCc) return; var profiler = Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler); if (!profiler) return; do_check_true(!profiler.IsActive()); profiler.StartProfiler(10, 100, [], 0); do_check_true(profiler.IsActive()); profiler.StopProfiler(); do_check_true(!profiler.IsActive()); }
{ "content_hash": "554375c7bc72e6d3c390ac734f2eac93", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 80, "avg_line_length": 29.24, "alnum_prop": 0.6867305061559508, "repo_name": "sergecodd/FireFox-OS", "id": "b04b130ff16bf102dbcef579b3059a2d62d98e1a", "size": "731", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "B2G/gecko/tools/profiler/tests/test_start.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ada", "bytes": "443" }, { "name": "ApacheConf", "bytes": "85" }, { "name": "Assembly", "bytes": "5123438" }, { "name": "Awk", "bytes": "46481" }, { "name": "Batchfile", "bytes": "56250" }, { "name": "C", "bytes": "101720951" }, { "name": "C#", "bytes": "38531" }, { "name": "C++", "bytes": "148896543" }, { "name": "CMake", "bytes": "23541" }, { "name": "CSS", "bytes": "2758664" }, { "name": "DIGITAL Command Language", "bytes": "56757" }, { "name": "Emacs Lisp", "bytes": "12694" }, { "name": "Erlang", "bytes": "889" }, { "name": "FLUX", "bytes": "34449" }, { "name": "GLSL", "bytes": "26344" }, { "name": "Gnuplot", "bytes": "710" }, { "name": "Groff", "bytes": "447012" }, { "name": "HTML", "bytes": "43343468" }, { "name": "IDL", "bytes": "1455122" }, { "name": "Java", "bytes": "43261012" }, { "name": "JavaScript", "bytes": "46646658" }, { "name": "Lex", "bytes": "38358" }, { "name": "Logos", "bytes": "21054" }, { "name": "Makefile", "bytes": "2733844" }, { "name": "Matlab", "bytes": "67316" }, { "name": "Max", "bytes": "3698" }, { "name": "NSIS", "bytes": "421625" }, { "name": "Objective-C", "bytes": "877657" }, { "name": "Objective-C++", "bytes": "737713" }, { "name": "PHP", "bytes": "17415" }, { "name": "Pascal", "bytes": "6780" }, { "name": "Perl", "bytes": "1153180" }, { "name": "Perl6", "bytes": "1255" }, { "name": "PostScript", "bytes": "1139" }, { "name": "PowerShell", "bytes": "8252" }, { "name": "Protocol Buffer", "bytes": "26553" }, { "name": "Python", "bytes": "8453201" }, { "name": "Ragel in Ruby Host", "bytes": "3481" }, { "name": "Ruby", "bytes": "5116" }, { "name": "Scilab", "bytes": "7" }, { "name": "Shell", "bytes": "3383832" }, { "name": "SourcePawn", "bytes": "23661" }, { "name": "TeX", "bytes": "879606" }, { "name": "WebIDL", "bytes": "1902" }, { "name": "XSLT", "bytes": "13134" }, { "name": "Yacc", "bytes": "112744" } ], "symlink_target": "" }
using System.ComponentModel; using System.Diagnostics.Contracts; using System.Threading.Tasks; namespace LordJZ.ObjectManagement.Contracts { [ContractClassFor(typeof(IObjectSaver))] [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] internal abstract class IObjectSaverContract : IObjectSaver { void IObjectSaver.Save(object key, object obj) { Contract.Requires(key != null); Contract.Requires(obj != null); } } [ContractClassFor(typeof(IObjectSaver<,>))] [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] internal abstract class IObjectSaverContract<TKey, TObject> : IObjectSaver<TKey, TObject> where TObject : class { void IObjectSaver<TKey, TObject>.Save(TKey key, TObject obj) { Contract.Requires(obj != default(TObject)); Contract.Requires(typeof(TKey).IsValueType || key != null); } public abstract void Save(object key, object obj); } [ContractClassFor(typeof(IAsyncObjectSaver<,>))] [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] internal abstract class IAsyncObjectSaverContract<TKey, TObject> : IAsyncObjectSaver<TKey, TObject> where TObject : class { Task IAsyncObjectSaver<TKey, TObject>.AsyncSave(TKey key, TObject obj) { Contract.Requires(obj != default(TObject)); Contract.Requires(typeof(TKey).IsValueType || key != null); Contract.Ensures(Contract.Result<Task>() != null); return null; } public abstract void Save(TKey key, TObject obj); public abstract void Save(object key, object obj); } }
{ "content_hash": "a984722c684c2f8282173cbe0095686e", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 78, "avg_line_length": 35.285714285714285, "alnum_prop": 0.6633892423366108, "repo_name": "LordJZ/LordJZ", "id": "a8e4ee6a287ea9d6154ccfd28e356bb38d38e395", "size": "1731", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "LordJZ/ObjectManagement/Contracts/IObjectSaverContract.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "470712" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="fr" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Ccoin</source> <translation>À propos de Ccoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Ccoin&lt;/b&gt; version</source> <translation>&lt;b&gt;Ccoin&lt;/b&gt; version</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation> Ce logiciel est en phase expérimentale. Distribué sous licence MIT/X11, voir le fichier COPYING ou http://www.opensource.org/licenses/mit-license.php. Ce produit comprend des fonctionnalités développées par le projet OpenSSL pour être utilisés dans la boîte à outils OpenSSL (http://www.openssl.org/), un logiciel cryptographique écrit par Eric Young (eay@cryptsoft.com), et des fonctionnalités développées pour le logiciel UPnP écrit par Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Droit d&apos;auteur</translation> </message> <message> <location line="+0"/> <source>The Ccoin developers</source> <translation>Les développeurs Ccoin</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Carnet d&apos;adresses</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Double cliquez afin de modifier l&apos;adresse ou l&apos;étiquette</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Créer une nouvelle adresse</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copier l&apos;adresse sélectionnée dans le presse-papiers</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Nouvelle adresse</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Ccoin 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>Voici vos adresses Ccoin qui vous permettent de recevoir des paiements. Vous pouvez donner une adresse différente à chaque expéditeur afin de savoir qui vous paye.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Copier l&apos;adresse</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Afficher le &amp;QR Code</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Ccoin address</source> <translation>Signer un message pour prouver que vous détenez une adresse Ccoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Signer un &amp;message</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Effacer l&apos;adresse actuellement sélectionnée de la liste</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Exporter les données de l&apos;onglet courant vers un fichier</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Exporter</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Ccoin address</source> <translation>Vérifier un message pour vous assurer qu&apos;il a bien été signé avec l&apos;adresse Ccoin spécifiée</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Vérifier un message</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Supprimer</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Ccoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Ce sont vos adresses Ccoin pour émettre des paiements. Vérifiez toujours le montant et l&apos;adresse du destinataire avant d&apos;envoyer des pièces.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Copier l&apos;é&amp;tiquette</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Éditer</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Envoyer des &amp;Ccoins</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Exporter les données du carnet d&apos;adresses</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Valeurs séparées par des virgules (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Erreur lors de l&apos;exportation</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Impossible d&apos;écrire dans le fichier %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Étiquette</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(aucune étiquette)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Dialogue de phrase de passe</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Entrez la phrase de passe</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nouvelle phrase de passe</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Répétez la phrase de passe</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>Entrez une nouvelle phrase de passe pour le porte-monnaie.&lt;br/&gt;Veuillez utiliser une phrase composée de &lt;b&gt;10 caractères aléatoires ou plus&lt;/b&gt;, ou bien de &lt;b&gt;huit mots ou plus&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Chiffrer le porte-monnaie</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Cette opération nécessite votre phrase de passe pour déverrouiller le porte-monnaie.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Déverrouiller le porte-monnaie</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Cette opération nécessite votre phrase de passe pour décrypter le porte-monnaie.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Déchiffrer le porte-monnaie</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Changer la phrase de passe</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Entrez l’ancienne phrase de passe pour le porte-monnaie ainsi que la nouvelle.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Confirmer le chiffrement du porte-monnaie</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>Attention : Si vous chiffrez votre porte-monnaie et perdez votre phrase de passe, vous &lt;b&gt;PERDREZ ACCÈS À TOUS VOS LITECOINS&lt;/b&gt; !</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Êtes-vous sûr de vouloir chiffrer votre porte-monnaie ?</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>IMPORTANT : Les sauvegardes précédentes de votre fichier de porte-monnaie devraient être remplacées par le nouveau fichier crypté de porte-monnaie. Pour des raisons de sécurité, les précédentes sauvegardes de votre fichier de porte-monnaie non chiffré deviendront inutilisables dès que vous commencerez à utiliser le nouveau porte-monnaie chiffré.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Attention : la touche Verr. Maj. est activée !</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Porte-monnaie chiffré</translation> </message> <message> <location line="-56"/> <source>Ccoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your ccoins from being stolen by malware infecting your computer.</source> <translation>Ccoin va à présent se fermer pour terminer la procédure de cryptage. N&apos;oubliez pas que le chiffrement de votre porte-monnaie ne peut pas fournir une protection totale contre le vol par des logiciels malveillants qui infecteraient votre ordinateur.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Le chiffrement du porte-monnaie a échoué</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Le chiffrement du porte-monnaie a échoué en raison d&apos;une erreur interne. Votre porte-monnaie n&apos;a pas été chiffré.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>Les phrases de passe entrées ne correspondent pas.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Le déverrouillage du porte-monnaie a échoué</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>La phrase de passe entrée pour décrypter le porte-monnaie était incorrecte.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Le déchiffrage du porte-monnaie a échoué</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>La phrase de passe du porte-monnaie a été modifiée avec succès.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>Signer un &amp;message...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Synchronisation avec le réseau…</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;Vue d&apos;ensemble</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Afficher une vue d’ensemble du porte-monnaie</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transactions</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Parcourir l&apos;historique des transactions</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Éditer la liste des adresses et des étiquettes stockées</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Afficher la liste des adresses pour recevoir des paiements</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>Q&amp;uitter</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Quitter l’application</translation> </message> <message> <location line="+4"/> <source>Show information about Ccoin</source> <translation>Afficher des informations à propos de Ccoin</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>À propos de &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Afficher des informations sur Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Options…</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Chiffrer le porte-monnaie...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Sauvegarder le porte-monnaie...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Modifier la phrase de passe...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Importation des blocs depuis le disque...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Réindexation des blocs sur le disque...</translation> </message> <message> <location line="-347"/> <source>Send coins to a Ccoin address</source> <translation>Envoyer des pièces à une adresse Ccoin</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Ccoin</source> <translation>Modifier les options de configuration de Ccoin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Sauvegarder le porte-monnaie à un autre emplacement</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Modifier la phrase de passe utilisée pour le chiffrement du porte-monnaie</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>Fenêtre de &amp;débogage</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Ouvrir une console de débogage et de diagnostic</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Vérifier un message...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Ccoin</source> <translation>Ccoin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Porte-monnaie</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Envoyer</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Recevoir</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Adresses</translation> </message> <message> <location line="+22"/> <source>&amp;About Ccoin</source> <translation>À &amp;propos de Ccoin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Afficher / Cacher</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Afficher ou masquer la fenêtre principale</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Crypter les clefs privées de votre porte-monnaie</translation> </message> <message> <location line="+7"/> <source>Sign messages with your Ccoin addresses to prove you own them</source> <translation>Signer les messages avec vos adresses Ccoin pour prouver que vous les détenez</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Ccoin addresses</source> <translation>Vérifier les messages pour vous assurer qu&apos;ils ont bien été signés avec les adresses Ccoin spécifiées</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Fichier</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Réglages</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Aide</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Barre d&apos;outils des onglets</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>Ccoin client</source> <translation>Client Ccoin</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Ccoin network</source> <translation><numerusform>%n connexion active avec le réseau Ccoin</numerusform><numerusform>%n connexions actives avec le réseau Ccoin</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>Aucune source de bloc disponible...</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>%1 blocs sur %2 (estimés) de l&apos;historique des transactions traités.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>%1 blocs de l&apos;historique des transactions traités.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n heure</numerusform><numerusform>%n heures</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n jour</numerusform><numerusform>%n jours</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n semaine</numerusform><numerusform>%n semaines</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>%1 en arrière</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>Le dernier bloc reçu avait été généré il y a %1.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Les transactions après cela ne seront pas encore visibles.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>Erreur</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Avertissement</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Information</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>Cette transaction dépasse la limite de taille. Vous pouvez quand même l&apos;envoyer en vous acquittant de frais d&apos;un montant de %1 qui iront aux nœuds qui traiteront la transaction et aideront à soutenir le réseau. Voulez-vous payer les frais ?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>À jour</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Rattrapage…</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Confirmer les frais de transaction</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Transaction envoyée</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Transaction entrante</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Date : %1 Montant : %2 Type : %3 Adresse : %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>Gestion des URI</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Ccoin address or malformed URI parameters.</source> <translation>L&apos;URI ne peut être analysé ! Cela peut être causé par une adresse Ccoin invalide ou par des paramètres d&apos;URI malformés.</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>Le porte-monnaie est &lt;b&gt;chiffré&lt;/b&gt; et est actuellement &lt;b&gt;déverrouillé&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>Le porte-monnaie est &lt;b&gt;chiffré&lt;/b&gt; et est actuellement &lt;b&gt;verrouillé&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Ccoin can no longer continue safely and will quit.</source> <translation>Une erreur fatale est survenue. Ccoin ne peut plus continuer à fonctionner de façon sûre et va s&apos;arrêter.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Alerte réseau</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Éditer l&apos;adresse</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Étiquette</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>L’étiquette associée à cette entrée du carnet d&apos;adresses</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Adresse</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>L’adresse associée avec cette entrée du carnet d&apos;adresses. Ne peut être modifiées que les adresses d’envoi.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Nouvelle adresse de réception</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nouvelle adresse d’envoi</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Éditer l’adresse de réception</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Éditer l’adresse d&apos;envoi</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>L’adresse fournie « %1 » est déjà présente dans le carnet d&apos;adresses.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Ccoin address.</source> <translation>L&apos;adresse fournie « %1 » n&apos;est pas une adresse Ccoin valide.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Impossible de déverrouiller le porte-monnaie.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Échec de la génération de la nouvelle clef.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Ccoin-Qt</source> <translation>Ccoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>version</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Utilisation :</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>options de ligne de commande</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>Options Interface Utilisateur</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Définir la langue, par exemple « de_DE » (par défaut : la langue du système)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Démarrer sous forme minimisée</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Afficher l&apos;écran d&apos;accueil au démarrage (par défaut : 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Options</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>Réglages &amp;principaux</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>Frais de transaction optionnel par ko qui aident à garantir un traitement rapide des transactions. La plupart des transactions utilisent 1 ko.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Payer des &amp;frais de transaction</translation> </message> <message> <location line="+31"/> <source>Automatically start Ccoin after logging in to the system.</source> <translation>Démarrer Ccoin automatiquement lors de l&apos;ouverture une session sur l&apos;ordinateur.</translation> </message> <message> <location line="+3"/> <source>&amp;Start Ccoin on system login</source> <translation>&amp;Démarrer Ccoin lors de l&apos;ouverture d&apos;une session</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>Remettre toutes les options du client aux valeurs par défaut.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>&amp;Remise à zéro des options</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Réseau</translation> </message> <message> <location line="+6"/> <source>Automatically open the Ccoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Ouvrir le port du client Ccoin automatiquement sur le routeur. Cela ne fonctionne que si votre routeur supporte l&apos;UPnP et si la fonctionnalité est activée.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Ouvrir le port avec l&apos;&amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Ccoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Connexion au réseau Ccoin à travers un proxy SOCKS (par ex. lors d&apos;une connexion via Tor).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Connexion à travers un proxy SOCKS :</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP du proxy :</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>Adresse IP du proxy (par ex. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Port :</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Port du proxy (par ex. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Version SOCKS :</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Version SOCKS du serveur mandataire (par ex. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Fenêtre</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Afficher uniquement une icône système après minimisation.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimiser dans la barre système au lieu de la barre des tâches</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>Minimiser au lieu quitter l&apos;application lorsque la fenêtre est fermée. Lorsque cette option est activée, l&apos;application ne pourra être fermée qu&apos;en sélectionnant Quitter dans le menu déroulant.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimiser lors de la fermeture</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Affichage</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Langue de l&apos;interface utilisateur :</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Ccoin.</source> <translation>La langue de l&apos;interface utilisateur peut être définie ici. Ce réglage sera pris en compte après redémarrage de Ccoin.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unité d&apos;affichage des montants :</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Choisissez la sous-unité par défaut pour l&apos;affichage dans l&apos;interface et lors de l&apos;envoi de pièces.</translation> </message> <message> <location line="+9"/> <source>Whether to show Ccoin addresses in the transaction list or not.</source> <translation>Détermine si les adresses Ccoin seront affichées sur la liste des transactions.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Afficher les adresses sur la liste des transactions</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;Valider</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>A&amp;nnuler</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Appliquer</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>par défaut</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>Confirmer la remise à zéro des options</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>La prise en compte de certains réglages peut nécessiter un redémarrage du client.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>Voulez-vous continuer ?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Avertissement</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Ccoin.</source> <translation>Ce réglage sera pris en compte après un redémarrage de Ccoin.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>L&apos;adresse de proxy fournie est invalide.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Formulaire</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Ccoin network after a connection is established, but this process has not completed yet.</source> <translation>Les informations affichées peuvent être obsolètes. Votre porte-monnaie est automatiquement synchronisé avec le réseau Ccoin lorsque la connexion s&apos;établit, or ce processus n&apos;est pas encore terminé.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Solde :</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Non confirmé :</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Porte-monnaie</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Immature :</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Le solde généré n&apos;est pas encore mûr</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transactions récentes&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Votre solde actuel</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>Total des transactions qui doivent encore être confirmées et qui ne sont pas prises en compte dans le solde actuel</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>désynchronisé</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start ccoin: click-to-pay handler</source> <translation>Impossible de démarrer ccoin : gestionnaire de cliquer-pour-payer</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Dialogue de QR Code</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Demande de paiement</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Montant :</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Étiquette :</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Message :</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Enregistrer sous...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Erreur de l&apos;encodage de l&apos;URI dans le QR Code.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Le montant entré est invalide, veuillez le vérifier.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>L&apos;URI résultant est trop long, essayez avec un texte d&apos;étiquette ou de message plus court.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Sauvegarder le QR Code</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>Images PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nom du client</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>Indisponible</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Version du client</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informations</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Version d&apos;OpenSSL utilisée</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Date de démarrage</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Réseau</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Nombre de connexions</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Sur testnet</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Chaîne de blocs</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Nombre actuel de blocs</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Nombre total estimé de blocs</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Horodatage du dernier bloc</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Ouvrir</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Options de ligne de commande</translation> </message> <message> <location line="+7"/> <source>Show the Ccoin-Qt help message to get a list with possible Ccoin command-line options.</source> <translation>Afficher le message d&apos;aide de Ccoin-Qt pour obtenir la liste des options de ligne de commande disponibles pour Ccoin.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Afficher</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Console</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Date de compilation</translation> </message> <message> <location line="-104"/> <source>Ccoin - Debug window</source> <translation>Ccoin - Fenêtre de débogage</translation> </message> <message> <location line="+25"/> <source>Ccoin Core</source> <translation>Noyau Ccoin</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Journal de débogage</translation> </message> <message> <location line="+7"/> <source>Open the Ccoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Ouvrir le journal de débogage de Ccoin depuis le répertoire de données actuel. Cela peut prendre quelques secondes pour les journaux de grande taille.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Nettoyer la console</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Ccoin RPC console.</source> <translation>Bienvenue sur la console RPC de Ccoin.</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>Utilisez les touches de curseur pour naviguer dans l&apos;historique et &lt;b&gt;Ctrl-L&lt;/b&gt; pour effacer l&apos;écran.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Tapez &lt;b&gt;help&lt;/b&gt; pour afficher une vue générale des commandes disponibles.</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>Envoyer des pièces</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Envoyer des pièces à plusieurs destinataires à la fois</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Ajouter un &amp;destinataire</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Enlever tous les champs de transaction</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>&amp;Tout nettoyer</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Solde :</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>Confirmer l’action d&apos;envoi</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>E&amp;nvoyer</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; à %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirmer l’envoi des pièces</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Êtes-vous sûr de vouloir envoyer %1 ?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> et </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>Cette adresse de destinataire n’est pas valide, veuillez la vérifier.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Le montant à payer doit être supérieur à 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Le montant dépasse votre solde.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Le montant dépasse votre solde lorsque les frais de transaction de %1 sont inclus.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Adresse dupliquée trouvée, il n&apos;est possible d&apos;envoyer qu&apos;une fois à chaque adresse par opération d&apos;envoi.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Erreur : Échec de la création de la transaction !</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>Erreur : la transaction a été rejetée. Cela peut arriver si certaines pièces de votre porte-monnaie ont déjà été dépensées, par exemple si vous avez utilisé une copie de wallet.dat avec laquelle les pièces ont été dépensées mais pas marquées comme telles ici.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Formulaire</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Montant :</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Payer &amp;à :</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>L&apos;adresse à laquelle le paiement sera envoyé (par ex. 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>Entrez une étiquette pour cette adresse afin de l’ajouter à votre carnet d’adresses</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Étiquette :</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Choisir une adresse dans le carnet d&apos;adresses</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>Coller une adresse depuis le presse-papiers</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>Enlever ce destinataire</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Ccoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Entrez une adresse Ccoin (par ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Signatures - Signer / Vérifier un message</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;Signer un message</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>Vous pouvez signer des messages avec vos adresses pour prouver que les détenez. Faites attention à ne pas signer quoi que ce soit de vague car des attaques d&apos;hameçonnage peuvent essayer d&apos;usurper votre identité par votre signature. Ne signez que des déclarations entièrement détaillées et avec lesquelles vous serez d&apos;accord.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>L&apos;adresse avec laquelle le message sera signé (par ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Choisir une adresse depuis le carnet d&apos;adresses</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>Coller une adresse depuis le presse-papiers</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>Entrez ici le message que vous désirez signer</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Signature</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Copier la signature actuelle dans le presse-papiers</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Ccoin address</source> <translation>Signer le message pour prouver que vous détenez cette adresse Ccoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Signer le &amp;message</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Remettre à zéro tous les champs de signature de message</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>&amp;Tout nettoyer</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Vérifier un message</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>Entrez ci-dessous l&apos;adresse ayant servi à signer, le message (assurez-vous d&apos;avoir copié exactement les retours à la ligne, les espacements, tabulations etc.) et la signature pour vérifier le message. Faites attention à ne pas déduire davantage de la signature que ce qui est contenu dans le message signé lui-même pour éviter d&apos;être trompé par une attaque d&apos;homme du milieu.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>L&apos;adresse avec laquelle le message a été signé (par ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Ccoin address</source> <translation>Vérifier le message pour vous assurer qu&apos;il a bien été signé par l&apos;adresse Ccoin spécifiée</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>Vérifier un &amp;message</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Remettre à zéro tous les champs de vérification de message</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Ccoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Entrez une adresse Ccoin (par ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Cliquez sur « Signer le message » pour générer la signature</translation> </message> <message> <location line="+3"/> <source>Enter Ccoin signature</source> <translation>Entrer une signature Ccoin</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>L&apos;adresse entrée est invalide.</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>Veuillez vérifier l&apos;adresse et réessayez.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>L&apos;adresse entrée ne fait pas référence à une clef.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Le déverrouillage du porte-monnaie a été annulé.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>La clef privée pour l&apos;adresse indiquée n&apos;est pas disponible.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>La signature du message a échoué.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Le message a été signé.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>La signature n&apos;a pu être décodée.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Veuillez vérifier la signature et réessayez.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>La signature ne correspond pas au hachage du message.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Échec de la vérification du message.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Message vérifié.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Ccoin developers</source> <translation>Les développeurs Ccoin</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Ouvert jusqu&apos;à %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/hors ligne</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/non confirmée</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmations</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>État</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, diffusée à travers %n nœud</numerusform><numerusform>, diffusée à travers %n nœuds</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Date</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Source</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Génération</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>De</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>À</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>votre propre adresse</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>étiquette</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Crédit</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>arrive à maturité dans %n bloc</numerusform><numerusform>arrive à maturité dans %n blocs de plus</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>non accepté</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Débit</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Frais de transaction</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Montant net</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Message</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Commentaire</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID de la transaction</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>Les pièces générées doivent mûrir pendant 120 blocs avant de pouvoir être dépensées. Lorsque vous avez généré ce bloc, il a été diffusé sur le réseau pour être ajouté à la chaîne de blocs. S’il échoue a intégrer la chaîne, son état sera modifié en « non accepté » et il ne sera pas possible de le dépenser. Cela peut arriver occasionnellement si un autre nœud génère un bloc quelques secondes avant ou après vous.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informations de débogage</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transaction</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Entrées</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Montant</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>vrai</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>faux</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, n’a pas encore été diffusée avec succès</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Ouvert pour %n bloc de plus</numerusform><numerusform>Ouvert pour %n blocs de plus</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>inconnu</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Détails de la transaction</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Ce panneau affiche une description détaillée de la transaction</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Date</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Montant</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>Ouvert pour %n bloc de plus</numerusform><numerusform>Ouvert pour %n blocs de plus</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Ouvert jusqu&apos;à %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Hors ligne (%1 confirmations)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Non confirmée (%1 confirmations sur un total de %2)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmée (%1 confirmations)</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>Le solde généré (mined) sera disponible quand il aura mûri dans %n bloc</numerusform><numerusform>Le solde généré (mined) sera disponible quand il aura mûri dans %n blocs</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>Ce bloc n’a été reçu par aucun autre nœud et ne sera probablement pas accepté !</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Généré mais pas accepté</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Reçue avec</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Reçue de</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Envoyée à</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Paiement à vous-même</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Extraction</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(indisponible)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>État de la transaction. Laissez le pointeur de la souris sur ce champ pour voir le nombre de confirmations.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Date et heure de réception de la transaction.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Type de transaction.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>L’adresse de destination de la transaction.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Montant ajouté au, ou enlevé du, solde.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Toutes</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Aujourd’hui</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Cette semaine</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Ce mois-ci</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Mois dernier</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Cette année</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Intervalle…</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Reçues avec</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Envoyées à</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>À vous-même</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Extraction</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Autres</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Entrez une adresse ou une étiquette à rechercher</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Montant min</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copier l’adresse</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copier l’étiquette</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copier le montant</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copier l&apos;ID de la transaction</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Éditer l’étiquette</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Afficher les détails de la transaction</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Exporter les données des transactions</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Valeurs séparées par des virgules (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmée</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Date</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Étiquette</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Montant</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Erreur lors de l’exportation</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Impossible d&apos;écrire dans le fichier %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Intervalle :</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>à</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Envoyer des pièces</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation>&amp;Exporter</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Exporter les données de l&apos;onglet courant vers un fichier</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Sauvegarder le porte-monnaie</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Données de porte-monnaie (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Échec de la sauvegarde</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Une erreur est survenue lors de l&apos;enregistrement des données de porte-monnaie à un nouvel endroit</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Sauvegarde réussie</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Les données de porte-monnaie ont été enregistrées avec succès sur le nouvel emplacement.</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Ccoin version</source> <translation>Version de Ccoin</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Utilisation :</translation> </message> <message> <location line="-29"/> <source>Send command to -server or ccoind</source> <translation>Envoyer une commande à -server ou à ccoind</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Lister les commandes</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Obtenir de l’aide pour une commande</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Options :</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: ccoin.conf)</source> <translation>Spécifier le fichier de configuration (par défaut : ccoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: ccoind.pid)</source> <translation>Spécifier le fichier PID (par défaut : ccoind.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Spécifier le répertoire de données</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Définir la taille du tampon en mégaoctets (par défaut : 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation>Écouter les connexions sur le &lt;port&gt; (par défaut : 9333 ou testnet : 19333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Garder au plus &lt;n&gt; connexions avec les pairs (par défaut : 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Se connecter à un nœud pour obtenir des adresses de pairs puis se déconnecter</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Spécifier votre propre adresse publique</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Seuil de déconnexion des pairs de mauvaise qualité (par défaut : 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Délai en secondes de refus de reconnexion aux pairs de mauvaise qualité (par défaut : 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>Une erreur est survenue lors de la mise en place du port RPC %u pour écouter sur IPv4 : %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9332 or testnet: 19332)</source> <translation>Écouter les connexions JSON-RPC sur le &lt;port&gt; (par défaut : 9332 ou tesnet : 19332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Accepter les commandes de JSON-RPC et de la ligne de commande</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Fonctionner en arrière-plan en tant que démon et accepter les commandes</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Utiliser le réseau de test</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Accepter les connexions entrantes (par défaut : 1 si -proxy ou -connect ne sont pas présents)</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=ccoinrpc 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;Ccoin Alert&quot; admin@foo.com </source> <translation>%s, vous devez définir un mot de passe rpc dans le fichier de configuration : %s Il vous est conseillé d&apos;utiliser le mot de passe aléatoire suivant : rpcuser=ccoinrpc rpcpassword=%s (vous n&apos;avez pas besoin de retenir ce mot de passe) Le nom d&apos;utilisateur et le mot de passe NE DOIVENT PAS être identiques. Si le fichier n&apos;existe pas, créez-le avec les droits de lecture accordés au propriétaire. Il est aussi conseillé de régler alertnotify pour être prévenu des problèmes ; par exemple : alertnotify=echo %%s | mail -s &quot;Ccoin Alert&quot; admin@foo.com </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Une erreur est survenue lors de la mise en place du port RPC %u pour écouter sur IPv6, retour à 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>Se lier à l&apos;adresse donnée et toujours l&apos;écouter. Utilisez la notation [host]:port pour l&apos;IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Ccoin is probably already running.</source> <translation>Impossible d’obtenir un verrou sur le répertoire de données %s. Ccoin fonctionne probablement déjà.</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>Erreur : la transaction a été rejetée ! Cela peut arriver si certaines pièces de votre porte-monnaie étaient déjà dépensées, par exemple si vous avez utilisé une copie de wallet.dat et les pièces ont été dépensées avec cette copie sans être marquées comme telles ici.</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>Erreur : cette transaction nécessite des frais de transaction d&apos;au moins %s en raison de son montant, de sa complexité ou parce que des fonds reçus récemment sont utilisés !</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Exécuter une commande lorsqu&apos;une alerte correspondante est reçue (%s dans la commande sera remplacé par le message)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Exécuter la commande lorsqu&apos;une transaction de porte-monnaie change (%s dans la commande est remplacée par TxID)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Définir la taille maximale en octets des transactions prioritaires/à frais modiques (par défaut : 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>Ceci est une pré-version de test - utilisez à vos risques et périls - ne l&apos;utilisez pas pour miner ou pour des applications marchandes</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>Attention : -paytxfee est réglée sur un montant très élevé ! Il s&apos;agit des frais de transaction que vous payerez si vous émettez une transaction.</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>Avertissement : les transactions affichées pourraient être incorrectes ! Vous ou d&apos;autres nœuds du réseau pourriez avoir besoin d&apos;effectuer une mise à jour.</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 Ccoin will not work properly.</source> <translation>Attention : veuillez vérifier que l&apos;heure et la date de votre ordinateur sont correctes ! Si votre horloge n&apos;est pas à l&apos;heure, Ccoin ne fonctionnera pas correctement.</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>Avertissement : une erreur est survenue lors de la lecture de wallet.dat ! Toutes les clefs ont été lues correctement mais les données de transaction ou les entrées du carnet d&apos;adresses pourraient être incorrectes ou manquantes.</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>Avertissement : wallet.dat corrompu, données récupérées ! Le fichier wallet.dat original a été enregistré en tant que wallet.{horodatage}.bak dans %s ; si votre solde ou transactions sont incorrects vous devriez effectuer une restauration depuis une sauvegarde.</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Tenter de récupérer les clefs privées d&apos;un wallet.dat corrompu</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Options de création des blocs :</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Ne se connecter qu&apos;au(x) nœud(s) spécifié(s)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>Base de données des blocs corrompue détectée</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Découvrir sa propre adresse IP (par défaut : 1 lors de l&apos;écoute et si -externalip n&apos;est pas présent)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Voulez-vous reconstruire la base de données des blocs maintenant ?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>Erreur lors de l&apos;initialisation de la base de données des blocs</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Erreur lors de l&apos;initialisation de l&apos;environnement de la base de données du porte-monnaie %s !</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Erreur du chargement de la base de données des blocs</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Erreur lors de l&apos;ouverture de la base de données</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Erreur : l&apos;espace disque est faible !</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Erreur : Porte-monnaie verrouillé, impossible de créer la transaction !</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Erreur : erreur système :</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Échec de l&apos;écoute sur un port quelconque. Utilisez -listen=0 si vous voulez cela.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>La lecture des informations de bloc a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>La lecture du bloc a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>La synchronisation de l&apos;index des blocs a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>L&apos;&apos;écriture de l&apos;index des blocs a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>L&apos;écriture des informations du bloc a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>L&apos;écriture du bloc a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>L&apos;écriture des informations de fichier a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>L&apos;écriture dans la base de données des pièces a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>L&apos;écriture de l&apos;index des transactions a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>L&apos;écriture des données d&apos;annulation a échoué</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Trouver des pairs en utilisant la recherche DNS (par défaut : 1 sauf si -connect est utilisé)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>Générer des pièces (défaut: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Nombre de blocs à vérifier au démarrage (par défaut : 288, 0 = tout)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>Niveau d&apos;approfondissement de la vérification des blocs (0-4, par défaut : 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation>Pas assez de descripteurs de fichiers disponibles.</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Reconstruire l&apos;index de la chaîne des blocs à partir des fichiers blk000??.dat actuels</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Définir le nombre d&apos;exétrons pour desservir les appels RPC (par défaut : 4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Vérification des blocs...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Vérification du porte-monnaie...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Importe des blocs depuis un fichier blk000??.dat externe</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>Définir le nombre de fils d’exécution pour la vérification des scripts (maximum 16, 0 = auto, &lt; 0 = laisser ce nombre de cœurs libres, par défaut : 0)</translation> </message> <message> <location line="+77"/> <source>Information</source> <translation>Informations</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Adresse -tor invalide : « %s »</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Montant invalide pour -minrelayfee=&lt;montant&gt; : « %s »</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Montant invalide pour -mintxfee=&lt;montant&gt; : « %s »</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>Maintenir un index complet des transactions (par défaut : 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Tampon maximal de réception par -connection, &lt;n&gt;*1000 octets (par défaut : 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Tampon maximal d&apos;envoi par connexion, &lt;n&gt;*1000 octets (par défaut : 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>N&apos;accepter que la chaîne de blocs correspondant aux points de vérification internes (par défaut : 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Se connecter uniquement aux nœuds du réseau &lt;net&gt; (IPv4, IPv6 ou Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Afficher des information de débogage supplémentaires. Cela signifie toutes les autres options -debug*</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Afficher des informations de débogage réseau supplémentaires</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Faire précéder les données de débogage par un horodatage</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Ccoin Wiki for SSL setup instructions)</source> <translation>Options SSL : (cf. le wiki de Ccoin pour les instructions de configuration du SSL)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Sélectionner la version du proxy socks à utiliser (4-5, 5 étant la valeur par défaut)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Envoyer les informations de débogage/trace à la console au lieu du fichier debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Envoyer les informations de débogage/trace au débogueur</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Définir la taille maximale des blocs en octets (par défaut : 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Définir la taille minimale des blocs en octets (par défaut : 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Réduire le fichier debug.log lors du démarrage du client (par défaut : 1 lorsque -debug n&apos;est pas présent)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>La signature de la transaction a échoué</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Spécifier le délai d&apos;expiration de la connexion en millisecondes (par défaut : 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Erreur système :</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation>Montant de la transaction trop bas</translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>Les montants de la transaction doivent être positifs</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>Transaction trop volumineuse</translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Utiliser l&apos;UPnP pour rediriger le port d&apos;écoute (par défaut : 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Utiliser l&apos;UPnP pour rediriger le port d&apos;écoute (par défaut : 1 lors de l&apos;écoute)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Utiliser un proxy pour atteindre les services cachés de Tor (par défaut : même valeur que -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Nom d&apos;utilisateur pour les connexions JSON-RPC</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Avertissement</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Avertissement : cette version est obsolète, une mise à jour est nécessaire !</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>Vous devez reconstruire les bases de données avec -reindex pour modifier -txindex</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrompu, la récupération a échoué</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Mot de passe pour les connexions JSON-RPC</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Autoriser les connexions JSON-RPC depuis l&apos;adresse IP spécifiée</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Envoyer des commandes au nœud fonctionnant à &lt;ip&gt; (par défaut : 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>Exécuter la commande lorsque le meilleur bloc change (%s est remplacé par le hachage du bloc dans cmd)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Mettre à jour le format du porte-monnaie</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Régler la taille de la plage de clefs sur &lt;n&gt; (par défaut : 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Réanalyser la chaîne de blocs pour les transactions de porte-monnaie manquantes</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Utiliser OpenSSL (https) pour les connexions JSON-RPC</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Fichier de certificat serveur (par défaut : server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Clef privée du serveur (par défaut : server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Clefs de chiffrement acceptables (par défaut : TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Ce message d&apos;aide</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Impossible de se lier à %s sur cet ordinateur (bind a retourné l&apos;erreur %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Connexion via un proxy socks</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Autoriser les recherches DNS pour -addnode, -seednode et -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Chargement des adresses…</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Erreur lors du chargement de wallet.dat : porte-monnaie corrompu</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Ccoin</source> <translation>Erreur lors du chargement de wallet.dat : le porte-monnaie nécessite une version plus récente de Ccoin</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Ccoin to complete</source> <translation>Le porte-monnaie nécessitait une réécriture : veuillez redémarrer Ccoin pour terminer l&apos;opération</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Erreur lors du chargement de wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Adresse -proxy invalide : « %s »</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Réseau inconnu spécifié sur -onlynet : « %s »</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Version inconnue de proxy -socks demandée : %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Impossible de résoudre l&apos;adresse -bind : « %s »</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Impossible de résoudre l&apos;adresse -externalip : « %s »</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Montant invalide pour -paytxfee=&lt;montant&gt; : « %s »</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Montant invalide</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Fonds insuffisants</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Chargement de l’index des blocs…</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Ajouter un nœud auquel se connecter et tenter de garder la connexion ouverte</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Ccoin is probably already running.</source> <translation>Impossible de se lier à %s sur cet ordinateur. Ccoin fonctionne probablement déjà.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Frais par Ko à ajouter aux transactions que vous enverrez</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Chargement du porte-monnaie…</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Impossible de revenir à une version antérieure du porte-monnaie</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Impossible d&apos;écrire l&apos;adresse par défaut</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Nouvelle analyse…</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Chargement terminé</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Pour utiliser l&apos;option %s</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Erreur</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>Vous devez ajouter la ligne rpcpassword=&lt;mot-de-passe&gt; au fichier de configuration : %s Si le fichier n&apos;existe pas, créez-le avec les droits de lecture seule accordés au propriétaire.</translation> </message> </context> </TS>
{ "content_hash": "6f84e5cf9641aba7aff8b1f43580aa92", "timestamp": "", "source": "github", "line_count": 2938, "max_line_length": 448, "avg_line_length": 41.313818924438394, "alnum_prop": 0.6372960949085517, "repo_name": "thecoinproject/ccointestbed", "id": "c021913ed05216953be77ed09763770c0d714404", "size": "122362", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_fr.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "32009" }, { "name": "C++", "bytes": "3043060" }, { "name": "CSS", "bytes": "1127" }, { "name": "JavaScript", "bytes": "98" }, { "name": "Makefile", "bytes": "13397" }, { "name": "Objective-C", "bytes": "1052" }, { "name": "Objective-C++", "bytes": "5864" }, { "name": "Python", "bytes": "73803" }, { "name": "Shell", "bytes": "13173" } ], "symlink_target": "" }
(function( window, undefined ) { // Use the correct document accordingly with window argument (sandbox) var document = window.document, navigator = window.navigator, location = window.location; var jQuery = (function() { // Define a local copy of jQuery var jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // A central reference to the root jQuery(document) rootjQuery, // A simple way to check for HTML strings or ID strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, // Check if a string has a non-whitespace character in it rnotwhite = /\S/, // Used for trimming whitespace trimLeft = /^\s+/, trimRight = /\s+$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, // Useragent RegExp rwebkit = /(webkit)[ \/]([\w.]+)/, ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, rmsie = /(msie) ([\w.]+)/, rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, // Matches dashed string for camelizing rdashAlpha = /-([a-z]|[0-9])/ig, rmsPrefix = /^-ms-/, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return ( letter + "" ).toUpperCase(); }, // Keep a UserAgent string for use with jQuery.browser userAgent = navigator.userAgent, // For matching the engine and version of the browser browserMatch, // The deferred used on DOM ready readyList, // The ready event handler DOMContentLoaded, // Save a reference to some core methods toString = Object.prototype.toString, hasOwn = Object.prototype.hasOwnProperty, push = Array.prototype.push, slice = Array.prototype.slice, trim = String.prototype.trim, indexOf = Array.prototype.indexOf, // [[Class]] -> type pairs class2type = {}; jQuery.fn = jQuery.prototype = { constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem, ret, doc; // Handle $(""), $(null), or $(undefined) if ( !selector ) { return this; } // Handle $(DOMElement) if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; } // The body element only exists once, optimize finding it if ( selector === "body" && !context && document.body ) { this.context = document; this[0] = document.body; this.selector = selector; this.length = 1; return this; } // Handle HTML strings if ( typeof selector === "string" ) { // Are we dealing with HTML string or an ID? if ( selector.charAt(0) === "<" && selector.charAt( 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 = quickExpr.exec( selector ); } // Verify a match, and that no context was specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; doc = ( context ? context.ownerDocument || context : document ); // If a single string is passed in and it's a single tag // just do a createElement and skip the rest ret = rsingleTag.exec( selector ); if ( ret ) { if ( jQuery.isPlainObject( context ) ) { selector = [ document.createElement( ret[1] ) ]; jQuery.fn.attr.call( selector, context, true ); } else { selector = [ doc.createElement( ret[1] ) ]; } } else { ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; } return jQuery.merge( this, selector ); // 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 ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we 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: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The current version of jQuery being used jquery: "1.7.2", // The default length of a jQuery object is 0 length: 0, // The number of elements contained in the matched element set size: function() { return this.length; }, toArray: function() { return slice.call( this, 0 ); }, // 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 a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems, name, selector ) { // Build a new jQuery matched element set var ret = this.constructor(); if ( jQuery.isArray( elems ) ) { push.apply( ret, elems ); } else { jQuery.merge( ret, elems ); } // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; if ( name === "find" ) { ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; } else if ( name ) { ret.selector = this.selector + "." + name + "(" + selector + ")"; } // 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 ); }, ready: function( fn ) { // Attach the listeners jQuery.bindReady(); // Add the callback readyList.add( fn ); return this; }, eq: function( i ) { i = +i; return i === -1 ? this.slice( i ) : this.slice( i, i + 1 ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ), "slice", slice.call(arguments).join(",") ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, 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: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; 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; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // 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 ( length === i ) { 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({ noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // 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 ) { // Either a released hold or an DOMready/load event and not yet ready if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready, 1 ); } // 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.fireWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger( "ready" ).off( "ready" ); } } }, bindReady: function() { if ( readyList ) { return; } readyList = jQuery.Callbacks( "once memory" ); // Catch cases where $(document).ready() is called after the // browser event has already occurred. if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready return setTimeout( jQuery.ready, 1 ); } // Mozilla, Opera and webkit nightlies currently support this event if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", jQuery.ready, false ); // If IE event model is used } else if ( document.attachEvent ) { // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent( "onreadystatechange", DOMContentLoaded ); // A fallback to window.onload, that will always work window.attachEvent( "onload", jQuery.ready ); // If IE and not a frame // continually check to see if the document is ready var toplevel = false; try { toplevel = window.frameElement == null; } catch(e) {} if ( document.documentElement.doScroll && toplevel ) { doScrollCheck(); } } }, // 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 || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { return obj == null ? String( obj ) : class2type[ toString.call(obj) ] || "object"; }, isPlainObject: function( obj ) { // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for ( key in obj ) {} return key === undefined || hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { for ( var name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, parseJSON: function( data ) { if ( typeof data !== "string" || !data ) { return null; } // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { if ( typeof data !== "string" || !data ) { return null; } var xml, tmp; try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && rnotwhite.test( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // 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.toUpperCase() === name.toUpperCase(); }, // args is for internal usage only each: function( object, callback, args ) { var name, i = 0, length = object.length, isObj = length === undefined || jQuery.isFunction( object ); if ( args ) { if ( isObj ) { for ( name in object ) { if ( callback.apply( object[ name ], args ) === false ) { break; } } } else { for ( ; i < length; ) { if ( callback.apply( object[ i++ ], args ) === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isObj ) { for ( name in object ) { if ( callback.call( object[ name ], name, object[ name ] ) === false ) { break; } } } else { for ( ; i < length; ) { if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { break; } } } } return object; }, // Use native String.trim function wherever possible trim: trim ? function( text ) { return text == null ? "" : trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); }, // results is for internal usage only makeArray: function( array, results ) { var ret = results || []; if ( array != null ) { // The window, strings (and functions) also have 'length' // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 var type = jQuery.type( array ); if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { push.call( ret, array ); } else { jQuery.merge( ret, array ); } } return ret; }, inArray: function( elem, array, i ) { var len; if ( array ) { if ( indexOf ) { return indexOf.call( array, elem, i ); } len = array.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in array && array[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var i = first.length, j = 0; if ( typeof second.length === "number" ) { for ( var l = second.length; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var ret = [], retVal; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( var i = 0, length = elems.length; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, key, ret = [], i = 0, length = elems.length, // jquery objects are treated as arrays isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( key in elems ) { value = callback( elems[ key ], key, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return ret.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 ) { if ( typeof context === "string" ) { var 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 var args = slice.call( arguments, 2 ), proxy = function() { return fn.apply( context, 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 || proxy.guid || jQuery.guid++; return proxy; }, // Mutifunctional method to get and set values to a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, pass ) { var exec, bulk = key == null, i = 0, length = elems.length; // Sets many values if ( key && typeof key === "object" ) { for ( i in key ) { jQuery.access( elems, fn, i, key[i], 1, emptyGet, value ); } chainable = 1; // Sets one value } else if ( value !== undefined ) { // Optionally, function values get executed if exec is true exec = pass === undefined && jQuery.isFunction( value ); if ( bulk ) { // Bulk operations only iterate when executing function values if ( exec ) { exec = fn; fn = function( elem, key, value ) { return exec.call( jQuery( elem ), value ); }; // Otherwise they run against the entire set } else { fn.call( elems, value ); fn = null; } } if ( fn ) { for (; i < length; i++ ) { fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); } } chainable = 1; } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); }, // Use of jQuery.browser is frowned upon. // More details: http://docs.jquery.com/Utilities/jQuery.browser uaMatch: function( ua ) { ua = ua.toLowerCase(); var match = rwebkit.exec( ua ) || ropera.exec( ua ) || rmsie.exec( ua ) || ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || []; return { browser: match[1] || "", version: match[2] || "0" }; }, sub: function() { function jQuerySub( selector, context ) { return new jQuerySub.fn.init( selector, context ); } jQuery.extend( true, jQuerySub, this ); jQuerySub.superclass = this; jQuerySub.fn = jQuerySub.prototype = this(); jQuerySub.fn.constructor = jQuerySub; jQuerySub.sub = this.sub; jQuerySub.fn.init = function init( selector, context ) { if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { context = jQuerySub( context ); } return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); }; jQuerySub.fn.init.prototype = jQuerySub.fn; var rootjQuerySub = jQuerySub(document); return jQuerySub; }, browser: {} }); // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); browserMatch = jQuery.uaMatch( userAgent ); if ( browserMatch.browser ) { jQuery.browser[ browserMatch.browser ] = true; jQuery.browser.version = browserMatch.version; } // Deprecated, use jQuery.browser.webkit instead if ( jQuery.browser.webkit ) { jQuery.browser.safari = true; } // IE doesn't match non-breaking spaces with \s if ( rnotwhite.test( "\xA0" ) ) { trimLeft = /^[\s\xA0]+/; trimRight = /[\s\xA0]+$/; } // All jQuery objects should point back to these rootjQuery = jQuery(document); // Cleanup functions for the document ready method if ( document.addEventListener ) { DOMContentLoaded = function() { document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); jQuery.ready(); }; } else if ( document.attachEvent ) { DOMContentLoaded = function() { // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( document.readyState === "complete" ) { document.detachEvent( "onreadystatechange", DOMContentLoaded ); jQuery.ready(); } }; } // The DOM ready check for Internet Explorer function doScrollCheck() { if ( jQuery.isReady ) { return; } try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); } catch(e) { setTimeout( doScrollCheck, 1 ); return; } // and execute any waiting functions jQuery.ready(); } return jQuery; })(); // String to Object flags format cache var flagsCache = {}; // Convert String-formatted flags into Object-formatted ones and store in cache function createFlags( flags ) { var object = flagsCache[ flags ] = {}, i, length; flags = flags.split( /\s+/ ); for ( i = 0, length = flags.length; i < length; i++ ) { object[ flags[i] ] = true; } return object; } /* * Create a callback list using the following parameters: * * flags: an optional list of space-separated flags that will change how * the callback list behaves * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible flags: * * 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( flags ) { // Convert flags from String-formatted to Object-formatted // (we check in cache first) flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; var // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = [], // 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, // Add one or several callbacks to the list add = function( args ) { var i, length, elem, type, actual; for ( i = 0, length = args.length; i < length; i++ ) { elem = args[ i ]; type = jQuery.type( elem ); if ( type === "array" ) { // Inspect recursively add( elem ); } else if ( type === "function" ) { // Add if not in unique mode and callback is not in if ( !flags.unique || !self.has( elem ) ) { list.push( elem ); } } } }, // Fire callbacks fire = function( context, args ) { args = args || []; memory = !flags.memory || [ context, args ]; fired = true; firing = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { memory = true; // Mark as halted break; } } firing = false; if ( list ) { if ( !flags.once ) { if ( stack && stack.length ) { memory = stack.shift(); self.fireWith( memory[ 0 ], memory[ 1 ] ); } } else if ( memory === true ) { self.disable(); } else { list = []; } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { var length = list.length; add( 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, unless previous // firing was halted (stopOnFalse) } else if ( memory && memory !== true ) { firingStart = length; fire( memory[ 0 ], memory[ 1 ] ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { var args = arguments, argIndex = 0, argLength = args.length; for ( ; argIndex < argLength ; argIndex++ ) { for ( var i = 0; i < list.length; i++ ) { if ( args[ argIndex ] === list[ i ] ) { // Handle firingIndex and firingLength if ( firing ) { if ( i <= firingLength ) { firingLength--; if ( i <= firingIndex ) { firingIndex--; } } } // Remove the element list.splice( i--, 1 ); // If we have some unicity property then // we only need to do this once if ( flags.unique ) { break; } } } } } return this; }, // Control if a given callback is in the list has: function( fn ) { if ( list ) { var i = 0, length = list.length; for ( ; i < length; i++ ) { if ( fn === list[ i ] ) { return true; } } } return false; }, // Remove all callbacks from the list empty: function() { list = []; 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 || memory === true ) { 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 ( stack ) { if ( firing ) { if ( !flags.once ) { stack.push( [ context, args ] ); } } else if ( !( flags.once && memory ) ) { fire( context, 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; }; var // Static reference to slice sliceDeferred = [].slice; jQuery.extend({ Deferred: function( func ) { var doneList = jQuery.Callbacks( "once memory" ), failList = jQuery.Callbacks( "once memory" ), progressList = jQuery.Callbacks( "memory" ), state = "pending", lists = { resolve: doneList, reject: failList, notify: progressList }, promise = { done: doneList.add, fail: failList.add, progress: progressList.add, state: function() { return state; }, // Deprecated isResolved: doneList.fired, isRejected: failList.fired, then: function( doneCallbacks, failCallbacks, progressCallbacks ) { deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); return this; }, always: function() { deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); return this; }, pipe: function( fnDone, fnFail, fnProgress ) { return jQuery.Deferred(function( newDefer ) { jQuery.each( { done: [ fnDone, "resolve" ], fail: [ fnFail, "reject" ], progress: [ fnProgress, "notify" ] }, function( handler, data ) { var fn = data[ 0 ], action = data[ 1 ], returned; if ( jQuery.isFunction( fn ) ) { deferred[ handler ](function() { returned = fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); } else { newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); } }); } else { deferred[ handler ]( newDefer[ action ] ); } }); }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { if ( obj == null ) { obj = promise; } else { for ( var key in promise ) { obj[ key ] = promise[ key ]; } } return obj; } }, deferred = promise.promise({}), key; for ( key in lists ) { deferred[ key ] = lists[ key ].fire; deferred[ key + "With" ] = lists[ key ].fireWith; } // Handle state deferred.done( function() { state = "resolved"; }, failList.disable, progressList.lock ).fail( function() { state = "rejected"; }, doneList.disable, progressList.lock ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( firstParam ) { var args = sliceDeferred.call( arguments, 0 ), i = 0, length = args.length, pValues = new Array( length ), count = length, pCount = length, deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? firstParam : jQuery.Deferred(), promise = deferred.promise(); function resolveFunc( i ) { return function( value ) { args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; if ( !( --count ) ) { deferred.resolveWith( deferred, args ); } }; } function progressFunc( i ) { return function( value ) { pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; deferred.notifyWith( promise, pValues ); }; } if ( length > 1 ) { for ( ; i < length; i++ ) { if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); } else { --count; } } if ( !count ) { deferred.resolveWith( deferred, args ); } } else if ( deferred !== firstParam ) { deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); } return promise; } }); jQuery.support = (function() { var support, all, a, select, opt, input, fragment, tds, events, eventName, i, isSupported, div = document.createElement( "div" ), documentElement = document.documentElement; // Preliminary tests div.setAttribute("className", "t"); div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; all = div.getElementsByTagName( "*" ); a = div.getElementsByTagName( "a" )[ 0 ]; // Can't get basic test support if ( !all || !all.length || !a ) { return {}; } // First batch of supports tests select = document.createElement( "select" ); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName( "input" )[ 0 ]; support = { // IE strips leading whitespace when .innerHTML is used leadingWhitespace: ( div.firstChild.nodeType === 3 ), // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables tbody: !div.getElementsByTagName("tbody").length, // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE htmlSerialize: !!div.getElementsByTagName("link").length, // Get the style information from getAttribute // (IE uses .cssText instead) style: /top/.test( a.getAttribute("style") ), // Make sure that URLs aren't manipulated // (IE normalizes it by default) hrefNormalized: ( a.getAttribute("href") === "/a" ), // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 opacity: /^0.55/.test( a.style.opacity ), // Verify style float existence // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, // Make sure that if no value is specified for a checkbox // that it defaults to "on". // (WebKit defaults to "" instead) checkOn: ( input.value === "on" ), // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) optSelected: opt.selected, // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) getSetAttribute: div.className !== "t", // Tests for enctype support on a form(#6743) enctype: !!document.createElement("form").enctype, // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", // Will be defined later submitBubbles: true, changeBubbles: true, focusinBubbles: false, deleteExpando: true, noCloneEvent: true, inlineBlockNeedsLayout: false, shrinkWrapBlocks: false, reliableMarginRight: true, pixelMargin: true }; // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat"); // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // 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; // Test to see if it's possible to delete an expando from an element // Fails in Internet Explorer try { delete div.test; } catch( e ) { support.deleteExpando = false; } if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { div.attachEvent( "onclick", function() { // Cloning a node shouldn't copy over any // bound event handlers (IE does this) support.noCloneEvent = false; }); div.cloneNode( true ).fireEvent( "onclick" ); } // Check if a radio maintains its value // after being appended to the DOM input = document.createElement("input"); input.value = "t"; input.setAttribute("type", "radio"); support.radioValue = input.value === "t"; input.setAttribute("checked", "checked"); // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "name", "t" ); div.appendChild( input ); fragment = document.createDocumentFragment(); fragment.appendChild( div.lastChild ); // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; fragment.removeChild( input ); fragment.appendChild( div ); // Technique from Juriy Zaytsev // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ // We only care about the case where non-standard event systems // are used, namely in IE. Short-circuiting here helps us to // avoid an eval call (in setAttribute) which can cause CSP // to go haywire. See: https://developer.mozilla.org/en/Security/CSP if ( div.attachEvent ) { for ( i in { submit: 1, change: 1, focusin: 1 }) { eventName = "on" + i; isSupported = ( eventName in div ); if ( !isSupported ) { div.setAttribute( eventName, "return;" ); isSupported = ( typeof div[ eventName ] === "function" ); } support[ i + "Bubbles" ] = isSupported; } } fragment.removeChild( div ); // Null elements to avoid leaks in IE fragment = select = opt = div = input = null; // Run tests that need a body at doc ready jQuery(function() { var container, outer, inner, table, td, offsetSupport, marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight, paddingMarginBorderVisibility, paddingMarginBorder, body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } conMarginTop = 1; paddingMarginBorder = "padding:0;margin:0;border:"; positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;"; paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;"; style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;"; html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" + "<table " + style + "' cellpadding='0' cellspacing='0'>" + "<tr><td></td></tr></table>"; container = document.createElement("div"); container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; body.insertBefore( container, body.firstChild ); // Construct the test element div = document.createElement("div"); container.appendChild( div ); // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). // (only IE 8 fails this test) div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>"; tds = div.getElementsByTagName( "td" ); isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Check if empty table cells still have offsetWidth/Height // (IE <= 8 fail this test) support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. For more // info see bug #3333 // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right if ( window.getComputedStyle ) { div.innerHTML = ""; marginDiv = document.createElement( "div" ); marginDiv.style.width = "0"; marginDiv.style.marginRight = "0"; div.style.width = "2px"; div.appendChild( marginDiv ); support.reliableMarginRight = ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; } if ( typeof div.style.zoom !== "undefined" ) { // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout // (IE < 8 does this) div.innerHTML = ""; div.style.width = div.style.padding = "1px"; div.style.border = 0; div.style.overflow = "hidden"; div.style.display = "inline"; div.style.zoom = 1; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Check if elements with layout shrink-wrap their children // (IE 6 does this) div.style.display = "block"; div.style.overflow = "visible"; div.innerHTML = "<div style='width:5px;'></div>"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); } div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility; div.innerHTML = html; outer = div.firstChild; inner = outer.firstChild; td = outer.nextSibling.firstChild.firstChild; offsetSupport = { doesNotAddBorder: ( inner.offsetTop !== 5 ), doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) }; inner.style.position = "fixed"; inner.style.top = "20px"; // safari subtracts parent border width here which is 5px offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); inner.style.position = inner.style.top = ""; outer.style.overflow = "hidden"; outer.style.position = "relative"; offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); if ( window.getComputedStyle ) { div.style.marginTop = "1%"; support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%"; } if ( typeof container.style.zoom !== "undefined" ) { container.style.zoom = 1; } body.removeChild( container ); marginDiv = div = container = null; jQuery.extend( support, offsetSupport ); }); return support; })(); var rbrace = /^(?:\{.*\}|\[.*\])$/, rmultiDash = /([A-Z])/g; jQuery.extend({ cache: {}, // Please use with caution uuid: 0, // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "applet": true }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data, pvt /* Internal Use Only */ ) { if ( !jQuery.acceptData( elem ) ) { return; } var privateCache, thisCache, ret, internalKey = jQuery.expando, getByName = typeof name === "string", // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, isEvents = name === "events"; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { elem[ internalKey ] = id = ++jQuery.uuid; } else { id = internalKey; } } if ( !cache[ id ] ) { cache[ id ] = {}; // Avoids exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify if ( !isNode ) { cache[ id ].toJSON = jQuery.noop; } } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } privateCache = thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Users should not attempt to inspect the internal events object using jQuery.data, // it is undocumented and subject to change. But does anyone listen? No. if ( isEvents && !thisCache[ name ] ) { return privateCache.events; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( getByName ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; }, removeData: function( elem, name, pvt /* Internal Use Only */ ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, l, // Reference to internal data cache key internalKey = jQuery.expando, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, // See jQuery.data for more information id = isNode ? elem[ internalKey ] : internalKey; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split( " " ); } } } for ( i = 0, l = name.length; i < l; i++ ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject(cache[ id ]) ) { return; } } // Browsers that fail expando deletion also refuse to delete expandos on // the window, but it will allow it on all other JS objects; other browsers // don't care // Ensure that `cache` is not a window object #10080 if ( jQuery.support.deleteExpando || !cache.setInterval ) { delete cache[ id ]; } else { cache[ id ] = null; } // We destroyed the cache and need to eliminate the expando on the node to avoid // false lookups in the cache for entries that no longer exist if ( isNode ) { // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( jQuery.support.deleteExpando ) { delete elem[ internalKey ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } } }, // For internal use only. _data: function( elem, name, data ) { return jQuery.data( elem, name, data, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { if ( elem.nodeName ) { var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; if ( match ) { return !(match === true || elem.getAttribute("classid") !== match); } } return true; } }); jQuery.fn.extend({ data: function( key, value ) { var parts, part, attr, name, l, elem = this[0], i = 0, data = null; // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attr = elem.attributes; for ( l = attr.length; i < l; i++ ) { name = attr[i].name; if ( name.indexOf( "data-" ) === 0 ) { name = jQuery.camelCase( name.substring(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } parts = key.split( ".", 2 ); parts[1] = parts[1] ? "." + parts[1] : ""; part = parts[1] + "!"; return jQuery.access( this, function( value ) { if ( value === undefined ) { data = this.triggerHandler( "getData" + part, [ parts[0] ] ); // Try to fetch any internally stored data first if ( data === undefined && elem ) { data = jQuery.data( elem, key ); data = dataAttr( elem, key, data ); } return data === undefined && parts[1] ? this.data( parts[0] ) : data; } parts[1] = value; this.each(function() { var self = jQuery( this ); self.triggerHandler( "setData" + part, parts ); jQuery.data( this, key, value ); self.triggerHandler( "changeData" + part, parts ); }); }, null, value, arguments.length > 1, null, false ); }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var 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 : jQuery.isNumeric( data ) ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { for ( var name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } function handleQueueMarkDefer( elem, type, src ) { var deferDataKey = type + "defer", queueDataKey = type + "queue", markDataKey = type + "mark", defer = jQuery._data( elem, deferDataKey ); if ( defer && ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { // Give room for hard-coded callbacks to fire first // and eventually mark/queue something else on the element setTimeout( function() { if ( !jQuery._data( elem, queueDataKey ) && !jQuery._data( elem, markDataKey ) ) { jQuery.removeData( elem, deferDataKey, true ); defer.fire(); } }, 0 ); } } jQuery.extend({ _mark: function( elem, type ) { if ( elem ) { type = ( type || "fx" ) + "mark"; jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); } }, _unmark: function( force, elem, type ) { if ( force !== true ) { type = elem; elem = force; force = false; } if ( elem ) { type = type || "fx"; var key = type + "mark", count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); if ( count ) { jQuery._data( elem, key, count ); } else { jQuery.removeData( elem, key, true ); handleQueueMarkDefer( elem, type, "mark" ); } } }, queue: function( elem, type, data ) { var q; if ( elem ) { type = ( type || "fx" ) + "queue"; q = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !q || jQuery.isArray(data) ) { q = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { q.push( data ); } } return q || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), fn = queue.shift(), hooks = {}; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } jQuery._data( elem, type + ".run", hooks ); fn.call( elem, function() { jQuery.dequeue( elem, type ); }, hooks ); } if ( !queue.length ) { jQuery.removeData( elem, type + "queue " + type + ".run", true ); handleQueueMarkDefer( elem, type, "queue" ); } } }); 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 ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ 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 ); }; }); }, 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, object ) { if ( typeof type !== "string" ) { object = type; type = undefined; } type = type || "fx"; var defer = jQuery.Deferred(), elements = this, i = elements.length, count = 1, deferDataKey = type + "defer", queueDataKey = type + "queue", markDataKey = type + "mark", tmp; function resolve() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } } while( i-- ) { if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { count++; tmp.add( resolve ); } } resolve(); return defer.promise( object ); } }); var rclass = /[\n\t\r]/g, rspace = /\s+/, rreturn = /\r/g, rtype = /^(?:button|input)$/i, rfocusable = /^(?:button|input|object|select|textarea)$/i, rclickable = /^a(?:rea)?$/i, rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, nodeHook, boolHook, fixSpecified; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classNames, i, l, elem, setClass, c, cl; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call(this, j, this.className) ); }); } if ( value && typeof value === "string" ) { classNames = value.split( rspace ); for ( i = 0, l = this.length; i < l; i++ ) { elem = this[ i ]; if ( elem.nodeType === 1 ) { if ( !elem.className && classNames.length === 1 ) { elem.className = value; } else { setClass = " " + elem.className + " "; for ( c = 0, cl = classNames.length; c < cl; c++ ) { if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { setClass += classNames[ c ] + " "; } } elem.className = jQuery.trim( setClass ); } } } } return this; }, removeClass: function( value ) { var classNames, i, l, elem, className, c, cl; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call(this, j, this.className) ); }); } if ( (value && typeof value === "string") || value === undefined ) { classNames = ( value || "" ).split( rspace ); for ( i = 0, l = this.length; i < l; i++ ) { elem = this[ i ]; if ( elem.nodeType === 1 && elem.className ) { if ( value ) { className = (" " + elem.className + " ").replace( rclass, " " ); for ( c = 0, cl = classNames.length; c < cl; c++ ) { className = className.replace(" " + classNames[ c ] + " ", " "); } elem.className = jQuery.trim( className ); } else { elem.className = ""; } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isBool = typeof stateVal === "boolean"; 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 ), state = stateVal, classNames = value.split( rspace ); while ( (className = classNames[ i++ ]) ) { // check each className given, space seperated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } } else if ( type === "undefined" || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // toggle whole className this.className = this.className || value === false ? "" : jQuery._data( 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 ) > -1 ) { return true; } } return false; }, 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 self = jQuery(this), val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, self.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 ) { // attributes.value is undefined in Blackberry 4.7 but // uses .value. See #6932 var val = elem.attributes.value; return !val || val.specified ? elem.value : elem.text; } }, select: { get: function( elem ) { var value, i, max, option, index = elem.selectedIndex, values = [], options = elem.options, one = elem.type === "select-one"; // Nothing was selected if ( index < 0 ) { return null; } // Loop through all the selected options i = one ? index : 0; max = one ? index + 1 : options.length; for ( ; i < max; i++ ) { option = options[ i ]; // Don't return options that are disabled or in a disabled optgroup if ( option.selected && (jQuery.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 ); } } // Fixes Bug #2551 -- select.val() broken in IE after form.reset() if ( one && !values.length && options.length ) { return jQuery( options[ index ] ).val(); } return values; }, set: function( elem, value ) { var values = jQuery.makeArray( value ); jQuery(elem).find("option").each(function() { this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; }); if ( !values.length ) { elem.selectedIndex = -1; } return values; } } }, attrFn: { val: true, css: true, html: true, text: true, data: true, width: true, height: true, offset: true }, attr: function( elem, name, value, pass ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } if ( pass && name in jQuery.attrFn ) { return jQuery( elem )[ name ]( value ); } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === "undefined" ) { return jQuery.prop( elem, name, value ); } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); // All attributes are lowercase // Grab necessary hook if one is defined if ( notxml ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); return; } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, "" + value ); return value; } } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = elem.getAttribute( name ); // Non-existent attributes return null, we normalize to undefined return ret === null ? undefined : ret; } }, removeAttr: function( elem, value ) { var propName, attrNames, name, l, isBool, i = 0; if ( value && elem.nodeType === 1 ) { attrNames = value.toLowerCase().split( rspace ); l = attrNames.length; for ( ; i < l; i++ ) { name = attrNames[ i ]; if ( name ) { propName = jQuery.propFix[ name ] || name; isBool = rboolean.test( name ); // See #9699 for explanation of this approach (setting first, then removal) // Do not do this for boolean attributes (see #10870) if ( !isBool ) { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); // Set corresponding property to false for boolean attributes if ( isBool && propName in elem ) { elem[ propName ] = false; } } } } }, attrHooks: { type: { set: function( elem, value ) { // We can't allow the type property to be changed (since it causes problems in IE) if ( rtype.test( elem.nodeName ) && elem.parentNode ) { jQuery.error( "type property can't be changed" ); } else if ( !jQuery.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 it's default in case type is set after value // This is for element creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } }, // Use the value property for back compat // Use the nodeHook for button elements in IE6/7 (#1954) value: { get: function( elem, name ) { if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { return nodeHook.get( elem, name ); } return name in elem ? elem.value : null; }, set: function( elem, value, name ) { if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { return nodeHook.set( elem, value, name ); } // Does not return so that setAttribute is also used elem.value = value; } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, 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 ) { if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { return ( elem[ name ] = value ); } } else { if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { return elem[ name ]; } } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ var attributeNode = elem.getAttributeNode("tabindex"); return attributeNode && attributeNode.specified ? parseInt( attributeNode.value, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : undefined; } } } }); // Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; // Hook for boolean attributes boolHook = { get: function( elem, name ) { // Align boolean attributes with corresponding properties // Fall back to attribute presence where some booleans are not supported var attrNode, property = jQuery.prop( elem, name ); return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? name.toLowerCase() : undefined; }, set: function( elem, value, name ) { var propName; if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else { // value is true since we know at this point it's type boolean and not false // Set boolean attributes to the same name and set the DOM property propName = jQuery.propFix[ name ] || name; if ( propName in elem ) { // Only set the IDL specifically if it already exists on the element elem[ propName ] = true; } elem.setAttribute( name, name.toLowerCase() ); } return name; } }; // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { fixSpecified = { name: true, id: true, coords: true }; // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = jQuery.valHooks.button = { get: function( elem, name ) { var ret; ret = elem.getAttributeNode( name ); return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? ret.nodeValue : undefined; }, set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { ret = document.createAttribute( name ); elem.setAttributeNode( ret ); } return ( ret.nodeValue = value + "" ); } }; // Apply the nodeHook to tabindex jQuery.attrHooks.tabindex.set = nodeHook.set; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }); }); // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { get: nodeHook.get, set: function( elem, value, name ) { if ( value === "" ) { value = "false"; } nodeHook.set( elem, value, name ); } }; } // Some attributes require a special call on IE if ( !jQuery.support.hrefNormalized ) { jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { get: function( elem ) { var ret = elem.getAttribute( name, 2 ); return ret === null ? undefined : ret; } }); }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Normalize to lowercase since IE uppercases css property names return elem.style.cssText.toLowerCase() || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = "" + value ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }); } // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter if ( !jQuery.support.checkOn ) { jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { get: function( elem ) { // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; } }; }); } jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }); }); var rformElems = /^(?:textarea|input|select)$/i, rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, rhoverHack = /(?:^|\s)hover(\.\S+)?\b/, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, quickParse = function( selector ) { var quick = rquickIs.exec( selector ); if ( quick ) { // 0 1 2 3 // [ _, tag, id, class ] quick[1] = ( quick[1] || "" ).toLowerCase(); quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); } return quick; }, quickIs = function( elem, m ) { var attrs = elem.attributes || {}; return ( (!m[1] || elem.nodeName.toLowerCase() === m[1]) && (!m[2] || (attrs.id || {}).value === m[2]) && (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) ); }, hoverHack = function( events ) { return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); }; /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { add: function( elem, types, handler, data, selector ) { var elemData, eventHandle, events, t, tns, type, namespaces, handleObj, handleObjIn, quick, handlers, special; // Don't attach events to noData or text/comment nodes (allow plain objects tho) if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { 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 events = elemData.events; if ( !events ) { elemData.events = events = {}; } eventHandle = elemData.handle; if ( !eventHandle ) { elemData.handle = eventHandle = 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 !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); types = jQuery.trim( hoverHack(types) ).split( " " ); for ( t = 0; t < types.length; t++ ) { tns = rtypenamespace.exec( types[t] ) || []; type = tns[1]; namespaces = ( tns[2] || "" ).split( "." ).sort(); // 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: tns[1], data: data, handler: handler, guid: handler.guid, selector: selector, quick: selector && quickParse( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first handlers = events[ type ]; if ( !handlers ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } 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; } // Nullify elem to prevent memory leaks in IE elem = null; }, global: {}, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), t, tns, type, origType, namespaces, origCount, j, events, special, handle, eventType, handleObj; if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = jQuery.trim( hoverHack( types || "" ) ).split(" "); for ( t = 0; t < types.length; t++ ) { tns = rtypenamespace.exec( types[t] ) || []; type = origType = tns[1]; namespaces = tns[2]; // 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; eventType = events[ type ] || []; origCount = eventType.length; namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; // Remove matching events for ( j = 0; j < eventType.length; j++ ) { handleObj = eventType[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !namespaces || namespaces.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { eventType.splice( j--, 1 ); if ( handleObj.selector ) { eventType.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 ( eventType.length === 0 && origCount !== eventType.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { handle = elemData.handle; if ( handle ) { handle.elem = null; } // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery.removeData( elem, [ "events", "handle" ], true ); } }, // Events that are safe to short-circuit if no handlers are attached. // Native DOM events should not be added, they may have inline handlers. customEvent: { "getData": true, "setData": true, "changeData": true }, trigger: function( event, data, elem, onlyHandlers ) { // Don't do events on text and comment nodes if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { return; } // Event object or event type var type = event.type || event, namespaces = [], cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; // 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 ) { // Exclusive events trigger only for the exact event (no namespaces) type = type.slice(0, -1); exclusive = true; } if ( type.indexOf( "." ) >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { // No jQuery handlers for this event type, and it can't have inline handlers return; } // Caller can pass in an Event, Object, or just an event type string event = typeof event === "object" ? // jQuery.Event object event[ jQuery.expando ] ? event : // Object literal new jQuery.Event( type, event ) : // Just the event type (string) new jQuery.Event( type ); event.type = type; event.isTrigger = true; event.exclusive = exclusive; event.namespace = namespaces.join( "." ); event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; // Handle a global trigger if ( !elem ) { // TODO: Stop taunting the data cache; remove global events and always attach to document cache = jQuery.cache; for ( i in cache ) { if ( cache[ i ].events && cache[ i ].events[ type ] ) { jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); } } return; } // 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 ? jQuery.makeArray( data ) : []; data.unshift( event ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( 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) eventPath = [[ elem, special.bindType || type ]]; if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; old = null; for ( ; cur; cur = cur.parentNode ) { eventPath.push([ cur, bubbleType ]); old = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( old && old === elem.ownerDocument ) { eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); } } // Fire handlers on the event path for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { cur = eventPath[i][0]; event.type = eventPath[i][1]; handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Note that this is a bare JS function and not a jQuery handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === 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( elem.ownerDocument, data ) === false) && !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) // IE<9 dies on focus/blur to hidden element (#1486) if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method old = elem[ ontype ]; if ( old ) { 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 ( old ) { elem[ ontype ] = old; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event || window.event ); var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), delegateCount = handlers.delegateCount, args = [].slice.call( arguments, 0 ), run_all = !event.exclusive && !event.namespace, special = jQuery.event.special[ event.type ] || {}, handlerQueue = [], i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; // 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 that should run if there are delegated events // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && !(event.button && event.type === "click") ) { // Pregenerate a single jQuery object for reuse with .is() jqcur = jQuery(this); jqcur.context = this.ownerDocument || this; for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { // Don't process events on disabled elements (#6911, #8165) if ( cur.disabled !== true ) { selMatch = {}; matches = []; jqcur[0] = cur; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; sel = handleObj.selector; if ( selMatch[ sel ] === undefined ) { selMatch[ sel ] = ( handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) ); } if ( selMatch[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, matches: matches }); } } } } // Add the remaining (directly-bound) handlers if ( handlers.length > delegateCount ) { handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); } // Run delegates first; they may want to stop propagation beneath us for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { matched = handlerQueue[ i ]; event.currentTarget = matched.elem; for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { handleObj = matched.matches[ j ]; // Triggered event must either 1) be non-exclusive and have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { event.data = handleObj.data; event.handleObj = handleObj; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { event.result = ret; if ( 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; }, // Includes some event props shared by KeyEvent and MouseEvent // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** props: "attrChange attrName relatedNode srcElement 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 fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var eventDoc, doc, body, button = original.button, fromElement = original.fromElement; // 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 relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // 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, originalEvent = event, fixHook = jQuery.event.fixHooks[ event.type ] || {}, copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = jQuery.Event( originalEvent ); for ( i = copy.length; i; ) { prop = copy[ --i ]; event[ prop ] = originalEvent[ prop ]; } // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Target should not be a text node (#504, Safari) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) if ( event.metaKey === undefined ) { event.metaKey = event.ctrlKey; } return fixHook.filter? fixHook.filter( event, originalEvent ) : event; }, special: { ready: { // Make sure the ready event is setup setup: jQuery.bindReady }, load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { delegateType: "focusin" }, blur: { delegateType: "focusout" }, beforeunload: { setup: function( data, namespaces, eventHandle ) { // We only want to do this special case on windows if ( jQuery.isWindow( this ) ) { this.onbeforeunload = eventHandle; } }, teardown: function( namespaces, eventHandle ) { if ( this.onbeforeunload === eventHandle ) { this.onbeforeunload = null; } } } }, 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(); } } }; // Some plugins are using, but it's undocumented/deprecated and will be removed. // The 1.7 special event interface should provide all the hooks needed now. jQuery.event.handle = jQuery.event.dispatch; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { if ( elem.detachEvent ) { elem.detachEvent( "on" + type, handle ); } }; 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.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? 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; }; function returnFalse() { return false; } function returnTrue() { return 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 = { preventDefault: function() { this.isDefaultPrevented = returnTrue; var e = this.originalEvent; if ( !e ) { return; } // if preventDefault exists run it on the original event if ( e.preventDefault ) { e.preventDefault(); // otherwise set the returnValue property of the original event to false (IE) } else { e.returnValue = false; } }, stopPropagation: function() { this.isPropagationStopped = returnTrue; var e = this.originalEvent; if ( !e ) { return; } // if stopPropagation exists run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // otherwise set the cancelBubble property of the original event to true (IE) e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); }, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var target = this, related = event.relatedTarget, handleObj = event.handleObj, selector = handleObj.selector, ret; // 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; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !form._submit_attached ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); form._submit_attached = true; } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; jQuery.event.simulate( "change", this, event, true ); } }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); elem._change_attached = true; } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } 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" ) { // && selector != null // ( 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 ) { if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event var 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 ( var 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 ); }); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, live: function( types, data, fn ) { jQuery( this.context ).on( types, this.selector, data, fn ); return this; }, die: function( types, fn ) { jQuery( this.context ).off( types, this.selector || "**", fn ); return this; }, 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 ); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { if ( this[0] ) { return jQuery.event.trigger( type, data, this[0], true ); } }, toggle: function( fn ) { // Save reference to arguments for access in closure var args = arguments, guid = fn.guid || jQuery.guid++, i = 0, toggler = function( event ) { // Figure out which function to execute var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); // Make sure that clicks stop event.preventDefault(); // and execute the function return args[ lastToggle ].apply( this, arguments ) || false; }; // link all the functions, so any of them can unbind this click handler toggler.guid = guid; while ( i < args.length ) { args[ i++ ].guid = guid; } return this.click( toggler ); }, hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); } }); 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 ) { if ( fn == null ) { fn = data; data = null; } return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; if ( jQuery.attrFn ) { jQuery.attrFn[ name ] = true; } if ( rkeyEvent.test( name ) ) { jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; } if ( rmouseEvent.test( name ) ) { jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; } }); /*! * Sizzle CSS Selector Engine * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, expando = "sizcache" + (Math.random() + '').replace('.', ''), done = 0, toString = Object.prototype.toString, hasDuplicate = false, baseHasDuplicate = true, rBackslash = /\\/g, rReturn = /\r\n/g, rNonWord = /\W/; // Here we check if the JavaScript engine is using some sort of // optimization where it does not always call our comparision // function. If that is the case, discard the hasDuplicate value. // Thus far that includes Google Chrome. [0, 0].sort(function() { baseHasDuplicate = false; return 0; }); var Sizzle = function( selector, context, results, seed ) { results = results || []; context = context || document; var origContext = context; if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } if ( !selector || typeof selector !== "string" ) { return results; } var m, set, checkSet, extra, ret, cur, pop, i, prune = true, contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); m = chunker.exec( soFar ); if ( m ) { soFar = m[3]; parts.push( m[1] ); if ( m[2] ) { extra = m[3]; break; } } } while ( m ); if ( parts.length > 1 && origPOS.exec( selector ) ) { if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { set = posProcess( parts[0] + parts[1], context, seed ); } else { set = Expr.relative[ parts[0] ] ? [ context ] : Sizzle( parts.shift(), context ); while ( parts.length ) { selector = parts.shift(); if ( Expr.relative[ selector ] ) { selector += parts.shift(); } set = posProcess( selector, set, seed ); } } } else { // Take a shortcut and set the context if the root selector is an ID // (but not if it'll be faster if the inner selector is an ID) if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { ret = Sizzle.find( parts.shift(), context, contextXML ); context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; } if ( context ) { ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; if ( parts.length > 0 ) { checkSet = makeArray( set ); } else { prune = false; } while ( parts.length ) { cur = parts.pop(); pop = cur; if ( !Expr.relative[ cur ] ) { cur = ""; } else { pop = parts.pop(); } if ( pop == null ) { pop = context; } Expr.relative[ cur ]( checkSet, pop, contextXML ); } } else { checkSet = parts = []; } } if ( !checkSet ) { checkSet = set; } if ( !checkSet ) { Sizzle.error( cur || selector ); } if ( toString.call(checkSet) === "[object Array]" ) { if ( !prune ) { results.push.apply( results, checkSet ); } else if ( context && context.nodeType === 1 ) { for ( i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { results.push( set[i] ); } } } else { for ( i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && checkSet[i].nodeType === 1 ) { results.push( set[i] ); } } } } else { makeArray( checkSet, results ); } if ( extra ) { Sizzle( extra, origContext, results, seed ); Sizzle.uniqueSort( results ); } return results; }; Sizzle.uniqueSort = function( results ) { if ( sortOrder ) { hasDuplicate = baseHasDuplicate; results.sort( sortOrder ); if ( hasDuplicate ) { for ( var i = 1; i < results.length; i++ ) { if ( results[i] === results[ i - 1 ] ) { results.splice( i--, 1 ); } } } } return results; }; Sizzle.matches = function( expr, set ) { return Sizzle( expr, null, null, set ); }; Sizzle.matchesSelector = function( node, expr ) { return Sizzle( expr, null, null, [node] ).length > 0; }; Sizzle.find = function( expr, context, isXML ) { var set, i, len, match, type, left; if ( !expr ) { return []; } for ( i = 0, len = Expr.order.length; i < len; i++ ) { type = Expr.order[i]; if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { left = match[1]; match.splice( 1, 1 ); if ( left.substr( left.length - 1 ) !== "\\" ) { match[1] = (match[1] || "").replace( rBackslash, "" ); set = Expr.find[ type ]( match, context, isXML ); if ( set != null ) { expr = expr.replace( Expr.match[ type ], "" ); break; } } } } if ( !set ) { set = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( "*" ) : []; } return { set: set, expr: expr }; }; Sizzle.filter = function( expr, set, inplace, not ) { var match, anyFound, type, found, item, filter, left, i, pass, old = expr, result = [], curLoop = set, isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); while ( expr && set.length ) { for ( type in Expr.filter ) { if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { filter = Expr.filter[ type ]; left = match[1]; anyFound = false; match.splice(1,1); if ( left.substr( left.length - 1 ) === "\\" ) { continue; } if ( curLoop === result ) { result = []; } if ( Expr.preFilter[ type ] ) { match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); if ( !match ) { anyFound = found = true; } else if ( match === true ) { continue; } } if ( match ) { for ( i = 0; (item = curLoop[i]) != null; i++ ) { if ( item ) { found = filter( item, match, i, curLoop ); pass = not ^ found; if ( inplace && found != null ) { if ( pass ) { anyFound = true; } else { curLoop[i] = false; } } else if ( pass ) { result.push( item ); anyFound = true; } } } } if ( found !== undefined ) { if ( !inplace ) { curLoop = result; } expr = expr.replace( Expr.match[ type ], "" ); if ( !anyFound ) { return []; } break; } } } // Improper expression if ( expr === old ) { if ( anyFound == null ) { Sizzle.error( expr ); } else { break; } } old = expr; } return curLoop; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Utility function for retreiving the text value of an array of DOM nodes * @param {Array|Element} elem */ var getText = Sizzle.getText = function( elem ) { var i, node, nodeType = elem.nodeType, ret = ""; if ( nodeType ) { if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent || innerText for elements if ( typeof elem.textContent === 'string' ) { return elem.textContent; } else if ( typeof elem.innerText === 'string' ) { // Replace IE's carriage returns return elem.innerText.replace( rReturn, '' ); } else { // Traverse it's children for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } } else { // If no nodeType, this is expected to be an array for ( i = 0; (node = elem[i]); i++ ) { // Do not traverse comment nodes if ( node.nodeType !== 8 ) { ret += getText( node ); } } } return ret; }; var Expr = Sizzle.selectors = { order: [ "ID", "NAME", "TAG" ], match: { ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function( elem ) { return elem.getAttribute( "href" ); }, type: function( elem ) { return elem.getAttribute( "type" ); } }, relative: { "+": function(checkSet, part){ var isPartStr = typeof part === "string", isTag = isPartStr && !rNonWord.test( part ), isPartStrNotTag = isPartStr && !isTag; if ( isTag ) { part = part.toLowerCase(); } for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { if ( (elem = checkSet[i]) ) { while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? elem || false : elem === part; } } if ( isPartStrNotTag ) { Sizzle.filter( part, checkSet, true ); } }, ">": function( checkSet, part ) { var elem, isPartStr = typeof part === "string", i = 0, l = checkSet.length; if ( isPartStr && !rNonWord.test( part ) ) { part = part.toLowerCase(); for ( ; i < l; i++ ) { elem = checkSet[i]; if ( elem ) { var parent = elem.parentNode; checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; } } } else { for ( ; i < l; i++ ) { elem = checkSet[i]; if ( elem ) { checkSet[i] = isPartStr ? elem.parentNode : elem.parentNode === part; } } if ( isPartStr ) { Sizzle.filter( part, checkSet, true ); } } }, "": function(checkSet, part, isXML){ var nodeCheck, doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !rNonWord.test( part ) ) { part = part.toLowerCase(); nodeCheck = part; checkFn = dirNodeCheck; } checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); }, "~": function( checkSet, part, isXML ) { var nodeCheck, doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !rNonWord.test( part ) ) { part = part.toLowerCase(); nodeCheck = part; checkFn = dirNodeCheck; } checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); } }, find: { ID: function( match, context, isXML ) { if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }, NAME: function( match, context ) { if ( typeof context.getElementsByName !== "undefined" ) { var ret = [], results = context.getElementsByName( match[1] ); for ( var i = 0, l = results.length; i < l; i++ ) { if ( results[i].getAttribute("name") === match[1] ) { ret.push( results[i] ); } } return ret.length === 0 ? null : ret; } }, TAG: function( match, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( match[1] ); } } }, preFilter: { CLASS: function( match, curLoop, inplace, result, not, isXML ) { match = " " + match[1].replace( rBackslash, "" ) + " "; if ( isXML ) { return match; } for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { if ( elem ) { if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { if ( !inplace ) { result.push( elem ); } } else if ( inplace ) { curLoop[i] = false; } } } return false; }, ID: function( match ) { return match[1].replace( rBackslash, "" ); }, TAG: function( match, curLoop ) { return match[1].replace( rBackslash, "" ).toLowerCase(); }, CHILD: function( match ) { if ( match[1] === "nth" ) { if ( !match[2] ) { Sizzle.error( match[0] ); } match[2] = match[2].replace(/^\+|\s*/g, ''); // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); // calculate the numbers (first)n+(last) including if they are negative match[2] = (test[1] + (test[2] || 1)) - 0; match[3] = test[3] - 0; } else if ( match[2] ) { Sizzle.error( match[0] ); } // TODO: Move to normal caching system match[0] = done++; return match; }, ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } // Handle if an un-quoted value was used match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); if ( match[2] === "~=" ) { match[4] = " " + match[4] + " "; } return match; }, PSEUDO: function( match, curLoop, inplace, result, not ) { if ( match[1] === "not" ) { // If we're dealing with a complex expression, or a simple one if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); if ( !inplace ) { result.push.apply( result, ret ); } return false; } } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } return match; }, POS: function( match ) { match.unshift( true ); return match; } }, filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; }, disabled: function( elem ) { return elem.disabled === true; }, checked: function( elem ) { return elem.checked === true; }, selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, parent: function( elem ) { return !!elem.firstChild; }, empty: function( elem ) { return !elem.firstChild; }, has: function( elem, i, match ) { return !!Sizzle( match[3], elem ).length; }, header: function( elem ) { return (/h\d/i).test( elem.nodeName ); }, text: function( elem ) { var attr = elem.getAttribute( "type" ), type = elem.type; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); }, radio: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; }, checkbox: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; }, file: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; }, password: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; }, submit: function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && "submit" === elem.type; }, image: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; }, reset: function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && "reset" === elem.type; }, button: function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && "button" === elem.type || name === "button"; }, input: function( elem ) { return (/input|select|textarea|button/i).test( elem.nodeName ); }, focus: function( elem ) { return elem === elem.ownerDocument.activeElement; } }, setFilters: { first: function( elem, i ) { return i === 0; }, last: function( elem, i, match, array ) { return i === array.length - 1; }, even: function( elem, i ) { return i % 2 === 0; }, odd: function( elem, i ) { return i % 2 === 1; }, lt: function( elem, i, match ) { return i < match[3] - 0; }, gt: function( elem, i, match ) { return i > match[3] - 0; }, nth: function( elem, i, match ) { return match[3] - 0 === i; }, eq: function( elem, i, match ) { return match[3] - 0 === i; } }, filter: { PSEUDO: function( elem, match, i, array ) { var name = match[1], filter = Expr.filters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } else if ( name === "contains" ) { return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; } else if ( name === "not" ) { var not = match[3]; for ( var j = 0, l = not.length; j < l; j++ ) { if ( not[j] === elem ) { return false; } } return true; } else { Sizzle.error( name ); } }, CHILD: function( elem, match ) { var first, last, doneName, parent, cache, count, diff, type = match[1], node = elem; switch ( type ) { case "only": case "first": while ( (node = node.previousSibling) ) { if ( node.nodeType === 1 ) { return false; } } if ( type === "first" ) { return true; } node = elem; /* falls through */ case "last": while ( (node = node.nextSibling) ) { if ( node.nodeType === 1 ) { return false; } } return true; case "nth": first = match[2]; last = match[3]; if ( first === 1 && last === 0 ) { return true; } doneName = match[0]; parent = elem.parentNode; if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } } parent[ expando ] = doneName; } diff = elem.nodeIndex - last; if ( first === 0 ) { return diff === 0; } else { return ( diff % first === 0 && diff / first >= 0 ); } } }, ID: function( elem, match ) { return elem.nodeType === 1 && elem.getAttribute("id") === match; }, TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; }, CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; }, ATTR: function( elem, match ) { var name = match[1], result = Sizzle.attr ? Sizzle.attr( elem, name ) : Expr.attrHandle[ name ] ? Expr.attrHandle[ name ]( elem ) : elem[ name ] != null ? elem[ name ] : elem.getAttribute( name ), value = result + "", type = match[2], check = match[4]; return result == null ? type === "!=" : !type && Sizzle.attr ? result != null : type === "=" ? value === check : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" " + value + " ").indexOf(check) >= 0 : !check ? value && result !== false : type === "!=" ? value !== check : type === "^=" ? value.indexOf(check) === 0 : type === "$=" ? value.substr(value.length - check.length) === check : type === "|=" ? value === check || value.substr(0, check.length + 1) === check + "-" : false; }, POS: function( elem, match, i, array ) { var name = match[2], filter = Expr.setFilters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } } } }; var origPOS = Expr.match.POS, fescape = function(all, num){ return "\\" + (num - 0 + 1); }; for ( var type in Expr.match ) { Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); } // Expose origPOS // "global" as in regardless of relation to brackets/parens Expr.match.globalPOS = origPOS; var makeArray = function( array, results ) { array = Array.prototype.slice.call( array, 0 ); if ( results ) { results.push.apply( results, array ); return results; } return array; }; // Perform a simple check to determine if the browser is capable of // converting a NodeList to an array using builtin methods. // Also verifies that the returned array holds DOM nodes // (which is not the case in the Blackberry browser) try { Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; // Provide a fallback method if it does not work } catch( e ) { makeArray = function( array, results ) { var i = 0, ret = results || []; if ( toString.call(array) === "[object Array]" ) { Array.prototype.push.apply( ret, array ); } else { if ( typeof array.length === "number" ) { for ( var l = array.length; i < l; i++ ) { ret.push( array[i] ); } } else { for ( ; array[i]; i++ ) { ret.push( array[i] ); } } } return ret; }; } var sortOrder, siblingCheck; if ( document.documentElement.compareDocumentPosition ) { sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { return a.compareDocumentPosition ? -1 : 1; } return a.compareDocumentPosition(b) & 4 ? -1 : 1; }; } else { sortOrder = function( a, b ) { // The nodes are identical, we can exit early if ( a === b ) { hasDuplicate = true; return 0; // Fallback to using sourceIndex (in IE) if it's available on both nodes } else if ( a.sourceIndex && b.sourceIndex ) { return a.sourceIndex - b.sourceIndex; } var al, bl, ap = [], bp = [], aup = a.parentNode, bup = b.parentNode, cur = aup; // If the nodes are siblings (or identical) we can do a quick check if ( aup === bup ) { return siblingCheck( a, b ); // If no parents were found then the nodes are disconnected } else if ( !aup ) { return -1; } else if ( !bup ) { return 1; } // Otherwise they're somewhere else in the tree so we need // to build up a full list of the parentNodes for comparison while ( cur ) { ap.unshift( cur ); cur = cur.parentNode; } cur = bup; while ( cur ) { bp.unshift( cur ); cur = cur.parentNode; } al = ap.length; bl = bp.length; // Start walking down the tree looking for a discrepancy for ( var i = 0; i < al && i < bl; i++ ) { if ( ap[i] !== bp[i] ) { return siblingCheck( ap[i], bp[i] ); } } // We ended someplace up the tree so do a sibling check return i === al ? siblingCheck( a, bp[i], -1 ) : siblingCheck( ap[i], b, 1 ); }; siblingCheck = function( a, b, ret ) { if ( a === b ) { return ret; } var cur = a.nextSibling; while ( cur ) { if ( cur === b ) { return -1; } cur = cur.nextSibling; } return 1; }; } // Check to see if the browser returns elements by name when // querying by getElementById (and provide a workaround) (function(){ // We're going to inject a fake input element with a specified name var form = document.createElement("div"), id = "script" + (new Date()).getTime(), root = document.documentElement; form.innerHTML = "<a name='" + id + "'/>"; // Inject it into the root element, check its status, and remove it quickly root.insertBefore( form, root.firstChild ); // The workaround has to do additional checks after a getElementById // Which slows things down for other browsers (hence the branching) if ( document.getElementById( id ) ) { Expr.find.ID = function( match, context, isXML ) { if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function( elem, match ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } root.removeChild( form ); // release memory in IE root = form = null; })(); (function(){ // Check to see if the browser returns only elements // when doing getElementsByTagName("*") // Create a fake element var div = document.createElement("div"); div.appendChild( document.createComment("") ); // Make sure no comments are found if ( div.getElementsByTagName("*").length > 0 ) { Expr.find.TAG = function( match, context ) { var results = context.getElementsByTagName( match[1] ); // Filter out possible comments if ( match[1] === "*" ) { var tmp = []; for ( var i = 0; results[i]; i++ ) { if ( results[i].nodeType === 1 ) { tmp.push( results[i] ); } } results = tmp; } return results; }; } // Check to see if an attribute returns normalized href attributes div.innerHTML = "<a href='#'></a>"; if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function( elem ) { return elem.getAttribute( "href", 2 ); }; } // release memory in IE div = null; })(); if ( document.querySelectorAll ) { (function(){ var oldSizzle = Sizzle, div = document.createElement("div"), id = "__sizzle__"; div.innerHTML = "<p class='TEST'></p>"; // Safari can't handle uppercase or unicode characters when // in quirks mode. if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } Sizzle = function( query, context, extra, seed ) { context = context || document; // Only use querySelectorAll on non-XML documents // (ID selectors don't work in non-HTML documents) if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } } else { return makeArray( [], extra ); } } try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { var oldContext = context, old = context.getAttribute( "id" ), nid = old || id, hasParent = context.parentNode, relativeHierarchySelector = /^\s*[+~]/.test( query ); if ( !old ) { context.setAttribute( "id", nid ); } else { nid = nid.replace( /'/g, "\\$&" ); } if ( relativeHierarchySelector && hasParent ) { context = context.parentNode; } try { if ( !relativeHierarchySelector || hasParent ) { return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); } } catch(pseudoError) { } finally { if ( !old ) { oldContext.removeAttribute( "id" ); } } } } return oldSizzle(query, context, extra, seed); }; for ( var prop in oldSizzle ) { Sizzle[ prop ] = oldSizzle[ prop ]; } // release memory in IE div = null; })(); } (function(){ var html = document.documentElement, matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; if ( matches ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9 fails this) var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), pseudoWorks = false; try { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); } catch( pseudoError ) { pseudoWorks = true; } Sizzle.matchesSelector = function( node, expr ) { // Make sure that attribute selectors are quoted expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { var ret = matches.call( node, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || !disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9, so check for that node.document && node.document.nodeType !== 11 ) { return ret; } } } catch(e) {} } return Sizzle(expr, null, null, [node]).length > 0; }; } })(); (function(){ var div = document.createElement("div"); div.innerHTML = "<div class='test e'></div><div class='test'></div>"; // Opera can't find a second classname (in 9.6) // Also, make sure that getElementsByClassName actually exists if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { return; } // Safari caches class attributes, doesn't catch changes (in 3.2) div.lastChild.className = "e"; if ( div.getElementsByClassName("e").length === 1 ) { return; } Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { return context.getElementsByClassName(match[1]); } }; // release memory in IE div = null; })(); function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var match = false; elem = elem[dir]; while ( elem ) { if ( elem[ expando ] === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 && !isXML ){ elem[ expando ] = doneName; elem.sizset = i; } if ( elem.nodeName.toLowerCase() === cur ) { match = elem; break; } elem = elem[dir]; } checkSet[i] = match; } } } function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var match = false; elem = elem[dir]; while ( elem ) { if ( elem[ expando ] === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 ) { if ( !isXML ) { elem[ expando ] = doneName; elem.sizset = i; } if ( typeof cur !== "string" ) { if ( elem === cur ) { match = true; break; } } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { match = elem; break; } } elem = elem[dir]; } checkSet[i] = match; } } } if ( document.documentElement.contains ) { Sizzle.contains = function( a, b ) { return a !== b && (a.contains ? a.contains(b) : true); }; } else if ( document.documentElement.compareDocumentPosition ) { Sizzle.contains = function( a, b ) { return !!(a.compareDocumentPosition(b) & 16); }; } else { Sizzle.contains = function() { return false; }; } Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; var posProcess = function( selector, context, seed ) { var match, tmpSet = [], later = "", root = context.nodeType ? [context] : context; // Position selectors must be done after the filter // And so must :not(positional) so we move all PSEUDOs to the end while ( (match = Expr.match.PSEUDO.exec( selector )) ) { later += match[0]; selector = selector.replace( Expr.match.PSEUDO, "" ); } selector = Expr.relative[selector] ? selector + "*" : selector; for ( var i = 0, l = root.length; i < l; i++ ) { Sizzle( selector, root[i], tmpSet, seed ); } return Sizzle.filter( later, tmpSet ); }; // EXPOSE // Override sizzle attribute retrieval Sizzle.attr = jQuery.attr; Sizzle.selectors.attrMap = {}; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.filters; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })(); var runtil = /Until$/, rparentsprev = /^(?:parents|prevUntil|prevAll)/, // Note: This RegExp should be improved, or likely pulled from Sizzle rmultiselector = /,/, isSimple = /^.[^:#\[\.,]*$/, slice = Array.prototype.slice, POS = jQuery.expr.match.globalPOS, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var self = this, i, l; if ( typeof selector !== "string" ) { return jQuery( selector ).filter(function() { for ( i = 0, l = self.length; i < l; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }); } var ret = this.pushStack( "", "find", selector ), length, n, r; for ( i = 0, l = this.length; i < l; i++ ) { length = ret.length; jQuery.find( selector, this[i], ret ); if ( i > 0 ) { // Make sure that the results are unique for ( n = length; n < ret.length; n++ ) { for ( r = 0; r < length; r++ ) { if ( ret[r] === ret[n] ) { ret.splice(n--, 1); break; } } } } } return ret; }, has: function( target ) { var targets = jQuery( target ); return this.filter(function() { for ( var i = 0, l = targets.length; i < l; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector, false), "not", selector); }, filter: function( selector ) { return this.pushStack( winnow(this, selector, true), "filter", selector ); }, is: function( selector ) { return !!selector && ( typeof selector === "string" ? // If this is a positional selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". POS.test( selector ) ? jQuery( selector, this.context ).index( this[0] ) >= 0 : jQuery.filter( selector, this ).length > 0 : this.filter( selector ).length > 0 ); }, closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; // Array (deprecated as of jQuery 1.7) if ( jQuery.isArray( selectors ) ) { var level = 1; while ( cur && cur.ownerDocument && cur !== context ) { for ( i = 0; i < selectors.length; i++ ) { if ( jQuery( cur ).is( selectors[ i ] ) ) { ret.push({ selector: selectors[ i ], elem: cur, level: level }); } } cur = cur.parentNode; level++; } return ret; } // String var pos = POS.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( i = 0, l = this.length; i < l; i++ ) { cur = this[i]; while ( cur ) { if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { ret.push( cur ); break; } else { cur = cur.parentNode; if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { break; } } } } ret = ret.length > 1 ? jQuery.unique( ret ) : ret; return this.pushStack( ret, "closest", selectors ); }, // 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.prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? all : jQuery.unique( all ) ); }, andSelf: function() { return this.add( this.prevObject ); } }); // A painfully simple check to see if an element is disconnected // from a document (should be improved, where feasible). function isDisconnected( node ) { return !node || !node.parentNode || node.parentNode.nodeType === 11; } 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 jQuery.nth( elem, 2, "nextSibling" ); }, prev: function( elem ) { return jQuery.nth( elem, 2, "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 jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.makeArray( elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( !runtil.test( name ) ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { ret = ret.reverse(); } return this.pushStack( ret, name, slice.call( arguments ).join(",") ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 ? jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : jQuery.find.matches(expr, elems); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, nth: function( cur, result, dir, elem ) { result = result || 1; var num = 0; for ( ; cur; cur = cur[dir] ) { if ( cur.nodeType === 1 && ++num === result ) { break; } } return cur; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, keep ) { // Can't pass null or undefined to indexOf in Firefox 4 // Set to 0 to skip string check qualifier = qualifier || 0; if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep(elements, function( elem, i ) { var retVal = !!qualifier.call( elem, i, elem ); return retVal === keep; }); } else if ( qualifier.nodeType ) { return jQuery.grep(elements, function( elem, i ) { return ( elem === qualifier ) === keep; }); } else if ( typeof qualifier === "string" ) { var filtered = jQuery.grep(elements, function( elem ) { return elem.nodeType === 1; }); if ( isSimple.test( qualifier ) ) { return jQuery.filter(qualifier, filtered, !keep); } else { qualifier = jQuery.filter( qualifier, filtered ); } } return jQuery.grep(elements, function( elem, i ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style)/i, rnocache = /<(?:script|object|embed|option|style)/i, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /\/(java|ecma)script/i, rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/, wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], area: [ 1, "<map>", "</map>" ], _default: [ 0, "", "" ] }, safeFragment = createSafeFragment( document ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; // IE can't serialize <link> and <script> tags normally if ( !jQuery.support.htmlSerialize ) { wrapMap._default = [ 1, "div<div>", "</div>" ]; } jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, wrapAll: function( html ) { 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 var 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.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } 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(); }, append: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 ) { this.appendChild( elem ); } }); }, prepend: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 ) { this.insertBefore( elem, this.firstChild ); } }); }, before: function() { if ( this[0] && this[0].parentNode ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this ); }); } else if ( arguments.length ) { var set = jQuery.clean( arguments ); set.push.apply( set, this.toArray() ); return this.pushStack( set, "before", arguments ); } }, after: function() { if ( this[0] && this[0].parentNode ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this.nextSibling ); }); } else if ( arguments.length ) { var set = this.pushStack( this, "after", arguments ); set.push.apply( set, jQuery.clean(arguments) ); return set; } }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); jQuery.cleanData( [ elem ] ); } if ( elem.parentNode ) { elem.parentNode.removeChild( elem ); } } } return this; }, empty: function() { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } } 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 jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : null; } if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName( "*" ) ); 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( value ) { if ( this[0] && this[0].parentNode ) { // Make sure that the elements are removed from the DOM before they are inserted // this can help fix replacing a parent with child elements if ( jQuery.isFunction( value ) ) { return this.each(function(i) { var self = jQuery(this), old = self.html(); self.replaceWith( value.call( this, i, old ) ); }); } if ( typeof value !== "string" ) { value = jQuery( value ).detach(); } return this.each(function() { var next = this.nextSibling, parent = this.parentNode; jQuery( this ).remove(); if ( next ) { jQuery(next).before( value ); } else { jQuery(parent).append( value ); } }); } else { return this.length ? this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) : this; } }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, table, callback ) { var results, first, fragment, parent, value = args[0], scripts = []; // We can't cloneNode fragments that contain checked, in WebKit if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) { return this.each(function() { jQuery(this).domManip( args, table, callback, true ); }); } if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); args[0] = value.call(this, i, table ? self.html() : undefined); self.domManip( args, table, callback ); }); } if ( this[0] ) { parent = value && value.parentNode; // If we're in a fragment, just use that instead of building a new one if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) { results = { fragment: parent }; } else { results = jQuery.buildFragment( args, this, scripts ); } fragment = results.fragment; if ( fragment.childNodes.length === 1 ) { first = fragment = fragment.firstChild; } else { first = fragment.firstChild; } if ( first ) { table = table && jQuery.nodeName( first, "tr" ); for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) { callback.call( table ? root(this[i], first) : this[i], // Make sure that we do not leak memory by inadvertently discarding // the original fragment (which might have attached data) instead of // using it; in addition, use the original fragment object for the last // item instead of first because it can end up being emptied incorrectly // in certain situations (Bug #8070). // Fragments from the fragment cache must always be cloned and never used // in place. results.cacheable || ( l > 1 && i < lastIndex ) ? jQuery.clone( fragment, true, true ) : fragment ); } } if ( scripts.length ) { jQuery.each( scripts, function( i, elem ) { if ( elem.src ) { jQuery.ajax({ type: "GET", global: false, url: elem.src, async: false, dataType: "script" }); } else { jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) ); } if ( elem.parentNode ) { elem.parentNode.removeChild( elem ); } }); } } return this; } }); function root( elem, cur ) { return jQuery.nodeName(elem, "table") ? (elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody"))) : elem; } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function cloneFixAttributes( src, dest ) { var nodeName; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } // clearAttributes removes the attributes, which we don't want, // but also removes the attachEvent events, which we *do* want if ( dest.clearAttributes ) { dest.clearAttributes(); } // mergeAttributes, in contrast, only merges back on the // original attributes, not the events if ( dest.mergeAttributes ) { dest.mergeAttributes( src ); } nodeName = dest.nodeName.toLowerCase(); // IE6-8 fail to clone children inside object elements that use // the proprietary classid attribute value (rather than the type // attribute) to identify the type of content to display if ( nodeName === "object" ) { dest.outerHTML = src.outerHTML; } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set if ( src.checked ) { dest.defaultChecked = dest.checked = src.checked; } // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; // IE blanks contents when cloning scripts } else if ( nodeName === "script" && dest.text !== src.text ) { dest.text = src.text; } // Event data gets referenced instead of copied if the expando // gets copied too dest.removeAttribute( jQuery.expando ); // Clear flags for bubbling special change/submit events, they must // be reattached when the newly cloned events are first activated dest.removeAttribute( "_submit_attached" ); dest.removeAttribute( "_change_attached" ); } jQuery.buildFragment = function( args, nodes, scripts ) { var fragment, cacheable, cacheresults, doc, first = args[ 0 ]; // nodes may contain either an explicit document object, // a jQuery collection or context object. // If nodes[0] contains a valid object to assign to doc if ( nodes && nodes[0] ) { doc = nodes[0].ownerDocument || nodes[0]; } // Ensure that an attr object doesn't incorrectly stand in as a document object // Chrome and Firefox seem to allow this to occur and will throw exception // Fixes #8950 if ( !doc.createDocumentFragment ) { doc = document; } // Only cache "small" (1/2 KB) HTML strings that are associated with the main document // Cloning options loses the selected state, so don't cache them // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501 if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document && first.charAt(0) === "<" && !rnocache.test( first ) && (jQuery.support.checkClone || !rchecked.test( first )) && (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) { cacheable = true; cacheresults = jQuery.fragments[ first ]; if ( cacheresults && cacheresults !== 1 ) { fragment = cacheresults; } } if ( !fragment ) { fragment = doc.createDocumentFragment(); jQuery.clean( args, doc, fragment, scripts ); } if ( cacheable ) { jQuery.fragments[ first ] = cacheresults ? fragment : 1; } return { fragment: fragment, cacheable: cacheable }; }; jQuery.fragments = {}; jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var ret = [], insert = jQuery( selector ), parent = this.length === 1 && this[0].parentNode; if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { insert[ original ]( this[0] ); return this; } else { for ( var i = 0, l = insert.length; i < l; i++ ) { var elems = ( i > 0 ? this.clone(true) : this ).get(); jQuery( insert[i] )[ original ]( elems ); ret = ret.concat( elems ); } return this.pushStack( ret, name, insert.selector ); } }; }); function getAll( elem ) { if ( typeof elem.getElementsByTagName !== "undefined" ) { return elem.getElementsByTagName( "*" ); } else if ( typeof elem.querySelectorAll !== "undefined" ) { return elem.querySelectorAll( "*" ); } else { return []; } } // Used in clean, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( elem.type === "checkbox" || elem.type === "radio" ) { elem.defaultChecked = elem.checked; } } // Finds all inputs and passes them to fixDefaultChecked function findInputs( elem ) { var nodeName = ( elem.nodeName || "" ).toLowerCase(); if ( nodeName === "input" ) { fixDefaultChecked( elem ); // Skip scripts, get other children } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) { jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); } } // Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js function shimCloneNode( elem ) { var div = document.createElement( "div" ); safeFragment.appendChild( div ); div.innerHTML = elem.outerHTML; return div.firstChild; } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var srcElements, destElements, i, // IE<=8 does not properly clone detached, unknown element nodes clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ? elem.cloneNode( true ) : shimCloneNode( elem ); if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // IE copies events bound via attachEvent when using cloneNode. // Calling detachEvent on the clone will also remove the events // from the original. In order to get around this, we use some // proprietary methods to clear the events. Thanks to MooTools // guys for this hotness. cloneFixAttributes( elem, clone ); // Using Sizzle here is crazy slow, so we use getElementsByTagName instead srcElements = getAll( elem ); destElements = getAll( clone ); // Weird iteration because IE will replace the length property // with an element if you are cloning the body and one of the // elements on the page has a name or id of "length" for ( i = 0; srcElements[i]; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { cloneFixAttributes( srcElements[i], destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { cloneCopyEvent( elem, clone ); if ( deepDataAndEvents ) { srcElements = getAll( elem ); destElements = getAll( clone ); for ( i = 0; srcElements[i]; ++i ) { cloneCopyEvent( srcElements[i], destElements[i] ); } } } srcElements = destElements = null; // Return the cloned set return clone; }, clean: function( elems, context, fragment, scripts ) { var checkScriptType, script, j, ret = []; context = context || document; // !context.createElement fails in IE with an error but returns typeof 'object' if ( typeof context.createElement === "undefined" ) { context = context.ownerDocument || context[0] && context[0].ownerDocument || document; } for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { if ( typeof elem === "number" ) { elem += ""; } if ( !elem ) { continue; } // Convert html string into DOM nodes if ( typeof elem === "string" ) { if ( !rhtml.test( elem ) ) { elem = context.createTextNode( elem ); } else { // Fix "XHTML"-style tags in all browsers elem = elem.replace(rxhtmlTag, "<$1></$2>"); // Trim whitespace, otherwise indexOf won't work as expected var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(), wrap = wrapMap[ tag ] || wrapMap._default, depth = wrap[0], div = context.createElement("div"), safeChildNodes = safeFragment.childNodes, remove; // Append wrapper element to unknown element safe doc fragment if ( context === document ) { // Use the fragment we've already created for this document safeFragment.appendChild( div ); } else { // Use a fragment created with the owner document createSafeFragment( context ).appendChild( div ); } // Go to html and back, then peel off extra wrappers div.innerHTML = wrap[1] + elem + wrap[2]; // Move to the right depth while ( depth-- ) { div = div.lastChild; } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> var hasBody = rtbody.test(elem), tbody = tag === "table" && !hasBody ? div.firstChild && div.firstChild.childNodes : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !hasBody ? div.childNodes : []; for ( j = tbody.length - 1; j >= 0 ; --j ) { if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { tbody[ j ].parentNode.removeChild( tbody[ j ] ); } } } // IE completely kills leading whitespace when innerHTML is used if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); } elem = div.childNodes; // Clear elements from DocumentFragment (safeFragment or otherwise) // to avoid hoarding elements. Fixes #11356 if ( div ) { div.parentNode.removeChild( div ); // Guard against -1 index exceptions in FF3.6 if ( safeChildNodes.length > 0 ) { remove = safeChildNodes[ safeChildNodes.length - 1 ]; if ( remove && remove.parentNode ) { remove.parentNode.removeChild( remove ); } } } } } // Resets defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) var len; if ( !jQuery.support.appendChecked ) { if ( elem[0] && typeof (len = elem.length) === "number" ) { for ( j = 0; j < len; j++ ) { findInputs( elem[j] ); } } else { findInputs( elem ); } } if ( elem.nodeType ) { ret.push( elem ); } else { ret = jQuery.merge( ret, elem ); } } if ( fragment ) { checkScriptType = function( elem ) { return !elem.type || rscriptType.test( elem.type ); }; for ( i = 0; ret[i]; i++ ) { script = ret[i]; if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) { scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script ); } else { if ( script.nodeType === 1 ) { var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType ); ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); } fragment.appendChild( script ); } } } return ret; }, cleanData: function( elems ) { var data, id, cache = jQuery.cache, special = jQuery.event.special, deleteExpando = jQuery.support.deleteExpando; for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { continue; } id = elem[ jQuery.expando ]; if ( id ) { data = cache[ id ]; if ( data && data.events ) { for ( var 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 ); } } // Null the DOM reference to avoid IE6/7/8 leak (#7054) if ( data.handle ) { data.handle.elem = null; } } if ( deleteExpando ) { delete elem[ jQuery.expando ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( jQuery.expando ); } delete cache[ id ]; } } } }); var ralpha = /alpha\([^)]*\)/i, ropacity = /opacity=([^)]*)/, // fixed for IE9, see #8346 rupper = /([A-Z]|^ms)/g, rnum = /^[\-+]?(?:\d*\.)?\d+$/i, rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i, rrelNum = /^([\-+])=([\-+.\de]+)/, rmargin = /^margin/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, // order is important! cssExpand = [ "Top", "Right", "Bottom", "Left" ], curCSS, getComputedStyle, currentStyle; jQuery.fn.css = function( name, value ) { return jQuery.access( this, function( elem, name, value ) { return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }; jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } else { return elem.style.opacity; } } } }, // Exclude the following css properties to add px cssNumber: { "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, origName = jQuery.camelCase( name ), style = elem.style, hooks = jQuery.cssHooks[ origName ]; name = jQuery.cssProps[ origName ] || origName; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra ) { var ret, hooks; // Make sure that we're working with the right name name = jQuery.camelCase( name ); hooks = jQuery.cssHooks[ name ]; name = jQuery.cssProps[ name ] || name; // cssFloat needs a special treatment if ( name === "cssFloat" ) { name = "float"; } // If a hook was provided get the computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) { return ret; // Otherwise, if a way to get the computed value exists, use that } else if ( curCSS ) { return curCSS( elem, name ); } }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback ) { var old = {}, ret, name; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.call( elem ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); // DEPRECATED in 1.3, Use jQuery.css() instead jQuery.curCSS = jQuery.css; if ( document.defaultView && document.defaultView.getComputedStyle ) { getComputedStyle = function( elem, name ) { var ret, defaultView, computedStyle, width, style = elem.style; name = name.replace( rupper, "-$1" ).toLowerCase(); if ( (defaultView = elem.ownerDocument.defaultView) && (computedStyle = defaultView.getComputedStyle( elem, null )) ) { ret = computedStyle.getPropertyValue( name ); if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { ret = jQuery.style( elem, name ); } } // A tribute to the "awesome hack by Dean Edwards" // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) { width = style.width; style.width = ret; ret = computedStyle.width; style.width = width; } return ret; }; } if ( document.documentElement.currentStyle ) { currentStyle = function( elem, name ) { var left, rsLeft, uncomputed, ret = elem.currentStyle && elem.currentStyle[ name ], style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && (uncomputed = style[ name ]) ) { ret = uncomputed; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels if ( rnumnonpx.test( ret ) ) { // Remember the original values left = style.left; rsLeft = elem.runtimeStyle && elem.runtimeStyle.left; // Put in the new values to get a computed value out if ( rsLeft ) { elem.runtimeStyle.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { elem.runtimeStyle.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } curCSS = getComputedStyle || currentStyle; function getWidthOrHeight( elem, name, extra ) { // Start with offset property var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, i = name === "width" ? 1 : 0, len = 4; if ( val > 0 ) { if ( extra !== "border" ) { for ( ; i < len; i += 2 ) { if ( !extra ) { val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0; } if ( extra === "margin" ) { val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0; } else { val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; } } } return val + "px"; } // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; // Add padding, border, margin if ( extra ) { for ( ; i < len; i += 2 ) { val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0; if ( extra !== "padding" ) { val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; } if ( extra === "margin" ) { val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0; } } } return val + "px"; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { if ( elem.offsetWidth !== 0 ) { return getWidthOrHeight( elem, name, extra ); } else { return jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }); } } }, set: function( elem, value ) { return rnum.test( value ) ? value + "px" : value; } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( parseFloat( RegExp.$1 ) / 100 ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there there is no filter style applied in a css rule, we are done if ( currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } jQuery(function() { // This hook cannot be added until DOM ready because the support test // for it is not run until after DOM ready if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, function() { if ( computed ) { return curCSS( elem, "margin-right" ); } else { return elem.style.marginRight; } }); } }; } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { var width = elem.offsetWidth, height = elem.offsetHeight; return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ], expanded = {}; for ( i = 0; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rhash = /#.*$/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rquery = /\?/, rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, rselectTextarea = /^(?:select|textarea)/i, rspacesAjax = /\s+/, rts = /([?&])_=[^&]*/, rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Document location ajaxLocation, // Document location segments ajaxLocParts, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = ["*/"] + ["*"]; // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } if ( jQuery.isFunction( func ) ) { var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ), i = 0, length = dataTypes.length, dataType, list, placeBefore; // For each dataType in the dataTypeExpression for ( ; i < length; i++ ) { dataType = dataTypes[ i ]; // We control if we're asked to add before // any existing element placeBefore = /^\+/.test( dataType ); if ( placeBefore ) { dataType = dataType.substr( 1 ) || "*"; } list = structure[ dataType ] = structure[ dataType ] || []; // then we add to the structure accordingly list[ placeBefore ? "unshift" : "push" ]( func ); } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, dataType /* internal */, inspected /* internal */ ) { dataType = dataType || options.dataTypes[ 0 ]; inspected = inspected || {}; inspected[ dataType ] = true; var list = structure[ dataType ], i = 0, length = list ? list.length : 0, executeOnly = ( structure === prefilters ), selection; for ( ; i < length && ( executeOnly || !selection ); i++ ) { selection = list[ i ]( options, originalOptions, jqXHR ); // If we got redirected to another dataType // we try there if executing only and not done already if ( typeof selection === "string" ) { if ( !executeOnly || inspected[ selection ] ) { selection = undefined; } else { options.dataTypes.unshift( selection ); selection = inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, selection, inspected ); } } } // If we're only executing or nothing was selected // we try the catchall dataType if not done already if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { selection = inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, "*", inspected ); } // unnecessary when only executing (prefilters) // but it'll be ignored by the caller in that case return selection; } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } } jQuery.fn.extend({ load: function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); // Don't do a request if no elements are being requested } else if ( !this.length ) { return this; } var off = url.indexOf( " " ); if ( off >= 0 ) { var selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // Default to a GET request var type = "GET"; // If the second parameter was provided if ( params ) { // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( typeof params === "object" ) { params = jQuery.param( params, jQuery.ajaxSettings.traditional ); type = "POST"; } } var self = this; // Request the remote document jQuery.ajax({ url: url, type: type, dataType: "html", data: params, // Complete callback (responseText is used internally) complete: function( jqXHR, status, responseText ) { // Store the response as specified by the jqXHR object responseText = jqXHR.responseText; // If successful, inject the HTML into all the matched elements if ( jqXHR.isResolved() ) { // #4825: Get the actual response in case // a dataFilter is present in ajaxSettings jqXHR.done(function( r ) { responseText = r; }); // See if a selector was specified self.html( selector ? // Create a dummy div to hold the results jQuery("<div>") // inject the contents of the document in, removing the scripts // to avoid any 'Permission Denied' errors in IE .append(responseText.replace(rscript, "")) // Locate the specified elements .find(selector) : // If not, just inject the full result responseText ); } if ( callback ) { self.each( callback, [ responseText, status, jqXHR ] ); } } }); return this; }, serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ return this.elements ? jQuery.makeArray( this.elements ) : this; }) .filter(function(){ return this.name && !this.disabled && ( this.checked || rselectTextarea.test( this.nodeName ) || rinput.test( this.type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val, i ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); // Attach a bunch of functions for handling common AJAX events jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){ jQuery.fn[ o ] = function( f ){ return this.on( o, f ); }; }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ type: method, url: url, data: data, success: callback, dataType: type }); }; }); jQuery.extend({ getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { if ( settings ) { // Building a settings object ajaxExtend( target, jQuery.ajaxSettings ); } else { // Extending ajaxSettings settings = target; target = jQuery.ajaxSettings; } ajaxExtend( target, settings ); return target; }, ajaxSettings: { url: ajaxLocation, isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, type: "GET", contentType: "application/x-www-form-urlencoded; charset=UTF-8", processData: true, async: true, /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, traditional: false, headers: {}, */ accepts: { xml: "application/xml, text/xml", html: "text/html", text: "text/plain", json: "application/json, text/javascript", "*": allTypes }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, // List of data converters // 1) key format is "source_type destination_type" (a single space in-between) // 2) the catchall symbol "*" can be used for source_type converters: { // Convert anything to text "* text": window.String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { context: true, url: true } }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events // It's the callbackContext if one was provided in the options // and if it's a DOM node or a jQuery collection globalEventContext = callbackContext !== s && ( callbackContext.nodeType || callbackContext instanceof jQuery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks( "once memory" ), // Status-dependent callbacks statusCode = s.statusCode || {}, // ifModified key ifModifiedKey, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // Response headers responseHeadersString, responseHeaders, // transport transport, // timeout handle timeoutTimer, // Cross-domain detection vars parts, // The jqXHR state state = 0, // To know if global events are to be dispatched fireGlobals, // Loop variable i, // Fake xhr jqXHR = { readyState: 0, // Caches the header setRequestHeader: function( name, value ) { if ( !state ) { var lname = name.toLowerCase(); name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while( ( match = rheaders.exec( responseHeadersString ) ) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match === undefined ? null : match; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Cancel the request abort: function( statusText ) { statusText = statusText || "abort"; if ( transport ) { transport.abort( statusText ); } done( 0, statusText ); return this; } }; // Callback for when everything is done // It is defined here because jslint complains if it is declared // at the end of the function (which would be more logical and readable) function done( status, nativeStatusText, responses, headers ) { // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; var isSuccess, success, error, statusText = nativeStatusText, response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined, lastModified, etag; // If successful, handle type chaining if ( status >= 200 && status < 300 || status === 304 ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) { jQuery.lastModified[ ifModifiedKey ] = lastModified; } if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) { jQuery.etag[ ifModifiedKey ] = etag; } } // If not modified if ( status === 304 ) { statusText = "notmodified"; isSuccess = true; // If we have data } else { try { success = ajaxConvert( s, response ); statusText = "success"; isSuccess = true; } catch(e) { // We have a parsererror statusText = "parsererror"; error = e; } } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( !statusText || status ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = "" + ( nativeStatusText || statusText ); // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ), [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger( "ajaxStop" ); } } } // Attach deferreds deferred.promise( jqXHR ); jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; jqXHR.complete = completeDeferred.add; // Status-dependent callbacks jqXHR.statusCode = function( map ) { if ( map ) { var tmp; if ( state < 2 ) { for ( tmp in map ) { statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ]; } } else { tmp = map[ jqXHR.status ]; jqXHR.then( tmp, tmp ); } } return this; }; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // We also use the url parameter if available s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax ); // Determine if a cross-domain request is in order if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return false; } // We can fire global events as of now if asked to fireGlobals = s.global; // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger( "ajaxStart" ); } // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data; // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Get ifModifiedKey before adding the anti-cache parameter ifModifiedKey = s.url; // Add anti-cache in url if needed if ( s.cache === false ) { var ts = jQuery.now(), // try replacing _= if it is there ret = s.url.replace( rts, "$1_=" + ts ); // if nothing was replaced, add timestamp to the end s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { ifModifiedKey = ifModifiedKey || s.url; if ( jQuery.lastModified[ ifModifiedKey ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] ); } if ( jQuery.etag[ ifModifiedKey ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] ); } } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already jqXHR.abort(); return false; } // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout( function(){ jqXHR.abort( "timeout" ); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch (e) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } return jqXHR; }, // Serialize an array of form elements or a set of // key/values into a query string param: function( a, traditional ) { var s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : value; s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = 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 ( var prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); } }); function buildParams( prefix, obj, traditional, add ) { 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 { // If array item is non-scalar (array or object), encode its // numeric index to resolve deserialization ambiguity issues. // Note that rack (as of 1.0.0) can't currently deserialize // nested arrays properly, and attempting to do so may cause // a server error. Possible fixes are to modify rack's // deserialization algorithm or to provide an option or flag // to force array serialization to be shallow. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( var name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } // This is still on the jQuery object... for now // Want to move this to jQuery.ajax some day jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {} }); /* Handles responses to an ajax request: * - sets all responseXXX fields accordingly * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var contents = s.contents, dataTypes = s.dataTypes, responseFields = s.responseFields, ct, type, finalDataType, firstDataType; // Fill responseXXX fields for ( type in responseFields ) { if ( type in responses ) { jqXHR[ responseFields[type] ] = responses[ type ]; } } // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader( "content-type" ); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } // Chain conversions given the request and the original response function ajaxConvert( s, response ) { // Apply the dataFilter if provided if ( s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } var dataTypes = s.dataTypes, converters = {}, i, key, length = dataTypes.length, tmp, // Current and previous dataTypes current = dataTypes[ 0 ], prev, // Conversion expression conversion, // Conversion function conv, // Conversion functions (transitive conversion) conv1, conv2; // For each dataType in the chain for ( i = 1; i < length; i++ ) { // Create converters map // with lowercased keys if ( i === 1 ) { for ( key in s.converters ) { if ( typeof key === "string" ) { converters[ key.toLowerCase() ] = s.converters[ key ]; } } } // Get the dataTypes prev = current; current = dataTypes[ i ]; // If current is auto dataType, update it to prev if ( current === "*" ) { current = prev; // If no auto and dataTypes are actually different } else if ( prev !== "*" && prev !== current ) { // Get the converter conversion = prev + " " + current; conv = converters[ conversion ] || converters[ "* " + current ]; // If there is no direct converter, search transitively if ( !conv ) { conv2 = undefined; for ( conv1 in converters ) { tmp = conv1.split( " " ); if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) { conv2 = converters[ tmp[1] + " " + current ]; if ( conv2 ) { conv1 = converters[ conv1 ]; if ( conv1 === true ) { conv = conv2; } else if ( conv2 === true ) { conv = conv1; } break; } } } } // If we found no converter, dispatch an error if ( !( conv || conv2 ) ) { jQuery.error( "No conversion from " + conversion.replace(" "," to ") ); } // If found converter is not an equivalence if ( conv !== true ) { // Convert with 1 or 2 converters accordingly response = conv ? conv( response ) : conv2( conv1(response) ); } } } return response; } var jsc = jQuery.now(), jsre = /(\=)\?(&|$)|\?\?/i; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { return jQuery.expando + "_" + ( jsc++ ); } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType ); if ( s.dataTypes[ 0 ] === "jsonp" || s.jsonp !== false && ( jsre.test( s.url ) || inspectData && jsre.test( s.data ) ) ) { var responseContainer, jsonpCallback = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback, previous = window[ jsonpCallback ], url = s.url, data = s.data, replace = "$1" + jsonpCallback + "$2"; if ( s.jsonp !== false ) { url = url.replace( jsre, replace ); if ( s.url === url ) { if ( inspectData ) { data = data.replace( jsre, replace ); } if ( s.data === data ) { // Add callback manually url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback; } } } s.url = url; s.data = data; // Install callback window[ jsonpCallback ] = function( response ) { responseContainer = [ response ]; }; // Clean-up function jqXHR.always(function() { // Set callback back to previous value window[ jsonpCallback ] = previous; // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( previous ) ) { window[ jsonpCallback ]( responseContainer[ 0 ] ); } }); // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( jsonpCallback + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Delegate to script return "script"; } }); // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /javascript|ecmascript/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement( "script" ); script.async = "async"; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( head && script.parentNode ) { head.removeChild( script ); } // Dereference the script script = undefined; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709 and #4378). head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( 0, 1 ); } } }; } }); var // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject ? function() { // Abort all pending requests for ( var key in xhrCallbacks ) { xhrCallbacks[ key ]( 0, 1 ); } } : false, xhrId = 0, xhrCallbacks; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject( "Microsoft.XMLHTTP" ); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties (function( xhr ) { jQuery.extend( jQuery.support, { ajax: !!xhr, cors: !!xhr && ( "withCredentials" in xhr ) }); })( jQuery.ajaxSettings.xhr() ); // Create transport if the browser can provide an xhr if ( jQuery.support.ajax ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var xhr = s.xhr(), handle, i; // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers[ "X-Requested-With" ] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( _ ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, statusText, responseHeaders, responses, xml; // Firefox throws exceptions when accessing properties // of an xhr when a network error occured // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); responses = {}; xml = xhr.responseXML; // Construct response list if ( xml && xml.documentElement /* #4958 */ ) { responses.xml = xml; } // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) try { responses.text = xhr.responseText; } catch( _ ) { } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; // if we're in sync mode or it's in cache // and has been retrieved directly (IE6 & IE7) // we need to manually fire the callback if ( !s.async || xhr.readyState === 4 ) { callback(); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback(0,1); } } }; } }); } var elemdisplay = {}, iframe, iframeDoc, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, timerId, fxAttrs = [ // height animations [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], // width animations [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], // opacity animations [ "opacity" ] ], fxNow; jQuery.fn.extend({ show: function( speed, easing, callback ) { var elem, display; if ( speed || speed === 0 ) { return this.animate( genFx("show", 3), speed, easing, callback ); } else { for ( var i = 0, j = this.length; i < j; i++ ) { elem = this[ i ]; if ( elem.style ) { display = elem.style.display; // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !jQuery._data(elem, "olddisplay") && display === "none" ) { display = elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( (display === "" && jQuery.css(elem, "display") === "none") || !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( i = 0; i < j; i++ ) { elem = this[ i ]; if ( elem.style ) { display = elem.style.display; if ( display === "" || display === "none" ) { elem.style.display = jQuery._data( elem, "olddisplay" ) || ""; } } } return this; } }, hide: function( speed, easing, callback ) { if ( speed || speed === 0 ) { return this.animate( genFx("hide", 3), speed, easing, callback); } else { var elem, display, i = 0, j = this.length; for ( ; i < j; i++ ) { elem = this[i]; if ( elem.style ) { display = jQuery.css( elem, "display" ); if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) { jQuery._data( elem, "olddisplay", display ); } } } // Set the display of the elements in a second loop // to avoid the constant reflow for ( i = 0; i < j; i++ ) { if ( this[i].style ) { this[i].style.display = "none"; } } return this; } }, // Save the old toggle function _toggle: jQuery.fn.toggle, toggle: function( fn, fn2, callback ) { var bool = typeof fn === "boolean"; if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) { this._toggle.apply( this, arguments ); } else if ( fn == null || bool ) { this.each(function() { var state = bool ? fn : jQuery(this).is(":hidden"); jQuery(this)[ state ? "show" : "hide" ](); }); } else { this.animate(genFx("toggle", 3), fn, fn2, callback); } return this; }, fadeTo: function( speed, to, easing, callback ) { return this.filter(":hidden").css("opacity", 0).show().end() .animate({opacity: to}, speed, easing, callback); }, animate: function( prop, speed, easing, callback ) { var optall = jQuery.speed( speed, easing, callback ); if ( jQuery.isEmptyObject( prop ) ) { return this.each( optall.complete, [ false ] ); } // Do not change referenced properties as per-property easing will be lost prop = jQuery.extend( {}, prop ); function doAnimation() { // XXX 'this' does not always have a nodeName when running the // test suite if ( optall.queue === false ) { jQuery._mark( this ); } var opt = jQuery.extend( {}, optall ), isElement = this.nodeType === 1, hidden = isElement && jQuery(this).is(":hidden"), name, val, p, e, hooks, replace, parts, start, end, unit, method; // will store per property easing and be used to determine when an animation is complete opt.animatedProperties = {}; // first pass over propertys to expand / normalize for ( p in prop ) { name = jQuery.camelCase( p ); if ( p !== name ) { prop[ name ] = prop[ p ]; delete prop[ p ]; } if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) { replace = hooks.expand( prop[ name ] ); delete prop[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'p' from above because we have the correct "name" for ( p in replace ) { if ( ! ( p in prop ) ) { prop[ p ] = replace[ p ]; } } } } for ( name in prop ) { val = prop[ name ]; // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default) if ( jQuery.isArray( val ) ) { opt.animatedProperties[ name ] = val[ 1 ]; val = prop[ name ] = val[ 0 ]; } else { opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing'; } if ( val === "hide" && hidden || val === "show" && !hidden ) { return opt.complete.call( this ); } if ( isElement && ( name === "height" || name === "width" ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( this, "display" ) === "inline" && jQuery.css( this, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) { this.style.display = "inline-block"; } else { this.style.zoom = 1; } } } } if ( opt.overflow != null ) { this.style.overflow = "hidden"; } for ( p in prop ) { e = new jQuery.fx( this, opt, p ); val = prop[ p ]; if ( rfxtypes.test( val ) ) { // Tracks whether to show or hide based on private // data attached to the element method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 ); if ( method ) { jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" ); e[ method ](); } else { e[ val ](); } } else { parts = rfxnum.exec( val ); start = e.cur(); if ( parts ) { end = parseFloat( parts[2] ); unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" ); // We need to compute starting value if ( unit !== "px" ) { jQuery.style( this, p, (end || 1) + unit); start = ( (end || 1) / e.cur() ) * start; jQuery.style( this, p, start + unit); } // If a +=/-= token was provided, we're doing a relative animation if ( parts[1] ) { end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start; } e.custom( start, end, unit ); } else { e.custom( start, val, "" ); } } } // For JS strict compliance return true; } return optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var index, hadTimers = false, timers = jQuery.timers, data = jQuery._data( this ); // clear marker counters if we know they won't be if ( !gotoEnd ) { jQuery._unmark( true, this ); } function stopQueue( elem, data, index ) { var hooks = data[ index ]; jQuery.removeData( elem, index, true ); hooks.stop( gotoEnd ); } if ( type == null ) { for ( index in data ) { if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) { stopQueue( this, data, index ); } } } else if ( data[ index = type + ".run" ] && data[ index ].stop ){ stopQueue( this, data, index ); } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { if ( gotoEnd ) { // force the next step to be the last timers[ index ]( true ); } else { timers[ index ].saveState(); } hadTimers = true; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( !( gotoEnd && hadTimers ) ) { jQuery.dequeue( this, type ); } }); } }); // Animations created synchronously will run synchronously function createFxNow() { setTimeout( clearFxNow, 0 ); return ( fxNow = jQuery.now() ); } function clearFxNow() { fxNow = undefined; } // Generate parameters to create a standard animation function genFx( type, num ) { var obj = {}; jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() { obj[ this ] = type; }); return obj; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx( "show", 1 ), slideUp: genFx( "hide", 1 ), slideToggle: genFx( "toggle", 1 ), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.extend({ speed: function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function( noUnmark ) { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } else if ( noUnmark !== false ) { jQuery._unmark( this ); } }; return opt; }, easing: { linear: function( p ) { return p; }, swing: function( p ) { return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5; } }, timers: [], fx: function( elem, options, prop ) { this.options = options; this.elem = elem; this.prop = prop; options.orig = options.orig || {}; } }); jQuery.fx.prototype = { // Simple function for setting a style value update: function() { if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this ); }, // Get the current size cur: function() { if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) { return this.elem[ this.prop ]; } var parsed, r = jQuery.css( this.elem, this.prop ); // Empty strings, null, undefined and "auto" are converted to 0, // complex values such as "rotate(1rad)" are returned as is, // simple values such as "10px" are parsed to Float. return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed; }, // Start an animation from one number to another custom: function( from, to, unit ) { var self = this, fx = jQuery.fx; this.startTime = fxNow || createFxNow(); this.end = to; this.now = this.start = from; this.pos = this.state = 0; this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" ); function t( gotoEnd ) { return self.step( gotoEnd ); } t.queue = this.options.queue; t.elem = this.elem; t.saveState = function() { if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) { if ( self.options.hide ) { jQuery._data( self.elem, "fxshow" + self.prop, self.start ); } else if ( self.options.show ) { jQuery._data( self.elem, "fxshow" + self.prop, self.end ); } } }; if ( t() && jQuery.timers.push(t) && !timerId ) { timerId = setInterval( fx.tick, fx.interval ); } }, // Simple 'show' function show: function() { var dataShow = jQuery._data( this.elem, "fxshow" + this.prop ); // Remember where we started, so that we can go back to it later this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop ); this.options.show = true; // Begin the animation // Make sure that we start at a small width/height to avoid any flash of content if ( dataShow !== undefined ) { // This show is picking up where a previous hide or show left off this.custom( this.cur(), dataShow ); } else { this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() ); } // Start by showing the element jQuery( this.elem ).show(); }, // Simple 'hide' function hide: function() { // Remember where we started, so that we can go back to it later this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop ); this.options.hide = true; // Begin the animation this.custom( this.cur(), 0 ); }, // Each step of an animation step: function( gotoEnd ) { var p, n, complete, t = fxNow || createFxNow(), done = true, elem = this.elem, options = this.options; if ( gotoEnd || t >= options.duration + this.startTime ) { this.now = this.end; this.pos = this.state = 1; this.update(); options.animatedProperties[ this.prop ] = true; for ( p in options.animatedProperties ) { if ( options.animatedProperties[ p ] !== true ) { done = false; } } if ( done ) { // Reset the overflow if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) { jQuery.each( [ "", "X", "Y" ], function( index, value ) { elem.style[ "overflow" + value ] = options.overflow[ index ]; }); } // Hide the element if the "hide" operation was done if ( options.hide ) { jQuery( elem ).hide(); } // Reset the properties, if the item has been hidden or shown if ( options.hide || options.show ) { for ( p in options.animatedProperties ) { jQuery.style( elem, p, options.orig[ p ] ); jQuery.removeData( elem, "fxshow" + p, true ); // Toggle data is no longer needed jQuery.removeData( elem, "toggle" + p, true ); } } // Execute the complete function // in the event that the complete function throws an exception // we must ensure it won't be called twice. #5684 complete = options.complete; if ( complete ) { options.complete = false; complete.call( elem ); } } return false; } else { // classical easing cannot be used with an Infinity duration if ( options.duration == Infinity ) { this.now = t; } else { n = t - this.startTime; this.state = n / options.duration; // Perform the easing function, defaults to swing this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration ); this.now = this.start + ( (this.end - this.start) * this.pos ); } // Perform the next step of the animation this.update(); } return true; } }; jQuery.extend( jQuery.fx, { tick: function() { var timer, timers = jQuery.timers, i = 0; for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } }, interval: 13, stop: function() { clearInterval( timerId ); timerId = null; }, speeds: { slow: 600, fast: 200, // Default speed _default: 400 }, step: { opacity: function( fx ) { jQuery.style( fx.elem, "opacity", fx.now ); }, _default: function( fx ) { if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) { fx.elem.style[ fx.prop ] = fx.now + fx.unit; } else { fx.elem[ fx.prop ] = fx.now; } } } }); // Ensure props that can't be negative don't go there on undershoot easing jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) { // exclude marginTop, marginLeft, marginBottom and marginRight from this list if ( prop.indexOf( "margin" ) ) { jQuery.fx.step[ prop ] = function( fx ) { jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit ); }; } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } // Try to restore the default display value of an element function defaultDisplay( nodeName ) { if ( !elemdisplay[ nodeName ] ) { var body = document.body, elem = jQuery( "<" + nodeName + ">" ).appendTo( body ), display = elem.css( "display" ); elem.remove(); // If the simple way fails, // get element's real default display by attaching it to a temp iframe if ( display === "none" || display === "" ) { // No iframe to use yet, so create it if ( !iframe ) { iframe = document.createElement( "iframe" ); iframe.frameBorder = iframe.width = iframe.height = 0; } body.appendChild( iframe ); // Create a cacheable copy of the iframe document on first call. // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML // document to it; WebKit & Firefox won't allow reusing the iframe document. if ( !iframeDoc || !iframe.createElement ) { iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" ); iframeDoc.close(); } elem = iframeDoc.createElement( nodeName ); iframeDoc.body.appendChild( elem ); display = jQuery.css( elem, "display" ); body.removeChild( iframe ); } // Store the correct default display elemdisplay[ nodeName ] = display; } return elemdisplay[ nodeName ]; } var getOffset, rtable = /^t(?:able|d|h)$/i, rroot = /^(?:body|html)$/i; if ( "getBoundingClientRect" in document.documentElement ) { getOffset = function( elem, doc, docElem, box ) { try { box = elem.getBoundingClientRect(); } catch(e) {} // Make sure we're not dealing with a disconnected DOM node if ( !box || !jQuery.contains( docElem, elem ) ) { return box ? { top: box.top, left: box.left } : { top: 0, left: 0 }; } var body = doc.body, win = getWindow( doc ), clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop, scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft, top = box.top + scrollTop - clientTop, left = box.left + scrollLeft - clientLeft; return { top: top, left: left }; }; } else { getOffset = function( elem, doc, docElem ) { var computedStyle, offsetParent = elem.offsetParent, prevOffsetParent = elem, body = doc.body, defaultView = doc.defaultView, prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, top = elem.offsetTop, left = elem.offsetLeft; while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) { break; } computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; top -= elem.scrollTop; left -= elem.scrollLeft; if ( elem === offsetParent ) { top += elem.offsetTop; left += elem.offsetLeft; if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) { top += parseFloat( computedStyle.borderTopWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0; } prevOffsetParent = offsetParent; offsetParent = elem.offsetParent; } if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { top += parseFloat( computedStyle.borderTopWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0; } prevComputedStyle = computedStyle; } if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) { top += body.offsetTop; left += body.offsetLeft; } if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) { top += Math.max( docElem.scrollTop, body.scrollTop ); left += Math.max( docElem.scrollLeft, body.scrollLeft ); } return { top: top, left: left }; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var elem = this[0], doc = elem && elem.ownerDocument; if ( !doc ) { return null; } if ( elem === doc.body ) { return jQuery.offset.bodyOffset( elem ); } return getOffset( elem, doc, doc.documentElement ); }; jQuery.offset = { bodyOffset: function( body ) { var top = body.offsetTop, left = body.offsetLeft; if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) { top += parseFloat( jQuery.css(body, "marginTop") ) || 0; left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; } return { top: top, left: left }; }, setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[0] ) { return null; } var elem = this[0], // Get *real* offsetParent offsetParent = this.offsetParent(), // Get correct offsets offset = this.offset(), parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); // Subtract element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; // Add offsetParent borders parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; // Subtract the two offsets return { top: offset.top - parentOffset.top, left: offset.left - parentOffset.left }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || document.body; while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { offsetParent = offsetParent.offsetParent; } return offsetParent; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : jQuery.support.boxModel && win.document.documentElement[ method ] || win.document.body[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { var clientProp = "client" + name, scrollProp = "scroll" + name, offsetProp = "offset" + name; // innerHeight and innerWidth jQuery.fn[ "inner" + name ] = function() { var elem = this[0]; return elem ? elem.style ? parseFloat( jQuery.css( elem, type, "padding" ) ) : this[ type ]() : null; }; // outerHeight and outerWidth jQuery.fn[ "outer" + name ] = function( margin ) { var elem = this[0]; return elem ? elem.style ? parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) : this[ type ]() : null; }; jQuery.fn[ type ] = function( value ) { return jQuery.access( this, function( elem, type, value ) { var doc, docElemProp, orig, ret; if ( jQuery.isWindow( elem ) ) { // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat doc = elem.document; docElemProp = doc.documentElement[ clientProp ]; return jQuery.support.boxModel && docElemProp || doc.body && doc.body[ clientProp ] || docElemProp; } // Get document width or height if ( elem.nodeType === 9 ) { // Either scroll[Width/Height] or offset[Width/Height], whichever is greater doc = elem.documentElement; // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height] // so we can't use max, as it'll choose the incorrect offset[Width/Height] // instead we use the correct client[Width/Height] // support:IE6 if ( doc[ clientProp ] >= doc[ scrollProp ] ) { return doc[ clientProp ]; } return Math.max( elem.body[ scrollProp ], doc[ scrollProp ], elem.body[ offsetProp ], doc[ offsetProp ] ); } // Get width or height on the element if ( value === undefined ) { orig = jQuery.css( elem, type ); ret = parseFloat( orig ); return jQuery.isNumeric( ret ) ? ret : orig; } // Set the width or height on the element jQuery( elem ).css( type, value ); }, type, value, arguments.length, null ); }; }); // Expose jQuery to the global object window.jQuery = window.$ = jQuery; // Expose jQuery as an AMD module, but only for AMD loaders that // understand the issues with loading multiple versions of jQuery // in a page that all might call define(). The loader will indicate // they have special allowances for multiple jQuery versions by // specifying define.amd.jQuery = true. Register as a named module, // since jQuery can be concatenated with other files that may use define, // but not use 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. if ( typeof define === "function" && define.amd && define.amd.jQuery ) { define( "jquery", [], function () { return jQuery; } ); } })( window ); // JavaScript Document
{ "content_hash": "81adc4512d8651d006ac0ec867405d8a", "timestamp": "", "source": "github", "line_count": 9393, "max_line_length": 193, "avg_line_length": 26.885659533695303, "alnum_prop": 0.6055944277472212, "repo_name": "BlueDress/School", "id": "2d2eaeff09b4b48e03a742f4911bf335fb5f42e9", "size": "252903", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Episerver/CMSTraining/AlloyDemo/Static/js/jquery.js", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "601" }, { "name": "Batchfile", "bytes": "1792" }, { "name": "C#", "bytes": "3240582" }, { "name": "CSS", "bytes": "533784" }, { "name": "HTML", "bytes": "134453" }, { "name": "Java", "bytes": "59647" }, { "name": "JavaScript", "bytes": "78257" }, { "name": "PHP", "bytes": "321319" }, { "name": "PLSQL", "bytes": "470" }, { "name": "PLpgSQL", "bytes": "4109" }, { "name": "SQLPL", "bytes": "3632" } ], "symlink_target": "" }
ActiveRecord::Schema.define(version: 20140810081136) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" create_table "admins", force: true do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" t.datetime "created_at" t.datetime "updated_at" end add_index "admins", ["email"], name: "index_admins_on_email", unique: true, using: :btree add_index "admins", ["reset_password_token"], name: "index_admins_on_reset_password_token", unique: true, using: :btree create_table "categories", force: true do |t| t.string "code" t.string "title" t.datetime "created_at" t.datetime "updated_at" end create_table "indicator_sources", force: true do |t| t.integer "indicator_id" t.string "title" t.integer "year" t.integer "month" t.string "url" t.string "authority" t.datetime "created_at" t.datetime "updated_at" t.string "sub_title" t.boolean "active", default: true, null: false end add_index "indicator_sources", ["indicator_id"], name: "index_indicator_sources_on_indicator_id", using: :btree create_table "indicators", force: true do |t| t.integer "category_id" t.string "code" t.string "title" t.datetime "created_at" t.datetime "updated_at" t.boolean "plus", default: true, null: false end add_index "indicators", ["category_id"], name: "index_indicators_on_category_id", using: :btree create_table "municipalities", force: true do |t| t.string "code" t.string "name" t.datetime "created_at" t.datetime "updated_at" end create_table "open_data", force: true do |t| t.integer "municipality_id" t.integer "indicator_source_id" t.integer "value" t.float "deviation_value" t.text "memo" t.datetime "created_at" t.datetime "updated_at" end add_index "open_data", ["indicator_source_id"], name: "index_open_data_on_indicator_source_id", using: :btree add_index "open_data", ["municipality_id"], name: "index_open_data_on_municipality_id", using: :btree end
{ "content_hash": "69eea95e527132dbabd7c9cd48c36e45", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 121, "avg_line_length": 32.97402597402598, "alnum_prop": 0.6419850334777472, "repo_name": "jwako/docosumo", "id": "12c91cc6924a9f5cb1f3adafa5b72a4fb967ad0a", "size": "3280", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/schema.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "17085" }, { "name": "JavaScript", "bytes": "4368" }, { "name": "Ruby", "bytes": "60478" } ], "symlink_target": "" }
using autofill::AutofillAgent; using autofill::PasswordAutofillAgent; using autofill::PasswordGenerationAgent; using base::ASCIIToUTF16; using base::UserMetricsAction; using blink::WebCache; using blink::WebConsoleMessage; using blink::WebDocument; using blink::WebFrame; using blink::WebLocalFrame; using blink::WebPlugin; using blink::WebPluginParams; using blink::WebSecurityOrigin; using blink::WebSecurityPolicy; using blink::WebString; using blink::WebURL; using blink::WebURLError; using blink::WebURLRequest; using blink::WebURLResponse; using blink::WebVector; using blink::mojom::FetchCacheMode; using content::RenderFrame; using content::RenderThread; using content::WebPluginInfo; using content::WebPluginMimeType; using extensions::Extension; namespace { // Allow PPAPI for Android Runtime for Chromium. (See crbug.com/383937) #if BUILDFLAG(ENABLE_PLUGINS) const char* const kPredefinedAllowedCameraDeviceOrigins[] = { "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", "4EB74897CB187C7633357C2FE832E0AD6A44883A"}; #endif #if BUILDFLAG(ENABLE_PLUGINS) void AppendParams( const std::vector<WebPluginMimeType::Param>& additional_params, WebVector<WebString>* existing_names, WebVector<WebString>* existing_values) { DCHECK(existing_names->size() == existing_values->size()); size_t existing_size = existing_names->size(); size_t total_size = existing_size + additional_params.size(); WebVector<WebString> names(total_size); WebVector<WebString> values(total_size); for (size_t i = 0; i < existing_size; ++i) { names[i] = (*existing_names)[i]; values[i] = (*existing_values)[i]; } for (size_t i = 0; i < additional_params.size(); ++i) { names[existing_size + i] = WebString::FromUTF16(additional_params[i].name); values[existing_size + i] = WebString::FromUTF16(additional_params[i].value); } existing_names->Swap(names); existing_values->Swap(values); } #endif // BUILDFLAG(ENABLE_PLUGINS) bool IsStandaloneContentExtensionProcess() { #if !BUILDFLAG(ENABLE_EXTENSIONS) return false; #else return base::CommandLine::ForCurrentProcess()->HasSwitch( extensions::switches::kExtensionProcess); #endif } std::unique_ptr<base::Unwinder> CreateV8Unwinder(v8::Isolate* isolate) { return std::make_unique<V8Unwinder>(isolate); } // Web Share is conditionally enabled here in chrome/, to avoid it being // made available in other clients of content/ that do not have a Web Share // Mojo implementation (e.g. WebView). void MaybeEnableWebShare() { #if BUILDFLAG(IS_WIN) if (base::win::GetVersion() < base::win::Version::WIN10) { // Web Share API is not functional for non-UWP apps prior to Windows 10. return; } #endif #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) if (base::FeatureList::IsEnabled(features::kWebShare)) #endif #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ BUILDFLAG(IS_ANDROID) blink::WebRuntimeFeatures::EnableWebShare(true); #endif } #if BUILDFLAG(ENABLE_NACL) && BUILDFLAG(ENABLE_EXTENSIONS) && \ BUILDFLAG(IS_CHROMEOS_ASH) bool IsTerminalSystemWebAppNaClPage(GURL url) { GURL::Replacements replacements; replacements.ClearQuery(); replacements.ClearRef(); url = url.ReplaceComponents(replacements); return url == "chrome-untrusted://terminal/html/terminal_ssh.html"; } #endif } // namespace ChromeContentRendererClient::ChromeContentRendererClient() : #if BUILDFLAG(IS_WIN) remote_module_watcher_(nullptr, base::OnTaskRunnerDeleter(nullptr)), #endif main_thread_profiler_( #if BUILDFLAG(IS_CHROMEOS) // The profiler can't start before the sandbox is initialized on // ChromeOS due to ChromeOS's sandbox initialization code's use of // AssertSingleThreaded(). nullptr #else ThreadProfiler::CreateAndStartOnMainThread() #endif ) { #if BUILDFLAG(ENABLE_EXTENSIONS) EnsureExtensionsClientInitialized(); extensions::ExtensionsRendererClient::Set( ChromeExtensionsRendererClient::GetInstance()); #endif #if BUILDFLAG(ENABLE_PLUGINS) for (const char* origin : kPredefinedAllowedCameraDeviceOrigins) allowed_camera_device_origins_.insert(origin); #endif } ChromeContentRendererClient::~ChromeContentRendererClient() {} void ChromeContentRendererClient::RenderThreadStarted() { RenderThread* thread = RenderThread::Get(); main_thread_profiler_->SetAuxUnwinderFactory(base::BindRepeating( &CreateV8Unwinder, base::Unretained(v8::Isolate::GetCurrent()))); // In the case of single process mode, the v8 unwinding will not work. tracing::TracingSamplerProfiler::SetAuxUnwinderFactoryOnMainThread( base::BindRepeating(&CreateV8Unwinder, base::Unretained(v8::Isolate::GetCurrent()))); const bool is_extension = IsStandaloneContentExtensionProcess(); thread->SetRendererProcessType( is_extension ? blink::scheduler::WebRendererProcessType::kExtensionRenderer : blink::scheduler::WebRendererProcessType::kRenderer); if (is_extension) { // The process name was set to "Renderer" in RendererMain(). Update it to // "Extension Renderer" to highlight that it's hosting an extension. base::CurrentProcess::GetInstance().SetProcessType( base::CurrentProcessType::PROCESS_RENDERER_EXTENSION); } #if BUILDFLAG(IS_WIN) mojo::PendingRemote<mojom::ModuleEventSink> module_event_sink; thread->BindHostReceiver(module_event_sink.InitWithNewPipeAndPassReceiver()); remote_module_watcher_ = RemoteModuleWatcher::Create( thread->GetIOTaskRunner(), std::move(module_event_sink)); #endif browser_interface_broker_ = blink::Platform::Current()->GetBrowserInterfaceBroker(); chrome_observer_ = std::make_unique<ChromeRenderThreadObserver>(); web_cache_impl_ = std::make_unique<web_cache::WebCacheImpl>(); #if BUILDFLAG(ENABLE_EXTENSIONS) ChromeExtensionsRendererClient::GetInstance()->RenderThreadStarted(); WebSecurityPolicy::RegisterURLSchemeAsExtension( WebString::FromASCII(extensions::kExtensionScheme)); #endif #if BUILDFLAG(ENABLE_SPELLCHECK) if (!spellcheck_) InitSpellCheck(); #endif subresource_filter_ruleset_dealer_ = std::make_unique<subresource_filter::UnverifiedRulesetDealer>(); phishing_model_setter_ = std::make_unique<safe_browsing::PhishingModelSetterImpl>(); thread->AddObserver(chrome_observer_.get()); thread->AddObserver(subresource_filter_ruleset_dealer_.get()); thread->AddObserver(phishing_model_setter_.get()); blink::WebScriptController::RegisterExtension( extensions_v8::LoadTimesExtension::Get()); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(variations::switches::kEnableBenchmarking)) { blink::WebScriptController::RegisterExtension( extensions_v8::BenchmarkingExtension::Get()); } if (command_line->HasSwitch(switches::kEnableNetBenchmarking)) { blink::WebScriptController::RegisterExtension( extensions_v8::NetBenchmarkingExtension::Get()); } // chrome: is also to be permitted to embeds https:// things and have them // treated as first-party. // See // ChromeContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel WebString chrome_scheme(WebString::FromASCII(content::kChromeUIScheme)); WebSecurityPolicy::RegisterURLSchemeAsFirstPartyWhenTopLevelEmbeddingSecure( chrome_scheme); // chrome-native: is a scheme used for placeholder navigations that allow // UIs to be drawn with platform native widgets instead of HTML. These pages // should not be accessible. No code should be runnable in these pages, // so it should not need to access anything nor should it allow javascript // URLs since it should never be visible to the user. // See also ChromeContentClient::AddAdditionalSchemes that adds it as an // empty document scheme. WebString native_scheme(WebString::FromASCII(chrome::kChromeNativeScheme)); WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(native_scheme); WebSecurityPolicy::RegisterURLSchemeAsNotAllowingJavascriptURLs( native_scheme); // chrome-search: and chrome-distiller: pages should not be accessible by // normal content, and should also be unable to script anything but themselves // (to help limit the damage that a corrupt page could cause). WebString chrome_search_scheme( WebString::FromASCII(chrome::kChromeSearchScheme)); if (base::FeatureList::IsEnabled(features::kIsolatedWebApps)) { // isolated-app: is the scheme used for Isolated Web Apps, which are web // applications packaged in Signed Web Bundles. WebString isolated_app_scheme( WebString::FromASCII(chrome::kIsolatedAppScheme)); // Resources contained in Isolated Web Apps are HTTP-like and safe to expose // to the fetch API. WebSecurityPolicy::RegisterURLSchemeAsSupportingFetchAPI( isolated_app_scheme); WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers( isolated_app_scheme); WebSecurityPolicy::RegisterURLSchemeAsAllowedForReferrer( isolated_app_scheme); } // The Instant process can only display the content but not read it. Other // processes can't display it or read it. if (!command_line->HasSwitch(switches::kInstantProcess)) WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme); WebString dom_distiller_scheme( WebString::FromASCII(dom_distiller::kDomDistillerScheme)); // TODO(nyquist): Add test to ensure this happens when the flag is set. WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(dom_distiller_scheme); #if BUILDFLAG(IS_ANDROID) WebSecurityPolicy::RegisterURLSchemeAsAllowedForReferrer( WebString::FromUTF8(content::kAndroidAppScheme)); #endif // chrome-search: pages should not be accessible by bookmarklets // or javascript: URLs typed in the omnibox. WebSecurityPolicy::RegisterURLSchemeAsNotAllowingJavascriptURLs( chrome_search_scheme); for (auto& scheme : secure_origin_allowlist::GetSchemesBypassingSecureContextCheck()) { WebSecurityPolicy::AddSchemeToSecureContextSafelist( WebString::FromASCII(scheme)); } // This doesn't work in single-process mode. if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kSingleProcess)) { using HeapProfilerController = heap_profiling::HeapProfilerController; // The HeapProfilerController should have been created in // ChromeMainDelegate::PostEarlyInitialization. DCHECK_NE(HeapProfilerController::GetProfilingEnabled(), HeapProfilerController::ProfilingEnabled::kNoController); if (ThreadProfiler::ShouldCollectProfilesForChildProcess() || HeapProfilerController::GetProfilingEnabled() == HeapProfilerController::ProfilingEnabled::kEnabled) { ThreadProfiler::SetMainThreadTaskRunner( base::SingleThreadTaskRunner::GetCurrentDefault()); mojo::PendingRemote<metrics::mojom::CallStackProfileCollector> collector; thread->BindHostReceiver(collector.InitWithNewPipeAndPassReceiver()); metrics::CallStackProfileBuilder:: SetParentProfileCollectorForChildProcess(std::move(collector)); } // This is superfluous in single-process mode and triggers a DCHECK blink::IdentifiabilityStudySettings::SetGlobalProvider( std::make_unique<PrivacyBudgetSettingsProvider>()); } } void ChromeContentRendererClient::ExposeInterfacesToBrowser( mojo::BinderMap* binders) { // NOTE: Do not add binders directly within this method. Instead, modify the // definition of |ExposeChromeRendererInterfacesToBrowser()| to ensure // security review coverage. ExposeChromeRendererInterfacesToBrowser(this, binders); } void ChromeContentRendererClient::RenderFrameCreated( content::RenderFrame* render_frame) { ChromeRenderFrameObserver* render_frame_observer = new ChromeRenderFrameObserver(render_frame, web_cache_impl_.get()); service_manager::BinderRegistry* registry = render_frame_observer->registry(); new prerender::PrerenderRenderFrameObserver(render_frame); bool should_allow_for_content_settings = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kInstantProcess); auto content_settings_delegate = std::make_unique<ChromeContentSettingsAgentDelegate>(render_frame); #if BUILDFLAG(ENABLE_EXTENSIONS) content_settings_delegate->SetExtensionDispatcher( ChromeExtensionsRendererClient::GetInstance()->extension_dispatcher()); #endif content_settings::ContentSettingsAgentImpl* content_settings = new content_settings::ContentSettingsAgentImpl( render_frame, should_allow_for_content_settings, std::move(content_settings_delegate)); if (chrome_observer_.get()) { if (chrome_observer_->content_settings_manager()) { mojo::Remote<content_settings::mojom::ContentSettingsManager> manager; chrome_observer_->content_settings_manager()->Clone( manager.BindNewPipeAndPassReceiver()); content_settings->SetContentSettingsManager(std::move(manager)); } } #if BUILDFLAG(ENABLE_EXTENSIONS) ChromeExtensionsRendererClient::GetInstance()->RenderFrameCreated( render_frame, registry); #endif #if BUILDFLAG(ENABLE_PPAPI) new PepperHelper(render_frame); #endif #if BUILDFLAG(ENABLE_NACL) new nacl::NaClHelper(render_frame); #endif #if BUILDFLAG(SAFE_BROWSING_DB_LOCAL) || BUILDFLAG(SAFE_BROWSING_DB_REMOTE) safe_browsing::ThreatDOMDetails::Create(render_frame, registry); #endif #if BUILDFLAG(ENABLE_PRINTING) new printing::PrintRenderFrameHelper( render_frame, std::make_unique<ChromePrintRenderFrameHelperDelegate>()); #endif #if BUILDFLAG(ENABLE_PAINT_PREVIEW) new paint_preview::PaintPreviewRecorderImpl(render_frame); #endif #if BUILDFLAG(IS_ANDROID) SandboxStatusExtension::Create(render_frame); #endif SyncEncryptionKeysExtension::Create(render_frame); if (render_frame->IsMainFrame()) new webapps::WebPageMetadataAgent(render_frame); const bool search_result_extractor_enabled = render_frame->IsMainFrame() && history_clusters::GetConfig().is_journeys_enabled_no_locale_check && history_clusters::IsApplicationLocaleSupportedByJourneys( RenderThread::Get()->GetLocale()); if (search_result_extractor_enabled) { continuous_search::SearchResultExtractorImpl::Create(render_frame); } new NetErrorHelper(render_frame); #if BUILDFLAG(ENABLE_SUPERVISED_USERS) new SupervisedUserErrorPageControllerDelegateImpl(render_frame); #endif if (!render_frame->IsMainFrame()) { auto* main_frame_no_state_prefetch_helper = prerender::NoStatePrefetchHelper::Get( render_frame->GetMainRenderFrame()); if (main_frame_no_state_prefetch_helper) { // Avoid any race conditions from having the browser tell subframes that // they're no-state prefetching. new prerender::NoStatePrefetchHelper( render_frame, main_frame_no_state_prefetch_helper->histogram_prefix()); } } // Set up a render frame observer to test if this page is a distiller page. new dom_distiller::DistillerJsRenderFrameObserver( render_frame, ISOLATED_WORLD_ID_CHROME_INTERNAL); if (dom_distiller::ShouldStartDistillabilityService()) { // Create DistillabilityAgent to send distillability updates to // DistillabilityDriver in the browser process. new dom_distiller::DistillabilityAgent(render_frame, DCHECK_IS_ON()); } blink::AssociatedInterfaceRegistry* associated_interfaces = render_frame_observer->associated_interfaces(); if (!render_frame->IsInFencedFrameTree() || base::FeatureList::IsEnabled( autofill::features::kAutofillEnableWithinFencedFrame) || base::FeatureList::IsEnabled( password_manager::features:: kEnablePasswordManagerWithinFencedFrame)) { PasswordAutofillAgent* password_autofill_agent = new PasswordAutofillAgent(render_frame, associated_interfaces); PasswordGenerationAgent* password_generation_agent = new PasswordGenerationAgent(render_frame, password_autofill_agent, associated_interfaces); autofill::AutofillAssistantAgent* autofill_assistant_agent = new autofill::AutofillAssistantAgent(render_frame); new AutofillAgent(render_frame, password_autofill_agent, password_generation_agent, autofill_assistant_agent, associated_interfaces); } if (content_capture::features::IsContentCaptureEnabled()) { new content_capture::ContentCaptureSender(render_frame, associated_interfaces); } #if BUILDFLAG(ENABLE_EXTENSIONS) associated_interfaces ->AddInterface<extensions::mojom::MimeHandlerViewContainerManager>( base::BindRepeating( &extensions::MimeHandlerViewContainerManager::BindReceiver, render_frame->GetRoutingID())); #endif // Owned by |render_frame|. page_load_metrics::MetricsRenderFrameObserver* metrics_render_frame_observer = new page_load_metrics::MetricsRenderFrameObserver(render_frame); // There is no render thread, thus no UnverifiedRulesetDealer in // ChromeRenderViewTests. if (subresource_filter_ruleset_dealer_) { // Create AdResourceTracker to tracker ad resource loads at the chrome // layer. auto ad_resource_tracker = std::make_unique<subresource_filter::AdResourceTracker>(); metrics_render_frame_observer->SetAdResourceTracker( ad_resource_tracker.get()); auto* subresource_filter_agent = new subresource_filter::SubresourceFilterAgent( render_frame, subresource_filter_ruleset_dealer_.get(), std::move(ad_resource_tracker)); subresource_filter_agent->Initialize(); } if (translate::IsSubFrameTranslationEnabled()) { new translate::PerFrameTranslateAgent( render_frame, ISOLATED_WORLD_ID_TRANSLATE, associated_interfaces); } #if !BUILDFLAG(IS_ANDROID) base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kInstantProcess) && render_frame->IsMainFrame()) { new SearchBox(render_frame); } #endif // We should create CommerceHintAgent only for a main frame except a fenced // frame that is the main frame as well, so we should check if |render_frame| // is the fenced frame. #if !BUILDFLAG(IS_ANDROID) if (command_line->HasSwitch(commerce::switches::kEnableChromeCart) && #else if (base::FeatureList::IsEnabled(commerce::kCommerceHintAndroid) && #endif // !BUILDFLAG(IS_ANDROID) render_frame->IsMainFrame() && !render_frame->IsInFencedFrameTree()) { new cart::CommerceHintAgent(render_frame); } #if BUILDFLAG(ENABLE_SPELLCHECK) new SpellCheckProvider(render_frame, spellcheck_.get(), this); #if BUILDFLAG(HAS_SPELLCHECK_PANEL) new SpellCheckPanel(render_frame, registry, this); #endif // BUILDFLAG(HAS_SPELLCHECK_PANEL) #endif #if BUILDFLAG(ENABLE_FEED_V2) if (render_frame->IsMainFrame() && base::FeatureList::IsEnabled(feed::kWebFeed)) { new feed::RssLinkReader(render_frame, registry); } #endif #if BUILDFLAG(IS_WIN) if (render_frame->IsMainFrame()) { associated_interfaces ->AddInterface<chrome::mojom::RenderFrameFontFamilyAccessor>( base::BindRepeating(&RenderFrameFontFamilyAccessor::Bind, render_frame)); } #endif } void ChromeContentRendererClient::WebViewCreated( blink::WebView* web_view, bool was_created_by_renderer, const url::Origin* outermost_origin) { new prerender::NoStatePrefetchClient(web_view); #if BUILDFLAG(ENABLE_EXTENSIONS) ChromeExtensionsRendererClient::GetInstance()->WebViewCreated( web_view, outermost_origin); #endif } SkBitmap* ChromeContentRendererClient::GetSadPluginBitmap() { return const_cast<SkBitmap*>(ui::ResourceBundle::GetSharedInstance() .GetImageNamed(IDR_SAD_PLUGIN) .ToSkBitmap()); } SkBitmap* ChromeContentRendererClient::GetSadWebViewBitmap() { return const_cast<SkBitmap*>(ui::ResourceBundle::GetSharedInstance() .GetImageNamed(IDR_SAD_WEBVIEW) .ToSkBitmap()); } bool ChromeContentRendererClient::IsPluginHandledExternally( content::RenderFrame* render_frame, const blink::WebElement& plugin_element, const GURL& original_url, const std::string& mime_type) { #if BUILDFLAG(ENABLE_EXTENSIONS) && BUILDFLAG(ENABLE_PLUGINS) DCHECK(plugin_element.HasHTMLTagName("object") || plugin_element.HasHTMLTagName("embed")); // Blink will next try to load a WebPlugin which would end up in // OverrideCreatePlugin, sending another IPC only to find out the plugin is // not supported. Here it suffices to return false but there should perhaps be // a more unified approach to avoid sending the IPC twice. chrome::mojom::PluginInfoPtr plugin_info = chrome::mojom::PluginInfo::New(); GetPluginInfoHost()->GetPluginInfo( original_url, render_frame->GetWebFrame()->Top()->GetSecurityOrigin(), mime_type, &plugin_info); // TODO(ekaramad): Not continuing here due to a disallowed status should take // us to CreatePlugin. See if more in depths investigation of |status| is // necessary here (see https://crbug.com/965747). For now, returning false // should take us to CreatePlugin after HTMLPlugInElement which is called // through HTMLPlugInElement::LoadPlugin code path. if (plugin_info->status != chrome::mojom::PluginStatus::kAllowed && plugin_info->status != chrome::mojom::PluginStatus::kPlayImportantContent) { // We could get here when a MimeHandlerView is loaded inside a <webview> // which is using permissions API (see WebViewPluginTests). ChromeExtensionsRendererClient::DidBlockMimeHandlerViewForDisallowedPlugin( plugin_element); return false; } #if BUILDFLAG(ENABLE_PDF) if (plugin_info->actual_mime_type == pdf::kInternalPluginMimeType) { // Only actually treat the internal PDF plugin as externally handled if // used within an origin allowed to create the internal PDF plugin; // otherwise, let Blink try to create the in-process PDF plugin. if (IsPdfInternalPluginAllowedOrigin( render_frame->GetWebFrame()->GetSecurityOrigin())) { return true; } } #endif // BUILDFLAG(ENABLE_PDF) return ChromeExtensionsRendererClient::MaybeCreateMimeHandlerView( plugin_element, original_url, plugin_info->actual_mime_type, plugin_info->plugin); #else // !(BUILDFLAG(ENABLE_EXTENSIONS) && BUILDFLAG(ENABLE_PLUGINS)) return false; #endif // BUILDFLAG(ENABLE_EXTENSIONS) && BUILDFLAG(ENABLE_PLUGINS) } v8::Local<v8::Object> ChromeContentRendererClient::GetScriptableObject( const blink::WebElement& plugin_element, v8::Isolate* isolate) { #if BUILDFLAG(ENABLE_EXTENSIONS) return ChromeExtensionsRendererClient::GetInstance()->GetScriptableObject( plugin_element, isolate); #else return v8::Local<v8::Object>(); #endif } bool ChromeContentRendererClient::OverrideCreatePlugin( content::RenderFrame* render_frame, const WebPluginParams& params, WebPlugin** plugin) { std::string orig_mime_type = params.mime_type.Utf8(); #if BUILDFLAG(ENABLE_EXTENSIONS) if (!ChromeExtensionsRendererClient::GetInstance()->OverrideCreatePlugin( render_frame, params)) { return false; } #endif GURL url(params.url); #if BUILDFLAG(ENABLE_PLUGINS) chrome::mojom::PluginInfoPtr plugin_info = chrome::mojom::PluginInfo::New(); GetPluginInfoHost()->GetPluginInfo( url, render_frame->GetWebFrame()->Top()->GetSecurityOrigin(), orig_mime_type, &plugin_info); *plugin = CreatePlugin(render_frame, params, *plugin_info); #else // !BUILDFLAG(ENABLE_PLUGINS) PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url); if (orig_mime_type == kPDFMimeType) { ReportPDFLoadStatus( PDFLoadStatus::kShowedDisabledPluginPlaceholderForEmbeddedPdf); PDFPluginPlaceholder* placeholder = PDFPluginPlaceholder::CreatePDFPlaceholder(render_frame, params); *plugin = placeholder->plugin(); return true; } auto* placeholder = NonLoadablePluginPlaceholder::CreateNotSupportedPlugin( render_frame, params); *plugin = placeholder->plugin(); #endif // BUILDFLAG(ENABLE_PLUGINS) return true; } #if BUILDFLAG(ENABLE_PLUGINS) WebPlugin* ChromeContentRendererClient::CreatePluginReplacement( content::RenderFrame* render_frame, const base::FilePath& plugin_path) { auto* placeholder = NonLoadablePluginPlaceholder::CreateErrorPlugin( render_frame, plugin_path); return placeholder->plugin(); } #endif // BUILDFLAG(ENABLE_PLUGINS) bool ChromeContentRendererClient::DeferMediaLoad( content::RenderFrame* render_frame, bool has_played_media_before, base::OnceClosure closure) { return prerender::DeferMediaLoad(render_frame, has_played_media_before, std::move(closure)); } #if BUILDFLAG(ENABLE_PLUGINS) mojo::AssociatedRemote<chrome::mojom::PluginInfoHost>& ChromeContentRendererClient::GetPluginInfoHost() { struct PluginInfoHostHolder { PluginInfoHostHolder() { RenderThread::Get()->GetChannel()->GetRemoteAssociatedInterface( &plugin_info_host); } ~PluginInfoHostHolder() {} mojo::AssociatedRemote<chrome::mojom::PluginInfoHost> plugin_info_host; }; static base::NoDestructor<PluginInfoHostHolder> holder; return holder->plugin_info_host; } // static WebPlugin* ChromeContentRendererClient::CreatePlugin( content::RenderFrame* render_frame, const WebPluginParams& original_params, const chrome::mojom::PluginInfo& plugin_info) { const WebPluginInfo& info = plugin_info.plugin; const std::string& actual_mime_type = plugin_info.actual_mime_type; const std::u16string& group_name = plugin_info.group_name; const std::string& identifier = plugin_info.group_identifier; chrome::mojom::PluginStatus status = plugin_info.status; GURL url(original_params.url); std::string orig_mime_type = original_params.mime_type.Utf8(); ChromePluginPlaceholder* placeholder = nullptr; // If the browser plugin is to be enabled, this should be handled by the // renderer, so the code won't reach here due to the early exit in // OverrideCreatePlugin. if (status == chrome::mojom::PluginStatus::kNotFound || orig_mime_type == content::kBrowserPluginMimeType) { // Flash has been thoroughly removed in M88+, so we need to have a special // case here to display a deprecated message instead of a generic // plugin-missing message. if (orig_mime_type == "application/x-shockwave-flash" || orig_mime_type == "application/futuresplash") { return NonLoadablePluginPlaceholder::CreateFlashDeprecatedPlaceholder( render_frame, original_params) ->plugin(); } else { PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url); placeholder = ChromePluginPlaceholder::CreateLoadableMissingPlugin( render_frame, original_params); } } else { // TODO(bauerb): This should be in content/. WebPluginParams params(original_params); for (const auto& mime_type : info.mime_types) { if (mime_type.mime_type == actual_mime_type) { AppendParams(mime_type.additional_params, &params.attribute_names, &params.attribute_values); break; } } if (params.mime_type.IsNull() && (actual_mime_type.size() > 0)) { // Webkit might say that mime type is null while we already know the // actual mime type via ChromeViewHostMsg_GetPluginInfo. In that case // we should use what we know since WebpluginDelegateProxy does some // specific initializations based on this information. params.mime_type = WebString::FromUTF8(actual_mime_type); } auto* content_settings_agent = content_settings::ContentSettingsAgentImpl::Get(render_frame); auto* content_settings_agent_delegate = ChromeContentSettingsAgentDelegate::Get(render_frame); const ContentSettingsType content_type = ContentSettingsType::JAVASCRIPT; if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; } auto create_blocked_plugin = [&render_frame, &params, &info, &identifier, &group_name](int template_id, const std::u16string& message) { return ChromePluginPlaceholder::CreateBlockedPlugin( render_frame, params, info, identifier, group_name, template_id, message); }; WebLocalFrame* frame = render_frame->GetWebFrame(); switch (status) { case chrome::mojom::PluginStatus::kNotFound: { NOTREACHED(); break; } case chrome::mojom::PluginStatus::kAllowed: case chrome::mojom::PluginStatus::kPlayImportantContent: { #if BUILDFLAG(ENABLE_NACL) && BUILDFLAG(ENABLE_EXTENSIONS) const bool is_nacl_plugin = info.name == ASCIIToUTF16(nacl::kNaClPluginName); const bool is_nacl_mime_type = actual_mime_type == nacl::kNaClPluginMimeType; const bool is_pnacl_mime_type = actual_mime_type == nacl::kPnaclPluginMimeType; if (is_nacl_plugin || is_nacl_mime_type || is_pnacl_mime_type) { bool has_enable_nacl_switch = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableNaCl); bool is_nacl_unrestricted = has_enable_nacl_switch || is_pnacl_mime_type; GURL manifest_url; GURL app_url; if (is_nacl_mime_type || is_pnacl_mime_type) { // Normal NaCl/PNaCl embed. The app URL is the page URL. manifest_url = url; app_url = frame->GetDocument().Url(); } else { // NaCl is being invoked as a content handler. Look up the NaCl // module using the MIME type. The app URL is the manifest URL. manifest_url = GetNaClContentHandlerURL(actual_mime_type, info); app_url = manifest_url; } bool is_module_allowed = false; const Extension* extension = extensions::RendererExtensionRegistry::Get() ->GetExtensionOrAppByURL(manifest_url); if (extension) { is_module_allowed = IsNativeNaClAllowed(app_url, is_nacl_unrestricted, extension); #if BUILDFLAG(IS_CHROMEOS_ASH) // Allow Terminal System App to load the SSH extension NaCl module. } else if (IsTerminalSystemWebAppNaClPage(app_url)) { is_module_allowed = true; #endif } else { WebDocument document = frame->GetDocument(); is_module_allowed = has_enable_nacl_switch || (is_pnacl_mime_type && blink::WebOriginTrials::isTrialEnabled(&document, "PNaCl")); } if (!is_module_allowed) { WebString error_message; if (is_nacl_mime_type) { error_message = "Only unpacked extensions and apps installed from the Chrome " "Web Store can load NaCl modules without enabling Native " "Client in about:flags."; } else if (is_pnacl_mime_type) { error_message = "PNaCl modules can only be used on the open web (non-app/" "extension) when the PNaCl Origin Trial is enabled"; } frame->AddMessageToConsole(WebConsoleMessage( blink::mojom::ConsoleMessageLevel::kError, error_message)); placeholder = create_blocked_plugin( IDR_BLOCKED_PLUGIN_HTML, #if BUILDFLAG(IS_CHROMEOS_ASH) l10n_util::GetStringUTF16(IDS_NACL_PLUGIN_BLOCKED)); #else l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); #endif break; } ReportNaClAppType(is_pnacl_mime_type, extension, extension ? extension->is_hosted_app() : false); } #endif // BUILDFLAG(ENABLE_NACL) && BUILDFLAG(ENABLE_EXTENSIONS) if (GURL(frame->GetDocument().Url()).host_piece() == extension_misc::kPdfExtensionId) { if (!base::FeatureList::IsEnabled(features::kWebUIDarkMode)) { auto* web_view = render_frame->GetWebView(); if (web_view) { web_view->GetSettings()->SetPreferredColorScheme( blink::mojom::PreferredColorScheme::kLight); } } } else if (info.name == ASCIIToUTF16(ChromeContentClient::kPDFExtensionPluginName)) { // Report PDF load metrics. Since the PDF plugin is comprised of an // extension that loads a second plugin, avoid double counting by // ignoring the creation of the second plugin. bool is_main_frame_plugin_document = render_frame->IsMainFrame() && render_frame->GetWebFrame()->GetDocument().IsPluginDocument(); ReportPDFLoadStatus( is_main_frame_plugin_document ? PDFLoadStatus::kLoadedFullPagePdfWithPdfium : PDFLoadStatus::kLoadedEmbeddedPdfWithPdfium); } // Delay loading plugins if no-state prefetching. // TODO(mmenke): In the case of NoStatePrefetch, feed into // ChromeContentRendererClient::CreatePlugin instead, to // reduce the chance of future regressions. bool is_no_state_prefetching = prerender::NoStatePrefetchHelper::IsPrefetching(render_frame); if (is_no_state_prefetching) { placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( render_frame, params, info, identifier, group_name, IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->set_blocked_for_prerendering(is_no_state_prefetching); placeholder->AllowLoading(); break; } #if BUILDFLAG(ENABLE_PDF) if (info.name == ASCIIToUTF16(ChromeContentClient::kPDFInternalPluginName)) { return pdf::CreateInternalPlugin( std::move(params), render_frame, std::make_unique<ChromePdfInternalPluginDelegate>()); } #endif // BUILDFLAG(ENABLE_PDF) return render_frame->CreatePlugin(info, params); } case chrome::mojom::PluginStatus::kDisabled: { PluginUMAReporter::GetInstance()->ReportPluginDisabled(orig_mime_type, url); if (info.name == ASCIIToUTF16(ChromeContentClient::kPDFExtensionPluginName)) { ReportPDFLoadStatus( PDFLoadStatus::kShowedDisabledPluginPlaceholderForEmbeddedPdf); return PDFPluginPlaceholder::CreatePDFPlaceholder(render_frame, params) ->plugin(); } placeholder = create_blocked_plugin( IDR_DISABLED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_DISABLED, group_name)); break; } case chrome::mojom::PluginStatus::kUnauthorized: { placeholder = create_blocked_plugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_NOT_AUTHORIZED, group_name)); placeholder->AllowLoading(); mojo::AssociatedRemote<chrome::mojom::PluginAuthHost> plugin_auth_host; render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); content_settings_agent->DidBlockContentType(content_type); break; } case chrome::mojom::PluginStatus::kBlocked: { placeholder = create_blocked_plugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); content_settings_agent->DidBlockContentType(content_type); break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { placeholder = create_blocked_plugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_BY_POLICY, group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); content_settings_agent->DidBlockContentType(content_type); break; } } } placeholder->SetStatus(status); return placeholder->plugin(); } #endif // BUILDFLAG(ENABLE_PLUGINS) // For NaCl content handling plugins, the NaCl manifest is stored in an // additonal 'nacl' param associated with the MIME type. // static GURL ChromeContentRendererClient::GetNaClContentHandlerURL( const std::string& actual_mime_type, const content::WebPluginInfo& plugin) { // Look for the manifest URL among the MIME type's additonal parameters. for (const auto& mime_type : plugin.mime_types) { if (mime_type.mime_type == actual_mime_type) { for (const auto& p : mime_type.additional_params) { if (p.name == u"nacl") return GURL(p.value); } break; } } return GURL(); } void ChromeContentRendererClient::GetInterface( const std::string& interface_name, mojo::ScopedMessagePipeHandle interface_pipe) { // TODO(crbug.com/977637): Get rid of the use of this implementation of // |service_manager::LocalInterfaceProvider|. This was done only to avoid // churning spellcheck code while eliminting the "chrome" and // "chrome_renderer" services. Spellcheck is (and should remain) the only // consumer of this implementation. RenderThread::Get()->BindHostReceiver( mojo::GenericPendingReceiver(interface_name, std::move(interface_pipe))); } #if BUILDFLAG(ENABLE_NACL) // static bool ChromeContentRendererClient::IsNativeNaClAllowed( const GURL& app_url, bool is_nacl_unrestricted, const Extension* extension) { bool is_invoked_by_webstore_installed_extension = false; bool is_extension_unrestricted = false; bool is_extension_force_installed = false; #if BUILDFLAG(ENABLE_EXTENSIONS) bool is_extension_from_webstore = extension && extension->from_webstore(); bool is_invoked_by_extension = app_url.SchemeIs(extensions::kExtensionScheme); bool is_invoked_by_hosted_app = extension && extension->is_hosted_app() && extension->web_extent().MatchesURL(app_url); is_invoked_by_webstore_installed_extension = is_extension_from_webstore && (is_invoked_by_extension || is_invoked_by_hosted_app); // Allow built-in extensions and developer mode extensions. is_extension_unrestricted = extension && (extensions::Manifest::IsUnpackedLocation(extension->location()) || extensions::Manifest::IsComponentLocation(extension->location())); // Allow extensions force installed by admin policy. is_extension_force_installed = extension && extensions::Manifest::IsPolicyLocation(extension->location()); #endif // BUILDFLAG(ENABLE_EXTENSIONS) // Allow NaCl under any of the following circumstances: // 1) An extension is loaded unpacked or built-in (component) to Chrome. // 2) An extension is force installed by policy. // 3) An extension is installed from the webstore, and invoked in that // context (hosted app URL or chrome-extension:// scheme). // 4) --enable-nacl is set. bool is_nacl_allowed_by_location = is_extension_unrestricted || is_extension_force_installed || is_invoked_by_webstore_installed_extension; bool is_nacl_allowed = is_nacl_allowed_by_location || is_nacl_unrestricted; return is_nacl_allowed; } // static void ChromeContentRendererClient::ReportNaClAppType(bool is_pnacl, bool is_extension_or_app, bool is_hosted_app) { // These values are persisted to logs. Entries should not be renumbered and // numeric values should never be reused. enum class NaClAppType { kPNaClOpenWeb = 0, kPNaClHostedApp = 1, kPNaClPackagedApp = 2, kNaClOpenWeb = 3, kNaClHostedApp = 4, kNaClPackagedApp = 5, kMaxValue = kNaClPackagedApp }; // If it's not an extension/app, it can't be hosted. DCHECK(!is_hosted_app || is_extension_or_app); // Not all of the remaining combinations are allowed by default (e.g. // kNaClOpenWeb) but they can be used with the --enable-nacl flag. NaClAppType app_type = is_pnacl ? NaClAppType::kPNaClOpenWeb : NaClAppType::kNaClOpenWeb; if (is_extension_or_app) { if (is_pnacl) { app_type = is_hosted_app ? NaClAppType::kPNaClHostedApp : NaClAppType::kPNaClPackagedApp; } else { app_type = is_hosted_app ? NaClAppType::kNaClHostedApp : NaClAppType::kNaClPackagedApp; } } base::UmaHistogramEnumeration("NaCl.AppType", app_type); } #endif // BUILDFLAG(ENABLE_NACL) void ChromeContentRendererClient::PrepareErrorPage( content::RenderFrame* render_frame, const blink::WebURLError& web_error, const std::string& http_method, content::mojom::AlternativeErrorPageOverrideInfoPtr alternative_error_page_info, std::string* error_html) { NetErrorHelper::Get(render_frame) ->PrepareErrorPage( error_page::Error::NetError( web_error.url(), web_error.reason(), web_error.extended_reason(), web_error.resolve_error_info(), web_error.has_copy_in_cache()), http_method == "POST", std::move(alternative_error_page_info), error_html); #if BUILDFLAG(ENABLE_SUPERVISED_USERS) SupervisedUserErrorPageControllerDelegateImpl::Get(render_frame) ->PrepareForErrorPage(); #endif } void ChromeContentRendererClient::PrepareErrorPageForHttpStatusError( content::RenderFrame* render_frame, const blink::WebURLError& error, const std::string& http_method, int http_status, content::mojom::AlternativeErrorPageOverrideInfoPtr alternative_error_page_info, std::string* error_html) { NetErrorHelper::Get(render_frame) ->PrepareErrorPage(error_page::Error::HttpError(error.url(), http_status), http_method == "POST", std::move(alternative_error_page_info), error_html); } void ChromeContentRendererClient::PostSandboxInitialized() { #if BUILDFLAG(IS_CHROMEOS) DCHECK(!main_thread_profiler_); main_thread_profiler_ = ThreadProfiler::CreateAndStartOnMainThread(); #endif // BUILDFLAG(IS_CHROMEOS) } void ChromeContentRendererClient::PostIOThreadCreated( base::SingleThreadTaskRunner* io_thread_task_runner) { io_thread_task_runner->PostTask( FROM_HERE, base::BindOnce(&ThreadProfiler::StartOnChildThread, metrics::CallStackProfileParams::Thread::kIo)); } void ChromeContentRendererClient::PostCompositorThreadCreated( base::SingleThreadTaskRunner* compositor_thread_task_runner) { compositor_thread_task_runner->PostTask( FROM_HERE, base::BindOnce(&ThreadProfiler::StartOnChildThread, metrics::CallStackProfileParams::Thread::kCompositor)); // Enable stack sampling for tracing. // We pass in CreateCoreUnwindersFactory here since it lives in the chrome/ // layer while TracingSamplerProfiler is outside of chrome/. compositor_thread_task_runner->PostTask( FROM_HERE, base::BindOnce(&tracing::TracingSamplerProfiler:: CreateOnChildThreadWithCustomUnwinders, base::BindRepeating(&CreateCoreUnwindersFactory))); } bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { return !IsStandaloneContentExtensionProcess(); } bool ChromeContentRendererClient::AllowPopup() { #if BUILDFLAG(ENABLE_EXTENSIONS) return ChromeExtensionsRendererClient::GetInstance()->AllowPopup(); #else return false; #endif } blink::ProtocolHandlerSecurityLevel ChromeContentRendererClient::GetProtocolHandlerSecurityLevel() { #if BUILDFLAG(ENABLE_EXTENSIONS) return ChromeExtensionsRendererClient::GetInstance() ->GetProtocolHandlerSecurityLevel(); #else return blink::ProtocolHandlerSecurityLevel::kStrict; #endif } void ChromeContentRendererClient::WillSendRequest( WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, const net::SiteForCookies& site_for_cookies, const url::Origin* initiator_origin, GURL* new_url) { #if BUILDFLAG(ENABLE_EXTENSIONS) // Check whether the request should be allowed. If not allowed, we reset the // URL to something invalid to prevent the request and cause an error. ChromeExtensionsRendererClient::GetInstance()->WillSendRequest( frame, transition_type, url, site_for_cookies, initiator_origin, new_url); if (!new_url->is_empty()) return; #endif if (!url.ProtocolIs(chrome::kChromeSearchScheme)) return; #if !BUILDFLAG(IS_ANDROID) SearchBox* search_box = SearchBox::Get(content::RenderFrame::FromWebFrame(frame->LocalRoot())); if (search_box) { // Note: this GURL copy could be avoided if host() were added to WebURL. GURL gurl(url); if (gurl.host_piece() == chrome::kChromeUIFaviconHost) search_box->GenerateImageURLFromTransientURL(url, new_url); } #endif // !BUILDFLAG(IS_ANDROID) } bool ChromeContentRendererClient::IsPrefetchOnly( content::RenderFrame* render_frame) { return prerender::NoStatePrefetchHelper::IsPrefetching(render_frame); } uint64_t ChromeContentRendererClient::VisitedLinkHash(const char* canonical_url, size_t length) { return chrome_observer_->visited_link_reader()->ComputeURLFingerprint( canonical_url, length); } bool ChromeContentRendererClient::IsLinkVisited(uint64_t link_hash) { return chrome_observer_->visited_link_reader()->IsVisited(link_hash); } std::unique_ptr<blink::WebPrescientNetworking> ChromeContentRendererClient::CreatePrescientNetworking( content::RenderFrame* render_frame) { return std::make_unique<network_hints::WebPrescientNetworkingImpl>( render_frame); } bool ChromeContentRendererClient::IsExternalPepperPlugin( const std::string& module_name) { // TODO(bbudge) remove this when the trusted NaCl plugin has been removed. // We must defer certain plugin events for NaCl instances since we switch // from the in-process to the out-of-process proxy after instantiating them. return module_name == "Native Client"; } bool ChromeContentRendererClient::IsOriginIsolatedPepperPlugin( const base::FilePath& plugin_path) { // Hosting plugins in-process is inherently incompatible with attempting to // process-isolate plugins from different origins. auto* cmdline = base::CommandLine::ForCurrentProcess(); if (cmdline->HasSwitch(switches::kPpapiInProcess)) { // The kPpapiInProcess switch should only be used by tests. In particular, // we expect that the PDF plugin should always be isolated in the product // (and that the switch won't interfere with PDF isolation). CHECK_NE(ChromeContentClient::kPDFPluginPath, plugin_path.value()); return false; } #if BUILDFLAG(ENABLE_NACL) // Don't isolate the NaCl plugin (preserving legacy behavior). if (plugin_path.value() == nacl::kInternalNaClPluginFileName) return false; #endif // Isolate all the other plugins (including the PDF plugin + test plugins). return true; } #if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS) bool ChromeContentRendererClient::IsExtensionOrSharedModuleAllowed( const GURL& url, const std::set<std::string>& allowlist) { const extensions::ExtensionSet* extension_set = extensions::RendererExtensionRegistry::Get()->GetMainThreadExtensionSet(); return ::IsExtensionOrSharedModuleAllowed(url, extension_set, allowlist); } #endif #if BUILDFLAG(ENABLE_SPELLCHECK) void ChromeContentRendererClient::InitSpellCheck() { spellcheck_ = std::make_unique<SpellCheck>(this); } #endif ChromeRenderThreadObserver* ChromeContentRendererClient::GetChromeObserver() const { return chrome_observer_.get(); } web_cache::WebCacheImpl* ChromeContentRendererClient::GetWebCache() { return web_cache_impl_.get(); } chrome::WebRtcLoggingAgentImpl* ChromeContentRendererClient::GetWebRtcLoggingAgent() { if (!webrtc_logging_agent_impl_) { webrtc_logging_agent_impl_ = std::make_unique<chrome::WebRtcLoggingAgentImpl>(); } return webrtc_logging_agent_impl_.get(); } #if BUILDFLAG(ENABLE_SPELLCHECK) SpellCheck* ChromeContentRendererClient::GetSpellCheck() { return spellcheck_.get(); } #endif // BUILDFLAG(ENABLE_SPELLCHECK) std::unique_ptr<blink::WebSocketHandshakeThrottleProvider> ChromeContentRendererClient::CreateWebSocketHandshakeThrottleProvider() { return std::make_unique<WebSocketHandshakeThrottleProviderImpl>( browser_interface_broker_.get()); } void ChromeContentRendererClient::GetSupportedKeySystems( media::GetSupportedKeySystemsCB cb) { GetChromeKeySystems(std::move(cb)); } bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource( const std::u16string& source) { #if BUILDFLAG(ENABLE_EXTENSIONS) return extensions::IsSourceFromAnExtension(source); #else return false; #endif } std::unique_ptr<blink::WebContentSettingsClient> ChromeContentRendererClient::CreateWorkerContentSettingsClient( content::RenderFrame* render_frame) { return std::make_unique<WorkerContentSettingsClient>(render_frame); } #if BUILDFLAG(ENABLE_SPEECH_SERVICE) std::unique_ptr<media::SpeechRecognitionClient> ChromeContentRendererClient::CreateSpeechRecognitionClient( content::RenderFrame* render_frame, media::SpeechRecognitionClient::OnReadyCallback callback) { return std::make_unique<ChromeSpeechRecognitionClient>(render_frame, std::move(callback)); } #endif // BUILDFLAG(ENABLE_SPEECH_SERVICE) bool ChromeContentRendererClient::IsPluginAllowedToUseCameraDeviceAPI( const GURL& url) { #if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(ENABLE_PPAPI) if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnablePepperTesting)) return true; #endif // BUILDFLAG(ENABLE_PPAPI) if (IsExtensionOrSharedModuleAllowed(url, allowed_camera_device_origins_)) return true; #endif return false; } void ChromeContentRendererClient::RunScriptsAtDocumentStart( content::RenderFrame* render_frame) { #if BUILDFLAG(ENABLE_EXTENSIONS) ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentStart( render_frame); // |render_frame| might be dead by now. #endif } void ChromeContentRendererClient::RunScriptsAtDocumentEnd( content::RenderFrame* render_frame) { #if BUILDFLAG(ENABLE_EXTENSIONS) ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( render_frame); // |render_frame| might be dead by now. #endif } void ChromeContentRendererClient::RunScriptsAtDocumentIdle( content::RenderFrame* render_frame) { #if BUILDFLAG(ENABLE_EXTENSIONS) ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentIdle( render_frame); // |render_frame| might be dead by now. #endif } void ChromeContentRendererClient:: SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() { // The performance manager service interfaces are provided by the chrome // embedder only. blink::WebRuntimeFeatures::EnablePerformanceManagerInstrumentation(true); MaybeEnableWebShare(); if (base::FeatureList::IsEnabled(subresource_filter::kAdTagging)) blink::WebRuntimeFeatures::EnableAdTagging(true); // Prerender2 should be enabled for supporting the basic infrastructure on the // browser side. // One of the features of kOmniboxTriggerForPrerender2 and // kSupportSearchSuggestionForPrerender2 should be enabled before telling the // blink side that chrome is enrolling the experinment. if (base::FeatureList::IsEnabled(features::kOmniboxTriggerForPrerender2) || base::FeatureList::IsEnabled( features::kSupportSearchSuggestionForPrerender2)) { blink::WebRuntimeFeatures::EnablePrerender2RelatedFeatures(true); } #if BUILDFLAG(ENABLE_EXTENSIONS) // WebHID and WebUSB on service workers is only available in extensions. if (IsStandaloneContentExtensionProcess()) { if (base::FeatureList::IsEnabled( features::kEnableWebUsbOnExtensionServiceWorker)) { blink::WebRuntimeFeatures::EnableWebUSBOnServiceWorkers(true); } #if !BUILDFLAG(IS_ANDROID) if (base::FeatureList::IsEnabled( features::kEnableWebHidOnExtensionServiceWorker)) { blink::WebRuntimeFeatures::EnableWebHIDOnServiceWorkers(true); } #endif // !BUILDFLAG(IS_ANDROID) } #endif // BUILDFLAG(ENABLE_EXTENSIONS) } bool ChromeContentRendererClient::AllowScriptExtensionForServiceWorker( const url::Origin& script_origin) { #if BUILDFLAG(ENABLE_EXTENSIONS) return script_origin.scheme() == extensions::kExtensionScheme; #else return false; #endif } void ChromeContentRendererClient:: WillInitializeServiceWorkerContextOnWorkerThread() { // This is called on the service worker thread. ThreadProfiler::StartOnChildThread( metrics::CallStackProfileParams::Thread::kServiceWorker); } void ChromeContentRendererClient:: DidInitializeServiceWorkerContextOnWorkerThread( blink::WebServiceWorkerContextProxy* context_proxy, const GURL& service_worker_scope, const GURL& script_url) { #if BUILDFLAG(ENABLE_EXTENSIONS) ChromeExtensionsRendererClient::GetInstance() ->extension_dispatcher() ->DidInitializeServiceWorkerContextOnWorkerThread( context_proxy, service_worker_scope, script_url); #endif } void ChromeContentRendererClient::WillEvaluateServiceWorkerOnWorkerThread( blink::WebServiceWorkerContextProxy* context_proxy, v8::Local<v8::Context> v8_context, int64_t service_worker_version_id, const GURL& service_worker_scope, const GURL& script_url) { #if BUILDFLAG(ENABLE_EXTENSIONS) ChromeExtensionsRendererClient::GetInstance() ->extension_dispatcher() ->WillEvaluateServiceWorkerOnWorkerThread( context_proxy, v8_context, service_worker_version_id, service_worker_scope, script_url); #endif } void ChromeContentRendererClient::DidStartServiceWorkerContextOnWorkerThread( int64_t service_worker_version_id, const GURL& service_worker_scope, const GURL& script_url) { #if BUILDFLAG(ENABLE_EXTENSIONS) ChromeExtensionsRendererClient::GetInstance() ->extension_dispatcher() ->DidStartServiceWorkerContextOnWorkerThread( service_worker_version_id, service_worker_scope, script_url); #endif } void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( v8::Local<v8::Context> context, int64_t service_worker_version_id, const GURL& service_worker_scope, const GURL& script_url) { #if BUILDFLAG(ENABLE_EXTENSIONS) ChromeExtensionsRendererClient::GetInstance() ->extension_dispatcher() ->WillDestroyServiceWorkerContextOnWorkerThread( context, service_worker_version_id, service_worker_scope, script_url); #endif } // If we're in an extension, there is no need disabling multiple routes as // chrome.system.network.getNetworkInterfaces provides the same // information. Also, the enforcement of sending and binding UDP is already done // by chrome extension permission model. bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { return !IsStandaloneContentExtensionProcess(); } GURL ChromeContentRendererClient::OverrideFlashEmbedWithHTML(const GURL& url) { if (!url.is_valid()) return GURL(); return FlashEmbedRewrite::RewriteFlashEmbedURL(url); } std::unique_ptr<blink::URLLoaderThrottleProvider> ChromeContentRendererClient::CreateURLLoaderThrottleProvider( blink::URLLoaderThrottleProviderType provider_type) { return std::make_unique<URLLoaderThrottleProviderImpl>( browser_interface_broker_.get(), provider_type, this); } blink::WebFrame* ChromeContentRendererClient::FindFrame( blink::WebLocalFrame* relative_to_frame, const std::string& name) { #if BUILDFLAG(ENABLE_EXTENSIONS) return ChromeExtensionsRendererClient::FindFrame(relative_to_frame, name); #else return nullptr; #endif // BUILDFLAG(ENABLE_EXTENSIONS) } bool ChromeContentRendererClient::IsSafeRedirectTarget(const GURL& from_url, const GURL& to_url) { #if BUILDFLAG(ENABLE_EXTENSIONS) if (to_url.SchemeIs(extensions::kExtensionScheme)) { const extensions::Extension* extension = extensions::RendererExtensionRegistry::Get()->GetByID(to_url.host()); if (!extension) return false; // TODO(solomonkinard): Use initiator_origin and add tests. if (extensions::WebAccessibleResourcesInfo::IsResourceWebAccessible( extension, to_url.path(), absl::optional<url::Origin>())) { return true; } return extension->guid() == from_url.host(); } #endif // BUILDFLAG(ENABLE_EXTENSIONS) return true; } void ChromeContentRendererClient::DidSetUserAgent( const std::string& user_agent) { #if BUILDFLAG(ENABLE_PRINTING) printing::SetAgent(user_agent); #endif } void ChromeContentRendererClient::AppendContentSecurityPolicy( const blink::WebURL& url, blink::WebVector<blink::WebContentSecurityPolicyHeader>* csp) { #if BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(ENABLE_PDF) // Don't apply default CSP to PDF renderers. // TODO(crbug.com/1252096): Lock down the CSP once style and script are no // longer injected inline by `pdf::PluginResponseWriter`. That class may be a // better place to define such CSP, or we may continue doing so here. if (pdf::IsPdfRenderer()) return; #endif // BUILDFLAG(ENABLE_PDF) DCHECK(csp); GURL gurl(url); const extensions::Extension* extension = extensions::RendererExtensionRegistry::Get()->GetExtensionOrAppByURL( gurl); if (!extension) return; // Append a minimum CSP to ensure the extension can't relax the default // applied CSP through means like Service Worker. const std::string* default_csp = extensions::CSPInfo::GetMinimumCSPToAppend(*extension, gurl.path()); if (!default_csp) return; csp->push_back({blink::WebString::FromUTF8(*default_csp), network::mojom::ContentSecurityPolicyType::kEnforce, network::mojom::ContentSecurityPolicySource::kHTTP}); #endif }
{ "content_hash": "44826864fd9d970ebbc2a563e5d51756", "timestamp": "", "source": "github", "line_count": 1529, "max_line_length": 80, "avg_line_length": 39.07194244604317, "alnum_prop": 0.7080229658023802, "repo_name": "chromium/chromium", "id": "abbcd33bbf7dfc29f2563508e368233efda86b24", "size": "71919", "binary": false, "copies": "5", "ref": "refs/heads/main", "path": "chrome/renderer/chrome_content_renderer_client.cc", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
package replication import ( "context" "fmt" "testing" "time" repctlmodel "github.com/goharbor/harbor/src/controller/replication/model" "github.com/goharbor/harbor/src/jobservice/job" "github.com/goharbor/harbor/src/lib" "github.com/goharbor/harbor/src/pkg/task" "github.com/goharbor/harbor/src/pkg/task/dao" "github.com/goharbor/harbor/src/testing/lib/orm" "github.com/goharbor/harbor/src/testing/mock" testingreg "github.com/goharbor/harbor/src/testing/pkg/reg" testingrep "github.com/goharbor/harbor/src/testing/pkg/replication" testingscheduler "github.com/goharbor/harbor/src/testing/pkg/scheduler" testingTask "github.com/goharbor/harbor/src/testing/pkg/task" "github.com/stretchr/testify/suite" ) type replicationTestSuite struct { suite.Suite ctl *controller repMgr *testingrep.Manager regMgr *testingreg.Manager execMgr *testingTask.ExecutionManager taskMgr *testingTask.Manager scheduler *testingscheduler.Scheduler flowCtl *flowController ormCreator *orm.Creator } func (r *replicationTestSuite) SetupTest() { r.repMgr = &testingrep.Manager{} r.regMgr = &testingreg.Manager{} r.execMgr = &testingTask.ExecutionManager{} r.taskMgr = &testingTask.Manager{} r.scheduler = &testingscheduler.Scheduler{} r.flowCtl = &flowController{} r.ormCreator = &orm.Creator{} r.ctl = &controller{ repMgr: r.repMgr, regMgr: r.regMgr, scheduler: r.scheduler, execMgr: r.execMgr, taskMgr: r.taskMgr, flowCtl: r.flowCtl, ormCreator: r.ormCreator, wp: lib.NewWorkerPool(1024), } } func (r *replicationTestSuite) TestStart() { // policy is disabled id, err := r.ctl.Start(context.Background(), &repctlmodel.Policy{Enabled: false}, nil, task.ExecutionTriggerManual) r.Require().NotNil(err) // got error when running the replication flow r.execMgr.On("Create", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(int64(1), nil) r.execMgr.On("Get", mock.Anything, mock.Anything).Return(&task.Execution{}, nil) r.execMgr.On("StopAndWait", mock.Anything, mock.Anything, mock.Anything).Return(nil) r.execMgr.On("MarkError", mock.Anything, mock.Anything, mock.Anything).Return(nil) r.flowCtl.On("Start", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(fmt.Errorf("error")) r.ormCreator.On("Create").Return(nil) id, err = r.ctl.Start(context.Background(), &repctlmodel.Policy{Enabled: true}, nil, task.ExecutionTriggerManual) r.Require().Nil(err) r.Equal(int64(1), id) time.Sleep(1 * time.Second) // wait the functions called in the goroutine r.execMgr.AssertExpectations(r.T()) r.flowCtl.AssertExpectations(r.T()) r.ormCreator.AssertExpectations(r.T()) // reset the mocks r.SetupTest() // got no error when running the replication flow r.execMgr.On("Create", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(int64(1), nil) r.execMgr.On("Get", mock.Anything, mock.Anything).Return(&task.Execution{}, nil) r.flowCtl.On("Start", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) r.ormCreator.On("Create").Return(nil) id, err = r.ctl.Start(context.Background(), &repctlmodel.Policy{Enabled: true}, nil, task.ExecutionTriggerManual) r.Require().Nil(err) r.Equal(int64(1), id) time.Sleep(1 * time.Second) // wait the functions called in the goroutine r.execMgr.AssertExpectations(r.T()) r.flowCtl.AssertExpectations(r.T()) r.ormCreator.AssertExpectations(r.T()) } func (r *replicationTestSuite) TestStop() { r.execMgr.On("Stop", mock.Anything, mock.Anything).Return(nil) err := r.ctl.Stop(nil, 1) r.Require().Nil(err) r.execMgr.AssertExpectations(r.T()) } func (r *replicationTestSuite) TestExecutionCount() { r.execMgr.On("Count", mock.Anything, mock.Anything).Return(int64(1), nil) total, err := r.ctl.ExecutionCount(nil, nil) r.Require().Nil(err) r.Equal(int64(1), total) r.execMgr.AssertExpectations(r.T()) } func (r *replicationTestSuite) TestListExecutions() { r.execMgr.On("List", mock.Anything, mock.Anything).Return([]*task.Execution{ { ID: 1, VendorType: job.Replication, VendorID: 1, Status: job.RunningStatus.String(), Metrics: &dao.Metrics{ TaskCount: 1, RunningTaskCount: 1, }, Trigger: task.ExecutionTriggerManual, StartTime: time.Time{}, EndTime: time.Time{}, }, }, nil) executions, err := r.ctl.ListExecutions(nil, nil) r.Require().Nil(err) r.Require().Len(executions, 1) r.Equal(int64(1), executions[0].ID) r.Equal(int64(1), executions[0].PolicyID) r.execMgr.AssertExpectations(r.T()) } func (r *replicationTestSuite) TestGetExecution() { r.execMgr.On("List", mock.Anything, mock.Anything).Return([]*task.Execution{ { ID: 1, VendorType: job.Replication, VendorID: 1, Status: job.RunningStatus.String(), Metrics: &dao.Metrics{ TaskCount: 1, RunningTaskCount: 1, }, Trigger: task.ExecutionTriggerManual, StartTime: time.Time{}, EndTime: time.Time{}, }, }, nil) execution, err := r.ctl.GetExecution(nil, 1) r.Require().Nil(err) r.Equal(int64(1), execution.ID) r.Equal(int64(1), execution.PolicyID) r.execMgr.AssertExpectations(r.T()) } func (r *replicationTestSuite) TestTaskCount() { r.taskMgr.On("Count", mock.Anything, mock.Anything).Return(int64(1), nil) total, err := r.ctl.TaskCount(nil, nil) r.Require().Nil(err) r.Equal(int64(1), total) r.taskMgr.AssertExpectations(r.T()) } func (r *replicationTestSuite) TestListTasks() { r.taskMgr.On("List", mock.Anything, mock.Anything).Return([]*task.Task{ { ID: 1, ExecutionID: 1, Status: job.RunningStatus.String(), ExtraAttrs: map[string]interface{}{ "resource_type": "artifact", "source_resource": "library/hello-world", "destination_resource": "library/hello-world", "operation": "copy", }, }, }, nil) tasks, err := r.ctl.ListTasks(nil, nil) r.Require().Nil(err) r.Require().Len(tasks, 1) r.Equal(int64(1), tasks[0].ID) r.Equal(int64(1), tasks[0].ExecutionID) r.Equal("artifact", tasks[0].ResourceType) r.Equal("library/hello-world", tasks[0].SourceResource) r.Equal("library/hello-world", tasks[0].DestinationResource) r.Equal("copy", tasks[0].Operation) r.taskMgr.AssertExpectations(r.T()) } func (r *replicationTestSuite) TestGetTask() { r.taskMgr.On("List", mock.Anything, mock.Anything).Return([]*task.Task{ { ID: 1, ExecutionID: 1, Status: job.RunningStatus.String(), ExtraAttrs: map[string]interface{}{ "resource_type": "artifact", "source_resource": "library/hello-world", "destination_resource": "library/hello-world", "operation": "copy", }, }, }, nil) task, err := r.ctl.GetTask(nil, 1) r.Require().Nil(err) r.Equal(int64(1), task.ID) r.Equal(int64(1), task.ExecutionID) r.Equal("artifact", task.ResourceType) r.Equal("library/hello-world", task.SourceResource) r.Equal("library/hello-world", task.DestinationResource) r.Equal("copy", task.Operation) r.taskMgr.AssertExpectations(r.T()) } func (r *replicationTestSuite) TestGetTaskLog() { r.taskMgr.On("List", mock.Anything, mock.Anything).Return([]*task.Task{ { ID: 1, }, }, nil) r.taskMgr.On("GetLog", mock.Anything, mock.Anything).Return([]byte{'a'}, nil) data, err := r.ctl.GetTaskLog(nil, 1) r.Require().Nil(err) r.Equal([]byte{'a'}, data) r.taskMgr.AssertExpectations(r.T()) } func TestReplicationTestSuite(t *testing.T) { suite.Run(t, &replicationTestSuite{}) }
{ "content_hash": "73bcb017365bf5ff8053bd4d0d83ad20", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 116, "avg_line_length": 33.04385964912281, "alnum_prop": 0.6971064507565702, "repo_name": "reasonerjt/harbor", "id": "bd90e310fbd8d2b539d61bbc6d18d9d0a7b1f2da", "size": "8128", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/controller/replication/execution_test.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "98351" }, { "name": "Dockerfile", "bytes": "18179" }, { "name": "Go", "bytes": "4076064" }, { "name": "HTML", "bytes": "486073" }, { "name": "JavaScript", "bytes": "4784" }, { "name": "Makefile", "bytes": "34745" }, { "name": "Mako", "bytes": "494" }, { "name": "PLSQL", "bytes": "148" }, { "name": "PLpgSQL", "bytes": "12834" }, { "name": "Python", "bytes": "309187" }, { "name": "RobotFramework", "bytes": "346744" }, { "name": "Shell", "bytes": "69183" }, { "name": "Smarty", "bytes": "26228" }, { "name": "TSQL", "bytes": "7714" }, { "name": "TypeScript", "bytes": "1544893" } ], "symlink_target": "" }
package com.opengamma.id; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotEquals; import static org.testng.Assert.assertNotSame; import static org.testng.Assert.assertNull; import static org.testng.Assert.assertSame; import static org.testng.Assert.assertTrue; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import org.testng.annotations.Test; import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; import com.opengamma.util.test.TestGroup; /** * Test {@link ExternalIdBundle}. */ @Test(groups = TestGroup.UNIT) public class ExternalIdBundleTest { private static final ExternalScheme SCHEME = ExternalScheme.of("Scheme"); private static final ExternalId ID_11 = ExternalId.of("D1", "V1"); private static final ExternalId ID_21 = ExternalId.of("D2", "V1"); private static final ExternalId ID_12 = ExternalId.of("D1", "V2"); private static final ExternalId ID_22 = ExternalId.of("D2", "V2"); /** * Tests that the number of ids in the empty bundle is zero. */ @Test public void singletonEmpty() { assertEquals(ExternalIdBundle.EMPTY.size(), 0); } //------------------------------------------------------------------------- /** * Tests the factory constructor that takes an ExternalScheme. */ @Test public void testFactoryExternalSchemeString() { final ExternalIdBundle test = ExternalIdBundle.of(ID_11.getScheme(), ID_11.getValue()); assertEquals(test.size(), 1); assertEquals(test.getExternalIds(), Sets.newHashSet(ID_11)); } /** * Tests that a scheme cannot be null. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testFactoryExternalSchemeStringNullScheme() { ExternalIdBundle.of((ExternalScheme) null, "value"); } /** * Tests that a value cannot be null. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testFactoryExternalSchemeStringNullValue() { ExternalIdBundle.of(SCHEME, (String) null); } /** * Tests that a value cannot be empty. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testFactoryExternalSchemeStringEmptyValue() { ExternalIdBundle.of(SCHEME, ""); } //------------------------------------------------------------------------- /** * Tests the factory constructor that takes the scheme as a string. */ @Test public void testFactoryStringString() { final ExternalIdBundle test = ExternalIdBundle.of(ID_11.getScheme().getName(), ID_11.getValue()); assertEquals(test.size(), 1); assertEquals(test.getExternalIds(), Sets.newHashSet(ID_11)); } /** * Tests that a scheme cannot be null. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testfactoryStringStringNullScheme() { ExternalIdBundle.of((String) null, "value"); } /** * Tests that a value cannot be null. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testFactoryStringStringNullValue() { ExternalIdBundle.of("Scheme", (String) null); } /** * Tests that a value cannot be empty. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testFactoryStringStringEmptyValue() { ExternalIdBundle.of("Scheme", ""); } //------------------------------------------------------------------------- /** * Tests that the external id cannot be null. */ @Test(expectedExceptions = IllegalArgumentException.class) public void factoryOfExternalIdNull() { ExternalIdBundle.of((ExternalId) null); } /** * Tests the static constructor that takes an external id. */ @Test public void testFactoryOfExternalId() { final ExternalIdBundle test = ExternalIdBundle.of(ID_11); assertEquals(test.size(), 1); assertEquals(test.getExternalIds(), Sets.newHashSet(ID_11)); } //------------------------------------------------------------------------- /** * Tests that an empty bundle is created. */ @Test public void testFactoryOfVarargsNoExternalIds() { final ExternalIdBundle test = ExternalIdBundle.of(); assertEquals(test.size(), 0); } /** * Tests the static constructor that takes external ids. */ @Test public void testFactoryOfVarargsTwoExternalIds() { final ExternalIdBundle test = ExternalIdBundle.of(ID_11, ID_12); assertEquals(test.size(), 2); assertEquals(Arrays.asList(ID_11, ID_12), test.getExternalIds()); } /** * Tests that the array of external ids cannot be null. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testFactoryOfVarargsNull() { ExternalIdBundle.of((ExternalId[]) null); } /** * Tests that nulls are not allowed. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testFactoryOfVarargsNoNulls() { ExternalIdBundle.of(ID_11, null, ID_12); } //------------------------------------------------------------------------- /** * Tests the static constructor that takes an iterable. */ @Test public void testFactoryOfIterableEmpty() { final ExternalIdBundle test = ExternalIdBundle.of(new ArrayList<ExternalId>()); assertEquals(test.size(), 0); } /** * Tests the static constructor that takes an iterable. */ @Test public void testFactoryOfIterableTwo() { final ExternalIdBundle test = ExternalIdBundle.of(Arrays.asList(ID_11, ID_12)); assertEquals(test.size(), 2); assertEquals(Arrays.asList(ID_11, ID_12), test.getExternalIds()); } /** * Tests that the iterable cannot be null. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testFactoryOfIterableNull() { ExternalIdBundle.of((Iterable<ExternalId>) null); } /** * Tests that null entries are not allowed. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testFactoryOfIterableNoNulls() { ExternalIdBundle.of(Arrays.asList(ID_11, null, ID_12)); } //------------------------------------------------------------------------- /** * Tests parsing an empty collection. */ @Test public void testFactoryParseIterableEmpty() { final ExternalIdBundle test = ExternalIdBundle.parse(new ArrayList<String>()); assertEquals(test.size(), 0); } /** * Tests that a collection of strings is parsed correctly. */ @Test public void testFactoryParseIterableTwo() { final ExternalIdBundle test = ExternalIdBundle.parse(Arrays.asList(ID_12.toString(), ID_11.toString())); assertEquals(2, test.size()); assertEquals(Arrays.asList(ID_11, ID_12), test.getExternalIds()); } /** * Tests that a null iterable cannot be parsed. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testFactoryParseIterableNull() { ExternalIdBundle.parse((Iterable<String>) null); } /** * Tests that an iterable containing nulls cannot be parsed. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testFactoryParseIterableNoNulls() { ExternalIdBundle.parse(Arrays.asList(ID_11.toString(), null, ID_12.toString())); } //------------------------------------------------------------------------- /** * Tests that bundles constructed differently are equal. */ @Test public void testSingleIdDifferentConstructors() { assertEquals(ExternalIdBundle.of(ID_11), ExternalIdBundle.of(Collections.singleton(ID_11))); } /** * Tests that bundles constructed differently are equal. */ @Test public void testMultipleIdDifferentConstructors() { assertEquals(ExternalIdBundle.of(ID_11, ID_22, ID_21, ID_12), ExternalIdBundle.of(Arrays.asList(ID_11, ID_21, ID_12, ID_22))); } /** * Tests that bundles constructed differently with different elements are not equal. */ @Test public void testSingleVersusMultipleId() { assertNotEquals(ExternalIdBundle.of(ID_11), ExternalIdBundle.of(ID_11, ID_12)); assertNotEquals(ExternalIdBundle.of(ID_11, ID_12), ExternalIdBundle.of(ID_11)); } //------------------------------------------------------------------------- /** * Tests the getExternalIdBundle() method. */ @Test public void testGetExternalIdBundle() { final ExternalIdBundle input = ExternalIdBundle.of(ID_11, ID_22); assertSame(input.getExternalIdBundle(), input); assertEquals(input.getExternalIdBundle(), input); } /** * Tests the toBundle() method. */ @Test public void testToBundle() { final ExternalIdBundle input = ExternalIdBundle.of(ID_11, ID_22); assertSame(input.toBundle(), input); assertEquals(input.toBundle(), input); } //------------------------------------------------------------------------- /** * Tests the getExternalId() method. */ @Test public void getExternalId() { final ExternalIdBundle input = ExternalIdBundle.of(ID_11, ID_22); assertEquals(input.getExternalId(ExternalScheme.of("D1")), ExternalId.of("D1", "V1")); assertEquals(input.getExternalId(ExternalScheme.of("D2")), ExternalId.of("D2", "V2")); assertNull(input.getExternalId(ExternalScheme.of("Kirk Wylie"))); assertNull(input.getExternalId(null)); } /** * Tests the getValue() method. */ @Test public void testGetValue() { final ExternalIdBundle input = ExternalIdBundle.of(ID_11, ID_22); assertEquals(input.getValue(ExternalScheme.of("D1")), "V1"); assertEquals(input.getValue(ExternalScheme.of("D2")), "V2"); assertNull(input.getValue(ExternalScheme.of("Kirk Wylie"))); assertNull(input.getValue(null)); } //------------------------------------------------------------------------- /** * Tests that adding an external id returns a new bundle. */ @Test public void testWithExternalId() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11); final ExternalIdBundle test = base.withExternalId(ID_21); assertEquals(base.size(), 1); assertEquals(test.size(), 2); assertTrue(test.getExternalIds().contains(ID_11)); assertTrue(test.getExternalIds().contains(ID_21)); } /** * Tests that adding an id that is already present has no effect and returns the original object. */ @Test public void testWithExternalIdSame() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11); final ExternalIdBundle test = base.withExternalId(ID_11); assertSame(base, test); assertEquals(base, test); } /** * Tests that a null id cannot be added. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testWithExternalIdNull() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11); base.withExternalId((ExternalId) null); } //------------------------------------------------------------------------- /** * Tests adding multiple ids. */ @Test public void testWithExternalIds() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11); final ExternalIdBundle test = base.withExternalIds(ImmutableList.of(ID_12, ID_21)); assertEquals(base.size(), 1); assertEquals(test.size(), 3); assertTrue(test.getExternalIds().contains(ID_11)); assertTrue(test.getExternalIds().contains(ID_12)); assertTrue(test.getExternalIds().contains(ID_21)); } /** * Tests that adding ids that are already present has no effect and returns the original object. */ @Test public void testWithExternalIdsSame() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11, ID_22); final ExternalIdBundle test = base.withExternalIds(ImmutableList.of(ID_11, ID_11, ID_22)); assertSame(base, test); assertEquals(base, test); } /** * Tests that a null id cannot be added. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testWithExternalIdsNull() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11); base.withExternalIds((Iterable<ExternalId>) null); } //------------------------------------------------------------------------- /** * Tests the removal of an id. */ @Test public void testWithoutExternalIdMatch() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11); final ExternalIdBundle test = base.withoutExternalId(ID_11); assertEquals(base.size(), 1); assertEquals(test.size(), 0); } /** * Tests that trying to remove an id that is not present returns the same object. */ @Test public void testWithoutExternalIdNoMatch() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11); final ExternalIdBundle test = base.withoutExternalId(ID_12); assertEquals(base.size(), 1); assertEquals(test.size(), 1); assertSame(base, test); assertTrue(test.getExternalIds().contains(ID_11)); } /** * Tests that it is not possible to try to remove a null id. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testWithoutExternalIdNull() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11); base.withoutExternalId(null); } //------------------------------------------------------------------------- /** * Tests that all ids with matching schemes are removed. */ @Test public void testWithoutSchemeExternalSchemeMatch() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11, ID_12, ID_22); final ExternalIdBundle test = base.withoutScheme(ID_11.getScheme()); assertEquals(base.size(), 3); assertEquals(test.size(), 1); assertEquals(test, ExternalIdBundle.of(ID_22)); } /** * Tests that removing a non-matching scheme has no effect and returns the same object. */ @Test public void testWithoutSchemeExternalSchemeNoMatch() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11); final ExternalIdBundle test = base.withoutScheme(ID_21.getScheme()); assertEquals(base.size(), 1); assertEquals(test.size(), 1); assertNotSame(base, test); assertEquals(base, test); } /** * Tests that trying to remove all ids with null scheme has no effect and returns the same object. */ @Test public void testWithoutSchemeExternalSchemeNull() { final ExternalIdBundle base = ExternalIdBundle.of(ID_11); final ExternalIdBundle test = base.withoutScheme(null); assertEquals(base.size(), 1); assertEquals(test.size(), 1); assertNotSame(base, test); assertEquals(base, test); } //------------------------------------------------------------------------- /** * Tests the size() method. */ @Test public void testSize() { assertEquals(ExternalIdBundle.EMPTY.size(), 0); assertEquals(ExternalIdBundle.of(ID_11).size(), 1); assertEquals(ExternalIdBundle.of(ID_11, ID_12).size(), 2); } /** * Tests the isEmpty() method. */ @Test public void testIsEmpty() { assertTrue(ExternalIdBundle.EMPTY.isEmpty()); assertFalse(ExternalIdBundle.of(ID_11).isEmpty()); } //------------------------------------------------------------------------- /** * Tests the iterator. */ @Test public void testIterator() { final Set<ExternalId> expected = new HashSet<>(); expected.add(ID_11); expected.add(ID_12); final Iterable<ExternalId> base = ExternalIdBundle.of(ID_11, ID_12); final Iterator<ExternalId> test = base.iterator(); assertTrue(test.hasNext()); assertTrue(expected.remove(test.next())); assertTrue(test.hasNext()); assertTrue(expected.remove(test.next())); assertFalse(test.hasNext()); assertEquals(expected.size(), 0); } //------------------------------------------------------------------------- /** * Tests the containsAll() method. */ @Test public void testContainsAll1() { final ExternalIdBundle test = ExternalIdBundle.of(ID_11); assertFalse(test.containsAll(ExternalIdBundle.of(ID_11, ID_12))); assertTrue(test.containsAll(ExternalIdBundle.of(ID_11))); assertFalse(test.containsAll(ExternalIdBundle.of(ID_12))); assertFalse(test.containsAll(ExternalIdBundle.of(ID_21))); assertTrue(test.containsAll(ExternalIdBundle.EMPTY)); } /** * Tests the containsAll() method. */ @Test public void testContainsAll2() { final ExternalIdBundle test = ExternalIdBundle.of(ID_11, ID_12); assertTrue(test.containsAll(ExternalIdBundle.of(ID_11, ID_12))); assertTrue(test.containsAll(ExternalIdBundle.of(ID_11))); assertTrue(test.containsAll(ExternalIdBundle.of(ID_12))); assertFalse(test.containsAll(ExternalIdBundle.of(ID_21))); assertTrue(test.containsAll(ExternalIdBundle.EMPTY)); } /** * Tests that the containsAll() method does not accept null. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testContainsAllNull() { final ExternalIdBundle test = ExternalIdBundle.of(ID_11, ID_12); test.containsAll(null); } //------------------------------------------------------------------------- /** * Tests the containsAny() method. */ @Test public void testContainsAny() { final ExternalIdBundle test = ExternalIdBundle.of(ID_11, ID_12); assertTrue(test.containsAny(ExternalIdBundle.of(ID_11, ID_12))); assertTrue(test.containsAny(ExternalIdBundle.of(ID_11))); assertTrue(test.containsAny(ExternalIdBundle.of(ID_12))); assertFalse(test.containsAny(ExternalIdBundle.of(ID_21))); assertFalse(test.containsAny(ExternalIdBundle.EMPTY)); } /** * Tests that the containsAny() method does not accept null. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testContainsAnyNull() { final ExternalIdBundle test = ExternalIdBundle.of(ID_11, ID_12); test.containsAny(null); } //------------------------------------------------------------------------- /** * Tests the contains() method. */ @Test public void testContains() { final ExternalIdBundle test = ExternalIdBundle.of(ID_11, ID_12); assertTrue(test.contains(ID_11)); assertTrue(test.contains(ID_11)); assertFalse(test.contains(ID_21)); } /** * Tests that the contains() method can accept null. */ @Test public void testContainsNull() { final ExternalIdBundle test = ExternalIdBundle.of(ID_11, ID_12); assertFalse(test.contains(null)); } //------------------------------------------------------------------------- /** * Tests the toStringList() method. */ @Test public void testToStringList() { final ExternalIdBundle test = ExternalIdBundle.of(ID_12, ID_11); assertEquals(test.toStringList(), Arrays.asList(ID_11.toString(), ID_12.toString())); } /** * Tests the toStringList() method. */ @Test public void testToStringListEmpty() { final ExternalIdBundle test = ExternalIdBundle.EMPTY; assertEquals(test.toStringList(), new ArrayList<String>()); } //------------------------------------------------------------------------- /** * Tests the compareTo() method on different sized bundles. */ @Test public void testCompareToDifferentSizes() { final ExternalIdBundle a1 = ExternalIdBundle.EMPTY; final ExternalIdBundle a2 = ExternalIdBundle.of(ID_11); assertEquals(a1.compareTo(a1), 0); assertTrue(a1.compareTo(a2) < 0); assertTrue(a2.compareTo(a1) > 0); assertEquals(a2.compareTo(a2), 0); } /** * Tests the compareTo() method on the same sized bundles. */ @Test public void testCompareToSameSizes() { final ExternalIdBundle a1 = ExternalIdBundle.of(ID_11); final ExternalIdBundle a2 = ExternalIdBundle.of(ID_12); assertEquals(a1.compareTo(a1), 0); assertTrue(a1.compareTo(a2) < 0); assertTrue(a2.compareTo(a1) > 0); assertEquals(a2.compareTo(a2), 0); } //------------------------------------------------------------------------- /** * Tests equality for empty bundles. */ @Test public void testEqualsSameEmpty() { final ExternalIdBundle a1 = ExternalIdBundle.EMPTY; final ExternalIdBundle a2 = ExternalIdBundle.of(ID_11).withoutScheme(ID_11.getScheme()); assertEquals(a1, a1); assertEquals(a2, a2); assertEquals(a2, a1); assertEquals(a2, a2); } /** * Tests equality for bundles. */ @Test public void testEqualsSameNonEmpty() { final ExternalIdBundle a1 = ExternalIdBundle.of(ID_11, ID_12); final ExternalIdBundle a2 = ExternalIdBundle.of(ID_11, ID_12); assertEquals(a1, a1); assertEquals(a1, a2); assertEquals(a2, a1); assertEquals(a2, a2); } /** * Tests equality for different bundles. */ @Test public void testEqualsDifferent() { final ExternalIdBundle a = ExternalIdBundle.EMPTY; final ExternalIdBundle b = ExternalIdBundle.of(ID_11, ID_12); assertEquals(a, a); assertNotEquals(a, b); assertNotEquals(b, a); assertEquals(b, b); assertNotEquals("Rubbish", a); assertNotEquals(null, a); } /** * Tests the hashCode() method. */ @Test public void testHashCode() { final ExternalIdBundle a = ExternalIdBundle.of(ID_11, ID_12); final ExternalIdBundle b = ExternalIdBundle.of(ID_11, ID_12); assertEquals(a.hashCode(), b.hashCode()); assertEquals(a.hashCode(), a.hashCode()); } /** * Tests the toString() method. */ @Test public void testToStringEmpty() { final ExternalIdBundle test = ExternalIdBundle.EMPTY; assertEquals("Bundle[]", test.toString()); } /** * Tests the toString() method. */ @Test public void testToStringNonEmpty() { final ExternalIdBundle test = ExternalIdBundle.of(ID_12, ID_11); assertEquals("Bundle[" + ID_11.toString() + ", " + ID_12.toString() + "]", test.toString()); } /** * Tests the getExternalIds() method. */ @Test public void testGetExternalIds() { final ExternalIdBundle bundle = ExternalIdBundle.of(ID_11, ID_12, ID_21, ID_22); final Set<ExternalId> expected = Sets.newHashSet(ID_11, ID_12); assertEquals(expected, bundle.getExternalIds(ExternalScheme.of("D1"))); } /** * Tests the getValues() method. */ @Test public void testGetValues() { final ExternalIdBundle bundle = ExternalIdBundle.of(ID_11, ID_12, ID_21, ID_22); final Set<String> expected = Sets.newHashSet(ID_11.getValue(), ID_12.getValue()); assertEquals(bundle.getValues(ExternalScheme.of("D1")), expected); } }
{ "content_hash": "45fed2fced9bc3668f6f134d7eca1829", "timestamp": "", "source": "github", "line_count": 719, "max_line_length": 108, "avg_line_length": 31.261474269819193, "alnum_prop": 0.6440806157405348, "repo_name": "McLeodMoores/starling", "id": "d6e335969a363789d39ea340be67a097f50b58bd", "size": "22614", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "projects/util/src/test/java/com/opengamma/id/ExternalIdBundleTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2505" }, { "name": "CSS", "bytes": "213501" }, { "name": "FreeMarker", "bytes": "310184" }, { "name": "GAP", "bytes": "1490" }, { "name": "Groovy", "bytes": "11518" }, { "name": "HTML", "bytes": "318295" }, { "name": "Java", "bytes": "79541905" }, { "name": "JavaScript", "bytes": "1511230" }, { "name": "PLSQL", "bytes": "398" }, { "name": "PLpgSQL", "bytes": "26901" }, { "name": "Shell", "bytes": "11481" }, { "name": "TSQL", "bytes": "604117" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "6708d3ff94861cc922fb224da05b0f17", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "912c9f30f36a7e55a41603fe988ca165f60167a2", "size": "219", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Saxifragales/Saxifragaceae/Saxifraga/Saxifraga cespitosa/ Syn. Saxifraga caespitosa delicatula/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package org.springframework.boot.autoconfigure.template; import java.util.Collection; import java.util.Collections; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.springframework.context.ApplicationContext; import org.springframework.core.io.ResourceLoader; import org.springframework.mock.env.MockEnvironment; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; /** * Tests for {@link TemplateAvailabilityProviders}. * * @author Phillip Webb */ public class TemplateAvailabilityProvidersTests { private TemplateAvailabilityProviders providers; @Mock private TemplateAvailabilityProvider provider; private String view = "view"; private ClassLoader classLoader = getClass().getClassLoader(); private MockEnvironment environment = new MockEnvironment(); @Mock private ResourceLoader resourceLoader; @Before public void setup() { MockitoAnnotations.initMocks(this); this.providers = new TemplateAvailabilityProviders( Collections.singleton(this.provider)); } @Test public void createWhenApplicationContextIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy( () -> new TemplateAvailabilityProviders((ApplicationContext) null)) .withMessageContaining("ClassLoader must not be null"); } @Test public void createWhenUsingApplicationContextShouldLoadProviders() { ApplicationContext applicationContext = mock(ApplicationContext.class); given(applicationContext.getClassLoader()).willReturn(this.classLoader); TemplateAvailabilityProviders providers = new TemplateAvailabilityProviders( applicationContext); assertThat(providers.getProviders()).isNotEmpty(); verify(applicationContext).getClassLoader(); } @Test public void createWhenClassLoaderIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new TemplateAvailabilityProviders((ClassLoader) null)) .withMessageContaining("ClassLoader must not be null"); } @Test public void createWhenUsingClassLoaderShouldLoadProviders() { TemplateAvailabilityProviders providers = new TemplateAvailabilityProviders( this.classLoader); assertThat(providers.getProviders()).isNotEmpty(); } @Test public void createWhenProvidersIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new TemplateAvailabilityProviders( (Collection<TemplateAvailabilityProvider>) null)) .withMessageContaining("Providers must not be null"); } @Test public void createWhenUsingProvidersShouldUseProviders() { TemplateAvailabilityProviders providers = new TemplateAvailabilityProviders( Collections.singleton(this.provider)); assertThat(providers.getProviders()).containsOnly(this.provider); } @Test public void getProviderWhenApplicationContextIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.providers.getProvider(this.view, null)) .withMessageContaining("ApplicationContext must not be null"); } @Test public void getProviderWhenViewIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.providers.getProvider(null, this.environment, this.classLoader, this.resourceLoader)) .withMessageContaining("View must not be null"); } @Test public void getProviderWhenEnvironmentIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.providers.getProvider(this.view, null, this.classLoader, this.resourceLoader)) .withMessageContaining("Environment must not be null"); } @Test public void getProviderWhenClassLoaderIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.providers.getProvider(this.view, this.environment, null, this.resourceLoader)) .withMessageContaining("ClassLoader must not be null"); } @Test public void getProviderWhenResourceLoaderIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.providers.getProvider(this.view, this.environment, this.classLoader, null)) .withMessageContaining("ResourceLoader must not be null"); } @Test public void getProviderWhenNoneMatchShouldReturnNull() { TemplateAvailabilityProvider found = this.providers.getProvider(this.view, this.environment, this.classLoader, this.resourceLoader); assertThat(found).isNull(); verify(this.provider).isTemplateAvailable(this.view, this.environment, this.classLoader, this.resourceLoader); } @Test public void getProviderWhenMatchShouldReturnProvider() { given(this.provider.isTemplateAvailable(this.view, this.environment, this.classLoader, this.resourceLoader)).willReturn(true); TemplateAvailabilityProvider found = this.providers.getProvider(this.view, this.environment, this.classLoader, this.resourceLoader); assertThat(found).isSameAs(this.provider); } @Test public void getProviderShouldCacheMatchResult() { given(this.provider.isTemplateAvailable(this.view, this.environment, this.classLoader, this.resourceLoader)).willReturn(true); this.providers.getProvider(this.view, this.environment, this.classLoader, this.resourceLoader); this.providers.getProvider(this.view, this.environment, this.classLoader, this.resourceLoader); verify(this.provider, times(1)).isTemplateAvailable(this.view, this.environment, this.classLoader, this.resourceLoader); } @Test public void getProviderShouldCacheNoMatchResult() { this.providers.getProvider(this.view, this.environment, this.classLoader, this.resourceLoader); this.providers.getProvider(this.view, this.environment, this.classLoader, this.resourceLoader); verify(this.provider, times(1)).isTemplateAvailable(this.view, this.environment, this.classLoader, this.resourceLoader); } @Test public void getProviderWhenCacheDisabledShouldNotUseCache() { given(this.provider.isTemplateAvailable(this.view, this.environment, this.classLoader, this.resourceLoader)).willReturn(true); this.environment.setProperty("spring.template.provider.cache", "false"); this.providers.getProvider(this.view, this.environment, this.classLoader, this.resourceLoader); this.providers.getProvider(this.view, this.environment, this.classLoader, this.resourceLoader); verify(this.provider, times(2)).isTemplateAvailable(this.view, this.environment, this.classLoader, this.resourceLoader); } }
{ "content_hash": "763a5c52c883f82fb0a527a8fa929b94", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 82, "avg_line_length": 35.361256544502616, "alnum_prop": 0.7919751258513473, "repo_name": "hello2009chen/spring-boot", "id": "03a6f874330a9bf9f1880e9c0583608aaf59ec6c", "size": "7374", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1948" }, { "name": "CSS", "bytes": "5774" }, { "name": "Groovy", "bytes": "46492" }, { "name": "HTML", "bytes": "70389" }, { "name": "Java", "bytes": "7092425" }, { "name": "JavaScript", "bytes": "37789" }, { "name": "Ruby", "bytes": "1305" }, { "name": "SQLPL", "bytes": "20085" }, { "name": "Shell", "bytes": "8165" }, { "name": "Smarty", "bytes": "3276" }, { "name": "XSLT", "bytes": "33894" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <inspections version="1.0"> <option name="myName" value="CBL-Custom" /> <option name="myLocal" value="true" /> <inspection_tool class="AccessToNonThreadSafeStaticFieldFromInstance" enabled="true" level="WARNING" enabled_by_default="true"> <option name="nonThreadSafeClasses"> <value /> </option> <option name="nonThreadSafeTypes" value="" /> </inspection_tool> <inspection_tool class="AccessToStaticFieldLockedOnInstance" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="AndroidLintAaptCrash" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintAdapterViewChildren" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintAddJavascriptInterface" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintAllowBackup" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintAlwaysShowAction" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintAppCompatMethod" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintAppCompatResource" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintAssert" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintButtonCase" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintButtonOrder" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintButtonStyle" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintByteOrderMark" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintCommitPrefEdits" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintCommitTransaction" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintContentDescription" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintCustomViewStyleable" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintCutPasteId" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintDeprecated" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintDeviceAdmin" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintDisableBaselineAlignment" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintDrawAllocation" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintDuplicateActivity" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintDuplicateDefinition" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintDuplicateIds" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintDuplicateIncludedIds" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintDuplicateUsesFeature" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintEnforceUTF8" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintExportedContentProvider" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintExportedReceiver" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintExportedService" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintExtraText" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintFullBackupContent" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintGetInstance" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintGoogleAppIndexingDeepLinkError" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintGoogleAppIndexingWarning" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintGradleOverrides" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintGrantAllUris" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintGridLayout" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintHandlerLeak" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintHardcodedDebugMode" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintHardcodedText" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintIllegalResourceRef" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintImpliedQuantity" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintInOrMmUsage" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintIncludeLayoutParam" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintInconsistentArrays" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintInefficientWeight" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintInflateParams" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintInlinedApi" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintInnerclassSeparator" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintInvalidId" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintInvalidUsesTagAttribute" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintJavascriptInterface" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintLabelFor" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintLibraryCustomView" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintLocalSuppress" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintLogTagMismatch" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintLongLogTag" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintManifestOrder" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintManifestResource" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintMenuTitle" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintMipmapIcons" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingApplicationIcon" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingId" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingIntentFilterForMediaSearch" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingLeanbackLauncher" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingLeanbackSupport" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingMediaBrowserServiceIntentFilter" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingOnPlayFromSearch" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingPrefix" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingQuantity" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingSuperCall" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingTvBanner" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintMissingVersion" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintMockLocation" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintMultipleUsesSdk" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintNestedScrolling" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintNestedWeights" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintNewApi" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintNfcTechWhitespace" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintNotSibling" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintObsoleteLayoutParam" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintOldTargetApi" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintOrientation" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintOverride" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintOverrideAbstract" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintPackageManagerGetSignatures" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintPackagedPrivateKey" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintParcelCreator" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintPermissionImpliesUnsupportedHardware" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintPrivateResource" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintProguard" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintProguardSplit" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintProtectedPermissions" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintPxUsage" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintRecycle" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintReferenceType" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintRelativeOverlap" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintResAuto" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintResourceCycle" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintResourceName" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintRtlCompat" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintRtlEnabled" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintRtlHardcoded" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintRtlSymmetry" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintSQLiteString" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintSSLCertificateSocketFactoryCreateSocket" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintSSLCertificateSocketFactoryGetInsecure" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintScrollViewCount" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintScrollViewSize" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintSdCardPath" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintServiceCast" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintSetJavaScriptEnabled" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintSetTextI18n" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintSetWorldReadable" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintSetWorldWritable" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintShiftFlags" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintShortAlarm" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintShowToast" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintSignatureOrSystemPermissions" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintSimpleDateFormat" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintSmallSp" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintSpUsage" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintStateListReachable" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintStringFormatMatches" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintSuspicious0dp" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintSuspiciousImport" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintTextFields" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintTextViewEdits" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintTooDeepLayout" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintTooManyViews" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintTypographyDashes" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintTypographyEllipsis" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintTypographyFractions" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintTypographyOther" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintTypos" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintUniqueConstants" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintUniquePermission" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintUnknownId" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintUnknownIdInLayout" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintUnlocalizedSms" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintUnprotectedSMSBroadcastReceiver" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintUnsupportedTvHardware" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintUnusedAttribute" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintUnusedQuantity" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintUseCompoundDrawables" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintUseSparseArrays" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintUseValueOf" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintUselessLeaf" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintUselessParent" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintUsesMinSdkAttributes" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintValidFragment" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintValidRestrictions" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintVectorRaster" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintViewConstructor" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintViewHolder" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintWebViewLayout" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintWorldReadableFiles" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintWorldWriteableFiles" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AndroidLintWrongCall" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintWrongCase" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintWrongFolder" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AndroidLintWrongViewCast" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AnonymousClassComplexity" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_limit" value="3" /> </inspection_tool> <inspection_tool class="AnonymousClassMethodCount" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_limit" value="1" /> </inspection_tool> <inspection_tool class="AnonymousInnerClassMayBeStatic" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ApiName" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="ApiNamespace" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="ApiParameter" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="AssertEqualsBetweenInconvertibleTypesTestNG" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="AssignmentToCatchBlockParameter" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="AssignmentToCollectionFieldFromParameter" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignorePrivateMethods" value="true" /> </inspection_tool> <inspection_tool class="AssignmentToDateFieldFromParameter" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignorePrivateMethods" value="true" /> </inspection_tool> <inspection_tool class="AssignmentToForLoopParameter" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_checkForeachParameters" value="false" /> </inspection_tool> <inspection_tool class="AssignmentToLambdaParameter" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="AssignmentToMethodParameter" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreTransformationOfOriginalParameter" value="false" /> </inspection_tool> <inspection_tool class="AssignmentToNull" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="AssignmentToStaticFieldFromInstanceMethod" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="AssignmentToSuperclassField" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="AssignmentUsedAsCondition" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="AwaitNotInLoop" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="AwaitWithoutCorrespondingSignal" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="BooleanParameter" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="BusyWait" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="CallToNativeMethodWhileLocked" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="CallToSimpleGetterInClass" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreGetterCallsOnOtherObjects" value="false" /> <option name="onlyReportPrivateGetter" value="false" /> </inspection_tool> <inspection_tool class="CallToSimpleSetterInClass" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreSetterCallsOnOtherObjects" value="false" /> <option name="onlyReportPrivateSetter" value="false" /> </inspection_tool> <inspection_tool class="CastToConcreteClass" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ChannelResource" enabled="true" level="WARNING" enabled_by_default="true"> <option name="insideTryAllowed" value="false" /> </inspection_tool> <inspection_tool class="CheckDtdRefs" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="CheckEmptyScriptTag" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="CheckValidXmlInScriptTagBody" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="CheckXmlFileWithXercesValidator" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="ClashingTraitMethods" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="ClassComplexity" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_limit" value="80" /> </inspection_tool> <inspection_tool class="ClassCoupling" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_includeJavaClasses" value="false" /> <option name="m_includeLibraryClasses" value="false" /> <option name="m_limit" value="15" /> </inspection_tool> <inspection_tool class="ClassInheritanceDepth" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_limit" value="2" /> </inspection_tool> <inspection_tool class="ClassLoaderInstantiation" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ClassNestingDepth" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_limit" value="1" /> </inspection_tool> <inspection_tool class="ClassNewInstance" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ClassReferencesSubclass" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="CloneInNonCloneableClass" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="CloneReturnsClassType" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="CloneableClassInSecureContext" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="CollectionContainsUrl" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="CollectionsMustHaveInitialCapacity" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ConditionSignal" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ConstantValueVariableUse" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="Constructor" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="ConstructorCount" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreDeprecatedConstructors" value="false" /> <option name="m_limit" value="5" /> </inspection_tool> <inspection_tool class="CustomClassloader" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="CustomSecurityManager" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="CyclomaticComplexity" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_limit" value="10" /> </inspection_tool> <inspection_tool class="DeclareCollectionAsInterface" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreLocalVariables" value="false" /> <option name="ignorePrivateMethodsAndFields" value="false" /> </inspection_tool> <inspection_tool class="DelegatesTo" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="DeserializableClassInSecureContext" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="DesignForExtension" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="DoubleBraceInitialization" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="DoubleCheckedLocking" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreOnVolatileVariables" value="false" /> </inspection_tool> <inspection_tool class="DynamicRegexReplaceableByCompiledPattern" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="EmptySynchronizedStatement" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="EqualsHashCodeCalledOnUrl" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ExtendsThread" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="FeatureEnvy" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreTestCases" value="false" /> </inspection_tool> <inspection_tool class="FieldAccessNotGuarded" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="FieldAccessedSynchronizedAndUnsynchronized" enabled="true" level="WARNING" enabled_by_default="true"> <option name="countGettersAndSetters" value="false" /> </inspection_tool> <inspection_tool class="FieldCount" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_countConstantFields" value="false" /> <option name="m_considerStaticFinalFieldsConstant" value="false" /> <option name="myCountEnumConstants" value="false" /> <option name="m_limit" value="10" /> </inspection_tool> <inspection_tool class="FieldMayBeStatic" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="FullJavaName" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="FullMethodName" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="GrDeprecatedAPIUsage" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GrEqualsBetweenInconvertibleTypes" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GrFinalVariableAccess" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GrMethodMayBeStatic" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GrPackage" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GrReassignedInClosureLocalVar" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GrUnresolvedAccess" enabled="false" level="WEAK WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyAccessToStaticFieldLockedOnInstance" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyAccessibility" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyAssignabilityCheck" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyConditionalWithIdenticalBranches" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyConstantConditional" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyConstantIfStatement" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyConstructorNamedArguments" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyDivideByZero" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyDocCheck" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="GroovyDoubleNegation" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyDuplicateSwitchBranch" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyEmptyStatementBody" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyFallthrough" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyIfStatementWithIdenticalBranches" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyInArgumentCheck" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyInfiniteLoopStatement" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyInfiniteRecursion" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyLabeledStatement" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyMissingReturnStatement" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyPointlessBoolean" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyResultOfObjectAllocationIgnored" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovySillyAssignment" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovySingletonAnnotation" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovySynchronizationOnNonFinalField" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovySynchronizationOnVariableInitializedWithLiteral" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyTrivialConditional" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyTrivialIf" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyUncheckedAssignmentOfMemberOfRawType" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyUnnecessaryContinue" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyUnnecessaryReturn" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyUnreachableStatement" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyUnsynchronizedMethodOverridesSynchronizedMethod" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyUnusedAssignment" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyUnusedCatchParameter" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyUnusedDeclaration" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyUnusedIncOrDec" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="GroovyVariableNotAssigned" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="HtmlExtraClosingTag" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="HtmlUnknownAnchorTarget" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="HtmlUnknownAttribute" enabled="false" level="WARNING" enabled_by_default="false"> <option name="myValues"> <value> <list size="0" /> </value> </option> <option name="myCustomValuesEnabled" value="true" /> </inspection_tool> <inspection_tool class="HtmlUnknownBooleanAttribute" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="HtmlUnknownTag" enabled="false" level="WARNING" enabled_by_default="false"> <option name="myValues"> <value> <list size="6"> <item index="0" class="java.lang.String" itemvalue="nobr" /> <item index="1" class="java.lang.String" itemvalue="noembed" /> <item index="2" class="java.lang.String" itemvalue="comment" /> <item index="3" class="java.lang.String" itemvalue="noscript" /> <item index="4" class="java.lang.String" itemvalue="embed" /> <item index="5" class="java.lang.String" itemvalue="script" /> </list> </value> </option> <option name="myCustomValuesEnabled" value="true" /> </inspection_tool> <inspection_tool class="HtmlUnknownTarget" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="IOResource" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoredTypesString" value="java.io.ByteArrayOutputStream,java.io.ByteArrayInputStream,java.io.StringBufferInputStream,java.io.CharArrayWriter,java.io.CharArrayReader,java.io.StringWriter,java.io.StringReader" /> <option name="insideTryAllowed" value="false" /> </inspection_tool> <inspection_tool class="IncrementDecrementUsedAsExpression" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="InnerClassMayBeStatic" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="InstanceGuardedByStatic" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="InstanceVariableOfConcreteClass" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="InstanceofChain" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreInstanceofOnLibraryClasses" value="false" /> </inspection_tool> <inspection_tool class="InstanceofInterfaces" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="InstanceofThis" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="InvalidParameterAnnotations" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="IteratorHasNextCallsIteratorNext" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="IteratorNextDoesNotThrowNoSuchElementException" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="JDBCExecuteWithNonConstantString" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="JDBCPrepareStatementWithNonConstantString" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="JavaLangReflect" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="KeySetIterationMayUseEntrySet" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="LengthOneStringInIndexOf" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="LengthOneStringsInConcatenation" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="LoadLibraryWithNonConstantString" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="LocalVariableOfConcreteClass" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false"> <option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" /> <option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" /> </inspection_tool> <inspection_tool class="LossyEncoding" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="MagicNumber" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="MapReplaceableByEnumMap" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="MavenDuplicateDependenciesInspection" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="MavenDuplicatePluginInspection" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="MavenModelInspection" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="MavenRedundantGroupId" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="MethodCount" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_limit" value="20" /> <option name="ignoreGettersAndSetters" value="false" /> <option name="ignoreOverridingMethods" value="false" /> </inspection_tool> <inspection_tool class="MethodCoupling" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_includeJavaClasses" value="false" /> <option name="m_includeLibraryClasses" value="false" /> <option name="m_limit" value="10" /> </inspection_tool> <inspection_tool class="MethodMayBeStatic" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_onlyPrivateOrFinal" value="false" /> <option name="m_ignoreEmptyMethods" value="true" /> </inspection_tool> <inspection_tool class="MethodMayBeSynchronized" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="MethodName" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="MethodOnlyUsedFromInnerClass" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreMethodsAccessedFromAnonymousClass" value="false" /> <option name="ignoreStaticMethodsFromNonStaticInnerClass" value="false" /> <option name="onlyReportStaticMethods" value="false" /> </inspection_tool> <inspection_tool class="MethodParameterType" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="MethodReturnOfConcreteClass" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="MethodReturnType" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="MissingFinalNewline" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="MisspelledHeader" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="NakedNotify" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NamedResource" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="NestedAssignment" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NestedSynchronizedStatement" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NestingDepth" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_limit" value="5" /> </inspection_tool> <inspection_tool class="NewInstanceOfSingleton" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="NonAtomicOperationOnVolatileField" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NonCommentSourceStatements" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_limit" value="30" /> </inspection_tool> <inspection_tool class="NonFinalClone" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NonFinalFieldInEnum" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NonFinalFieldInImmutable" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NonFinalGuard" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NonStaticInnerClassInSecureContext" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NonSynchronizedMethodOverridesSynchronizedMethod" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NotifyCalledOnCondition" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NotifyNotInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NotifyWithoutCorrespondingWait" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ObjectNotify" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ObsoleteCollection" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreRequiredObsoleteCollectionTypes" value="false" /> </inspection_tool> <inspection_tool class="OverlyStrongTypeCast" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreInMatchingInstanceof" value="false" /> </inspection_tool> <inspection_tool class="PackageVisibleField" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="PackageVisibleInnerClass" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreEnums" value="false" /> <option name="ignoreInterfaces" value="false" /> </inspection_tool> <inspection_tool class="ParameterOfConcreteClass" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="PublicFieldAccessedInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="PublicMethodNotExposedInInterface" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignorableAnnotations"> <value /> </option> <option name="onlyWarnIfContainingClassImplementsAnInterface" value="false" /> </inspection_tool> <inspection_tool class="PublicStaticArrayField" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="PublicStaticCollectionField" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="RandomDoubleForRandomInteger" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ReplaceAssignmentWithOperatorAssignment" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreLazyOperators" value="true" /> <option name="ignoreObscureOperators" value="false" /> </inspection_tool> <inspection_tool class="RequiredAttributes" enabled="false" level="WARNING" enabled_by_default="false"> <option name="myAdditionalRequiredHtmlAttributes" value="" /> </inspection_tool> <inspection_tool class="ResourceParameter" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="RestSignature" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="ResultOfObjectAllocationIgnored" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ReturnOfInnerClass" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="RuntimeExecWithNonConstantString" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SafeLock" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SecondUnsafeCall" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="SerializableClassInSecureContext" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SetReplaceableByEnumSet" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SharedThreadLocalRandom" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SignalWithoutCorrespondingAwait" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="Since15" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="SleepWhileHoldingLock" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SocketResource" enabled="true" level="WARNING" enabled_by_default="true"> <option name="insideTryAllowed" value="false" /> </inspection_tool> <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false"> <option name="processCode" value="true" /> <option name="processLiterals" value="true" /> <option name="processComments" value="true" /> </inspection_tool> <inspection_tool class="StaticCollection" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_ignoreWeakCollections" value="false" /> </inspection_tool> <inspection_tool class="StaticGuardedByInstance" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="StaticMethodOnlyUsedInOneClass" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="StaticVariableOfConcreteClass" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="StringBufferField" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="StringBufferMustHaveInitialCapacity" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="StringBufferToStringInConcatenation" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="StringConcatenationInFormatCall" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="StringConcatenationInLoops" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_ignoreUnlessAssigned" value="true" /> </inspection_tool> <inspection_tool class="StringConcatenationInMessageFormatCall" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="StringEqualsEmptyString" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="StringReplaceableByStringBuffer" enabled="true" level="WARNING" enabled_by_default="true"> <option name="onlyWarnOnLoop" value="true" /> </inspection_tool> <inspection_tool class="SynchronizationOnStaticField" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SynchronizeOnLock" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SynchronizeOnThis" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SynchronizedMethod" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_includeNativeMethods" value="true" /> <option name="ignoreSynchronizedSuperMethods" value="true" /> </inspection_tool> <inspection_tool class="SynchronizedOnLiteralObject" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SystemGC" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SystemOutErr" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SystemProperties" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SystemRunFinalizersOnExit" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="SystemSetSecurityManager" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="TailRecursion" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="TestOnlyProblems" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ThreadDeathRethrown" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ThreadDumpStack" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ThreadLocalNotStaticFinal" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ThreadPriority" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ThreadRun" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ThreadStartInConstruction" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ThreadStopSuspendResume" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ThreadWithDefaultRunMethod" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ThreadYield" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ThrowablePrintStackTrace" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="TooBroadScope" enabled="true" level="WARNING" enabled_by_default="true"> <option name="m_allowConstructorAsInitializer" value="false" /> <option name="m_onlyLookAtBlocks" value="false" /> </inspection_tool> <inspection_tool class="TrailingSpacesInProperty" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="TrivialStringConcatenation" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="TypeCustomizer" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="TypeMayBeWeakened" enabled="true" level="WARNING" enabled_by_default="true"> <option name="useRighthandTypeAsWeakestTypeInAssignments" value="true" /> <option name="useParameterizedTypeForCollectionMethods" value="true" /> <option name="doNotWeakenToJavaLangObject" value="true" /> <option name="onlyWeakentoInterface" value="true" /> </inspection_tool> <inspection_tool class="UnconditionalWait" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="UnknownGuard" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="UnnecessaryQualifiedReference" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="UnsecureRandomNumberGeneration" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="UnusedMessageFormatParameter" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="UnusedProperty" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="UseOfAnotherObjectsPrivateField" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreSameClass" value="false" /> <option name="ignoreEquals" value="false" /> </inspection_tool> <inspection_tool class="UseOfObsoleteDateTimeApi" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="UseOfPropertiesAsHashtable" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="VolatileArrayField" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="VolatileLongOrDoubleField" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="WaitCalledOnCondition" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="WaitNotInLoop" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="WaitNotInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="WaitOrAwaitWithoutTimeout" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="WaitWhileHoldingTwoLocks" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="WaitWithoutCorrespondingNotify" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="WhileLoopSpinsOnField" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreNonEmtpyLoops" value="false" /> </inspection_tool> <inspection_tool class="XmlDuplicatedId" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="XmlInvalidId" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="XmlPathReference" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="XmlWrongRootElement" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="ZeroLengthArrayInitialization" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="dependsOnMethodTestNG" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="groupsTestNG" enabled="false" level="WARNING" enabled_by_default="false"> <option name="groups"> <value> <list size="0" /> </value> </option> </inspection_tool> </inspections>
{ "content_hash": "4257d4a6e0c843932dfa941f3e8f6e48", "timestamp": "", "source": "github", "line_count": 589, "max_line_length": 229, "avg_line_length": 93.73005093378607, "alnum_prop": 0.7599760899885885, "repo_name": "gotmyjobs/couchbase-lite-android", "id": "5d319b7adfaf21a630af6fe8af647a238580a2b8", "size": "55207", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "etc/cbl-custom-inspections.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1056126" }, { "name": "Shell", "bytes": "2764" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:tr="http://myfaces.apache.org/trinidad" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin" xmlns:mafp="http://myfaces.apache.org/maven-trinidad-plugin" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <component> <description><![CDATA[go is a base abstraction for components like goButton and goLink that are used to navigate directly to a different page without any server-side actions.]]> </description> <icon> <small-icon>/org/apache/myfaces/trinidadinternal/metadata/icons/go.gif</small-icon> </icon> <component-type>org.apache.myfaces.trinidad.Go</component-type> <component-class>org.apache.myfaces.trinidad.component.UIXGo</component-class> <property> <description><![CDATA[the URI this go component references]]></description> <property-name>destination</property-name> <property-class>java.lang.String</property-class> <property-extension> <mfp:property-metadata> <mfp:preferred>true</mfp:preferred> <mfp:property-editor>URI</mfp:property-editor> </mfp:property-metadata> </property-extension> </property> <component-extension> <mfp:component-family>org.apache.myfaces.trinidad.Go</mfp:component-family> <mfp:component-supertype>org.apache.myfaces.trinidad.ComponentBase</mfp:component-supertype> <mfp:renderer-type>org.apache.myfaces.trinidad.Go</mfp:renderer-type> <mfp:tag-class>org.apache.myfaces.trinidadinternal.taglib.UIXGoTag</mfp:tag-class> <mfp:author>Prakash Udupa</mfp:author> <mfp:tag-class-modifier>abstract</mfp:tag-class-modifier> </component-extension> </component> </faces-config>
{ "content_hash": "3c353a6ce9f939ba3379814f0fee4f88", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 98, "avg_line_length": 46.33898305084746, "alnum_prop": 0.6982443306510607, "repo_name": "adamrduffy/trinidad-1.0.x", "id": "a81292b41828405590fdc410401d5b471439a4ba", "size": "2734", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/Go.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "97216" }, { "name": "HTML", "bytes": "92" }, { "name": "Java", "bytes": "9255440" }, { "name": "JavaScript", "bytes": "671775" } ], "symlink_target": "" }
module Gitlab module ImportExport module JSON class StreamingSerializer include Gitlab::ImportExport::CommandLineUtil BATCH_SIZE = 100 SMALLER_BATCH_SIZE = 2 def self.batch_size(exportable) if Feature.enabled?(:export_reduce_relation_batch_size, exportable) SMALLER_BATCH_SIZE else BATCH_SIZE end end class Raw < String def to_json(*_args) to_s end end def initialize(exportable, relations_schema, json_writer, exportable_path:) @exportable = exportable @exportable_path = exportable_path @relations_schema = relations_schema @json_writer = json_writer end def execute serialize_root includes.each do |relation_definition| serialize_relation(relation_definition) end end private attr_reader :json_writer, :relations_schema, :exportable def serialize_root attributes = exportable.as_json( relations_schema.merge(include: nil, preloads: nil)) json_writer.write_attributes(@exportable_path, attributes) end def serialize_relation(definition) raise ArgumentError, 'definition needs to be Hash' unless definition.is_a?(Hash) raise ArgumentError, 'definition needs to have exactly one Hash element' unless definition.one? key, options = definition.first record = exportable.public_send(key) # rubocop: disable GitlabSecurity/PublicSend if record.is_a?(ActiveRecord::Relation) serialize_many_relations(key, record, options) elsif record.respond_to?(:each) # this is to support `project_members` that return an Array serialize_many_each(key, record, options) else serialize_single_relation(key, record, options) end end def serialize_many_relations(key, records, options) enumerator = Enumerator.new do |items| key_preloads = preloads&.dig(key) records = records.preload(key_preloads) if key_preloads records.in_batches(of: batch_size) do |batch| # rubocop:disable Cop/InBatches # order each batch by its primary key to ensure # consistent and predictable ordering of each exported relation # as additional `WHERE` clauses can impact the order in which data is being # returned by database when no `ORDER` is specified batch = batch.reorder(batch.klass.primary_key) batch.each do |record| items << Raw.new(record.to_json(options)) end end end json_writer.write_relation_array(@exportable_path, key, enumerator) end def serialize_many_each(key, records, options) enumerator = Enumerator.new do |items| records.each do |record| items << Raw.new(record.to_json(options)) end end json_writer.write_relation_array(@exportable_path, key, enumerator) end def serialize_single_relation(key, record, options) json = Raw.new(record.to_json(options)) json_writer.write_relation(@exportable_path, key, json) end def includes relations_schema[:include] end def preloads relations_schema[:preload] end def batch_size @batch_size ||= self.class.batch_size(@exportable) end end end end end
{ "content_hash": "716c384130b6115c263256b3955a7fa0", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 105, "avg_line_length": 31.646551724137932, "alnum_prop": 0.597657314083356, "repo_name": "mmkassem/gitlabhq", "id": "05b7679e0ff4222afe60c822c115066605ff2c1f", "size": "3702", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/gitlab/import_export/json/streaming_serializer.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "113683" }, { "name": "CoffeeScript", "bytes": "139197" }, { "name": "Cucumber", "bytes": "119759" }, { "name": "HTML", "bytes": "447030" }, { "name": "JavaScript", "bytes": "29805" }, { "name": "Ruby", "bytes": "2417833" }, { "name": "Shell", "bytes": "14336" } ], "symlink_target": "" }
<!DOCTYPE html > <html> <head> <title>DeprecatedPrettyMethods - Scalactic 3.0.0 - org.scalactic.DeprecatedPrettyMethods</title> <meta name="description" content="DeprecatedPrettyMethods - Scalactic 3.0.0 - org.scalactic.DeprecatedPrettyMethods" /> <meta name="keywords" content="DeprecatedPrettyMethods Scalactic 3.0.0 org.scalactic.DeprecatedPrettyMethods" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <link href="../../lib/template.css" media="screen" type="text/css" rel="stylesheet" /> <link href="../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" /> <script type="text/javascript" src="../../lib/jquery.js" id="jquery-js"></script> <script type="text/javascript" src="../../lib/jquery-ui.js"></script> <script type="text/javascript" src="../../lib/template.js"></script> <script type="text/javascript" src="../../lib/tools.tooltip.js"></script> <script type="text/javascript"> if(top === self) { var url = '../../index.html'; var hash = 'org.scalactic.DeprecatedPrettyMethods'; var anchor = window.location.hash; var anchor_opt = ''; if (anchor.length >= 1) anchor_opt = '@' + anchor.substring(1); window.location.href = url + '#' + hash + anchor_opt; } </script> <!-- gtag [javascript] --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-71294502-2"></script> <script defer> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-71294502-2'); </script> </head> <body class="type"> <!-- Top of doc.scalactic.org [javascript] --> <script type="text/javascript"> var rnd = window.rnd || Math.floor(Math.random()*10e6); var pid204569 = window.pid204569 || rnd; var plc204569 = window.plc204569 || 0; var abkw = window.abkw || ''; var absrc = 'http://ab167933.adbutler-ikon.com/adserve/;ID=167933;size=468x60;setID=204569;type=js;sw='+screen.width+';sh='+screen.height+';spr='+window.devicePixelRatio+';kw='+abkw+';pid='+pid204569+';place='+(plc204569++)+';rnd='+rnd+';click=CLICK_MACRO_PLACEHOLDER'; document.write('<scr'+'ipt src="'+absrc+'" type="text/javascript"></scr'+'ipt>'); </script> <div id="definition"> <a href="DeprecatedPrettyMethods$.html" title="See companion object"><img alt="Trait/Object" src="../../lib/trait_to_object_big.png" /></a> <p id="owner"><a href="../package.html" class="extype" name="org">org</a>.<a href="package.html" class="extype" name="org.scalactic">scalactic</a></p> <h1><a href="DeprecatedPrettyMethods$.html" title="See companion object">DeprecatedPrettyMethods</a></h1><h3><span class="morelinks"><div> Related Docs: <a href="DeprecatedPrettyMethods$.html" title="See companion object">object DeprecatedPrettyMethods</a> | <a href="package.html" class="extype" name="org.scalactic">package scalactic</a> </div></span></h3><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> </div> <h4 id="signature" class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">trait</span> </span> <span class="symbol"> <span class="name deprecated" title="Deprecated: Please use PrettyMethods instead.">DeprecatedPrettyMethods</span><span class="result"> extends <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> </h4> <div id="comment" class="fullcommenttop"><div class="comment cmt"><p><strong>This trait is the 2.2.6 PrettyMethods trait renamed to DeprecatedPrettyMethods. It is a quick way to get old code working again that defined an implicit <code>PrettifierConfig</code>, but before the deprecation cycle is over please change the implicit <code>PrettifierConfig</code> to an implicit <code>Prettifier</code>.</strong> Provides an implicit conversion that enables <code>pretty</code> to be invoked on any object, to transform that object into a <code>String</code> representation. </p></div><dl class="attributes block"> <dt>Annotations</dt><dd> <span class="name">@deprecated</span> </dd><dt>Deprecated</dt><dd class="cmt"><p>Please use PrettyMethods instead.</p></dd><dt>Source</dt><dd><a href="https://github.com/scalatest/scalatest/tree/release-3.0.0/scalactic//src/main/scala/org/scalactic/DeprecatedPrettyMethods.scala" target="_blank">DeprecatedPrettyMethods.scala</a></dd></dl><div class="toggleContainer block"> <span class="toggle">Linear Supertypes</span> <div class="superTypes hiddenContent"><span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div> </div><div class="toggleContainer block"> <span class="toggle">Known Subclasses</span> <div class="subClasses hiddenContent"><a href="DeprecatedPrettyMethods$.html" class="extype" name="org.scalactic.DeprecatedPrettyMethods">DeprecatedPrettyMethods</a></div> </div></div> <div id="mbrsel"> <div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div> <div id="order"> <span class="filtertype">Ordering</span> <ol> <li class="alpha in"><span>Alphabetic</span></li> <li class="inherit out"><span>By Inheritance</span></li> </ol> </div> <div id="ancestors"> <span class="filtertype">Inherited<br /> </span> <ol id="linearization"> <li class="in" name="org.scalactic.DeprecatedPrettyMethods"><span>DeprecatedPrettyMethods</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li> </ol> </div><div id="ancestors"> <span class="filtertype"></span> <ol> <li class="hideall out"><span>Hide All</span></li> <li class="showall in"><span>Show All</span></li> </ol> </div> <div id="visbl"> <span class="filtertype">Visibility</span> <ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol> </div> </div> <div id="template"> <div id="allMembers"> <div id="types" class="types members"> <h3>Type Members</h3> <ol><li name="org.scalactic.DeprecatedPrettyMethods.Prettyizer" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="PrettyizerextendsAnyRef"></a> <a id="Prettyizer:Prettyizer"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">implicit </span> <span class="kind">class</span> </span> <span class="symbol"> <a href="DeprecatedPrettyMethods$Prettyizer.html"><span class="name">Prettyizer</span></a><span class="result"> extends <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@PrettyizerextendsAnyRef" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <p class="shortcomment cmt">Implicit class that adds a <code>pretty</code> method to any object.</code></p><div class="fullcomment"><div class="comment cmt"><p>Implicit class that adds a <code>pretty</code> method to any object.</p><p>The constructor of this class, besides taking an object <code>o</code> to prettify, also takes an implicit <code>PrettifierConfig</code> that the <code>pretty</code> method will use to prettify the object.</p></div></div> </li><li name="org.scalactic.DeprecatedPrettyMethods.PrettifierConfig" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="PrettifierConfigextendsProductwithSerializable"></a> <a id="PrettifierConfig:PrettifierConfig"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">case class</span> </span> <span class="symbol"> <a href="DeprecatedPrettyMethods$PrettifierConfig.html"><span class="name deprecated" title="Deprecated: Please use Prettifer and PrettyMethods instead.">PrettifierConfig</span></a><span class="params">(<span name="prettifier">prettifier: <a href="Prettifier.html" class="extype" name="org.scalactic.Prettifier">Prettifier</a></span>)</span><span class="result"> extends <span class="extype" name="scala.Product">Product</span> with <span class="extype" name="scala.Serializable">Serializable</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@PrettifierConfigextendsProductwithSerializable" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <p class="shortcomment cmt"><strong>This class is deprecated and will be removed in a future version of ScalaTest. Please use an implicit Prettifier and PrettyMethods instead.</strong> </strong></p><div class="fullcomment"><div class="comment cmt"><p><strong>This class is deprecated and will be removed in a future version of ScalaTest. Please use an implicit Prettifier and PrettyMethods instead.</strong></p><p>Wraps a <code>Prettifier</code>.</p><p>This class exists so that instances of <code>PrettifierConfig</code> can be made implicit instead of <code>Prettifer</code>. Because <code>Prettifier</code> is a <code>Any =&gt; String</code>, making it implicit could result in unintentional applications.</p></div><dl class="paramcmts block"><dt class="param">prettifier</dt><dd class="cmt"><p>the configured <code>Prettifier</code></p></dd></dl><dl class="attributes block"> <dt>Annotations</dt><dd> <span class="name">@deprecated</span> </dd><dt>Deprecated</dt><dd class="cmt"><p>Please use Prettifer and PrettyMethods instead.</p></dd></dl></div> </li></ol> </div> <div id="values" class="values members"> <h3>Value Members</h3> <ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="!=(x$1:Any):Boolean"></a> <a id="!=(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@!=(x$1:Any):Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="##():Int"></a> <a id="##():Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@##():Int" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="==(x$1:Any):Boolean"></a> <a id="==(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@==(x$1:Any):Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="asInstanceOf[T0]:T0"></a> <a id="asInstanceOf[T0]:T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@asInstanceOf[T0]:T0" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="clone():Object"></a> <a id="clone():AnyRef"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@clone():Object" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="eq(x$1:AnyRef):Boolean"></a> <a id="eq(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@eq(x$1:AnyRef):Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#equals" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="equals(x$1:Any):Boolean"></a> <a id="equals(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@equals(x$1:Any):Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="finalize():Unit"></a> <a id="finalize():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@finalize():Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="symbol">classOf[java.lang.Throwable]</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="getClass():Class[_]"></a> <a id="getClass():Class[_]"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@getClass():Class[_]" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#hashCode" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="hashCode():Int"></a> <a id="hashCode():Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@hashCode():Int" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="isInstanceOf[T0]:Boolean"></a> <a id="isInstanceOf[T0]:Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@isInstanceOf[T0]:Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ne(x$1:AnyRef):Boolean"></a> <a id="ne(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@ne(x$1:AnyRef):Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notify():Unit"></a> <a id="notify():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@notify():Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notifyAll():Unit"></a> <a id="notifyAll():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@notifyAll():Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="org.scalactic.DeprecatedPrettyMethods#prettifierConfig" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="prettifierConfig:DeprecatedPrettyMethods.this.PrettifierConfig"></a> <a id="prettifierConfig:PrettifierConfig"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">implicit </span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">prettifierConfig</span><span class="result">: <a href="DeprecatedPrettyMethods$PrettifierConfig.html" class="extype" name="org.scalactic.DeprecatedPrettyMethods.PrettifierConfig">PrettifierConfig</a></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@prettifierConfig:DeprecatedPrettyMethods.this.PrettifierConfig" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <p class="shortcomment cmt">An implicit <code>PrettifierConfig</code> that contains a <code>Prettifier.default</code>.</code></code></p><div class="fullcomment"><div class="comment cmt"><p>An implicit <code>PrettifierConfig</code> that contains a <code>Prettifier.default</code>.</p><p>Subclasses can override this method with a different implicit method to have <code>pretty</code> use a different <code>Prettifier</code>.</p></div></div> </li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="synchronized[T0](x$1:=&gt;T0):T0"></a> <a id="synchronized[T0](⇒T0):T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@synchronized[T0](x$1:=&gt;T0):T0" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="toString():String"></a> <a id="toString():String"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@toString():String" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait():Unit"></a> <a id="wait():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@wait():Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long,x$2:Int):Unit"></a> <a id="wait(Long,Int):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@wait(x$1:Long,x$2:Int):Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long):Unit"></a> <a id="wait(Long):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalactic.DeprecatedPrettyMethods@wait(x$1:Long):Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li></ol> </div> </div> <div id="inheritedMembers"> <div class="parent" name="scala.AnyRef"> <h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3> </div><div class="parent" name="scala.Any"> <h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3> </div> </div> <div id="groupedMembers"> <div class="group" name="Ungrouped"> <h3>Ungrouped</h3> </div> </div> </div> <div id="tooltip"></div> <div id="footer"> </div> </body> </html>
{ "content_hash": "374670db34e9353c12c2ee644435f236", "timestamp": "", "source": "github", "line_count": 596, "max_line_length": 514, "avg_line_length": 54.401006711409394, "alnum_prop": 0.6104925515837523, "repo_name": "scalatest/scalactic-website", "id": "c64b9768758a3c31152bdb8f5b1ec0ff4c404a59", "size": "32441", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/scaladoc/3.0.0/org/scalactic/DeprecatedPrettyMethods.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1408792" }, { "name": "HTML", "bytes": "480104429" }, { "name": "JavaScript", "bytes": "2361554" }, { "name": "Procfile", "bytes": "62" }, { "name": "Scala", "bytes": "15775" } ], "symlink_target": "" }
<?xml version='1.0' encoding='UTF-8'?> <!-- edited with XMLSpy v2012 sp1 (x64) (http://www.altova.com) by Peter Backes (Wireless Generation) --> <!--Sample XML file generated by XMLSpy v2012 sp1 (http://www.altova.com) --> <InterchangeStaffAssociation xsi:schemaLocation='http://ed-fi.org/0100 ../../../../../../edfi-schema/src/main/resources/edfiXsd-SLI/SLI-Interchange-StaffAssociation.xsd' xmlns='http://ed-fi.org/0100' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <!-- jjackson to ACC-TEST-PROG-1 --> <StaffProgramAssociation> <StaffReference> <StaffIdentity> <StaffUniqueStateId>jjackson</StaffUniqueStateId> </StaffIdentity> </StaffReference> <ProgramReference> <ProgramIdentity> <ProgramId>ACC-TEST-PROG-1</ProgramId> </ProgramIdentity> </ProgramReference> <BeginDate>2011-12-31</BeginDate> <!-- change: should make a new entity --> <EndDate>2012-02-15</EndDate> <StudentRecordAccess>true</StudentRecordAccess> </StaffProgramAssociation> <!-- jjackson to ACC-TEST-PROG-2 --> <StaffProgramAssociation> <StaffReference> <StaffIdentity> <StaffUniqueStateId>jjackson</StaffUniqueStateId> </StaffIdentity> </StaffReference> <ProgramReference> <ProgramIdentity> <ProgramId>ACC-TEST-PROG-2</ProgramId> </ProgramIdentity> </ProgramReference> <BeginDate>2011-12-31</BeginDate> <!-- change: should make a new entity --> <EndDate>2012-02-15</EndDate> <StudentRecordAccess>true</StudentRecordAccess> </StaffProgramAssociation> <!-- jstevenson to ACC-TEST-PROG-1 --> <StaffProgramAssociation> <StaffReference> <StaffIdentity> <StaffUniqueStateId>jstevenson</StaffUniqueStateId> </StaffIdentity> </StaffReference> <ProgramReference> <ProgramIdentity> <ProgramId>ACC-TEST-PROG-1</ProgramId> </ProgramIdentity> </ProgramReference> <BeginDate>2011-12-31</BeginDate> <!-- change: should make a new entity --> <EndDate>2012-02-15</EndDate> <StudentRecordAccess>true</StudentRecordAccess> </StaffProgramAssociation> <!-- jstevenson to ACC-TEST-PROG-2 --> <StaffProgramAssociation> <StaffReference> <StaffIdentity> <StaffUniqueStateId>jstevenson</StaffUniqueStateId> </StaffIdentity> </StaffReference> <ProgramReference> <ProgramIdentity> <ProgramId>ACC-TEST-PROG-2</ProgramId> </ProgramIdentity> </ProgramReference> <BeginDate>2011-12-31</BeginDate> <!-- change: should make a new entity --> <EndDate>2012-02-15</EndDate> <StudentRecordAccess>true</StudentRecordAccess> </StaffProgramAssociation> <!-- sbantu to ACC-TEST-PROG-2 --> <StaffProgramAssociation> <StaffReference> <StaffIdentity> <StaffUniqueStateId>sbantu</StaffUniqueStateId> </StaffIdentity> </StaffReference> <ProgramReference> <ProgramIdentity> <ProgramId>ACC-TEST-PROG-2</ProgramId> </ProgramIdentity> </ProgramReference> <BeginDate>2011-01-01</BeginDate> <EndDate>2012-03-16</EndDate> <!-- change (add): should update existing entity --> <StudentRecordAccess>true</StudentRecordAccess> <!-- change: should update existing entity --> </StaffProgramAssociation> <!-- mjohnson to ACC-TEST-PROG-2 --> <StaffProgramAssociation> <StaffReference> <StaffIdentity> <StaffUniqueStateId>mjohnson</StaffUniqueStateId> </StaffIdentity> </StaffReference> <ProgramReference> <ProgramIdentity> <ProgramId>ACC-TEST-PROG-2</ProgramId> </ProgramIdentity> </ProgramReference> <BeginDate>2011-01-01</BeginDate> <EndDate>2012-03-16</EndDate> <!-- change (add): should update existing entity --> <StudentRecordAccess>true</StudentRecordAccess> <!-- change: should update existing entity --> </StaffProgramAssociation> </InterchangeStaffAssociation>
{ "content_hash": "374ec31460d15e9b08a0eaa29e852c13", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 254, "avg_line_length": 34.211009174311926, "alnum_prop": 0.7235183695360686, "repo_name": "inbloom/secure-data-service", "id": "4f6668d66fb06d8a9360118e8dffde54f0495407", "size": "3729", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sli/acceptance-tests/test/features/ingestion/test_data/StoriedDataSet_IL_Daybreak_Deltas/InterchangeStaffAssociation.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "9748" }, { "name": "CSS", "bytes": "112888" }, { "name": "Clojure", "bytes": "37861" }, { "name": "CoffeeScript", "bytes": "18305" }, { "name": "Groovy", "bytes": "26568" }, { "name": "Java", "bytes": "12115410" }, { "name": "JavaScript", "bytes": "390822" }, { "name": "Objective-C", "bytes": "490386" }, { "name": "Python", "bytes": "34255" }, { "name": "Ruby", "bytes": "2543748" }, { "name": "Shell", "bytes": "111267" }, { "name": "XSLT", "bytes": "144746" } ], "symlink_target": "" }
package com.sem4ikt.uni.recipefinderchatbot.presenter; import com.sem4ikt.uni.recipefinderchatbot.model.MessageModel; import com.sem4ikt.uni.recipefinderchatbot.view.IChatListAdapterView; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; /** * Created by mathiaslykkepedersen on 04/05/2017. */ @RunWith(MockitoJUnitRunner.class) //Includes mockito in unittestClass public class ChatListAdapterPresenterTest { @Mock //<-- Mocking with mockito IChatListAdapterView view; //Class that gets mocked private ChatListAdapterPresenter presenter; //class we want to unittest @Before public void setup() throws Exception { presenter = new ChatListAdapterPresenter(view); //Injecting the mocke class } @Test //Junit unittest annotation public void clearViewOnDestroy() { presenter.clearView(); //Call method Assert.assertEquals(presenter.getView(), null); //Assert with Junit } @Test public void addMessageTest() { MessageModel m = new MessageModel("",0, MessageModel.TYPE.NORMAL); presenter.addMessage(m); //Call Method //Static method verify from Mockijito, check if the mocked view //Received 1 call on the method onAddMessage with parameter m verify(view,times(1)).onAddMessage(m); } @Test public void setView() { presenter.clearView(); presenter.setView(view); Assert.assertEquals(presenter.getView(), view); } @Test public void doClickTest() { int position = 0; presenter.doClick(position); verify(view,times(1)).onClick(position); } }
{ "content_hash": "583e5574d90d2a0d19f6681f10150ce3", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 83, "avg_line_length": 26.154929577464788, "alnum_prop": 0.7032848680667744, "repo_name": "mat0pad/SemesterProjekt-4-IKT", "id": "12943ed438ecabc4d7c698587cd5d6ff86d48fdd", "size": "1857", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/test/java/com/sem4ikt/uni/recipefinderchatbot/presenter/ChatListAdapterPresenterTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "408444" } ], "symlink_target": "" }
document.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>'); var App = Ember.Application.create({}); var NAMESPACE = Ember.get(ECB_OUTPUT_CONFIG.global); App.rootElement = '#ember-testing'; emq.globalize(); App.setupForTesting(); App.injectTestHelpers(); setResolver(Ember.DefaultResolver.extend({ testSubjects: { 'component:eb-label': NAMESPACE.EBLabelComponent, 'component:eb-control': NAMESPACE.EBControlComponent, 'component:eb-bucket': NAMESPACE.EBBucketComponent, 'service:bucket': NAMESPACE.BucketService }, resolve: function(fullName) { return this.testSubjects[fullName] || this._super.apply(this, arguments); } }).create()); Function.prototype.compile = function() { var template = this.toString().split('\n').slice(1,-1).join('\n') + '\n'; return Ember.Handlebars.compile(template); }; function lookupComponent(id) { return Ember.View.views[id]; } function buildComponent(type, test, props) { props = props || {}; var component = test.subject(Ember.merge({ template: window.TEST_TEMPLATES[type] }, props)); test.append(); return component; } window.TEST_TEMPLATES = {};
{ "content_hash": "273735558e7c904d0f67f588ee51dc1a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 89, "avg_line_length": 27.162790697674417, "alnum_prop": 0.7029109589041096, "repo_name": "pixelhandler/ember-bucket", "id": "62d40e43619eb4e8d9cfaebaab882f02da2d8d92", "size": "1168", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/support/setup.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1697" }, { "name": "CoffeeScript", "bytes": "2421" }, { "name": "JavaScript", "bytes": "107603" }, { "name": "Shell", "bytes": "1043" } ], "symlink_target": "" }
#include <CoreFoundation/CFCalendar.h> #include <CoreFoundation/CFRuntime.h> #include "CFInternal.h" #include "CFPriv.h" #include <unicode/ucal.h> #define BUFFER_SIZE 512 struct __CFCalendar { CFRuntimeBase _base; CFStringRef _identifier; // canonical identifier, never NULL CFLocaleRef _locale; CFStringRef _localeID; CFTimeZoneRef _tz; UCalendar *_cal; }; static Boolean __CFCalendarEqual(CFTypeRef cf1, CFTypeRef cf2) { CFCalendarRef calendar1 = (CFCalendarRef)cf1; CFCalendarRef calendar2 = (CFCalendarRef)cf2; return CFEqual(calendar1->_identifier, calendar2->_identifier); } static CFHashCode __CFCalendarHash(CFTypeRef cf) { CFCalendarRef calendar = (CFCalendarRef)cf; return CFHash(calendar->_identifier); } static CFStringRef __CFCalendarCopyDescription(CFTypeRef cf) { CFCalendarRef calendar = (CFCalendarRef)cf; return CFStringCreateWithFormat(CFGetAllocator(calendar), NULL, CFSTR("<CFCalendar %p [%p]>{identifier = '%@'}"), cf, CFGetAllocator(calendar), calendar->_identifier); } static void __CFCalendarDeallocate(CFTypeRef cf) { CFCalendarRef calendar = (CFCalendarRef)cf; if (calendar->_identifier) CFRelease(calendar->_identifier); if (calendar->_locale) CFRelease(calendar->_locale); if (calendar->_localeID) CFRelease(calendar->_localeID); if (calendar->_identifier) CFRelease(calendar->_tz); if (calendar->_cal) ucal_close(calendar->_cal); } static CFTypeID __kCFCalendarTypeID = _kCFRuntimeNotATypeID; static const CFRuntimeClass __CFCalendarClass = { 0, "CFCalendar", NULL, // init NULL, // copy __CFCalendarDeallocate, __CFCalendarEqual, __CFCalendarHash, NULL, // __CFCalendarCopyDescription }; CFTypeID CFCalendarGetTypeID(void) { static dispatch_once_t initOnce; dispatch_once(&initOnce, ^{ __kCFCalendarTypeID = _CFRuntimeRegisterClass(&__CFCalendarClass); }); return __kCFCalendarTypeID; } CF_PRIVATE UCalendar *__CFCalendarCreateUCalendar(CFStringRef calendarID, CFStringRef localeID, CFTimeZoneRef tz) { if (calendarID) { CFDictionaryRef components = CFLocaleCreateComponentsFromLocaleIdentifier(kCFAllocatorSystemDefault, localeID); CFMutableDictionaryRef mcomponents = CFDictionaryCreateMutableCopy(kCFAllocatorSystemDefault, 0, components); CFDictionarySetValue(mcomponents, kCFLocaleCalendarIdentifier, calendarID); localeID = CFLocaleCreateLocaleIdentifierFromComponents(kCFAllocatorSystemDefault, mcomponents); CFRelease(mcomponents); CFRelease(components); } char buffer[BUFFER_SIZE]; const char *cstr = CFStringGetCStringPtr(localeID, kCFStringEncodingASCII); if (NULL == cstr) { if (CFStringGetCString(localeID, buffer, BUFFER_SIZE, kCFStringEncodingASCII)) cstr = buffer; } if (NULL == cstr) { if (calendarID) CFRelease(localeID); return NULL; } UChar ubuffer[BUFFER_SIZE]; CFStringRef tznam = CFTimeZoneGetName(tz); CFIndex cnt = CFStringGetLength(tznam); if (BUFFER_SIZE < cnt) cnt = BUFFER_SIZE; CFStringGetCharacters(tznam, CFRangeMake(0, cnt), (UniChar *)ubuffer); UErrorCode status = U_ZERO_ERROR; UCalendar *cal = ucal_open(ubuffer, cnt, cstr, UCAL_DEFAULT, &status); if (calendarID) CFRelease(localeID); return cal; } static void __CFCalendarSetupCal(CFCalendarRef calendar) { calendar->_cal = __CFCalendarCreateUCalendar(calendar->_identifier, calendar->_localeID, calendar->_tz); } #if DEPLOYMENT_RUNTIME_SWIFT Boolean _CFCalendarIsWeekend(CFCalendarRef calendar, CFAbsoluteTime at) { if (calendar->_cal == NULL) { __CFCalendarSetupCal(calendar); } UDate udate = at * 1000.0; UErrorCode status = U_ZERO_ERROR; UBool result = ucal_isWeekend(calendar->_cal, udate, &status); return result; } Boolean _CFCalendarGetNextWeekend(CFCalendarRef calendar, _CFCalendarWeekendRange *range) { CFIndex weekdaysIndex[7]; memset(weekdaysIndex, '\0', sizeof(CFIndex)*7); CFIndex firstWeekday = CFCalendarGetFirstWeekday(calendar); weekdaysIndex[0] = firstWeekday; for (CFIndex i = 1; i < 7; i++) { weekdaysIndex[i] = (weekdaysIndex[i-1] % 7) + 1; } UCalendarWeekdayType weekdayTypes[7]; CFIndex onset = kCFNotFound; CFIndex cease = kCFNotFound; if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (!calendar->_cal) { return false; } for (CFIndex i = 0; i < 7; i++) { UErrorCode status = U_ZERO_ERROR; weekdayTypes[i] = ucal_getDayOfWeekType(calendar->_cal, (UCalendarDaysOfWeek)weekdaysIndex[i], &status); if (weekdayTypes[i] == UCAL_WEEKEND_ONSET) { onset = weekdaysIndex[i]; } else if (weekdayTypes[i] == UCAL_WEEKEND_CEASE) { cease = weekdaysIndex[i]; } } BOOL hasWeekend = NO; for (CFIndex i = 0; i < 7; i++) { if (weekdayTypes[i] == UCAL_WEEKEND || weekdayTypes[i] == UCAL_WEEKEND_ONSET || weekdayTypes[i] == UCAL_WEEKEND_CEASE) { hasWeekend = YES; break; } } if (!hasWeekend) { return false; } int32_t onsetTime = 0; int32_t ceaseTime = 0; if (onset != kCFNotFound) { UErrorCode status = U_ZERO_ERROR; onsetTime = ucal_getWeekendTransition(calendar->_cal, (UCalendarDaysOfWeek)onset, &status); } if (cease != kCFNotFound) { UErrorCode status = U_ZERO_ERROR; ceaseTime = ucal_getWeekendTransition(calendar->_cal, (UCalendarDaysOfWeek)cease, &status); } CFIndex weekendStart = kCFNotFound; CFIndex weekendEnd = kCFNotFound; if (onset != kCFNotFound) { weekendStart = onset; } else { if (weekdayTypes[0] == UCAL_WEEKEND && weekdayTypes[6] == UCAL_WEEKEND) { for (CFIndex i = 5; i >= 0; i--) { if (weekdayTypes[i] != UCAL_WEEKEND) { weekendStart = weekdaysIndex[i + 1]; break; } } } else { for (CFIndex i = 0; i < 7; i++) { if (weekdayTypes[i] == UCAL_WEEKEND) { weekendStart = weekdaysIndex[i]; break; } } } } if (cease != kCFNotFound) { weekendEnd = cease; } else { if (weekdayTypes[0] == UCAL_WEEKEND && weekdayTypes[6] == UCAL_WEEKEND) { for (CFIndex i = 1; i < 7; i++) { if (weekdayTypes[i] != UCAL_WEEKEND) { weekendEnd = weekdaysIndex[i - 1]; break; } } } else { for (CFIndex i = 6; i >= 0; i--) { if (weekdayTypes[i] == UCAL_WEEKEND) { weekendEnd = weekdaysIndex[i]; break; } } } } range->onsetTime = onsetTime / 1000.0; range->ceaseTime = ceaseTime / 1000.0; range->start = weekendStart; range->end = weekendEnd; return true; } #endif static void __CFCalendarZapCal(CFCalendarRef calendar) { ucal_close(calendar->_cal); calendar->_cal = NULL; } CFCalendarRef CFCalendarCopyCurrent(void) { CFLocaleRef locale = CFLocaleCopyCurrent(); CFCalendarRef calID = (CFCalendarRef)CFLocaleGetValue(locale, kCFLocaleCalendarIdentifier); if (calID) { CFCalendarRef calendar = CFCalendarCreateWithIdentifier(kCFAllocatorSystemDefault, (CFStringRef)calID); CFCalendarSetLocale(calendar, locale); CFRelease(locale); return calendar; } return NULL; } Boolean _CFCalendarInitWithIdentifier(CFCalendarRef calendar, CFStringRef identifier) { if (identifier != kCFGregorianCalendar && identifier != kCFBuddhistCalendar && identifier != kCFJapaneseCalendar && identifier != kCFIslamicCalendar && identifier != kCFIslamicCivilCalendar && identifier != kCFHebrewCalendar && identifier != kCFRepublicOfChinaCalendar && identifier != kCFPersianCalendar && identifier != kCFCalendarIdentifierCoptic && identifier != kCFCalendarIdentifierEthiopicAmeteMihret && identifier != kCFCalendarIdentifierEthiopicAmeteAlem && identifier != kCFChineseCalendar && identifier != kCFISO8601Calendar && identifier != kCFIslamicTabularCalendar && identifier != kCFIslamicUmmAlQuraCalendar) { if (CFEqual(kCFGregorianCalendar, identifier)) identifier = kCFGregorianCalendar; else if (CFEqual(kCFBuddhistCalendar, identifier)) identifier = kCFBuddhistCalendar; else if (CFEqual(kCFJapaneseCalendar, identifier)) identifier = kCFJapaneseCalendar; else if (CFEqual(kCFIslamicCalendar, identifier)) identifier = kCFIslamicCalendar; else if (CFEqual(kCFIslamicCivilCalendar, identifier)) identifier = kCFIslamicCivilCalendar; else if (CFEqual(kCFHebrewCalendar, identifier)) identifier = kCFHebrewCalendar; else if (CFEqual(kCFRepublicOfChinaCalendar, identifier)) identifier = kCFRepublicOfChinaCalendar; else if (CFEqual(kCFPersianCalendar, identifier)) identifier = kCFPersianCalendar; else if (CFEqual(kCFIndianCalendar, identifier)) identifier = kCFIndianCalendar; else if (CFEqual(kCFCalendarIdentifierCoptic, identifier)) identifier = kCFCalendarIdentifierCoptic; else if (CFEqual(kCFCalendarIdentifierEthiopicAmeteMihret, identifier)) identifier = kCFCalendarIdentifierEthiopicAmeteMihret; else if (CFEqual(kCFCalendarIdentifierEthiopicAmeteAlem, identifier)) identifier = kCFCalendarIdentifierEthiopicAmeteAlem; else if (CFEqual(kCFChineseCalendar, identifier)) identifier = kCFChineseCalendar; else if (CFEqual(kCFISO8601Calendar, identifier)) identifier = kCFISO8601Calendar; else if (CFEqual(kCFIslamicTabularCalendar, identifier)) identifier = kCFIslamicTabularCalendar; else if (CFEqual(kCFIslamicUmmAlQuraCalendar, identifier)) identifier = kCFIslamicUmmAlQuraCalendar; else return false; } calendar->_identifier = (CFStringRef)CFRetain(identifier); calendar->_locale = NULL; calendar->_localeID = CFRetain(CFLocaleGetIdentifier(CFLocaleGetSystem())); calendar->_tz = CFTimeZoneCopyDefault(); calendar->_cal = NULL; return true; } CFCalendarRef CFCalendarCreateWithIdentifier(CFAllocatorRef allocator, CFStringRef identifier) { if (allocator == NULL) allocator = __CFGetDefaultAllocator(); __CFGenericValidateType(allocator, CFAllocatorGetTypeID()); __CFGenericValidateType(identifier, CFStringGetTypeID()); // return NULL until Chinese calendar is available if (identifier != kCFGregorianCalendar && identifier != kCFBuddhistCalendar && identifier != kCFJapaneseCalendar && identifier != kCFIslamicCalendar && identifier != kCFIslamicCivilCalendar && identifier != kCFHebrewCalendar) { // if (identifier != kCFGregorianCalendar && identifier != kCFBuddhistCalendar && identifier != kCFJapaneseCalendar && identifier != kCFIslamicCalendar && identifier != kCFIslamicCivilCalendar && identifier != kCFHebrewCalendar && identifier != kCFChineseCalendar) { if (CFEqual(kCFGregorianCalendar, identifier)) identifier = kCFGregorianCalendar; else if (CFEqual(kCFBuddhistCalendar, identifier)) identifier = kCFBuddhistCalendar; else if (CFEqual(kCFJapaneseCalendar, identifier)) identifier = kCFJapaneseCalendar; else if (CFEqual(kCFIslamicCalendar, identifier)) identifier = kCFIslamicCalendar; else if (CFEqual(kCFIslamicCivilCalendar, identifier)) identifier = kCFIslamicCivilCalendar; else if (CFEqual(kCFHebrewCalendar, identifier)) identifier = kCFHebrewCalendar; else if (CFEqual(kCFISO8601Calendar, identifier)) identifier = kCFISO8601Calendar; // else if (CFEqual(kCFChineseCalendar, identifier)) identifier = kCFChineseCalendar; else return NULL; } struct __CFCalendar *calendar = NULL; uint32_t size = sizeof(struct __CFCalendar) - sizeof(CFRuntimeBase); calendar = (struct __CFCalendar *)_CFRuntimeCreateInstance(allocator, CFCalendarGetTypeID(), size, NULL); if (NULL == calendar) { return NULL; } calendar->_identifier = (CFStringRef)CFRetain(identifier); calendar->_locale = NULL; calendar->_localeID = CFRetain(CFLocaleGetIdentifier(CFLocaleGetSystem())); calendar->_tz = CFTimeZoneCopyDefault(); calendar->_cal = NULL; return (CFCalendarRef)calendar; } CFStringRef CFCalendarGetIdentifier(CFCalendarRef calendar) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), CFStringRef, calendar, calendarIdentifier); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); return calendar->_identifier; } CFLocaleRef CFCalendarCopyLocale(CFCalendarRef calendar) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), CFLocaleRef, calendar, _copyLocale); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); return (CFLocaleRef)CFLocaleCreate(kCFAllocatorSystemDefault, calendar->_localeID); } void CFCalendarSetLocale(CFCalendarRef calendar, CFLocaleRef locale) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), void, calendar, setLocale:locale); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); __CFGenericValidateType(locale, CFLocaleGetTypeID()); CFStringRef localeID = CFLocaleGetIdentifier(locale); if (localeID != calendar->_localeID) { CFRelease(calendar->_localeID); CFRetain(localeID); calendar->_localeID = localeID; if (calendar->_cal) __CFCalendarZapCal(calendar); } } CFTimeZoneRef CFCalendarCopyTimeZone(CFCalendarRef calendar) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), CFTimeZoneRef, calendar_copyTimeZone); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); return (CFTimeZoneRef)CFRetain(calendar->_tz); } void CFCalendarSetTimeZone(CFCalendarRef calendar, CFTimeZoneRef tz) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), void, calendar, setTimeZone:tz); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); if (tz) __CFGenericValidateType(tz, CFTimeZoneGetTypeID()); if (tz != calendar->_tz) { CFRelease(calendar->_tz); calendar->_tz = tz ? (CFTimeZoneRef)CFRetain(tz) : CFTimeZoneCopyDefault(); if (calendar->_cal) __CFCalendarZapCal(calendar); } } CFIndex CFCalendarGetFirstWeekday(CFCalendarRef calendar) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), CFIndex, calendar, firstWeekday); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) { return ucal_getAttribute(calendar->_cal, UCAL_FIRST_DAY_OF_WEEK); } return -1; } void CFCalendarSetFirstWeekday(CFCalendarRef calendar, CFIndex wkdy) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), void, calendar, setFirstWeekday:wkdy); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) { ucal_setAttribute(calendar->_cal, UCAL_FIRST_DAY_OF_WEEK, wkdy); } } CFIndex CFCalendarGetMinimumDaysInFirstWeek(CFCalendarRef calendar) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), CFIndex, calendar, minimumDaysInFirstWeek); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); if (!calendar->_cal) __CFCalendarSetupCal(calendar); return calendar->_cal ? ucal_getAttribute(calendar->_cal, UCAL_MINIMAL_DAYS_IN_FIRST_WEEK) : -1; } void CFCalendarSetMinimumDaysInFirstWeek(CFCalendarRef calendar, CFIndex mwd) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), void, calendar, setMinimumDaysInFirstWeek:mwd); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) ucal_setAttribute(calendar->_cal, UCAL_MINIMAL_DAYS_IN_FIRST_WEEK, mwd); } CFDateRef CFCalendarCopyGregorianStartDate(CFCalendarRef calendar) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), CFDateRef, calendar, _gregorianStartDate); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); if (!calendar->_cal) __CFCalendarSetupCal(calendar); UErrorCode status = U_ZERO_ERROR; UDate udate = calendar->_cal ? ucal_getGregorianChange(calendar->_cal, &status) : 0; if (calendar->_cal && U_SUCCESS(status)) { CFAbsoluteTime at = (double)udate / 1000.0 - kCFAbsoluteTimeIntervalSince1970; return CFDateCreate(CFGetAllocator(calendar), at); } return NULL; } void CFCalendarSetGregorianStartDate(CFCalendarRef calendar, CFDateRef date) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), void, calendar, _setGregorianStartDate:date); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); if (date) __CFGenericValidateType(date, CFDateGetTypeID()); if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (!calendar->_cal) return; if (!date) { UErrorCode status = U_ZERO_ERROR; UCalendar *cal = __CFCalendarCreateUCalendar(calendar->_identifier, calendar->_localeID, calendar->_tz); UDate udate = cal ? ucal_getGregorianChange(cal, &status) : 0; if (cal && U_SUCCESS(status)) { status = U_ZERO_ERROR; if (calendar->_cal) ucal_setGregorianChange(calendar->_cal, udate, &status); } if (cal) ucal_close(cal); } else { CFAbsoluteTime at = CFDateGetAbsoluteTime(date); UDate udate = (at + kCFAbsoluteTimeIntervalSince1970) * 1000.0; UErrorCode status = U_ZERO_ERROR; if (calendar->_cal) ucal_setGregorianChange(calendar->_cal, udate, &status); } } static UCalendarDateFields __CFCalendarGetICUFieldCode(CFCalendarUnit unit) { switch (unit) { case kCFCalendarUnitEra: return UCAL_ERA; case kCFCalendarUnitYear: return UCAL_YEAR; case kCFCalendarUnitMonth: return UCAL_MONTH; case kCFCalendarUnitDay: return UCAL_DAY_OF_MONTH; case kCFCalendarUnitHour: return UCAL_HOUR_OF_DAY; case kCFCalendarUnitMinute: return UCAL_MINUTE; case kCFCalendarUnitSecond: return UCAL_SECOND; case kCFCalendarUnitWeek: return UCAL_WEEK_OF_YEAR; case kCFCalendarUnitWeekOfYear: return UCAL_WEEK_OF_YEAR; case kCFCalendarUnitWeekOfMonth: return UCAL_WEEK_OF_MONTH; case kCFCalendarUnitYearForWeekOfYear: return UCAL_YEAR_WOY; case kCFCalendarUnitWeekday: return UCAL_DAY_OF_WEEK; case kCFCalendarUnitWeekdayOrdinal: return UCAL_DAY_OF_WEEK_IN_MONTH; } return (UCalendarDateFields)-1; } static UCalendarDateFields __CFCalendarGetICUFieldCodeFromChar(char ch) { switch (ch) { case 'G': return UCAL_ERA; case 'y': return UCAL_YEAR; case 'M': return UCAL_MONTH; case 'l': return UCAL_IS_LEAP_MONTH; case 'd': return UCAL_DAY_OF_MONTH; case 'h': return UCAL_HOUR; case 'H': return UCAL_HOUR_OF_DAY; case 'm': return UCAL_MINUTE; case 's': return UCAL_SECOND; case 'S': return UCAL_MILLISECOND; case 'w': return UCAL_WEEK_OF_YEAR; case 'W': return UCAL_WEEK_OF_MONTH; case 'Y': return UCAL_YEAR_WOY; case 'E': return UCAL_DAY_OF_WEEK; case 'D': return UCAL_DAY_OF_YEAR; case 'F': return UCAL_DAY_OF_WEEK_IN_MONTH; case 'a': return UCAL_AM_PM; case 'g': return UCAL_JULIAN_DAY; } return (UCalendarDateFields)-1; } static CFCalendarUnit __CFCalendarGetCalendarUnitFromChar(char ch) { switch (ch) { case 'G': return kCFCalendarUnitEra; case 'y': return kCFCalendarUnitYear; case 'M': return kCFCalendarUnitMonth; case 'd': return kCFCalendarUnitDay; case 'H': return kCFCalendarUnitHour; case 'm': return kCFCalendarUnitMinute; case 's': return kCFCalendarUnitSecond; case 'w': return kCFCalendarUnitWeekOfYear; case 'W': return kCFCalendarUnitWeekOfMonth; case 'Y': return kCFCalendarUnitYearForWeekOfYear; case 'E': return kCFCalendarUnitWeekday; case 'F': return kCFCalendarUnitWeekdayOrdinal; } return (UCalendarDateFields)-1; } CFRange CFCalendarGetMinimumRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), CFRange, calendar, _minimumRangeOfUnit:unit); CFRange range = {kCFNotFound, kCFNotFound}; __CFGenericValidateType(calendar, CFCalendarGetTypeID()); if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) { ucal_clear(calendar->_cal); UCalendarDateFields field = __CFCalendarGetICUFieldCode(unit); UErrorCode status = U_ZERO_ERROR; range.location = ucal_getLimit(calendar->_cal, field, UCAL_GREATEST_MINIMUM, &status); range.length = ucal_getLimit(calendar->_cal, field, UCAL_LEAST_MAXIMUM, &status) - range.location + 1; if (UCAL_MONTH == field) range.location++; if (100000 < range.length) range.length = 100000; } return range; } CFRange CFCalendarGetMaximumRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), CFRange, calendar, _maximumRangeOfUnit:unit); CFRange range = {kCFNotFound, kCFNotFound}; __CFGenericValidateType(calendar, CFCalendarGetTypeID()); if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) { ucal_clear(calendar->_cal); UCalendarDateFields field = __CFCalendarGetICUFieldCode(unit); UErrorCode status = U_ZERO_ERROR; range.location = ucal_getLimit(calendar->_cal, field, UCAL_MINIMUM, &status); range.length = ucal_getLimit(calendar->_cal, field, UCAL_MAXIMUM, &status) - range.location + 1; if (UCAL_MONTH == field) range.location++; if (100000 < range.length) range.length = 100000; } return range; } static void __CFCalendarSetToFirstInstant(CFCalendarRef calendar, CFCalendarUnit unit, CFAbsoluteTime at) { // Set UCalendar to first instant of unit prior to 'at' UErrorCode status = U_ZERO_ERROR; UDate udate = floor((at + kCFAbsoluteTimeIntervalSince1970) * 1000.0); ucal_setMillis(calendar->_cal, udate, &status); int target_era = INT_MIN; switch (unit) { // largest to smallest, we set the fields to their minimum value case kCFCalendarUnitYearForWeekOfYear:; ucal_set(calendar->_cal, UCAL_WEEK_OF_YEAR, ucal_getLimit(calendar->_cal, UCAL_WEEK_OF_YEAR, UCAL_ACTUAL_MINIMUM, &status)); case kCFCalendarUnitWeek: case kCFCalendarUnitWeekOfMonth:; case kCFCalendarUnitWeekOfYear:; { // reduce to first day of week, then reduce the rest of the day int32_t goal = ucal_getAttribute(calendar->_cal, UCAL_FIRST_DAY_OF_WEEK); int32_t dow = ucal_get(calendar->_cal, UCAL_DAY_OF_WEEK, &status); while (dow != goal) { ucal_add(calendar->_cal, UCAL_DAY_OF_MONTH, -1, &status); dow = ucal_get(calendar->_cal, UCAL_DAY_OF_WEEK, &status); } goto day; } case kCFCalendarUnitEra: { target_era = ucal_get(calendar->_cal, UCAL_ERA, &status); ucal_set(calendar->_cal, UCAL_YEAR, ucal_getLimit(calendar->_cal, UCAL_YEAR, UCAL_ACTUAL_MINIMUM, &status)); } case kCFCalendarUnitYear: ucal_set(calendar->_cal, UCAL_MONTH, ucal_getLimit(calendar->_cal, UCAL_MONTH, UCAL_ACTUAL_MINIMUM, &status)); case kCFCalendarUnitMonth: ucal_set(calendar->_cal, UCAL_DAY_OF_MONTH, ucal_getLimit(calendar->_cal, UCAL_DAY_OF_MONTH, UCAL_ACTUAL_MINIMUM, &status)); case kCFCalendarUnitWeekday: case kCFCalendarUnitDay: day:; ucal_set(calendar->_cal, UCAL_HOUR_OF_DAY, ucal_getLimit(calendar->_cal, UCAL_HOUR_OF_DAY, UCAL_ACTUAL_MINIMUM, &status)); case kCFCalendarUnitHour: ucal_set(calendar->_cal, UCAL_MINUTE, ucal_getLimit(calendar->_cal, UCAL_MINUTE, UCAL_ACTUAL_MINIMUM, &status)); case kCFCalendarUnitMinute: ucal_set(calendar->_cal, UCAL_SECOND, ucal_getLimit(calendar->_cal, UCAL_SECOND, UCAL_ACTUAL_MINIMUM, &status)); case kCFCalendarUnitSecond: ucal_set(calendar->_cal, UCAL_MILLISECOND, 0); } if (INT_MIN != target_era && ucal_get(calendar->_cal, UCAL_ERA, &status) < target_era) { // In the Japanese calendar, and possibly others, eras don't necessarily // start on the first day of a year, so the previous code may have backed // up into the previous era, and we have to correct forward. UDate bad_udate = ucal_getMillis(calendar->_cal, &status); ucal_add(calendar->_cal, UCAL_MONTH, 1, &status); while (ucal_get(calendar->_cal, UCAL_ERA, &status) < target_era) { bad_udate = ucal_getMillis(calendar->_cal, &status); ucal_add(calendar->_cal, UCAL_MONTH, 1, &status); } udate = ucal_getMillis(calendar->_cal, &status); // target date is between bad_udate and udate for (;;) { UDate test_udate = (udate + bad_udate) / 2; ucal_setMillis(calendar->_cal, test_udate, &status); if (ucal_get(calendar->_cal, UCAL_ERA, &status) < target_era) { bad_udate = test_udate; } else { udate = test_udate; } if (fabs(udate - bad_udate) < 1000) break; } do { bad_udate = floor((bad_udate + 1000) / 1000) * 1000; ucal_setMillis(calendar->_cal, bad_udate, &status); } while (ucal_get(calendar->_cal, UCAL_ERA, &status) < target_era); } } static Boolean __validUnits(CFCalendarUnit smaller, CFCalendarUnit bigger) { switch (bigger) { case kCFCalendarUnitEra: if (kCFCalendarUnitEra == smaller) return false; if (kCFCalendarUnitWeekday == smaller) return false; if (kCFCalendarUnitMinute == smaller) return false; // this causes CFIndex overflow in range.length if (kCFCalendarUnitSecond == smaller) return false; // this causes CFIndex overflow in range.length return true; case kCFCalendarUnitYearForWeekOfYear: case kCFCalendarUnitYear: if (kCFCalendarUnitEra == smaller) return false; if (kCFCalendarUnitYear == smaller) return false; if (kCFCalendarUnitYearForWeekOfYear == smaller) return false; if (kCFCalendarUnitWeekday == smaller) return false; return true; case kCFCalendarUnitMonth: if (kCFCalendarUnitEra == smaller) return false; if (kCFCalendarUnitYear == smaller) return false; if (kCFCalendarUnitMonth == smaller) return false; if (kCFCalendarUnitWeekday == smaller) return false; return true; case kCFCalendarUnitDay: if (kCFCalendarUnitHour == smaller) return true; if (kCFCalendarUnitMinute == smaller) return true; if (kCFCalendarUnitSecond == smaller) return true; return false; case kCFCalendarUnitHour: if (kCFCalendarUnitMinute == smaller) return true; if (kCFCalendarUnitSecond == smaller) return true; return false; case kCFCalendarUnitMinute: if (kCFCalendarUnitSecond == smaller) return true; return false; case kCFCalendarUnitWeek: case kCFCalendarUnitWeekOfMonth: case kCFCalendarUnitWeekOfYear: if (kCFCalendarUnitWeekday == smaller) return true; if (kCFCalendarUnitDay == smaller) return true; if (kCFCalendarUnitHour == smaller) return true; if (kCFCalendarUnitMinute == smaller) return true; if (kCFCalendarUnitSecond == smaller) return true; return false; case kCFCalendarUnitSecond: case kCFCalendarUnitWeekday: case kCFCalendarUnitWeekdayOrdinal: return false; } return false; }; static CFRange __CFCalendarGetRangeOfUnit2(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at) __attribute__((noinline)); static CFRange __CFCalendarGetRangeOfUnit2(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), CFRange, calendar, _rangeOfUnit:smallerUnit inUnit:biggerUnit forAT:at); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); CFRange range = {kCFNotFound, kCFNotFound}; if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) { switch (smallerUnit) { case kCFCalendarUnitSecond: switch (biggerUnit) { case kCFCalendarUnitMinute: case kCFCalendarUnitHour: case kCFCalendarUnitDay: case kCFCalendarUnitWeekday: case kCFCalendarUnitWeek: case kCFCalendarUnitMonth: case kCFCalendarUnitYear: case kCFCalendarUnitEra: // goto calculate; range.location = 0; range.length = 60; break; } break; case kCFCalendarUnitMinute: switch (biggerUnit) { case kCFCalendarUnitHour: case kCFCalendarUnitDay: case kCFCalendarUnitWeekday: case kCFCalendarUnitWeek: case kCFCalendarUnitMonth: case kCFCalendarUnitYear: case kCFCalendarUnitEra: // goto calculate; range.location = 0; range.length = 60; break; } break; case kCFCalendarUnitHour: switch (biggerUnit) { case kCFCalendarUnitDay: case kCFCalendarUnitWeekday: case kCFCalendarUnitWeek: case kCFCalendarUnitMonth: case kCFCalendarUnitYear: case kCFCalendarUnitEra: // goto calculate; range.location = 0; range.length = 24; break; } break; case kCFCalendarUnitDay: switch (biggerUnit) { case kCFCalendarUnitWeek: case kCFCalendarUnitMonth: case kCFCalendarUnitYear: case kCFCalendarUnitEra: goto calculate; break; } break; case kCFCalendarUnitWeekday: switch (biggerUnit) { case kCFCalendarUnitWeek: case kCFCalendarUnitMonth: case kCFCalendarUnitYear: case kCFCalendarUnitEra: goto calculate; break; } break; case kCFCalendarUnitWeekdayOrdinal: switch (biggerUnit) { case kCFCalendarUnitMonth: case kCFCalendarUnitYear: case kCFCalendarUnitEra: goto calculate; break; } break; case kCFCalendarUnitWeek: switch (biggerUnit) { case kCFCalendarUnitMonth: case kCFCalendarUnitYear: case kCFCalendarUnitEra: goto calculate; break; } break; case kCFCalendarUnitMonth: switch (biggerUnit) { case kCFCalendarUnitYear: case kCFCalendarUnitEra: goto calculate; break; } break; case kCFCalendarUnitYear: switch (biggerUnit) { case kCFCalendarUnitEra: goto calculate; break; } break; case kCFCalendarUnitEra: break; } } return range; calculate:; ucal_clear(calendar->_cal); UCalendarDateFields smallField = __CFCalendarGetICUFieldCode(smallerUnit); UCalendarDateFields bigField = __CFCalendarGetICUFieldCode(biggerUnit); UCalendarDateFields yearField = __CFCalendarGetICUFieldCode(kCFCalendarUnitYear); UCalendarDateFields fieldToAdd = smallField; if (kCFCalendarUnitWeekday == smallerUnit) { fieldToAdd = __CFCalendarGetICUFieldCode(kCFCalendarUnitDay); } int32_t dow = -1; if (kCFCalendarUnitWeekdayOrdinal == smallerUnit) { UErrorCode status = U_ZERO_ERROR; UDate udate = floor((at + kCFAbsoluteTimeIntervalSince1970) * 1000.0); ucal_setMillis(calendar->_cal, udate, &status); dow = ucal_get(calendar->_cal, UCAL_DAY_OF_WEEK, &status); fieldToAdd = __CFCalendarGetICUFieldCode(kCFCalendarUnitWeek); } // Set calendar to first instant of big unit __CFCalendarSetToFirstInstant(calendar, biggerUnit, at); if (kCFCalendarUnitWeekdayOrdinal == smallerUnit) { UErrorCode status = U_ZERO_ERROR; // roll day forward to first 'dow' while (ucal_get(calendar->_cal, (kCFCalendarUnitMonth == biggerUnit) ? UCAL_WEEK_OF_MONTH : UCAL_WEEK_OF_YEAR, &status) != 1) { ucal_add(calendar->_cal, UCAL_DAY_OF_MONTH, 1, &status); } while (ucal_get(calendar->_cal, UCAL_DAY_OF_WEEK, &status) != dow) { ucal_add(calendar->_cal, UCAL_DAY_OF_MONTH, 1, &status); } } int32_t minSmallValue = INT32_MAX; int32_t maxSmallValue = INT32_MIN; UErrorCode status = U_ZERO_ERROR; int32_t bigValue = ucal_get(calendar->_cal, bigField, &status); for (;;) { int32_t smallValue = ucal_get(calendar->_cal, smallField, &status); if (smallValue < minSmallValue) minSmallValue = smallValue; if (smallValue > maxSmallValue) maxSmallValue = smallValue; ucal_add(calendar->_cal, fieldToAdd, 1, &status); if (bigValue != ucal_get(calendar->_cal, bigField, &status)) break; if (biggerUnit == kCFCalendarUnitEra && ucal_get(calendar->_cal, yearField, &status) > 10000) break; // we assume an answer for 10000 years can be extrapolated to 100000 years, to save time } status = U_ZERO_ERROR; range.location = minSmallValue; if (smallerUnit == kCFCalendarUnitMonth) range.location = 1; range.length = maxSmallValue - minSmallValue + 1; if (biggerUnit == kCFCalendarUnitEra && ucal_get(calendar->_cal, yearField, &status) > 10000) range.length = 100000; return range; } CFRange CFCalendarGetRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at) { return __CFCalendarGetRangeOfUnit2(calendar, smallerUnit, biggerUnit, at); } CFIndex CFCalendarGetOrdinalityOfUnit(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at) { CFIndex result = kCFNotFound; if (!__validUnits(smallerUnit, biggerUnit)) return result; CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), CFIndex, calendar, _ordinalityOfUnit:smallerUnit inUnit:biggerUnit forAT:at); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) { UErrorCode status = U_ZERO_ERROR; ucal_clear(calendar->_cal); if (kCFCalendarUnitWeek == smallerUnit && kCFCalendarUnitYear == biggerUnit) { UDate udate = floor((at + kCFAbsoluteTimeIntervalSince1970) * 1000.0); ucal_setMillis(calendar->_cal, udate, &status); int32_t val = ucal_get(calendar->_cal, UCAL_WEEK_OF_YEAR, &status); return val; } else if (kCFCalendarUnitWeek == smallerUnit && kCFCalendarUnitMonth == biggerUnit) { UDate udate = floor((at + kCFAbsoluteTimeIntervalSince1970) * 1000.0); ucal_setMillis(calendar->_cal, udate, &status); int32_t val = ucal_get(calendar->_cal, UCAL_WEEK_OF_MONTH, &status); return val; } UCalendarDateFields smallField = __CFCalendarGetICUFieldCode(smallerUnit); // Set calendar to first instant of big unit __CFCalendarSetToFirstInstant(calendar, biggerUnit, at); UDate curr = ucal_getMillis(calendar->_cal, &status); UDate goal = floor((at + kCFAbsoluteTimeIntervalSince1970) * 1000.0); result = 1; const int multiple_table[] = {0, 0, 16, 19, 24, 26, 24, 28, 14, 14, 14}; int multiple = (1 << multiple_table[flsl(smallerUnit) - 1]); Boolean divide = false, alwaysDivide = false; while (curr < goal) { ucal_add(calendar->_cal, smallField, multiple, &status); UDate newcurr = ucal_getMillis(calendar->_cal, &status); if (curr < newcurr && newcurr <= goal) { result += multiple; curr = newcurr; } else { // Either newcurr is going backwards, or not making // progress, or has overshot the goal; reset date // and try smaller multiples. ucal_setMillis(calendar->_cal, curr, &status); divide = true; // once we start overshooting the goal, the add at // smaller multiples will succeed at most once for // each multiple, so we reduce it every time through // the loop. if (goal < newcurr) alwaysDivide = true; } if (divide) { multiple = multiple / 2; if (0 == multiple) break; divide = alwaysDivide; } } } return result; } Boolean _CFCalendarComposeAbsoluteTimeV(CFCalendarRef calendar, /* out */ CFAbsoluteTime *atp, const char *componentDesc, int *vector, int count) { if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) { UErrorCode status = U_ZERO_ERROR; ucal_clear(calendar->_cal); ucal_set(calendar->_cal, UCAL_YEAR, 1); ucal_set(calendar->_cal, UCAL_MONTH, 0); ucal_set(calendar->_cal, UCAL_DAY_OF_MONTH, 1); ucal_set(calendar->_cal, UCAL_HOUR_OF_DAY, 0); ucal_set(calendar->_cal, UCAL_MINUTE, 0); ucal_set(calendar->_cal, UCAL_SECOND, 0); const char *desc = componentDesc; Boolean doWOY = false; char ch = *desc; while (ch) { UCalendarDateFields field = __CFCalendarGetICUFieldCodeFromChar(ch); if (UCAL_WEEK_OF_YEAR == field) { doWOY = true; } desc++; ch = *desc; } desc = componentDesc; ch = *desc; while (ch) { UCalendarDateFields field = __CFCalendarGetICUFieldCodeFromChar(ch); int value = *vector; if (UCAL_YEAR == field && doWOY) field = UCAL_YEAR_WOY; if (UCAL_MONTH == field) value--; ucal_set(calendar->_cal, field, value); vector++; desc++; ch = *desc; } UDate udate = ucal_getMillis(calendar->_cal, &status); CFAbsoluteTime at = (udate / 1000.0) - kCFAbsoluteTimeIntervalSince1970; if (atp) *atp = at; return U_SUCCESS(status) ? true : false; } return false; } Boolean _CFCalendarDecomposeAbsoluteTimeV(CFCalendarRef calendar, CFAbsoluteTime at, const char *componentDesc, int **vector, int count) { if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) { UErrorCode status = U_ZERO_ERROR; ucal_clear(calendar->_cal); UDate udate = floor((at + kCFAbsoluteTimeIntervalSince1970) * 1000.0); ucal_setMillis(calendar->_cal, udate, &status); char ch = *componentDesc; while (ch) { UCalendarDateFields field = __CFCalendarGetICUFieldCodeFromChar(ch); int value = ucal_get(calendar->_cal, field, &status); if (UCAL_MONTH == field) value++; *(*vector) = value; vector++; componentDesc++; ch = *componentDesc; } return U_SUCCESS(status) ? true : false; } return false; } Boolean _CFCalendarAddComponentsV(CFCalendarRef calendar, /* inout */ CFAbsoluteTime *atp, CFOptionFlags options, const char *componentDesc, int *vector, int count) { if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) { UErrorCode status = U_ZERO_ERROR; ucal_clear(calendar->_cal); UDate udate = floor((*atp + kCFAbsoluteTimeIntervalSince1970) * 1000.0); ucal_setMillis(calendar->_cal, udate, &status); char ch = *componentDesc; while (ch) { UCalendarDateFields field = __CFCalendarGetICUFieldCodeFromChar(ch); int amount = *vector; if (options & kCFCalendarComponentsWrap) { ucal_roll(calendar->_cal, field, amount, &status); } else { ucal_add(calendar->_cal, field, amount, &status); } vector++; componentDesc++; ch = *componentDesc; } udate = ucal_getMillis(calendar->_cal, &status); *atp = (udate / 1000.0) - kCFAbsoluteTimeIntervalSince1970; return U_SUCCESS(status) ? true : false; } return false; } Boolean _CFCalendarGetComponentDifferenceV(CFCalendarRef calendar, CFAbsoluteTime startingAT, CFAbsoluteTime resultAT, CFOptionFlags options, const char *componentDesc, int **vector, int count) { if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) { UErrorCode status = U_ZERO_ERROR; ucal_clear(calendar->_cal); UDate curr = floor((startingAT + kCFAbsoluteTimeIntervalSince1970) * 1000.0); UDate goal = floor((resultAT + kCFAbsoluteTimeIntervalSince1970) * 1000.0); ucal_setMillis(calendar->_cal, curr, &status); int direction = (startingAT <= resultAT) ? 1 : -1; char ch = *componentDesc; while (ch) { UCalendarDateFields field = __CFCalendarGetICUFieldCodeFromChar(ch); const int multiple_table[] = {0, 0, 16, 19, 24, 26, 24, 28, 14, 14, 14}; int multiple = direction * (1 << multiple_table[flsl(__CFCalendarGetCalendarUnitFromChar(ch)) - 1]); Boolean divide = false, alwaysDivide = false; int result = 0; while ((direction > 0 && curr < goal) || (direction < 0 && goal < curr)) { ucal_add(calendar->_cal, field, multiple, &status); UDate newcurr = ucal_getMillis(calendar->_cal, &status); if ((direction > 0 && curr < newcurr && newcurr <= goal) || (direction < 0 && newcurr < curr && goal <= newcurr)) { result += multiple; curr = newcurr; } else { // Either newcurr is going backwards, or not making // progress, or has overshot the goal; reset date // and try smaller multiples. ucal_setMillis(calendar->_cal, curr, &status); divide = true; // once we start overshooting the goal, the add at // smaller multiples will succeed at most once for // each multiple, so we reduce it every time through // the loop. if ((direction > 0 && goal < newcurr) || (direction < 0 && newcurr < goal)) alwaysDivide = true; } if (divide) { multiple = multiple / 2; if (0 == multiple) break; divide = alwaysDivide; } } *(*vector) = result; vector++; componentDesc++; ch = *componentDesc; } return U_SUCCESS(status) ? true : false; } return false; } Boolean CFCalendarComposeAbsoluteTime(CFCalendarRef calendar, /* out */ CFAbsoluteTime *atp, const char *componentDesc, ...) { va_list args; va_start(args, componentDesc); CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), Boolean, calendar, _composeAbsoluteTime:atp :componentDesc :args); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); int idx, cnt = strlen((char *)componentDesc); STACK_BUFFER_DECL(int, vector, cnt); for (idx = 0; idx < cnt; idx++) { int arg = va_arg(args, int); vector[idx] = arg; } va_end(args); return _CFCalendarComposeAbsoluteTimeV(calendar, atp, componentDesc, vector, cnt); } Boolean CFCalendarDecomposeAbsoluteTime(CFCalendarRef calendar, CFAbsoluteTime at, const char *componentDesc, ...) { va_list args; va_start(args, componentDesc); CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), Boolean, calendar, _decomposeAbsoluteTime:at :componentDesc :args); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); int idx, cnt = strlen((char *)componentDesc); STACK_BUFFER_DECL(int *, vector, cnt); for (idx = 0; idx < cnt; idx++) { int *arg = va_arg(args, int *); vector[idx] = arg; } va_end(args); return _CFCalendarDecomposeAbsoluteTimeV(calendar, at, componentDesc, vector, cnt); } Boolean CFCalendarAddComponents(CFCalendarRef calendar, /* inout */ CFAbsoluteTime *atp, CFOptionFlags options, const char *componentDesc, ...) { va_list args; va_start(args, componentDesc); CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), Boolean, calendar, _addComponents:atp :options :componentDesc :args); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); int idx, cnt = strlen((char *)componentDesc); STACK_BUFFER_DECL(int, vector, cnt); for (idx = 0; idx < cnt; idx++) { int arg = va_arg(args, int); vector[idx] = arg; } va_end(args); return _CFCalendarAddComponentsV(calendar, atp, options, componentDesc, vector, cnt); } Boolean CFCalendarGetComponentDifference(CFCalendarRef calendar, CFAbsoluteTime startingAT, CFAbsoluteTime resultAT, CFOptionFlags options, const char *componentDesc, ...) { va_list args; va_start(args, componentDesc); CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), Boolean, calendar, _diffComponents:startingAT :resultAT :options :componentDesc :args); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); int idx, cnt = strlen((char *)componentDesc); STACK_BUFFER_DECL(int *, vector, cnt); for (idx = 0; idx < cnt; idx++) { int *arg = va_arg(args, int *); vector[idx] = arg; } va_end(args); Boolean ret = _CFCalendarGetComponentDifferenceV(calendar, startingAT, resultAT, options, componentDesc, vector, cnt); return ret; } Boolean CFCalendarGetTimeRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit, CFAbsoluteTime at, CFAbsoluteTime *startp, CFTimeInterval *tip) { CF_OBJC_FUNCDISPATCHV(CFCalendarGetTypeID(), Boolean, calendar, _rangeOfUnit:unit startTime:startp interval:tip forAT:at); __CFGenericValidateType(calendar, CFCalendarGetTypeID()); if (kCFCalendarUnitWeekdayOrdinal == unit) return false; if (kCFCalendarUnitWeekday == unit) unit = kCFCalendarUnitDay; if (!calendar->_cal) __CFCalendarSetupCal(calendar); if (calendar->_cal) { ucal_clear(calendar->_cal); __CFCalendarSetToFirstInstant(calendar, unit, at); UErrorCode status = U_ZERO_ERROR; UDate start = ucal_getMillis(calendar->_cal, &status); UCalendarDateFields field = __CFCalendarGetICUFieldCode(unit); ucal_add(calendar->_cal, field, 1, &status); UDate end = ucal_getMillis(calendar->_cal, &status); if (end == start && kCFCalendarUnitEra == unit) { // ICU refuses to do the addition, probably because we are // at the limit of UCAL_ERA. Use alternate strategy. CFIndex limit = ucal_getLimit(calendar->_cal, UCAL_YEAR, UCAL_MAXIMUM, &status); if (100000 < limit) limit = 100000; ucal_add(calendar->_cal, UCAL_YEAR, limit, &status); end = ucal_getMillis(calendar->_cal, &status); } if (U_SUCCESS(status)) { if (startp) *startp = (double)start / 1000.0 - kCFAbsoluteTimeIntervalSince1970; if (tip) *tip = (double)(end - start) / 1000.0; return true; } } return false; } CF_PRIVATE CFCalendarRef _CFCalendarCopyCoWCurrentCalendar() { return CFCalendarCopyCurrent(); } CF_PRIVATE CFCalendarRef _CFCalendarCreateCoWWithIdentifier(CFStringRef identifier) { return CFCalendarCreateWithIdentifier(kCFAllocatorSystemDefault, identifier); } #undef BUFFER_SIZE
{ "content_hash": "164c43d451405fc58af41b741c493483", "timestamp": "", "source": "github", "line_count": 1080, "max_line_length": 630, "avg_line_length": 41.99166666666667, "alnum_prop": 0.6943176556195012, "repo_name": "johnno1962b/swift-corelibs-foundation", "id": "1c18bc782b6bd4d478bfef8ab8049af235577762", "size": "45749", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "CoreFoundation/Locale.subproj/CFCalendar.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "2817" }, { "name": "C", "bytes": "6340499" }, { "name": "C++", "bytes": "2386532" }, { "name": "Objective-C", "bytes": "584315" }, { "name": "Python", "bytes": "91933" }, { "name": "Shell", "bytes": "270" }, { "name": "Swift", "bytes": "3976025" } ], "symlink_target": "" }
import pytest @pytest.fixture def target_class(): from google.cloud.bigquery import ModelReference return ModelReference def test_from_api_repr(target_class): resource = { "projectId": "my-project", "datasetId": "my_dataset", "modelId": "my_model", } got = target_class.from_api_repr(resource) assert got.project == "my-project" assert got.dataset_id == "my_dataset" assert got.model_id == "my_model" assert got.path == "/projects/my-project/datasets/my_dataset/models/my_model" def test_from_api_repr_w_unknown_fields(target_class): resource = { "projectId": "my-project", "datasetId": "my_dataset", "modelId": "my_model", "thisFieldIsNotInTheProto": "just ignore me", } got = target_class.from_api_repr(resource) assert got.project == "my-project" assert got.dataset_id == "my_dataset" assert got.model_id == "my_model" assert got._properties is resource def test_to_api_repr(target_class): ref = target_class.from_string("my-project.my_dataset.my_model") got = ref.to_api_repr() assert got == { "projectId": "my-project", "datasetId": "my_dataset", "modelId": "my_model", } def test_from_string(target_class): got = target_class.from_string("string-project.string_dataset.string_model") assert got.project == "string-project" assert got.dataset_id == "string_dataset" assert got.model_id == "string_model" assert got.path == ( "/projects/string-project/datasets/string_dataset/models/string_model" ) def test_from_string_legacy_string(target_class): with pytest.raises(ValueError): target_class.from_string("string-project:string_dataset.string_model") def test_from_string_not_fully_qualified(target_class): with pytest.raises(ValueError): target_class.from_string("string_model") with pytest.raises(ValueError): target_class.from_string("string_dataset.string_model") with pytest.raises(ValueError): target_class.from_string("a.b.c.d") def test_from_string_with_default_project(target_class): got = target_class.from_string( "string_dataset.string_model", default_project="default-project" ) assert got.project == "default-project" assert got.dataset_id == "string_dataset" assert got.model_id == "string_model" def test_from_string_ignores_default_project(target_class): got = target_class.from_string( "string-project.string_dataset.string_model", default_project="default-project" ) assert got.project == "string-project" assert got.dataset_id == "string_dataset" assert got.model_id == "string_model" def test_eq(target_class): model = target_class.from_string("my-proj.my_dset.my_model") model_too = target_class.from_string("my-proj.my_dset.my_model") assert model == model_too assert not (model != model_too) other_model = target_class.from_string("my-proj.my_dset.my_model2") assert not (model == other_model) assert model != other_model notamodel = object() assert not (model == notamodel) assert model != notamodel def test_hash(target_class): model = target_class.from_string("my-proj.my_dset.my_model") model2 = target_class.from_string("my-proj.my_dset.model2") got = {model: "hello", model2: "world"} assert got[model] == "hello" assert got[model2] == "world" model_too = target_class.from_string("my-proj.my_dset.my_model") assert got[model_too] == "hello" def test_repr(target_class): model = target_class.from_string("my-proj.my_dset.my_model") got = repr(model) assert ( got == "ModelReference(project_id='my-proj', dataset_id='my_dset', model_id='my_model')" )
{ "content_hash": "75117e62a6067f9e571a992ca3553146", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 92, "avg_line_length": 30.733870967741936, "alnum_prop": 0.6591445814746786, "repo_name": "googleapis/python-bigquery", "id": "39dabb55db68215bfe6404b4a9a9a6ba7ab8d23e", "size": "4413", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "tests/unit/model/test_model_reference.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "2050" }, { "name": "Python", "bytes": "2520564" }, { "name": "Shell", "bytes": "31939" } ], "symlink_target": "" }
// Copyright (c) 2011 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. // IPC messages for drag and drop. // Multiply-included message file, hence no include guard. #include "content/public/common/common_param_traits.h" #include "ipc/ipc_message_macros.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" #include "ui/gfx/point.h" #include "webkit/glue/webdropdata.h" #define IPC_MESSAGE_START DragMsgStart IPC_ENUM_TRAITS(WebKit::WebDragOperation) IPC_STRUCT_TRAITS_BEGIN(WebDropData) IPC_STRUCT_TRAITS_MEMBER(url) IPC_STRUCT_TRAITS_MEMBER(url_title) IPC_STRUCT_TRAITS_MEMBER(download_metadata) IPC_STRUCT_TRAITS_MEMBER(file_extension) IPC_STRUCT_TRAITS_MEMBER(filenames) IPC_STRUCT_TRAITS_MEMBER(plain_text) IPC_STRUCT_TRAITS_MEMBER(text_html) IPC_STRUCT_TRAITS_MEMBER(html_base_url) IPC_STRUCT_TRAITS_MEMBER(file_description_filename) IPC_STRUCT_TRAITS_MEMBER(file_contents) IPC_STRUCT_TRAITS_MEMBER(custom_data) IPC_STRUCT_TRAITS_END() // Messages sent from the browser to the renderer. IPC_MESSAGE_ROUTED4(DragMsg_TargetDragEnter, WebDropData /* drop_data */, gfx::Point /* client_pt */, gfx::Point /* screen_pt */, WebKit::WebDragOperationsMask /* ops_allowed */) IPC_MESSAGE_ROUTED3(DragMsg_TargetDragOver, gfx::Point /* client_pt */, gfx::Point /* screen_pt */, WebKit::WebDragOperationsMask /* ops_allowed */) IPC_MESSAGE_ROUTED0(DragMsg_TargetDragLeave) IPC_MESSAGE_ROUTED2(DragMsg_TargetDrop, gfx::Point /* client_pt */, gfx::Point /* screen_pt */) // Notifies the renderer of updates in mouse position of an in-progress // drag. if |ended| is true, then the user has ended the drag operation. IPC_MESSAGE_ROUTED4(DragMsg_SourceEndedOrMoved, gfx::Point /* client_pt */, gfx::Point /* screen_pt */, bool /* ended */, WebKit::WebDragOperation /* drag_operation */) // Notifies the renderer that the system DoDragDrop call has ended. IPC_MESSAGE_ROUTED0(DragMsg_SourceSystemDragEnded) // Messages sent from the renderer to the browser. // Used to tell the parent the user started dragging in the content area. The // WebDropData struct contains contextual information about the pieces of the // page the user dragged. The parent uses this notification to initiate a // drag session at the OS level. IPC_MESSAGE_ROUTED4(DragHostMsg_StartDragging, WebDropData /* drop_data */, WebKit::WebDragOperationsMask /* ops_allowed */, SkBitmap /* image */, gfx::Point /* image_offset */) // The page wants to update the mouse cursor during a drag & drop operation. // |is_drop_target| is true if the mouse is over a valid drop target. IPC_MESSAGE_ROUTED1(DragHostMsg_UpdateDragCursor, WebKit::WebDragOperation /* drag_operation */) // Notifies the host that the renderer finished a drop operation. IPC_MESSAGE_ROUTED0(DragHostMsg_TargetDrop_ACK)
{ "content_hash": "b454cba5fb4c6ca25ad17957429f1b36", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 78, "avg_line_length": 41.01234567901235, "alnum_prop": 0.6773028296207104, "repo_name": "paul99/clank", "id": "2d7070857dbdff0f4384fd465f5178c5e65432f8", "size": "3322", "binary": false, "copies": "2", "ref": "refs/heads/chrome-18.0.1025.469", "path": "content/common/drag_messages.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "56689" }, { "name": "C", "bytes": "8707669" }, { "name": "C++", "bytes": "89569069" }, { "name": "Go", "bytes": "10440" }, { "name": "Java", "bytes": "1201391" }, { "name": "JavaScript", "bytes": "5587454" }, { "name": "Lua", "bytes": "13641" }, { "name": "Objective-C", "bytes": "4568468" }, { "name": "PHP", "bytes": "11278" }, { "name": "Perl", "bytes": "51521" }, { "name": "Python", "bytes": "2615443" }, { "name": "R", "bytes": "262" }, { "name": "Ruby", "bytes": "107" }, { "name": "Scheme", "bytes": "10604" }, { "name": "Shell", "bytes": "588836" } ], "symlink_target": "" }
/*======================================= Template Design By MarkUps. Author URI : http://www.markups.io/ ========================================*/ h2 { color: #ff871c; } .aa-primary-btn:hover, .aa-primary-btn:focus { color: #ff871c; border-color: #ff871c; } .aa-secondary-btn { background-color: #ff871c; } .aa-view-btn { background-color: #ff871c; } .aa-view-btn:hover, .aa-view-btn:focus { color: #ff871c; } .scrollToTop { background-color: #ff871c; border: 2px solid #ff871c; } .scrollToTop:hover, .scrollToTop:focus { color: #ff871c; } .pulse:before, .pulse:after { border: 5px solid #ff871c; } #aa-menu-area .main-navbar .navbar-header .aa-logo span { color: #ff871c; } #aa-menu-area .main-navbar .navbar-nav li a:hover, #aa-menu-area .main-navbar .navbar-nav li a:focus { color: #ff871c; } #aa-menu-area .main-navbar .navbar-nav .active a { color: #ff871c; } #aa-menu-area .main-navbar .navbar-nav .open a { color: #ff871c; } #aa-menu-area .main-navbar .navbar-nav .dropdown-menu li a:hover, #aa-menu-area .main-navbar .navbar-nav .dropdown-menu li a:focus { color: #ff871c; } #aa-slider .aa-slider-area .aa-top-slider .slick-prev:hover, #aa-slider .aa-slider-area .aa-top-slider .slick-next:hover { background-color: #ff871c; } #aa-slider .aa-slider-area .aa-top-slider .aa-top-slider-price { color: #ff871c; } #aa-slider .aa-slider-area .aa-top-slider .aa-top-slider-btn:hover, #aa-slider .aa-slider-area .aa-top-slider .aa-top-slider-btn:focus { color: #ff871c; } #aa-advance-search .aa-advance-search-area .aa-advance-search-top .aa-single-advance-search .aa-search-btn { background-color: #ff871c; } .aa-single-filter-search .noUi-connect { background-color: #ff871c; } .aa-single-filter-search .noUi-handle { background-color: #ff871c; } .aa-title span { background-color: #ff871c; } .aa-title span:before { background-color: #ff871c; } .aa-title span:after { background-color: #ff871c; } .aa-properties-item .for-sale { background-color: #ff871c; } #aa-service .aa-service-area .aa-service-content .aa-single-service .aa-service-icon span { background-color: #ff871c; } #aa-service .aa-service-area .aa-service-content .aa-single-service .aa-single-service-content h4 a:hover { color: #ff871c; } #aa-agents .aa-agents-area .aa-agents-content .aa-agents-slider li .aa-single-agents .aa-agetns-info { background-color: #ff871c; } #aa-agents .aa-agents-area .aa-agents-content .aa-agents-slider li .aa-single-agents .aa-agetns-info .aa-agent-social a:hover, #aa-agents .aa-agents-area .aa-agents-content .aa-agents-slider li .aa-single-agents .aa-agetns-info .aa-agent-social a:focus { color: #ff871c; } #aa-client-testimonial .aa-client-testimonial-area .aa-testimonial-content .aa-testimonial-slider li .aa-testimonial-single .aa-testimonial-info p:before { color: #ff871c; } .aa-blog-single .aa-date-tag { background-color: #ff871c; } .aa-blog-single .aa-blog-single-content h3 a:hover, .aa-blog-single .aa-blog-single-content h3 a:focus { color: #ff871c; } .aa-blog-single .aa-blog-single-bottom .aa-blog-author:hover, .aa-blog-single .aa-blog-single-bottom .aa-blog-author:focus { color: #ff871c; } .aa-blog-single .aa-blog-single-bottom .aa-blog-comments:hover, .aa-blog-single .aa-blog-single-bottom .aa-blog-comments:focus { color: #ff871c; } #aa-footer .aa-footer-area .aa-footer-left p a:hover, #aa-footer .aa-footer-area .aa-footer-left p a:focus { color: #ff871c; } #aa-footer .aa-footer-area .aa-footer-middle a:hover, #aa-footer .aa-footer-area .aa-footer-middle a:focus { color: #ff871c; border-color: #ff871c; } #aa-footer .aa-footer-area .aa-footer-right a:hover, #aa-footer .aa-footer-area .aa-footer-right a:focus { color: #ff871c; } #aa-property-header .aa-property-header-inner .breadcrumb li.active { color: #ff871c; } #aa-properties .aa-properties-content .aa-properties-content-head .aa-properties-content-head-right a:hover, #aa-properties .aa-properties-content .aa-properties-content-head .aa-properties-content-head-right a:focus { color: #ff871c; border-color: #ff871c; } #aa-properties .aa-properties-sidebar .aa-properties-single-sidebar .aa-single-advance-search .aa-search-btn { background-color: #ff871c; } #aa-properties .aa-properties-sidebar .aa-properties-single-sidebar .media .media-body h4 a:hover { color: #ff871c; } .aa-properties-content-bottom .pagination li a:hover, .aa-properties-content-bottom .pagination li a:focus { background-color: #ff871c; border-color: #ff871c; } .aa-properties-content-bottom .pagination .active a { background-color: #ff871c; } .aa-properties-details .aa-properties-details-img .slick-prev, .aa-properties-details .aa-properties-details-img .slick-next { background-color: #ff871c; } .aa-properties-details .aa-properties-info ul li:before { color: #ff871c; } .aa-properties-social ul li a:hover, .aa-properties-social ul li a:focus { color: #ff871c; border-color: #ff871c; } #aa-blog .aa-blog-area .aa-blog-sidebar .aa-blog-sidebar-single .aa-blog-search .aa-search-text:focus { border-color: #ff871c; } #aa-blog .aa-blog-area .aa-blog-sidebar .aa-blog-sidebar-single .aa-blog-search .aa-search-submit:hover, #aa-blog .aa-blog-area .aa-blog-sidebar .aa-blog-sidebar-single .aa-blog-search .aa-search-submit:focus { color: #ff871c; } #aa-blog .aa-blog-area .aa-blog-sidebar .aa-blog-sidebar-single .aa-blog-catg li a:hover, #aa-blog .aa-blog-area .aa-blog-sidebar .aa-blog-sidebar-single .aa-blog-catg li a:focus { color: #ff871c; } #aa-blog .aa-blog-area .aa-blog-sidebar .aa-blog-sidebar-single .tag-cloud a:hover, #aa-blog .aa-blog-area .aa-blog-sidebar .aa-blog-sidebar-single .tag-cloud a:focus { background-color: #ff871c; border-color: #ff871c; } #aa-blog .aa-blog-area .aa-blog-sidebar .aa-blog-sidebar-single .aa-blog-recent-post .media .media-body .media-heading a:hover, #aa-blog .aa-blog-area .aa-blog-sidebar .aa-blog-sidebar-single .aa-blog-recent-post .media .media-body .media-heading a:focus { color: #ff871c; } .aa-blog-details .aa-blog-single-content h1, .aa-blog-details .aa-blog-single-content h3, .aa-blog-details .aa-blog-single-content h4 { color: #ff871c; font-weight: bold; } .aa-blog-navigation .aa-blog-pagination-left .aa-prev:hover, .aa-blog-navigation .aa-blog-pagination-left .aa-prev:focus { color: #ff871c; border-color: #ff871c; } .aa-blog-navigation .aa-blog-pagination-right .aa-next:hover, .aa-blog-navigation .aa-blog-pagination-right .aa-next:focus { color: #ff871c; border-color: #ff871c; } .aa-comments-area .comments .commentlist li .reply-btn:hover, .aa-comments-area .comments .commentlist li .reply-btn:focus { color: #ff871c; border-color: #ff871c; } .aa-comments-area .comments .commentlist li .author-tag { background-color: #ff871c; } #respond input[type="text"]:focus, #respond input[type="email"]:focus, #respond input[type="url"]:focus { border: 1px solid #ff871c; } #respond textarea:focus { border: 1px solid #ff871c; } #respond .form-submit input:hover { color: #ff871c; border-color: #ff871c; } #aa-contact .aa-contact-area .aa-contact-bottom .aa-contact-form input[type="text"]:focus, #aa-contact .aa-contact-area .aa-contact-bottom .aa-contact-form input[type="email"]:focus, #aa-contact .aa-contact-area .aa-contact-bottom .aa-contact-form input[type="url"]:focus { border: 2px solid #ff871c; } #aa-contact .aa-contact-area .aa-contact-bottom .aa-contact-form textarea:focus { border: 2px solid #ff871c; } #aa-contact .aa-contact-area .aa-contact-bottom .aa-contact-form .form-submit input:hover { color: #ff871c; border: 2px solid #ff871c; } #aa-error .aa-error-area h2 { border: 3px solid #ff871c; } #aa-error .aa-error-area h2:before { border: 3px solid #ff871c; } #aa-error .aa-error-area a:hover, #aa-error .aa-error-area a:focus { color: #ff871c; border-color: #ff871c; } #aa-gallery .aa-gallery-area .aa-gallery-content .aa-gallery-top ul li:hover, #aa-gallery .aa-gallery-area .aa-gallery-content .aa-gallery-top ul li:focus { background-color: #ff871c; border-color: #ff871c; } #aa-gallery .aa-gallery-area .aa-gallery-content .aa-gallery-top ul .active { background-color: #ff871c; border-color: #ff871c; } #aa-gallery .aa-gallery-area .aa-gallery-content .aa-gallery-body .aa-single-gallery .aa-single-gallery-item .aa-single-gallery-info a:hover, #aa-gallery .aa-gallery-area .aa-gallery-content .aa-gallery-body .aa-single-gallery .aa-single-gallery-item .aa-single-gallery-info a:focus { color: #ff871c; border-color: #ff871c; } #aa-signin .aa-signin-area .aa-signin-form .aa-single-submit input[type="submit"] { background-color: #ff871c; border: 2px solid #ff871c; } #aa-signin .aa-signin-area .aa-signin-form .aa-single-submit input[type="submit"]:hover { color: #ff871c; border-color: #ff871c; } .navbar-default .navbar-toggle { border-color: #ff871c; } .navbar-default .navbar-toggle .icon-bar { background-color: #ff871c; } /*======================================= Template Design By MarkUps. Author URI : http://www.markups.io/ ========================================*/
{ "content_hash": "47816ef3ebfd92a633d417acb8d678a0", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 284, "avg_line_length": 33.57651245551602, "alnum_prop": 0.6828828828828829, "repo_name": "etewiah/property-web-builder", "id": "ef68054ade8fa9b49416c482ccb5e6e2a4827bbf", "size": "9435", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/assets/stylesheets/pwb/themes/berlin/colors/orange-theme.css", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "39352" }, { "name": "HTML", "bytes": "62353" }, { "name": "JavaScript", "bytes": "7446" }, { "name": "Ruby", "bytes": "242588" } ], "symlink_target": "" }
package ublu.command; import ublu.util.ArgArray; import static ublu.util.DataSink.SINKTYPE.FILE; import static ublu.util.DataSink.SINKTYPE.STD; import static ublu.util.DataSink.SINKTYPE.TUPLE; import static ublu.util.DataSink.SINKTYPE.URL; import ublu.util.InterpreterThread; import ublu.util.Tuple; import ublu.util.Utils; import com.ibm.as400.access.AS400SecurityException; import com.ibm.as400.access.ErrorCompletingRequestException; import com.ibm.as400.access.ObjectDoesNotExistException; import com.ibm.as400.access.RequestNotSupportedException; import java.io.IOException; import java.sql.SQLException; import java.util.logging.Level; import ublu.util.TupleMap; /** * Command to launch a block in a background interpreter thread * * @author jwoehr */ public class CmdTask extends Command { { setNameAndDescription("TASK", "/1? [-from ~@datasink] [-to ~@datasink] [-local @tuplename ~@tuple [-local ..]] [-start] $[ BLOCK TO EXECUTE ]$ : create a background thread to execute a block, putting the thread and starting the thread if specified"); } /** * Command to launch a block in a background interpreter thread */ public CmdTask() { } TupleMap tm = new TupleMap(); /** * Interpret a block in a thread in the background * * @param argArray the ArgArray currently under interpretation * @return the remainder of the ArgArray */ public ArgArray cmdTask(ArgArray argArray) { boolean wasSetDataSource = false; boolean startNow = false; while (argArray.hasDashCommand()) { String dashCommand = argArray.parseDashCommand(); switch (dashCommand) { case "-from": setDataSrcfromArgArray(argArray); wasSetDataSource = true; break; case "-to": setDataDestfromArgArray(argArray); break; case "-local": tm.setTuple(argArray.next(), argArray.nextTupleOrPop().getValue()); break; case "-start": startNow = true; break; default: unknownDashCommand(dashCommand); } } if (havingUnknownDashCommand()) { setCommandResult(COMMANDRESULT.FAILURE); } else { String block = null; if (wasSetDataSource) { switch (getDataSrc().getType()) { case FILE: String filepath = getDataSrc().getName(); try { block = Utils.getFileAsString(filepath); } catch (IOException ex) { getLogger().log(Level.SEVERE, "Exception including " + filepath, ex); setCommandResult(COMMANDRESULT.FAILURE); } break; case STD: getLogger().log(Level.SEVERE, "STD not implemented in {0}", getNameAndDescription()); setCommandResult(COMMANDRESULT.FAILURE); case TUPLE: Tuple tupleWithProgramLines = getInterpreter().getTuple(getDataSrc().getName()); if (tupleWithProgramLines == null) { getLogger().log(Level.SEVERE, "Tuple {0} does not exist.", getDataSrc().getName()); setCommandResult(COMMANDRESULT.FAILURE); } else { Object value = tupleWithProgramLines.getValue(); if (value instanceof String) { block = String.class.cast(value); } else { getLogger().log(Level.SEVERE, "Tuple {0} does not contain program lines.", tupleWithProgramLines.getKey()); setCommandResult(COMMANDRESULT.FAILURE); } } break; case URL: getLogger().log(Level.SEVERE, "URL not implemented in {0}", getNameAndDescription()); setCommandResult(COMMANDRESULT.FAILURE); break; } } else { block = argArray.nextUnlessNotBlock(); } if (block == null) { getLogger().log(Level.SEVERE, "TASK found with neither a $[ block ]$ nor a data source containing a program in {0}", getNameAndDescription()); setCommandResult(COMMANDRESULT.FAILURE); } else { InterpreterThread interpreterThread = new InterpreterThread(getInterpreter(), block); for (String k : tm.keySet()) { interpreterThread.getInterpreter().setTuple(k, tm.getTuple(k).getValue()); } if (startNow) { interpreterThread.start(); } try { put(interpreterThread); } catch (SQLException | IOException | AS400SecurityException | ErrorCompletingRequestException | InterruptedException | ObjectDoesNotExistException | RequestNotSupportedException ex) { getLogger().log(Level.SEVERE, "Error putting InterpreterThread in " + getNameAndDescription(), ex); setCommandResult(COMMANDRESULT.FAILURE); } } } return argArray; } @Override public void reinit() { super.reinit(); } @Override public ArgArray cmd(ArgArray args) { reinit(); return cmdTask(args); } @Override public COMMANDRESULT getResult() { return getCommandResult(); } }
{ "content_hash": "3eb0927d9de596f63bea83ca1ae41da9", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 258, "avg_line_length": 40.020270270270274, "alnum_prop": 0.5434745905790984, "repo_name": "jwoehr/Ubloid", "id": "64b6633648ced81fd4f3a06ec271a2acab50aaf4", "size": "7472", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AndroidStudioProject/ubloid/app/src/main/java/ublu/command/CmdTask.java", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "HTML", "bytes": "20444" }, { "name": "Java", "bytes": "1866389" } ], "symlink_target": "" }
// // Copyright (c) 2014 Loic Gardiol <loic.gardiol@gmail.com> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // Created by Loïc Gardiol on 27.01.15. #import "NSObject+LGAAdditions.h" #import "NSNotificationCenter+LGAAdditions.h" #import "NSMapTable+LGAAdditions.h" #import <objc/runtime.h> @interface LGAObserverWrapper : NSObject @property (nonatomic, copy) NSString* notifName; @property (nonatomic, weak) id notifSender; @property (nonatomic, copy) void (^block)(NSNotification* notif); @end @implementation LGAObserverWrapper - (void)newNotification:(NSNotification*)notification { if (self.block) { self.block(notification); } } @end @interface NSNotificationCenter () @property (nonatomic, readonly) NSMapTable* wrappersForObserver; // Key: original observer, as passed in addObserver:... Value: Mutable Array of LGAObserverWrapper @end @implementation NSNotificationCenter (LGAAdditions) /*+ (void)load { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ [self lga_swizzleMethodWithOriginalSelector:@selector(removeObserver:) withSwizzledSelector:@selector(lga_removeObserver:) isClassMethod:NO]; [self lga_swizzleMethodWithOriginalSelector:@selector(removeObserver:name:object:) withSwizzledSelector:@selector(lga_removeObserver:name:object:) isClassMethod:NO]; }); }*/ #pragma mark - Public - (void)lga_addObserver:(id)observer name:(NSString*)notificationName object:(id)object block:(void (^)(NSNotification* notif))block { LGAObserverWrapper* wrapper = [LGAObserverWrapper new]; wrapper.notifName = notificationName; wrapper.notifSender = object; wrapper.block = block; [self addObserver:wrapper selector:@selector(newNotification:) name:notificationName object:object]; NSMutableArray* wrappers = self.wrappersForObserver[observer] ?: [NSMutableArray array]; [wrappers addObject:wrapper]; self.wrappersForObserver[observer] = wrappers; } #pragma mark - NSNotificationCenter overrides - (void)lga_removeObserver:(id)observer { [self lga_removeObserver:observer]; //calling original implementation if (observer) { NSMutableArray* wrappers = self.wrappersForObserver[observer]; for (LGAObserverWrapper* wrapper in wrappers) { [self lga_removeObserver:wrapper]; } [self.wrappersForObserver removeObjectForKey:observer]; //all wrappers removed for this observer } } - (void)lga_removeObserver:(id)observer name:(NSString *)aName object:(id)anObject { [self lga_removeObserver:observer name:aName object:anObject]; //calling original implementation if (observer) { NSMutableArray* wrappers = self.wrappersForObserver[observer]; for (LGAObserverWrapper* wrapper in [wrappers copy]) { [self lga_removeObserver:wrapper name:aName object:anObject]; //calling original implementation for opaqueObserver if ((aName && ![aName isEqualToString:wrapper.notifName]) || (anObject && (anObject != wrapper.notifSender))) { // If name or object was specified and one of them is not equal to the corresponding proerty in registered observer (wrapper), observer was removed. // removeObserver:... does not tell us whether removal was done, that's why we have to determine it ourselves } else { [wrappers removeObject:wrapper]; } } } } #pragma mark - Private - (NSMapTable*)wrappersForObserver { static NSString* const kAssocObjectKey = @"lga_wrappersForObserver"; NSMapTable* table = objc_getAssociatedObject(self, (__bridge const void *)(kAssocObjectKey)); if (!table) { @synchronized (self) { if (!table) { table = objc_getAssociatedObject(self, (__bridge const void *)(kAssocObjectKey)); if (!table) { table = [NSMapTable mapTableWithKeyOptions:NSPointerFunctionsOpaqueMemory|NSPointerFunctionsOpaquePersonality valueOptions:NSPointerFunctionsStrongMemory]; objc_setAssociatedObject(self, (__bridge const void *)(kAssocObjectKey), table, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } } } } return table; } @end
{ "content_hash": "b6a56533da8710865b44fdb5a8e66371", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 184, "avg_line_length": 41.96923076923077, "alnum_prop": 0.6944648093841642, "repo_name": "loicgardiol/LGALibrary", "id": "83caa05536b7b9f09941755ae26f7d420589c2d8", "size": "5457", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Pod/Classes/NSNotificationCenter+LGAAdditions.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "552152" }, { "name": "Ruby", "bytes": "1386" }, { "name": "Shell", "bytes": "8821" } ], "symlink_target": "" }
import queue from '../lib/queue'; import * as builder from 'botbuilder'; import ConversationState from '../framework/enum/ConversationState'; export default function logDialog(session, botMsg: string) { let customerConversationId = session.message.address.channelId + '/' + session.message.address.conversation.id; let conversation = queue.get(customerConversationId); queue.add(customerConversationId, new builder.Message().text(botMsg), null); // add to this customer queue }
{ "content_hash": "f18a0932bd0a21006501e1014acac9aa", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 115, "avg_line_length": 54.55555555555556, "alnum_prop": 0.7657841140529531, "repo_name": "KenFigueiredo/Bot-HandOff", "id": "e87eb0c2dbfd03c051738915016fdf82009773f0", "size": "491", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/utils/logDialog.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "580" }, { "name": "HTML", "bytes": "1158" }, { "name": "JavaScript", "bytes": "2584" }, { "name": "TypeScript", "bytes": "41087" } ], "symlink_target": "" }
package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" "github.com/go-openapi/swag" ) // PartGeometryURL part geometry Url // swagger:model PartGeometryUrl type PartGeometryURL struct { // signed Url SignedURL string `json:"signedUrl,omitempty"` } // Validate validates this part geometry Url func (m *PartGeometryURL) Validate(formats strfmt.Registry) error { var res []error if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } // MarshalBinary interface implementation func (m *PartGeometryURL) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } return swag.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PartGeometryURL) UnmarshalBinary(b []byte) error { var res PartGeometryURL if err := swag.ReadJSON(b, &res); err != nil { return err } *m = res return nil }
{ "content_hash": "094d98d43116f3014ffaeeacc1748af1", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 84, "avg_line_length": 21.93617021276596, "alnum_prop": 0.7313288069835111, "repo_name": "ryanwalls/simulation-goclient", "id": "3bbb577070ee91e6a089641eb422f4a56a8f66fe", "size": "1078", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "models/part_geometry_url.go", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "524" }, { "name": "Go", "bytes": "284468" } ], "symlink_target": "" }
declare module 'sugarss' { import postcss = require('postcss'); const postcssSugarss: postcss.ProcessOptions; export = postcssSugarss; }
{ "content_hash": "1df7a562c97a719ca769d07fd74763a7", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 46, "avg_line_length": 16, "alnum_prop": 0.7430555555555556, "repo_name": "mrmlnc/vscode-stylefmt", "id": "6420872c2d92df1b287b7ee6b7944d6b901bc86d", "size": "144", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "typings/sugarss.d.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1394" }, { "name": "TypeScript", "bytes": "11481" } ], "symlink_target": "" }
<?php /* # ---------------------------------------------------------------------- # RECOVER PASSWORD: VIEW # ---------------------------------------------------------------------- */ include('get.php'); include('update.php'); include('control.php'); ?> <?php show_alert($_SESSION['alert']['type'], $_SESSION['alert']['msg']); ?> <form method="post"> <div class="container main <?php echo $class_hidden;?>"> <div class="box row login"> <div class="navbar-login clearfix"> <div class="navbar-brand"><img src="<?php echo BASE_URL.'static/thimthumb.php?src='.$_global_general->logo.'&w=40&h=40&q=80';?>" alt="logo"></div> <h1><?php echo $_global_general->website_title;?> Admin</h1> </div> <div class="content"> <ul class="form-set clearfix"> <p class="m_b_15">Reset password for <strong><?php echo $data->admin_username;?></strong></p> <li class="form-group row" id="id-row-password"> <label class="col-xs-4 control-label">New Password</label> <div class="col-xs-8"> <input type="password" class="form-control" style="width: 100%" id="id-password" name="password"> </div> </li> <li class="form-group row" id="id-row-repassword"> <label class="col-xs-4 control-label">Retype Password</label> <div class="col-xs-8"> <input type="password" class="form-control" autocomplete="off" style="width: 100%" id="id-repassword" name="repassword"> </div> </li> <li class="btn-placeholder m_b_15"> <a href="<?php echo BASE_URL;?>"><input type="button" class="btn btn-default btn-sm" value="Back"></a> <input type="button" class="btn btn-success btn-sm" value="Reset Password" id="btn-alias-submit"> <input type="submit" class="btn btn-success btn-sm hidden" value="Reset Password" id="btn-submit" name="btn-admin-recover"> </li> </ul> </div><!--.content--> </div><!--.box.row--> </div><!--.container.main--> </form> <script type="text/javascript" src="<?php echo BASE_URL;?>script/recover-password.js"></script>
{ "content_hash": "a019008411797c5aae8f10cec2469ee7", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 164, "avg_line_length": 49.36538461538461, "alnum_prop": 0.45851188157382156, "repo_name": "garygunarman/firanew", "id": "049214709f6fefce7c83eb3477cbb199fba594d5", "size": "2567", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "admin/account/_recover/recover.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "29862" }, { "name": "ApacheConf", "bytes": "26112" }, { "name": "CSS", "bytes": "338705" }, { "name": "CoffeeScript", "bytes": "53020" }, { "name": "HTML", "bytes": "404741" }, { "name": "JavaScript", "bytes": "909778" }, { "name": "PHP", "bytes": "9928566" }, { "name": "Ruby", "bytes": "1888" } ], "symlink_target": "" }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _lib = require('../../lib'); var _Checkbox = require('../../modules/Checkbox'); var _Checkbox2 = _interopRequireDefault(_Checkbox); var _FormField = require('./FormField'); var _FormField2 = _interopRequireDefault(_FormField); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Sugar for <Form.Field control={Checkbox} /> * @see Checkbox * @see Form */ function FormCheckbox(props) { var control = props.control; var rest = (0, _lib.getUnhandledProps)(FormCheckbox, props); var ElementType = (0, _lib.getElementType)(FormCheckbox, props); return _react2.default.createElement(ElementType, _extends({}, rest, { control: control })); } FormCheckbox._meta = { name: 'FormCheckbox', parent: 'Form', type: _lib.META.TYPES.COLLECTION }; FormCheckbox.propTypes = { /** An element type to render as (string or function). */ as: _lib.customPropTypes.as, /** A FormField control prop */ control: _FormField2.default.propTypes.control }; FormCheckbox.defaultProps = { as: _FormField2.default, control: _Checkbox2.default }; exports.default = FormCheckbox;
{ "content_hash": "720d26c5adf9815e327dfcb33c661e83", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 257, "avg_line_length": 26.913793103448278, "alnum_prop": 0.683536194746957, "repo_name": "IgorKilipenko/KTS_React", "id": "eb86f72cb696e41f10f665375196adbf4b9554a2", "size": "1561", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node_modules/semantic-ui-react/dist/commonjs/collections/Form/FormCheckbox.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "13262" }, { "name": "HTML", "bytes": "15334" }, { "name": "JavaScript", "bytes": "330731" } ], "symlink_target": "" }
package net.dsys.tkvs.api.tkvs; import java.util.Map; import javax.annotation.Nonnull; import net.dsys.tkvs.api.data.Key; import net.dsys.tkvs.api.data.Value; /** * @author Ricardo Padilha */ public interface Table { @Nonnull Boolean contains(@Nonnull Key key); @Nonnull Value read(@Nonnull Key key); @Nonnull Map<Key, Value> readRange(@Nonnull Key start, @Nonnull Boolean includeStart, @Nonnull Key end, @Nonnull Boolean includeEnd); @Nonnull Map<Key, Value> readRange(@Nonnull Key start, @Nonnull Boolean includeStart, @Nonnull Integer count, @Nonnull Direction direction); @Nonnull Key previous(@Nonnull Key key); @Nonnull Key next(@Nonnull Key key); void write(@Nonnull Key key, @Nonnull Value value); void delete(@Nonnull Key key); }
{ "content_hash": "60fdbb76923b71e08c7d919c6309bacb", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 77, "avg_line_length": 18.951219512195124, "alnum_prop": 0.7297297297297297, "repo_name": "ricardopadilha/dsys-tkvs", "id": "0f55794f5e6005e0c38e8ec4d0b117aed9b1e860", "size": "1376", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/net/dsys/tkvs/api/tkvs/Table.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "162080" } ], "symlink_target": "" }
'use strict'; /** * This code is mostly from the old Etherpad. Please help us to comment this code. * This helps other people to understand this code better and helps them to improve it. * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED */ /** * Copyright 2009 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS-IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const isNodeText = (node) => (node.nodeType === 3); const getAssoc = (obj, name) => obj[`_magicdom_${name}`]; const setAssoc = (obj, name, value) => { // note that in IE designMode, properties of a node can get // copied to new nodes that are spawned during editing; also, // properties representable in HTML text can survive copy-and-paste obj[`_magicdom_${name}`] = value; }; // "func" is a function over 0..(numItems-1) that is monotonically // "increasing" with index (false, then true). Finds the boundary // between false and true, a number between 0 and numItems inclusive. const binarySearch = (numItems, func) => { if (numItems < 1) return 0; if (func(0)) return 0; if (!func(numItems - 1)) return numItems; let low = 0; // func(low) is always false let high = numItems - 1; // func(high) is always true while ((high - low) > 1) { const x = Math.floor((low + high) / 2); // x != low, x != high if (func(x)) high = x; else low = x; } return high; }; const binarySearchInfinite = (expectedLength, func) => { let i = 0; while (!func(i)) i += expectedLength; return binarySearch(i, func); }; const noop = () => {}; exports.isNodeText = isNodeText; exports.getAssoc = getAssoc; exports.setAssoc = setAssoc; exports.binarySearch = binarySearch; exports.binarySearchInfinite = binarySearchInfinite; exports.noop = noop;
{ "content_hash": "177e6234c5093ddfe3f228b3b5fe0c37", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 87, "avg_line_length": 32.64705882352941, "alnum_prop": 0.6887387387387387, "repo_name": "wikimedia/operations-debs-etherpad-lite", "id": "c1dab5cfd8be021179c1c58588dfc5b4e4b22e52", "size": "2220", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/static/js/ace2_common.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1477" }, { "name": "CSS", "bytes": "89516" }, { "name": "Dockerfile", "bytes": "3412" }, { "name": "HTML", "bytes": "87100" }, { "name": "JavaScript", "bytes": "2173278" }, { "name": "Makefile", "bytes": "849" }, { "name": "Shell", "bytes": "28047" } ], "symlink_target": "" }
'use strict'; function handler(request, reply) { const user = request.yar.get('user'); if (user) { return reply.redirect('dashboard'); } return reply.view('index'); } module.exports = handler;
{ "content_hash": "3751001c8c72d31a6d8d4276cc892fa3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 43, "avg_line_length": 17, "alnum_prop": 0.6153846153846154, "repo_name": "wbprice/burrow-serverless-app", "id": "5ccd4f3bb628672c398e38e46a1e81fc5951ce55", "size": "221", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/routes/home/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1706" }, { "name": "HTML", "bytes": "5960" }, { "name": "JavaScript", "bytes": "16382" } ], "symlink_target": "" }
require 'test_helper' class DehumanizeTest < ActiveSupport::TestCase # Replace this with your real tests. test "the truth" do assert true end end
{ "content_hash": "79ab22baffbce05a66d45d3b4865828a", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 46, "avg_line_length": 19.625, "alnum_prop": 0.732484076433121, "repo_name": "andyw8/dehumanize", "id": "c38a5c9723ee64aa52e3298dacf18aaafd2d8164", "size": "157", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/dehumanize_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "1178" } ], "symlink_target": "" }
// if (mealSelectionElement) { // mealSelectionElement.addEventListener("change", updateSelection); // citySelectionElement.addEventListener("change", updateSelection); // function updateSelection() { // var outputTextElement = document.getElementById("my-sentence"); // var mealText = mealSelectionElement.options[mealSelectionElement.selectedIndex].innerHTML; // var cityText = citySelectionElement.options[citySelectionElement.selectedIndex].innerHTML; // if (!mealText && cityText ) { // outputTextElement.textContent = "I am eating in " + cityText + ", but I don't know when."; // } // else if (mealText && !cityText) { // outputTextElement.textContent = "I am eating " + mealText + ", but I don't know where."; // } // else if (mealText && cityText ) { // outputTextElement.textContent = "I am eating " + mealText + " in " + cityText + "."; // } // else { // outputTextElement.textContent = "I have no clue what I'm doing." // } // }; // }; var companyValidationText = document.getElementById("company-validation"); var importNameValidationText = document.getElementById("import-name-validation"); var newImportNextButton = document.getElementById("new-import-next"); var importNameInput = document.getElementById("import-name"); if (companyValidationText) { newImportNextButton.addEventListener("click", validateNewImportPage); companyInput.addEventListener("input", updateValidationTextCompany); importNameInput.addEventListener("input", updateValidationTextImportName); function validateNewImportPage() { if (companyInput.value.length > 1 && importNameInput.value.length >1) { newImportNextButton.href = "/productCategory.php"; console.log("link ok "); } else if (!companyInput || !importNameInput) { newImportNextButton.href = "#"; console.log("link disabled "); } if (!companyInput.value) { companyValidationText.textContent = "Required"; console.log(companyInput.value); } if (!importNameInput.value) { importNameValidationText.textContent = "Required"; } ; }; function updateValidationTextCompany() { if (!companyInput.value) { companyValidationText.textContent = "Required"; console.log(1); console.log(companyInput.value); } else if (companyInput.value.length >1) { companyValidationText.textContent = ""; console.log(companyInput.value); }; }; function updateValidationTextImportName() { if (!importNameInput.value) { importNameValidationText.textContent = "Required"; console.log(importNameInput.value); console.log(3); } else if (importNameInput.value.length >1) { importNameValidationText.textContent = ""; console.log(importNameInput.value); console.log(4); }; }; }; // ----- Mapping page ---- var formElement = document.getElementById("mapping-form") // var question1Element = document.getElementById("1"); // var question2Element = document.getElementById("2"); // var question3Element = document.getElementById("3"); // var question4Element = document.getElementById("4"); // var question5Element = document.getElementById("5"); // var question6Element = document.getElementById("6"); if (formElement) { formElement.addEventListener("change", updateMappedFields); // question1Element.addEventListener("change", updateMappedFields); // question2Element.addEventListener("change", updateMappedFields); // question3Element.addEventListener("change", updateMappedFields); // question4Element.addEventListener("change", updateMappedFields); // question5Element.addEventListener("change", updateMappedFields); // question6Element.addEventListener("change", updateMappedFields); function updateMappedFields() { // var mappingRight1 = document.getElementById("mapping-right-1"); // var mappingRight2 = document.getElementById("mapping-right-2"); // var mappingRight3 = document.getElementById("mapping-right-3"); // var mappingRight4 = document.getElementById("mapping-right-4"); // var mappingRight5 = document.getElementById("mapping-right-5"); // var mappingRight6 = document.getElementById("mapping-right-6"); // var question1ElementValue = question1Element.options[question1Element.selectedIndex].innerHTML; // var question2ElementValue = question1Element.options[question2Element.selectedIndex].innerHTML; // var question3ElementValue = question1Element.options[question3Element.selectedIndex].innerHTML; // var question4ElementValue = question1Element.options[question4Element.selectedIndex].innerHTML; // var question5ElementValue = question1Element.options[question5Element.selectedIndex].innerHTML; // var question6ElementValue = question1Element.options[question6Element.selectedIndex].innerHTML; var mappedFields = document.getElementById('mapped-field-list').getElementsByTagName('li'); for( j=0; j< mappedFields.length; j++ ) { var currentItemRight = mappedFields[j] var currentValueRight = currentItemRight.childNodes[0].nodeValue; // loop through each dropdown to see if it matches "Name" var dropdowns = document.getElementById('mapping-form').getElementsByTagName('select'); for( i=0; i< dropdowns.length; i++ ) { var currentValueLeft = dropdowns[i].options[dropdowns[i].selectedIndex].innerHTML; if (currentValueLeft == currentValueRight) { currentItemRight.classList.add("gray"); }; }; var counter = 0; for( i=0; i< dropdowns.length; i++ ) { var currentValueLeft = dropdowns[i].options[dropdowns[i].selectedIndex].innerHTML; if (currentValueLeft == currentValueRight) { counter ++; }; }; if (counter == 0 ) { currentItemRight.classList.remove("gray"); }; if (counter >1) { currentItemRight.getElementsByTagName('span')[0].textContent = counter; }; if (counter ==1) { currentItemRight.getElementsByTagName('span')[0].textContent = ""; }; // }; }; // if (question1ElementValue == mappingRight1.textContent) { // mappingRight1.classList.add("gray"); // } // var cityText = question2Element.options[question2Element.selectedIndex].innerHTML; }; };
{ "content_hash": "6aa70e8970b5cafc3a264cc212f84b7c", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 111, "avg_line_length": 46.459119496855344, "alnum_prop": 0.6003790442669554, "repo_name": "christopherpturney/christopherpturney.github.io", "id": "996420dda3a19d346384123efbafcd047ba1c4a2", "size": "7531", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Enhatch Importer/js/lab.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "56328" }, { "name": "HTML", "bytes": "116349" }, { "name": "JavaScript", "bytes": "122170" }, { "name": "PHP", "bytes": "37613" }, { "name": "Shell", "bytes": "26" } ], "symlink_target": "" }
package api import ( "fmt" "strings" "github.com/Azure/acs-engine/pkg/api/common" "github.com/Azure/acs-engine/pkg/api/v20170930" "github.com/Azure/acs-engine/pkg/api/vlabs" "github.com/Masterminds/semver" ) type orchestratorsFunc func(*OrchestratorProfile) ([]*OrchestratorVersionProfile, error) var funcmap map[string]orchestratorsFunc func init() { funcmap = map[string]orchestratorsFunc{ Kubernetes: kubernetesInfo, DCOS: dcosInfo, Swarm: swarmInfo, SwarmMode: dockerceInfo, } } func validate(orchestrator, version string) (string, error) { switch { case strings.EqualFold(orchestrator, Kubernetes): return Kubernetes, nil case strings.EqualFold(orchestrator, DCOS): return DCOS, nil case strings.EqualFold(orchestrator, Swarm): return Swarm, nil case strings.EqualFold(orchestrator, SwarmMode): return SwarmMode, nil case orchestrator == "": if version != "" { return "", fmt.Errorf("Must specify orchestrator for version '%s'", version) } default: return "", fmt.Errorf("Unsupported orchestrator '%s'", orchestrator) } return "", nil } // GetOrchestratorVersionProfileListVLabs returns vlabs OrchestratorVersionProfileList object per (optionally) specified orchestrator and version func GetOrchestratorVersionProfileListVLabs(orchestrator, version string) (*vlabs.OrchestratorVersionProfileList, error) { apiOrchs, err := getOrchestratorVersionProfileList(orchestrator, version) if err != nil { return nil, err } orchList := &vlabs.OrchestratorVersionProfileList{} orchList.Orchestrators = []*vlabs.OrchestratorVersionProfile{} for _, orch := range apiOrchs { orchList.Orchestrators = append(orchList.Orchestrators, ConvertOrchestratorVersionProfileToVLabs(orch)) } return orchList, nil } // GetOrchestratorVersionProfileListV20170930 returns v20170930 OrchestratorVersionProfileList object per (optionally) specified orchestrator and version func GetOrchestratorVersionProfileListV20170930(orchestrator, version string) (*v20170930.OrchestratorVersionProfileList, error) { apiOrchs, err := getOrchestratorVersionProfileList(orchestrator, version) if err != nil { return nil, err } orchList := &v20170930.OrchestratorVersionProfileList{} for _, orch := range apiOrchs { orchList.Properties.Orchestrators = append(orchList.Properties.Orchestrators, ConvertOrchestratorVersionProfileToV20170930(orch)) } return orchList, nil } func getOrchestratorVersionProfileList(orchestrator, version string) ([]*OrchestratorVersionProfile, error) { var err error if orchestrator, err = validate(orchestrator, version); err != nil { return nil, err } orchs := []*OrchestratorVersionProfile{} if len(orchestrator) == 0 { // return all orchestrators for _, f := range funcmap { arr, err := f(&OrchestratorProfile{}) if err != nil { return nil, err } orchs = append(orchs, arr...) } } else { if orchs, err = funcmap[orchestrator](&OrchestratorProfile{OrchestratorVersion: version}); err != nil { return nil, err } } return orchs, nil } // GetOrchestratorVersionProfile returns orchestrator info for upgradable container service func GetOrchestratorVersionProfile(orch *OrchestratorProfile) (*OrchestratorVersionProfile, error) { if orch.OrchestratorVersion == "" { return nil, fmt.Errorf("Missing Orchestrator Version") } if orch.OrchestratorType != Kubernetes { return nil, fmt.Errorf("Upgrade operation is not supported for '%s'", orch.OrchestratorType) } arr, err := kubernetesInfo(orch) if err != nil { return nil, err } // has to be exactly one element per specified orchestrator/version if len(arr) != 1 { return nil, fmt.Errorf("Umbiguous Orchestrator Versions") } return arr[0], nil } func kubernetesInfo(csOrch *OrchestratorProfile) ([]*OrchestratorVersionProfile, error) { orchs := []*OrchestratorVersionProfile{} if csOrch.OrchestratorVersion == "" { // get info for all supported versions for _, ver := range common.GetAllSupportedKubernetesVersions() { upgrades, err := kubernetesUpgrades(&OrchestratorProfile{OrchestratorVersion: ver}) if err != nil { return nil, err } orchs = append(orchs, &OrchestratorVersionProfile{ OrchestratorProfile: OrchestratorProfile{ OrchestratorType: Kubernetes, OrchestratorVersion: ver, }, Default: ver == common.KubernetesDefaultVersion, Upgrades: upgrades, }) } } else { ver, err := semver.NewVersion(csOrch.OrchestratorVersion) if err != nil { return nil, err } cons, err := semver.NewConstraint("<1.5.0") if err != nil { return nil, err } if cons.Check(ver) { return nil, fmt.Errorf("Kubernetes version %s is not supported", csOrch.OrchestratorVersion) } upgrades, err := kubernetesUpgrades(csOrch) if err != nil { return nil, err } orchs = append(orchs, &OrchestratorVersionProfile{ OrchestratorProfile: OrchestratorProfile{ OrchestratorType: Kubernetes, OrchestratorVersion: csOrch.OrchestratorVersion, }, Default: csOrch.OrchestratorVersion == common.KubernetesDefaultVersion, Upgrades: upgrades, }) } return orchs, nil } func kubernetesUpgrades(csOrch *OrchestratorProfile) ([]*OrchestratorProfile, error) { ret := []*OrchestratorProfile{} currentVer, err := semver.NewVersion(csOrch.OrchestratorVersion) if err != nil { return nil, err } currentMajor, currentMinor, currentPatch := currentVer.Major(), currentVer.Minor(), currentVer.Patch() var nextMajor, nextMinor int64 switch { case currentMajor == 1 && currentMinor == 5: nextMajor = 1 nextMinor = 6 case currentMajor == 1 && currentMinor == 6: nextMajor = 1 nextMinor = 7 case currentMajor == 1 && currentMinor == 7: nextMajor = 1 nextMinor = 8 case currentMajor == 1 && currentMinor == 8: nextMajor = 1 nextMinor = 9 } for ver, supported := range common.AllKubernetesSupportedVersions { if !supported { continue } nextVersion, err := semver.NewVersion(ver) if err != nil { continue } // add patch upgrade if nextVersion.Major() == currentMajor && nextVersion.Minor() == currentMinor && currentPatch < nextVersion.Patch() { ret = append(ret, &OrchestratorProfile{ OrchestratorType: Kubernetes, OrchestratorVersion: ver, }) } // add next version if nextVersion.Major() == nextMajor && nextVersion.Minor() == nextMinor { ret = append(ret, &OrchestratorProfile{ OrchestratorType: Kubernetes, OrchestratorVersion: ver, }) } } return ret, nil } func dcosInfo(csOrch *OrchestratorProfile) ([]*OrchestratorVersionProfile, error) { orchs := []*OrchestratorVersionProfile{} if csOrch.OrchestratorVersion == "" { // get info for all supported versions for _, ver := range common.AllDCOSSupportedVersions { orchs = append(orchs, &OrchestratorVersionProfile{ OrchestratorProfile: OrchestratorProfile{ OrchestratorType: DCOS, OrchestratorVersion: ver, }, Default: ver == common.DCOSDefaultVersion, }) } } else { // get info for the specified version orchs = append(orchs, &OrchestratorVersionProfile{ OrchestratorProfile: OrchestratorProfile{ OrchestratorType: DCOS, OrchestratorVersion: csOrch.OrchestratorVersion, }, Default: csOrch.OrchestratorVersion == common.DCOSDefaultVersion, }) } return orchs, nil } func swarmInfo(csOrch *OrchestratorProfile) ([]*OrchestratorVersionProfile, error) { return []*OrchestratorVersionProfile{ { OrchestratorProfile: OrchestratorProfile{ OrchestratorType: Swarm, OrchestratorVersion: SwarmVersion, }, }, }, nil } func dockerceInfo(csOrch *OrchestratorProfile) ([]*OrchestratorVersionProfile, error) { return []*OrchestratorVersionProfile{ { OrchestratorProfile: OrchestratorProfile{ OrchestratorType: SwarmMode, OrchestratorVersion: DockerCEVersion, }, }, }, nil }
{ "content_hash": "2e7f736c32208a7d4383bb554350b85c", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 153, "avg_line_length": 30.202290076335878, "alnum_prop": 0.7269050928851257, "repo_name": "rocketraman/acs-engine", "id": "234b5d548178ef96e47af1a0f67ae8a81ad1a311", "size": "7913", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pkg/api/orchestrators.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "857527" }, { "name": "Groovy", "bytes": "24761" }, { "name": "Makefile", "bytes": "5299" }, { "name": "Perl", "bytes": "299925" }, { "name": "PowerShell", "bytes": "45340" }, { "name": "Python", "bytes": "5986" }, { "name": "Shell", "bytes": "100388" } ], "symlink_target": "" }
<?php namespace App\Controllers; use App\Models; class QuoteController extends \App\Controller { public function index($request, $response, $args) { $args['results'] = Models\Quote::with('user', 'teacher')->orderBy('created_at', 'desc')->paginate(10); $args['results']->setPath($this->router->pathFor($request->getAttribute('route')->getName())); $response = $this->view->render($response, 'quotes/index.twig', $args); return $response; } public function datail($request, $response, $args) { $quote = Models\Quote::with('teacher')->find($args['id']); if (empty($quote)) { throw new \Slim\Exception\NotFoundException($request, $response); } $args['result'] = $quote; $response = $this->view->render($response, 'quotes/datail.twig', $args); return $response; } public function form($request, $response, $args) { if (!empty($args['id'])) { $quote = Models\Quote::find($args['id']); if (empty($quote) || ($quote->user_id != $this->auth->getUser()->id && !$this->auth->isAdmin())) { throw new \Slim\Exception\NotFoundException($request, $response); } $args['result'] = $quote; } $args['teachers'] = Models\Teacher::orderBy('name', 'asc')->get(); $response = $this->view->render($response, 'quotes/form.twig', $args); return $response; } public function formPost($request, $response, $args) { if (!$this->validator->hasErrors()) { if (!empty($args['id'])) { $quote = Models\Quote::find($args['id']); if (empty($quote) || ($quote->user_id != $this->auth->getUser()->id && !$this->auth->isAdmin())) { throw new \Slim\Exception\NotFoundException($request, $response); } } else { $quote = new Models\Quote(); } $teacher = Models\Teacher::find($this->filter->teacher); if (empty($teacher)) { $teacher = Models\Teacher::where(['name' => $this->filter->new_teacher])->first(); if (empty($teacher)) { $teacher = new Models\Teacher(); $teacher->name = $this->filter->new_teacher; $teacher->user()->associate($this->auth->getUser()); $teacher->save(); } } $quote->teacher()->associate($teacher); $quote->user()->associate($this->auth->getUser()); $quote->content = $this->filter->content; $quote->save(); $this->flash->addMessage('infos', $this->translator->translate('quote.success')); $this->router->redirectTo('quotes'); } return $response; } public function delete($request, $response, $args) { $args['delete'] = true; return $this->datail($request, $response, $args); } public function deletePost($request, $response, $args) { if (!empty($args['id'])) { $quote = Models\Quote::find($args['id']); if (empty($quote) || ($quote->user_id != $this->auth->getUser()->id && !$this->auth->isAdmin())) { throw new \Slim\Exception\NotFoundException($request, $response); } $quote->delete(); } $this->router->redirectTo('quotes'); return $response; } }
{ "content_hash": "a4b90a8e550c85d6f74fec2bb4d822d0", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 114, "avg_line_length": 31.15929203539823, "alnum_prop": 0.5168986083499006, "repo_name": "Dasc3er/Sito-studentesco", "id": "f434e22368a65558047117b99d4cce89802481e7", "size": "3521", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/QuoteController.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "210" }, { "name": "CSS", "bytes": "7117" }, { "name": "HTML", "bytes": "69670" }, { "name": "JavaScript", "bytes": "7967" }, { "name": "PHP", "bytes": "138815" } ], "symlink_target": "" }
<!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_60-ea) on Fri Nov 04 13:24:39 EDT 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>org.wildfly.swarm.config.remoting (Public javadocs 2016.11.0 API)</title> <meta name="date" content="2016-11-04"> <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="org.wildfly.swarm.config.remoting (Public javadocs 2016.11.0 API)"; } } 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 class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></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 class="aboutLanguage">WildFly Swarm API, 2016.11.0</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/naming/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../../../../../org/wildfly/swarm/config/resource/adapters/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/remoting/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.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"> <h1 title="Package" class="title">Package&nbsp;org.wildfly.swarm.config.remoting</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation"> <caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Interface</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/ConnectorConsumer.html" title="interface in org.wildfly.swarm.config.remoting">ConnectorConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/Connector.html" title="class in org.wildfly.swarm.config.remoting">Connector</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/ConnectorSupplier.html" title="interface in org.wildfly.swarm.config.remoting">ConnectorSupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/Connector.html" title="class in org.wildfly.swarm.config.remoting">Connector</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/EndpointConfigurationConsumer.html" title="interface in org.wildfly.swarm.config.remoting">EndpointConfigurationConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/EndpointConfiguration.html" title="class in org.wildfly.swarm.config.remoting">EndpointConfiguration</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/EndpointConfigurationSupplier.html" title="interface in org.wildfly.swarm.config.remoting">EndpointConfigurationSupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/EndpointConfiguration.html" title="class in org.wildfly.swarm.config.remoting">EndpointConfiguration</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/HTTPConnectorConsumer.html" title="interface in org.wildfly.swarm.config.remoting">HTTPConnectorConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/HTTPConnector.html" title="class in org.wildfly.swarm.config.remoting">HTTPConnector</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/HTTPConnectorSupplier.html" title="interface in org.wildfly.swarm.config.remoting">HTTPConnectorSupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/HTTPConnector.html" title="class in org.wildfly.swarm.config.remoting">HTTPConnector</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/LocalOutboundConnectionConsumer.html" title="interface in org.wildfly.swarm.config.remoting">LocalOutboundConnectionConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/LocalOutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">LocalOutboundConnection</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/LocalOutboundConnectionSupplier.html" title="interface in org.wildfly.swarm.config.remoting">LocalOutboundConnectionSupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/LocalOutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">LocalOutboundConnection</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/OutboundConnectionConsumer.html" title="interface in org.wildfly.swarm.config.remoting">OutboundConnectionConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/OutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">OutboundConnection</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/OutboundConnectionSupplier.html" title="interface in org.wildfly.swarm.config.remoting">OutboundConnectionSupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/OutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">OutboundConnection</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/PolicySASLPolicyConsumer.html" title="interface in org.wildfly.swarm.config.remoting">PolicySASLPolicyConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/PolicySASLPolicy.html" title="class in org.wildfly.swarm.config.remoting">PolicySASLPolicy</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/PolicySASLPolicySupplier.html" title="interface in org.wildfly.swarm.config.remoting">PolicySASLPolicySupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/PolicySASLPolicy.html" title="class in org.wildfly.swarm.config.remoting">PolicySASLPolicy</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.remoting">PropertyConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/Property.html" title="class in org.wildfly.swarm.config.remoting">Property</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/PropertySupplier.html" title="interface in org.wildfly.swarm.config.remoting">PropertySupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/Property.html" title="class in org.wildfly.swarm.config.remoting">Property</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/RemoteOutboundConnectionConsumer.html" title="interface in org.wildfly.swarm.config.remoting">RemoteOutboundConnectionConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/RemoteOutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">RemoteOutboundConnection</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/RemoteOutboundConnectionSupplier.html" title="interface in org.wildfly.swarm.config.remoting">RemoteOutboundConnectionSupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/RemoteOutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">RemoteOutboundConnection</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/SASLSecurityConsumer.html" title="interface in org.wildfly.swarm.config.remoting">SASLSecurityConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/SASLSecurity.html" title="class in org.wildfly.swarm.config.remoting">SASLSecurity</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/SASLSecuritySupplier.html" title="interface in org.wildfly.swarm.config.remoting">SASLSecuritySupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/SASLSecurity.html" title="class in org.wildfly.swarm.config.remoting">SASLSecurity</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/Connector.html" title="class in org.wildfly.swarm.config.remoting">Connector</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/Connector.html" title="class in org.wildfly.swarm.config.remoting">Connector</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">The configuration of a Remoting connector.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/Connector.ConnectorResources.html" title="class in org.wildfly.swarm.config.remoting">Connector.ConnectorResources</a></td> <td class="colLast"> <div class="block">Child mutators for Connector</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/EndpointConfiguration.html" title="class in org.wildfly.swarm.config.remoting">EndpointConfiguration</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/EndpointConfiguration.html" title="class in org.wildfly.swarm.config.remoting">EndpointConfiguration</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Endpoint configuration</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/HTTPConnector.html" title="class in org.wildfly.swarm.config.remoting">HTTPConnector</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/HTTPConnector.html" title="class in org.wildfly.swarm.config.remoting">HTTPConnector</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">The configuration of a HTTP Upgrade based Remoting connector.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/HTTPConnector.HTTPConnectorResources.html" title="class in org.wildfly.swarm.config.remoting">HTTPConnector.HTTPConnectorResources</a></td> <td class="colLast"> <div class="block">Child mutators for HTTPConnector</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/LocalOutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">LocalOutboundConnection</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/LocalOutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">LocalOutboundConnection</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Remoting outbound connection with an implicit local:// URI scheme.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/LocalOutboundConnection.LocalOutboundConnectionResources.html" title="class in org.wildfly.swarm.config.remoting">LocalOutboundConnection.LocalOutboundConnectionResources</a></td> <td class="colLast"> <div class="block">Child mutators for LocalOutboundConnection</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/OutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">OutboundConnection</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/OutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">OutboundConnection</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Remoting outbound connection.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/OutboundConnection.OutboundConnectionResources.html" title="class in org.wildfly.swarm.config.remoting">OutboundConnection.OutboundConnectionResources</a></td> <td class="colLast"> <div class="block">Child mutators for OutboundConnection</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/PolicySASLPolicy.html" title="class in org.wildfly.swarm.config.remoting">PolicySASLPolicy</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/PolicySASLPolicy.html" title="class in org.wildfly.swarm.config.remoting">PolicySASLPolicy</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">The policy configuration.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/Property.html" title="class in org.wildfly.swarm.config.remoting">Property</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/Property.html" title="class in org.wildfly.swarm.config.remoting">Property</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Properties supported by the underlying provider.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/RemoteOutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">RemoteOutboundConnection</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/RemoteOutboundConnection.html" title="class in org.wildfly.swarm.config.remoting">RemoteOutboundConnection</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Remoting outbound connection with an implicit remote:// URI scheme.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/RemoteOutboundConnection.RemoteOutboundConnectionResources.html" title="class in org.wildfly.swarm.config.remoting">RemoteOutboundConnection.RemoteOutboundConnectionResources</a></td> <td class="colLast"> <div class="block">Child mutators for RemoteOutboundConnection</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/SASLSecurity.html" title="class in org.wildfly.swarm.config.remoting">SASLSecurity</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/remoting/SASLSecurity.html" title="class in org.wildfly.swarm.config.remoting">SASLSecurity</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">The "sasl" element contains the SASL authentication configuration for this connector.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/SASLSecurity.SASLSecurityResources.html" title="class in org.wildfly.swarm.config.remoting">SASLSecurity.SASLSecurityResources</a></td> <td class="colLast"> <div class="block">Child mutators for SASLSecurity</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Summary table, listing enums, and an explanation"> <caption><span>Enum Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Enum</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/remoting/RemoteOutboundConnection.Protocol.html" title="enum in org.wildfly.swarm.config.remoting">RemoteOutboundConnection.Protocol</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </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 class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></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 class="aboutLanguage">WildFly Swarm API, 2016.11.0</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/naming/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../../../../../org/wildfly/swarm/config/resource/adapters/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/remoting/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.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 ======= --> <p class="legalCopy"><small>Copyright &#169; 2016 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
{ "content_hash": "15d38dd57c8b188dcd6de1c83748964d", "timestamp": "", "source": "github", "line_count": 331, "max_line_length": 409, "avg_line_length": 62.01812688821752, "alnum_prop": 0.6971453624318005, "repo_name": "wildfly-swarm/wildfly-swarm-javadocs", "id": "03d663484862cc91086344093b3ca951105d0720", "size": "20528", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "2016.11.0/apidocs/org/wildfly/swarm/config/remoting/package-summary.html", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package resources import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/robomaker" ) type RoboMakerRobotApplication struct { svc *robomaker.RoboMaker name *string arn *string version *string } func init() { register("RoboMakerRobotApplication", ListRoboMakerRobotApplications) } func ListRoboMakerRobotApplications(sess *session.Session) ([]Resource, error) { svc := robomaker.New(sess) resources := []Resource{} params := &robomaker.ListRobotApplicationsInput{ MaxResults: aws.Int64(30), } for { resp, err := svc.ListRobotApplications(params) if err != nil { return nil, err } for _, robotApplication := range resp.RobotApplicationSummaries { resources = append(resources, &RoboMakerRobotApplication{ svc: svc, name: robotApplication.Name, arn: robotApplication.Arn, version: robotApplication.Version, }) } if resp.NextToken == nil { break } params.NextToken = resp.NextToken } return resources, nil } func (f *RoboMakerRobotApplication) Remove() error { request := robomaker.DeleteRobotApplicationInput{ Application: f.arn, } if f.version != nil && *f.version != "$LATEST" { request.ApplicationVersion = f.version } _, err := f.svc.DeleteRobotApplication(&request) return err } func (f *RoboMakerRobotApplication) String() string { return *f.name }
{ "content_hash": "8c932efc6f704014f1fdbfd82ecb372a", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 80, "avg_line_length": 20.608695652173914, "alnum_prop": 0.7046413502109705, "repo_name": "rebuy-de/aws-nuke", "id": "42bb7519b7988127ec55061b3af5309e110be296", "size": "1422", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "resources/robomaker-robot-applications.go", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "539" }, { "name": "Go", "bytes": "688430" }, { "name": "Makefile", "bytes": "2365" }, { "name": "Shell", "bytes": "230" } ], "symlink_target": "" }
<?php namespace App\AdminBundle\Controller; use App\CoreBundle\Controller\BaseController; class AdminBaseController extends BaseController { protected $namespace = 'AppAdminBundle:'; protected $name = null; public function addAction() { return $this->addItem($this->name); } public function editAction($id) { return $this->editItem($this->name, $id); } public function deleteAction($id) { return $this->removeItem($this->name, $id); } }
{ "content_hash": "36de7183a80713b9a0d9e091ce8b0ec9", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 51, "avg_line_length": 19.14814814814815, "alnum_prop": 0.6382978723404256, "repo_name": "abdeltiflouardi/CMSsf", "id": "643da7049b555c13eb58108c87cb9b087f3f6a2f", "size": "517", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/App/AdminBundle/Controller/AdminBaseController.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "176" }, { "name": "CSS", "bytes": "22208" }, { "name": "PHP", "bytes": "175048" }, { "name": "XML", "bytes": "4701" } ], "symlink_target": "" }