code
stringlengths
5
1.01M
repo_name
stringlengths
5
84
path
stringlengths
4
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
5
1.01M
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
/************************************************************************* * * TIGHTDB CONFIDENTIAL * __________________ * * [2011] - [2012] TightDB Inc * All Rights Reserved. * * NOTICE: All information contained herein is, and remains * the property of TightDB Incorporated and its suppliers, * if any. The intellectual and technical concepts contained * herein are proprietary to TightDB Incorporated * and its suppliers and may be covered by U.S. and Foreign Patents, * patents in process, and are protected by trade secret or copyright law. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from TightDB Incorporated. * **************************************************************************/ #ifndef TIGHTDB_COLUMN_BASIC_HPP #define TIGHTDB_COLUMN_BASIC_HPP #include <tightdb/column.hpp> #include <tightdb/array_basic.hpp> namespace tightdb { template<class T> struct AggReturnType { typedef T sum_type; }; template<> struct AggReturnType<float> { typedef double sum_type; }; /// A basic column (BasicColumn<T>) is a single B+-tree, and the root /// of the column is the root of the B+-tree. All leaf nodes are /// single arrays of type BasicArray<T>. /// /// A basic column can currently only be used for simple unstructured /// types like float, double. template<class T> class BasicColumn : public ColumnBase, public ColumnTemplate<T> { public: typedef T value_type; BasicColumn(Allocator&, ref_type); ~BasicColumn() TIGHTDB_NOEXCEPT TIGHTDB_OVERRIDE; std::size_t size() const TIGHTDB_NOEXCEPT; bool is_empty() const TIGHTDB_NOEXCEPT { return size() == 0; } T get(std::size_t ndx) const TIGHTDB_NOEXCEPT; void add(T value = T()); void set(std::size_t ndx, T value); void insert(std::size_t ndx, T value = T()); void erase(std::size_t row_ndx); void move_last_over(std::size_t row_ndx); void clear(); std::size_t count(T value) const; typedef typename AggReturnType<T>::sum_type SumType; SumType sum(std::size_t begin = 0, std::size_t end = npos, std::size_t limit = std::size_t(-1), size_t* return_ndx = null_ptr) const; double average(std::size_t begin = 0, std::size_t end = npos, std::size_t limit = std::size_t(-1), size_t* return_ndx = null_ptr) const; T maximum(std::size_t begin = 0, std::size_t end = npos, std::size_t limit = std::size_t(-1), size_t* return_ndx = null_ptr) const; T minimum(std::size_t begin = 0, std::size_t end = npos, std::size_t limit = std::size_t(-1), size_t* return_ndx = null_ptr) const; std::size_t find_first(T value, std::size_t begin = 0 , std::size_t end = npos) const; void find_all(Column& result, T value, std::size_t begin = 0, std::size_t end = npos) const; //@{ /// Find the lower/upper bound for the specified value assuming /// that the elements are already sorted in ascending order. std::size_t lower_bound(T value) const TIGHTDB_NOEXCEPT; std::size_t upper_bound(T value) const TIGHTDB_NOEXCEPT; //@{ /// Compare two columns for equality. bool compare(const BasicColumn&) const; static ref_type create(Allocator&, std::size_t size = 0); // Overrriding method in ColumnBase ref_type write(std::size_t, std::size_t, std::size_t, _impl::OutputStream&) const TIGHTDB_OVERRIDE; void insert(std::size_t, std::size_t, bool) TIGHTDB_OVERRIDE; void erase(std::size_t, bool) TIGHTDB_OVERRIDE; void move_last_over(std::size_t, std::size_t, bool) TIGHTDB_OVERRIDE; void clear(std::size_t, bool) TIGHTDB_OVERRIDE; void refresh_accessor_tree(std::size_t, const Spec&) TIGHTDB_OVERRIDE; #ifdef TIGHTDB_DEBUG void Verify() const; void to_dot(std::ostream&, StringData title) const TIGHTDB_OVERRIDE; void do_dump_node_structure(std::ostream&, int) const TIGHTDB_OVERRIDE; #endif protected: T get_val(size_t row) const { return get(row); } private: std::size_t do_get_size() const TIGHTDB_NOEXCEPT TIGHTDB_OVERRIDE { return size(); } /// \param row_ndx Must be `tightdb::npos` if appending. void do_insert(std::size_t row_ndx, T value, std::size_t num_rows); // Called by Array::bptree_insert(). static ref_type leaf_insert(MemRef leaf_mem, ArrayParent&, std::size_t ndx_in_parent, Allocator&, std::size_t insert_ndx, Array::TreeInsert<BasicColumn<T> >&); template <typename R, Action action, class cond> R aggregate(T target, std::size_t start, std::size_t end, std::size_t* return_ndx) const; class SetLeafElem; class EraseLeafElem; class CreateHandler; class SliceHandler; void do_erase(std::size_t row_ndx, bool is_last); void do_move_last_over(std::size_t row_ndx, std::size_t last_row_ndx); void do_clear(); #ifdef TIGHTDB_DEBUG static std::size_t verify_leaf(MemRef, Allocator&); void leaf_to_dot(MemRef, ArrayParent*, std::size_t ndx_in_parent, std::ostream&) const TIGHTDB_OVERRIDE; static void leaf_dumper(MemRef, Allocator&, std::ostream&, int level); #endif friend class Array; friend class ColumnBase; }; } // namespace tightdb // template implementation #include <tightdb/column_basic_tpl.hpp> #endif // TIGHTDB_COLUMN_BASIC_HPP
TheSwanFactory/hands-on
hope-club/Pods/Realm/include/tightdb/column_basic.hpp
C++
mit
5,444
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/bin/bash usage() { local prog=$(basename "$0") echo " Usage: $prog " if [ $EUID -ne 0 ]; then echo echo "This script requires ROOT privileges to run" echo fi exit 1 } error() { local msg="$1" local ret=$2 echo "Error: $msg" 1>&2 [ -n "$ret" ] && exit $ret exit 1 } download_file() { local url="$1" local temp_file="$2" local retries=${3:-3} local wait_before_retry=${4:-20} if hash curl &>/dev/null; then curl -s -f -L --retry $retries --retry-delay $wait_before_retry -o "$temp_file" "$url" status=$? elif hash wget &>/dev/null; then wget -t $retries -w $wait_before_retry -O "$temp_file" "$url" status=$? fi return $status } # main if [ $EUID -ne 0 ]; then error "this script requires ROOT privileges to run successfully" fi umask 022 unset dp_server_uuid dp_server_key is_provisioner # the lines below are to be uncommented out when this script is served # through the install URL #dp_server_uuid="" #dp_server_key="" #taskd_api="" #is_provisioner=1 provisioner_repo="https://github.com/devpanel/paas-provisioner" target_dir="/opt/webenabled" bootstrap_url="https://install.devpanel.com/bootstrap.tar" if [ -z "$dp_server_uuid" ]; then error "the server uuid is not set." elif [ -z "$dp_server_key" ]; then error "the server key is not set." elif [ -z "$taskd_api" ]; then error "the taskd_api is not set." fi tmp_bootstrap_dir=`mktemp -d /tmp/bootstrap_provisioner.XXXXXXXXXXXXXX` if [ $? -ne 0 ]; then error "unable to create temporary dir" fi trap 'ex=$?; rm -rf "$tmp_bootstrap_dir"; exit $ex' HUP INT TERM EXIT tmp_tar=`mktemp "$tmp_bootstrap_dir/bootstrap.tar.XXXXXXXXXXX"` if [ $? -ne 0 ]; then error "unable to create temporary file" fi if ! download_file "$bootstrap_url" "$tmp_tar"; then error "unable to download the bootstrap tar file from '$bootstrap_url'" fi if ! tar -xf "$tmp_tar" -C "$tmp_bootstrap_dir"; then error "unable to extract bootstrap tar file '$tmp_tar'" fi "$tmp_bootstrap_dir/bootstrap/install.sh" -u "$dp_server_uuid" \ -k "$dp_server_key" -A "$taskd_api" if [ $? -ne 0 ]; then exit 1 fi if [ -n "$is_provisioner" -a "$is_provisioner" != 0 ]; then ( cd "$target_dir" && git clone "$provisioner_repo" ) if [ $? -ne 0 ]; then error "failed to clone the provisioner repository" fi fi exit 0
devpanel/serverlink
install/bootstrap/install_provisioner_url.sh
Shell
agpl-3.0
2,344
[ 30522, 1001, 999, 1013, 8026, 1013, 24234, 8192, 1006, 1007, 1063, 2334, 4013, 2290, 1027, 1002, 1006, 2918, 18442, 1000, 1002, 1014, 1000, 1007, 9052, 1000, 8192, 1024, 1002, 4013, 2290, 1000, 2065, 1031, 1002, 7327, 3593, 1011, 11265, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import React from 'react' import { compose } from 'redux' import { connect } from 'react-redux' import { Field, FieldArray, reduxForm } from 'redux-form' import { amount, autocomplete, debitCredit } from './Fields' import { Button, FontIcon } from 'react-toolbox' import { getAutocomplete } from 'modules/autocomplete' import { create } from 'modules/entities/journalEntryCreatedEvents' import classes from './JournalEntryForm.scss' import { fetch as fetchLedgers } from 'modules/entities/ledgers' const validate = (values) => { const errors = {} return errors } const renderRecords = ({ fields, meta: { touched, error, submitFailed }, ledgers, financialFactId }) => ( <div> <div> <Button onClick={() => fields.push({})}> <FontIcon value='add' /></Button> {(touched || submitFailed) && error && <span>{error}</span>} </div> <div className={classes.recordsList}> {fields.map((record, index) => <div key={index}> <Button onClick={() => fields.remove(index)}> <FontIcon value='remove' /></Button> <div className={classes.journalEntryField}> <Field name={`${record}.ledger`} component={autocomplete} label='Ledger' source={ledgers} multiple={false} /> </div> <div className={classes.journalEntryField}> <Field name={`${record}.debitCredit`} component={debitCredit} label='Debit/credit' /> </div> <div className={classes.journalEntryField}> <Field name={`${record}.amount`} component={amount} label='Amount' /> </div> </div> )} </div> </div> ) const JournalEntryForm = (props) => { const { ledgers, handleSubmit, submitting, reset } = props return ( <div className={classes.journalEntryForm}> <form onSubmit={handleSubmit}> <FieldArray name='records' component={renderRecords} ledgers={ledgers} /> <Button type='submit' disabled={submitting}>Submit</Button> <Button type='button' disabled={submitting} onClick={reset}>Clear</Button> </form> </div> ) } const onSubmit = (values) => { return create({ values: { ...values } }) } const mapDispatchToProps = { onSubmit, fetchLedgers } const mapStateToProps = (state) => { return { ledgers: getAutocomplete(state, 'ledgers') } } export default compose( connect(mapStateToProps, mapDispatchToProps), reduxForm({ form: 'JournalEntryForm', validate }))(JournalEntryForm)
joris77/admin-web
src/forms/JournalEntryForm.js
JavaScript
mit
2,642
[ 30522, 12324, 10509, 2013, 1005, 10509, 1005, 12324, 1063, 17202, 1065, 2013, 1005, 2417, 5602, 1005, 12324, 1063, 7532, 1065, 2013, 1005, 10509, 1011, 2417, 5602, 1005, 12324, 1063, 2492, 1010, 2492, 2906, 9447, 1010, 2417, 5602, 14192, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.cdn.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cdn.fluent.ValidatesClient; import com.azure.resourcemanager.cdn.fluent.models.ValidateSecretOutputInner; import com.azure.resourcemanager.cdn.models.ValidateSecretInput; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ValidatesClient. */ public final class ValidatesClientImpl implements ValidatesClient { private final ClientLogger logger = new ClientLogger(ValidatesClientImpl.class); /** The proxy service used to perform REST calls. */ private final ValidatesService service; /** The service client containing this operation class. */ private final CdnManagementClientImpl client; /** * Initializes an instance of ValidatesClientImpl. * * @param client the instance of the service client containing this operation class. */ ValidatesClientImpl(CdnManagementClientImpl client) { this.service = RestProxy.create(ValidatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** * The interface defining all the services for CdnManagementClientValidates to be used by the proxy service to * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "CdnManagementClientV") private interface ValidatesService { @Headers({"Content-Type: application/json"}) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateSecret") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono<Response<ValidateSecretOutputInner>> secret( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ValidateSecretInput validateSecretInput, @HeaderParam("Accept") String accept, Context context); } /** * Validate a Secret in the profile. * * @param validateSecretInput The Secret source. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return output of the validated secret along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono<Response<ValidateSecretOutputInner>> secretWithResponseAsync(ValidateSecretInput validateSecretInput) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (validateSecretInput == null) { return Mono .error(new IllegalArgumentException("Parameter validateSecretInput is required and cannot be null.")); } else { validateSecretInput.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service .secret( this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), validateSecretInput, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Validate a Secret in the profile. * * @param validateSecretInput The Secret source. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return output of the validated secret along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<ValidateSecretOutputInner>> secretWithResponseAsync( ValidateSecretInput validateSecretInput, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (validateSecretInput == null) { return Mono .error(new IllegalArgumentException("Parameter validateSecretInput is required and cannot be null.")); } else { validateSecretInput.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .secret( this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), validateSecretInput, accept, context); } /** * Validate a Secret in the profile. * * @param validateSecretInput The Secret source. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return output of the validated secret on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono<ValidateSecretOutputInner> secretAsync(ValidateSecretInput validateSecretInput) { return secretWithResponseAsync(validateSecretInput) .flatMap( (Response<ValidateSecretOutputInner> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { return Mono.empty(); } }); } /** * Validate a Secret in the profile. * * @param validateSecretInput The Secret source. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return output of the validated secret. */ @ServiceMethod(returns = ReturnType.SINGLE) public ValidateSecretOutputInner secret(ValidateSecretInput validateSecretInput) { return secretAsync(validateSecretInput).block(); } /** * Validate a Secret in the profile. * * @param validateSecretInput The Secret source. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return output of the validated secret along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response<ValidateSecretOutputInner> secretWithResponse( ValidateSecretInput validateSecretInput, Context context) { return secretWithResponseAsync(validateSecretInput, context).block(); } }
Azure/azure-sdk-for-java
sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/implementation/ValidatesClientImpl.java
Java
mit
9,487
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 7513, 3840, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 7000, 2104, 1996, 10210, 6105, 1012, 1013, 1013, 3642, 7013, 2011, 7513, 1006, 1054, 1007, 8285, 28533, 3642, 13103, 1012, 7427, 4012, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Nitrogen 2.x Documentation</title> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/> <meta name="title" content="Nitrogen 2.x Documentation"/> <meta name="generator" content="Org-mode"/> <meta name="generated" content="2012-10-31 21:51:19 CDT"/> <meta name="author" content="Rusty Klophaus (@rustyio)"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <style type="text/css"> <!--/*--><![CDATA[/*><!--*/ html { font-family: Times, serif; font-size: 12pt; } .title { text-align: center; } .todo { color: red; } .done { color: green; } .tag { background-color: #add8e6; font-weight:normal } .target { } .timestamp { color: #bebebe; } .timestamp-kwd { color: #5f9ea0; } .right {margin-left:auto; margin-right:0px; text-align:right;} .left {margin-left:0px; margin-right:auto; text-align:left;} .center {margin-left:auto; margin-right:auto; text-align:center;} p.verse { margin-left: 3% } pre { border: 1pt solid #AEBDCC; background-color: #F3F5F7; padding: 5pt; font-family: courier, monospace; font-size: 90%; overflow:auto; } table { border-collapse: collapse; } td, th { vertical-align: top; } th.right { text-align:center; } th.left { text-align:center; } th.center { text-align:center; } td.right { text-align:right; } td.left { text-align:left; } td.center { text-align:center; } dt { font-weight: bold; } div.figure { padding: 0.5em; } div.figure p { text-align: center; } div.inlinetask { padding:10px; border:2px solid gray; margin:10px; background: #ffffcc; } textarea { overflow-x: auto; } .linenr { font-size:smaller } .code-highlighted {background-color:#ffff00;} .org-info-js_info-navigation { border-style:none; } #org-info-js_console-label { font-size:10px; font-weight:bold; white-space:nowrap; } .org-info-js_search-highlight {background-color:#ffff00; color:#000000; font-weight:bold; } /*]]>*/--> </style> <LINK href="stylesheet.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> <!--/*--><![CDATA[/*><!--*/ function CodeHighlightOn(elem, id) { var target = document.getElementById(id); if(null != target) { elem.cacheClassElem = elem.className; elem.cacheClassTarget = target.className; target.className = "code-highlighted"; elem.className = "code-highlighted"; } } function CodeHighlightOff(elem, id) { var target = document.getElementById(id); if(elem.cacheClassElem) elem.className = elem.cacheClassElem; if(elem.cacheClassTarget) target.className = elem.cacheClassTarget; } /*]]>*///--> </script> </head> <body> <div id="preamble"> </div> <div id="content"> <h1 class="title">Nitrogen 2.x Documentation</h1> <p><a href="./index.html">Getting Started</a> | <a href="./api.html">API</a> | <a href="./elements.html">Elements</a> | <b>Actions</b> | <a href="./validators.html">Validators</a> | <a href="./handlers.html">Handlers</a> | <a href="./config.html">Configuration Options</a> | <a href="./about.html">About</a> </p> <div class=headline>Nitrogen Actions</div> <div id="table-of-contents"> <h2>Table of Contents</h2> <div id="text-table-of-contents"> <ul> <li><a href="#sec-1">1 Base Action</a></li> <li><a href="#sec-2">2 Page Manipulation</a></li> <li><a href="#sec-3">3 Effects</a></li> <li><a href="#sec-4">4 Feedback</a></li> <li><a href="#sec-5">5 See Also</a></li> </ul> </div> </div> <div id="outline-container-1" class="outline-2"> <h2 id="sec-1"><span class="section-number-2">1</span> Base Action</h2> <div class="outline-text-2" id="text-1"> <ul> <li><a href="./actions/base.html">Base Action</a> - All actions contain these attributes. </li> </ul> </div> </div> <div id="outline-container-2" class="outline-2"> <h2 id="sec-2"><span class="section-number-2">2</span> Page Manipulation</h2> <div class="outline-text-2" id="text-2"> <ul> <li><a href="./actions/event.html">Event</a> </li> <li><a href="./actions/script.html">Script</a> </li> <li><a href="./actions/validate.html">Validate</a> </li> <li><a href="./actions/clear_validation.html">Clear Validation</a> </li> <li><a href="./actions/api.html">Ajax API</a> </li> </ul> </div> </div> <div id="outline-container-3" class="outline-2"> <h2 id="sec-3"><span class="section-number-2">3</span> Effects</h2> <div class="outline-text-2" id="text-3"> <ul> <li><a href="./actions/show.html">Show</a> </li> <li><a href="./actions/hide.html">Hide</a> </li> <li><a href="./actions/appear.html">Appear</a> </li> <li><a href="./actions/fade.html">Fade</a> </li> <li><a href="./actions/slide_down.html">Slide Down</a> </li> <li><a href="./actions/slide_up.html">Slide Up</a> </li> <li><a href="./actions/animate.html">Animate</a> </li> <li><a href="./actions/toggle.html">Toggle</a> </li> <li><a href="./actions/effect.html">Effect</a> </li> <li><a href="./actions/add_class.html">Add Class</a> </li> <li><a href="./actions/remove_class.html">Remove Class</a> </li> <li><a href="./actions/disable.html">Disable</a> </li> </ul> </div> </div> <div id="outline-container-4" class="outline-2"> <h2 id="sec-4"><span class="section-number-2">4</span> Feedback</h2> <div class="outline-text-2" id="text-4"> <ul> <li><a href="./actions/alert.html">Alert</a> </li> <li><a href="./actions/confirm.html">Confirm</a> </li> <li><a href="./actions/other.html">Other</a> </li> </ul> </div> </div> <div id="outline-container-5" class="outline-2"> <h2 id="sec-5"><span class="section-number-2">5</span> See Also</h2> <div class="outline-text-2" id="text-5"> <ul> <li><a href="./paths.html">Nitrogen Element Paths</a> </li> </ul> </div> </div> </div> <div id="postamble"> <p class="date">Date: 2012-10-31 21:51:19 CDT</p> <p class="author">Author: Rusty Klophaus (@rustyio)</p> <p class="creator">Org version 7.8.02 with Emacs version 23</p> <a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a> </div><h2>Comments</h2> <b>Note:</b><!-- Disqus does not currently support Erlang for its syntax highlighting, so t-->To specify <!--Erlang--> code blocks, just use the generic code block syntax: <pre><b>&lt;pre&gt;&lt;code&gt;your code here&lt;/code&gt;&lt;/pre&gt;</b></pre> <br /> <br /> <div id="disqus_thread"></div> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = 'nitrogenproject'; // required: replace example with your forum shortname var disqus_identifier = 'html/actions.html'; //This will be replaced with the path part of the url /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> </body> </html>
jpyle/nitrogen_core
doc/html/actions.html
HTML
mit
7,516
[ 30522, 1026, 1029, 20950, 2544, 1027, 1000, 1015, 1012, 1014, 1000, 17181, 1027, 1000, 11163, 1011, 6070, 28154, 1011, 1015, 1000, 1029, 1028, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# vmware ## stretch vm-tools ``` echo "deb http://ftp.debian.org/debian/ stretch main contrib" >> /etc/apt/sources.list apt-get update apt-get install open-vm-tools apt-get install open-vm-tools-desktop ``` ## refs * http://partnerweb.vmware.com/GOSIG/Debian_9.html#Tools * https://kb.vmware.com/s/article/2073803
tinc2k/cheatsheets
vmware.md
Markdown
unlicense
318
[ 30522, 1001, 1058, 2213, 8059, 1001, 1001, 7683, 1058, 2213, 1011, 5906, 1036, 1036, 1036, 9052, 1000, 2139, 2497, 8299, 1024, 1013, 1013, 3027, 2361, 1012, 2139, 15599, 1012, 8917, 1013, 2139, 15599, 1013, 7683, 2364, 9530, 18886, 2497, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Agendatech::Application.routes.draw do resources :authentications devise_for :users devise_for :admins namespace :admin do root :to => 'admin#index' resources :eventos, :only => [:index,:update] do member do get 'aprovar' get 'remover' end end resources :grupos, :only => [:index,:update,:destroy] do member do put 'aprovar' end end end match '/auth/:provider/callback' => 'authentications#create' match 'gadgets/:evento/:tipo' => 'gadgets#create', :as => :gadgets match 'rss/feed.:format' => 'rss#feed', :as => :feed match '/' => 'eventos#index' resources :eventos, :path_names => {:new => 'novo', :edit => 'editar'} root :to => 'eventos#index' resources :comentarios match 'calendario/eventos' => 'calendario#index', :as => :calendario match 'calendario/eventos/:estado' => 'calendario#index', :as => :calendario_por_estado resources :grupos match 'colaboradores' => 'sobre#colaboradores', :as => :colaboradores match 'contato' => 'notifier#index', :as => :contato match 'sobre' => 'sobre#index', :as => :sobre match 'calendario' => 'calendario#links', :as => :calendario_link match '/:controller(/:action(/:id))' match 'eventos/tecnologia/:ano/:id' => 'eventos#show', :as => :evento match 'grupos/:nome/:id/eventos' => 'grupos#show', :as => :grupo match 'busca/eventos/:estado' => 'eventos#index', :as => :eventos_por_estado match 'busca/eventos/:ano/:month' => 'eventos#index', :as => :eventos_por_mes match 'eventos/lista/:evento_name' => 'eventos#lista' end
pmariano/agendatech
config/routes.rb
Ruby
lgpl-2.1
1,590
[ 30522, 11376, 15007, 1024, 1024, 4646, 1012, 5847, 1012, 4009, 2079, 4219, 1024, 27280, 2015, 14386, 3366, 1035, 2005, 1024, 5198, 14386, 3366, 1035, 2005, 1024, 4748, 21266, 3415, 15327, 1024, 4748, 10020, 2079, 7117, 1024, 2000, 1027, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Genji Scrum Tool and Issue Tracker * Copyright (C) 2015 Steinbeis GmbH & Co. KG Task Management Solutions * <a href="http://www.trackplus.com">Genji Scrum Tool</a> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* $Id:$ */ package com.aurel.track.fieldType.runtime.callbackInterfaces; import java.util.List; import java.util.Map; /** * Fields whose datasource is remotely filtered * @author Tamas Ruff * */ public interface IExternalLookupLucene { /** * Gets all external lookup objects to index * @return */ List getAllExternalLookups(); /** * Gets the searchable lucene (sub)field names */ String[] getSearchableFieldNames(); /** * Gets the field names to values map for an external lookup instance * @param externalLookupObject * @return */ Map<String, String> getUnfoldedSearchFields(Object externalLookupObject); /** * Gets the lookup object ID * @param externalLookupObject * @return */ Integer getLookupObjectID(Object externalLookupObject); }
trackplus/Genji
src/main/java/com/aurel/track/fieldType/runtime/callbackInterfaces/IExternalLookupLucene.java
Java
gpl-3.0
1,615
[ 30522, 1013, 1008, 1008, 1008, 8991, 4478, 8040, 30524, 8040, 6824, 6994, 1026, 1013, 1037, 1028, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 1008, 2009, 2104, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Problem 1. Lorem Ipsum page</title> <link rel="stylesheet" href="Problem%201.%20Lorem%20Ipsum%20page.css"> </head> <body> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sem turpis, consequat non posuere non, placerat condimentum lacus. Suspendisse ut efficitur nibh. Donec in accumsan neque. Proin convallis imperdiet massa non scelerisque. Integer tincidunt mollis pharetra. Duis nec suscipit enim. Morbi quis lorem ante. In fermentum, nisi quis tincidunt luctus, diam dui aliquam lorem, a condimentum tellus leo sit amet neque. Vivamus bibendum egestas risus sit amet pulvinar. Phasellus et velit sit amet odio euismod rutrum vel quis justo. Morbi sit amet auctor elit, eget ultricies ligula. Aenean pretium tempus lorem, non consectetur nulla rhoncus nec. Ut nec odio sed quam commodo lobortis eu id sem. Sed aliquam ex vitae mauris consequat, id egestas lectus finibus. Maecenas elementum ex eu est volutpat tempus. Nam eget sapien nulla. </p> </body> </html>
VProfirov/Telerik-Academy
Telerik-Academy/Module 1/[02] CSharp Advanced and CSS/CSS/02.CSS Presentation/Problem 1. Lorem Ipsum page/Problem 1. Lorem Ipsum page.html
HTML
mit
1,085
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 2516, 1028, 3291, 1015, 1012, 19544, 2213, 129...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System.Security.Principal; using Moq; using PlantUmlStudio.Core.Security; using Xunit; namespace Tests.Unit.PlantUmlStudio.Core.Security { public class WindowsSecurityServiceTests { public WindowsSecurityServiceTests() { securityService = new WindowsSecurityService(() => principal.Object); } [Theory] [InlineData(true, @"BUILTIN\Administrators")] [InlineData(false, @"BUILTIN\Users")] [InlineData(false, @"BUILTIN\Guests")] [InlineData(false, @"BUILTIN\Account Operators")] [InlineData(false, @"BUILTIN\Server Operators")] [InlineData(false, @"BUILTIN\Replicator")] public void Test_HasAdminPriviledges(bool expected, string role) { // Arrange. principal.Setup(p => p.IsInRole(role)) .Returns(true); // Act. bool actual = securityService.HasAdminPriviledges(); // Assert. Assert.Equal(expected, actual); } private readonly WindowsSecurityService securityService; private readonly Mock<IPrincipal> principal = new Mock<IPrincipal>(); } }
mthamil/PlantUMLStudio
Tests.Unit/PlantUmlStudio.Core/Security/WindowsSecurityServiceTests.cs
C#
apache-2.0
1,019
[ 30522, 2478, 2291, 1012, 3036, 1012, 4054, 1025, 2478, 9587, 4160, 1025, 2478, 3269, 2819, 4877, 8525, 20617, 1012, 4563, 1012, 3036, 1025, 2478, 15990, 3490, 2102, 1025, 3415, 15327, 5852, 1012, 3131, 1012, 3269, 2819, 4877, 8525, 20617, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * 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. */ package org.apache.jackrabbit.oak.plugins.document.blob.ds; import java.util.Date; import org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreBlobStore; import org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreUtils; import org.apache.jackrabbit.oak.plugins.document.DocumentMK; import org.apache.jackrabbit.oak.plugins.document.MongoBlobGCTest; import org.apache.jackrabbit.oak.plugins.document.MongoUtils; import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.BeforeClass; /** * Test for MongoMK GC with {@link DataStoreBlobStore} * */ public class MongoDataStoreBlobGCTest extends MongoBlobGCTest { protected Date startDate; protected DataStoreBlobStore blobStore; @BeforeClass public static void setUpBeforeClass() throws Exception { try { Assume.assumeNotNull(DataStoreUtils.getBlobStore()); } catch (Exception e) { Assume.assumeNoException(e); } } @Override protected DocumentMK.Builder addToBuilder(DocumentMK.Builder mk) { return super.addToBuilder(mk).setBlobStore(blobStore); } @Before @Override public void setUpConnection() throws Exception { startDate = new Date(); blobStore = DataStoreUtils.getBlobStore(folder.newFolder()); super.setUpConnection(); } }
trekawek/jackrabbit-oak
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/blob/ds/MongoDataStoreBlobGCTest.java
Java
apache-2.0
2,161
[ 30522, 1013, 1008, 1008, 7000, 2000, 1996, 15895, 4007, 3192, 1006, 2004, 2546, 1007, 2104, 2028, 2030, 2062, 1008, 12130, 6105, 10540, 1012, 2156, 1996, 5060, 5371, 5500, 2007, 1008, 2023, 2147, 2005, 3176, 2592, 4953, 9385, 6095, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using Ritter.Infra.Crosscutting.Validations; namespace Ritter.Samples.Application.DTO.People.Requests { public class AddPersonRequest : Validatable<AddPersonRequest> { public string FirstName { get; set; } public string LastName { get; set; } public string Cpf { get; set; } public override void AddValidations(ValidationContext<AddPersonRequest> context) { context.Set(e => e.FirstName) .IsRequired() .HasMaxLength(50); context.Set(e => e.LastName) .IsRequired() .HasMaxLength(50); context.Set(e => e.Cpf) .IsRequired("O CPF é obrigatório") .HasMaxLength(11) .HasPattern(@"[0-9]{3}\.?[0-9]{3}\.?[0-9]{3}\-?[0-9]{2}") .IsCpf(); } } }
arsouza/Aritter
samples/Ritter.Samples.Application.DTO/People/Requests/AddPersonRequest.cs
C#
mit
862
[ 30522, 2478, 23168, 1012, 1999, 27843, 1012, 2892, 12690, 3436, 1012, 27354, 2015, 1025, 3415, 15327, 23168, 1012, 8168, 1012, 4646, 1012, 26718, 2080, 1012, 2111, 1012, 11186, 1063, 2270, 2465, 5587, 27576, 2890, 15500, 1024, 9398, 27892, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php require_once('library/HTML5/Parser.php'); require_once('library/HTMLPurifier.auto.php'); function arr_add_hashes(&$item,$k) { $item = '#' . $item; } function parse_url_content(&$a) { $text = null; $str_tags = ''; if(x($_GET,'binurl')) $url = trim(hex2bin($_GET['binurl'])); else $url = trim($_GET['url']); if($_GET['title']) $title = strip_tags(trim($_GET['title'])); if($_GET['description']) $text = strip_tags(trim($_GET['description'])); if($_GET['tags']) { $arr_tags = str_getcsv($_GET['tags']); if(count($arr_tags)) { array_walk($arr_tags,'arr_add_hashes'); $str_tags = '<br />' . implode(' ',$arr_tags) . '<br />'; } } logger('parse_url: ' . $url); $template = "<br /><a class=\"bookmark\" href=\"%s\" >%s</a>%s<br />"; $arr = array('url' => $url, 'text' => ''); call_hooks('parse_link', $arr); if(strlen($arr['text'])) { echo $arr['text']; killme(); } if($url && $title && $text) { $text = '<br /><br /><blockquote>' . $text . '</blockquote><br />'; $title = str_replace(array("\r","\n"),array('',''),$title); $result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags; logger('parse_url (unparsed): returns: ' . $result); echo $result; killme(); } if($url) { $s = fetch_url($url); } else { echo ''; killme(); } // logger('parse_url: data: ' . $s, LOGGER_DATA); if(! $s) { echo sprintf($template,$url,$url,'') . $str_tags; killme(); } $matches = ''; $c = preg_match('/\<head(.*?)\>(.*?)\<\/head\>/ism',$s,$matches); if($c) { // logger('parse_url: header: ' . $matches[2], LOGGER_DATA); try { $domhead = HTML5_Parser::parse($matches[2]); } catch (DOMException $e) { logger('scrape_dfrn: parse error: ' . $e); } if($domhead) logger('parsed header'); } if(! $title) { if(strpos($s,'<title>')) { $title = substr($s,strpos($s,'<title>')+7,64); if(strpos($title,'<') !== false) $title = strip_tags(substr($title,0,strpos($title,'<'))); } } $config = HTMLPurifier_Config::createDefault(); $config->set('Cache.DefinitionImpl', null); $purifier = new HTMLPurifier($config); $s = $purifier->purify($s); // logger('purify_output: ' . $s); try { $dom = HTML5_Parser::parse($s); } catch (DOMException $e) { logger('scrape_dfrn: parse error: ' . $e); } if(! $dom) { echo sprintf($template,$url,$url,'') . $str_tags; killme(); } $items = $dom->getElementsByTagName('title'); if($items) { foreach($items as $item) { $title = trim($item->textContent); break; } } if(! $text) { $divs = $dom->getElementsByTagName('div'); if($divs) { foreach($divs as $div) { $class = $div->getAttribute('class'); if($class && (stristr($class,'article') || stristr($class,'content'))) { $items = $div->getElementsByTagName('p'); if($items) { foreach($items as $item) { $text = $item->textContent; if(stristr($text,'<script')) { $text = ''; continue; } $text = strip_tags($text); if(strlen($text) < 100) { $text = ''; continue; } $text = substr($text,0,250) . '...' ; break; } } } if($text) break; } } if(! $text) { $items = $dom->getElementsByTagName('p'); if($items) { foreach($items as $item) { $text = $item->textContent; if(stristr($text,'<script')) continue; $text = strip_tags($text); if(strlen($text) < 100) { $text = ''; continue; } $text = substr($text,0,250) . '...' ; break; } } } } if(! $text) { logger('parsing meta'); $items = $domhead->getElementsByTagName('meta'); if($items) { foreach($items as $item) { $property = $item->getAttribute('property'); if($property && (stristr($property,':description'))) { $text = $item->getAttribute('content'); if(stristr($text,'<script')) { $text = ''; continue; } $text = strip_tags($text); $text = substr($text,0,250) . '...' ; } if($property && (stristr($property,':image'))) { $image = $item->getAttribute('content'); if(stristr($text,'<script')) { $image = ''; continue; } $image = strip_tags($image); $i = fetch_url($image); if($i) { require_once('include/Photo.php'); $ph = new Photo($i); if($ph->is_valid()) { if($ph->getWidth() > 300 || $ph->getHeight() > 300) { $ph->scaleImage(300); $new_width = $ph->getWidth(); $new_height = $ph->getHeight(); $image = '<br /><br /><img height="' . $new_height . '" width="' . $new_width . '" src="' .$image . '" alt="photo" />'; } else $image = '<br /><br /><img src="' . $image . '" alt="photo" />'; } else $image = ''; } } } } } if(strlen($text)) { $text = '<br /><br /><blockquote>' . $text . '</blockquote><br />'; } if($image) { $text = $image . '<br />' . $text; } $title = str_replace(array("\r","\n"),array('',''),$title); $result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags; logger('parse_url: returns: ' . $result); echo $result; killme(); }
kyriakosbrastianos/friendica-deb
mod/parse_url.php
PHP
mit
5,224
[ 30522, 1026, 1029, 25718, 5478, 1035, 2320, 1006, 1005, 3075, 1013, 16129, 2629, 1013, 11968, 8043, 1012, 25718, 1005, 1007, 1025, 5478, 1035, 2320, 1006, 1005, 3075, 1013, 16129, 24661, 8873, 2121, 1012, 30524, 1005, 1001, 1005, 1012, 1002...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Collections; using System.Collections.Specialized; using System.Diagnostics; using System.Globalization; using System.Runtime.CompilerServices; namespace Logging.Impl { /// <summary> /// An implementation of <see cref="ILoggerFactory"/> that caches loggers created by the factory. /// </summary> /// <remarks> /// For a concrete implementation, override <see cref="CreateLogger"/>. /// </remarks> public abstract class AbstractCachingLoggerFactory : ILoggerFactory { private readonly Hashtable _loggers; /// <summary> /// Creates a new instance of the caching logger factory. /// </summary> /// <param name="caseSensitiveCache"> /// If <c>true</c> loggers will be stored in the cache with case sensitivity. /// </param> protected AbstractCachingLoggerFactory(bool caseSensitiveCache) { _loggers = (caseSensitiveCache) ? new Hashtable() : CollectionsUtil.CreateCaseInsensitiveHashtable(); } /// <summary> /// Flushes the logger cache. /// </summary> protected void ClearCache() { lock (_loggers) { _loggers.Clear(); } } /// <summary> /// Creates an instance of a logger with a specific name. /// </summary> /// <param name="name">The name of the logger.</param> /// <remarks> /// Derived factories need to implement this method to create the actual logger instance. /// </remarks> protected abstract ILogger CreateLogger(string name); #region ILoggerFactory Members /// <summary> /// GetField an <see cref="ILogger"/> instance by type. /// </summary> /// <param name="type">The <see cref="Type">type</see> to use for the logger</param> /// <returns>An <see cref="ILogger"/> instance.</returns> public ILogger GetLogger(Type type) { if (type == null) throw new ArgumentNullException("type"); return GetLoggerInternal(type.FullName); } /// <summary> /// GetField an <see cref="ILogger"/> instance by name. /// </summary> /// <param name="name">The name of the logger</param> /// <returns>An <see cref="ILogger"/> instance.</returns> public ILogger GetLogger(string name) { if (name == null) throw new ArgumentNullException("name"); return GetLoggerInternal(name); } /// <summary> /// Gets a logger using the type of the calling class. /// </summary> /// <remarks> /// This method needs to inspect the <see cref="StackTrace"/> in order to determine the calling /// class. This of course comes with a performance penalty, thus you shouldn't call it too /// often in your application. /// </remarks> /// <seealso cref="ILoggerFactory.GetLogger(System.Type)"/> [MethodImpl(MethodImplOptions.NoInlining)] public ILogger GetCurrentClassLogger() { var frame = new StackFrame(1, false); return GetLogger(frame.GetMethod().DeclaringType); } #endregion #region GetLoggerInternal /// <summary> /// GetField or create a <see cref="ILogger" /> instance by name. /// </summary> /// <param name="name">Usually a <see cref="Type" />'s Name or FullName property.</param> /// <returns> /// An <see cref="ILogger" /> instance either obtained from the internal cache or created by a call to <see cref="CreateLogger"/>. /// </returns> private ILogger GetLoggerInternal(string name) { var logger = _loggers[name] as ILogger; if (logger == null) { lock (_loggers) { logger = _loggers[name] as ILogger; if (logger == null) { logger = CreateLogger(name); if (logger == null) { throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "{0} returned null on creating logger instance for name {1}", GetType().FullName, name)); } } } } return logger; } #endregion } }
mishrsud/EnterpriseApplicationSamples
LoggingApplicationBlock/Source/Logging.Impl/AbstractCachingLoggerFactory.cs
C#
lgpl-3.0
3,872
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1025, 2478, 2291, 1012, 6407, 1012, 7772, 1025, 2478, 2291, 1012, 16474, 2015, 1025, 2478, 2291, 1012, 24370, 1025, 2478, 2291, 1012, 2448, 7292, 1012, 21624, 8043, 7903, 2229, 1025, 3415, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
class Groovysdk < Formula desc "SDK for Groovy: a Java-based scripting language" homepage "http://www.groovy-lang.org" url "https://dl.bintray.com/groovy/maven/apache-groovy-sdk-2.5.0.zip" sha256 "866e9c7217f1fce76f202f8e64cdb3f910910e4ad8533724246a0b1310b3d5aa" bottle :unneeded depends_on :java => "1.6+" conflicts_with "groovy", :because => "both install the same binaries" def install ENV["GROOVY_HOME"] = libexec # We don't need Windows' files. rm_f Dir["bin/*.bat"] prefix.install_metafiles bin.install Dir["bin/*"] libexec.install "conf", "lib", "src", "doc" bin.env_script_all_files(libexec+"bin", :GROOVY_HOME => ENV["GROOVY_HOME"]) end test do system "#{bin}/grape", "install", "org.activiti", "activiti-engine", "5.16.4" end end
battlemidget/homebrew-core
Formula/groovysdk.rb
Ruby
bsd-2-clause
801
[ 30522, 2465, 24665, 9541, 10736, 16150, 2243, 1026, 5675, 4078, 2278, 1000, 17371, 2243, 2005, 24665, 9541, 10736, 1024, 1037, 9262, 1011, 2241, 5896, 2075, 2653, 1000, 2188, 13704, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 24665, 9541, 107...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Date.CultureInfo = { /* Culture Name */ name: "fr-FR", englishName: "French (France)", nativeName: "français (France)", /* Day Name Strings */ dayNames: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], abbreviatedDayNames: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."], shortestDayNames: ["di", "lu", "ma", "me", "je", "ve", "sa"], firstLetterDayNames: ["d", "l", "m", "m", "j", "v", "s"], /* Month Name Strings */ monthNames: ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"], abbreviatedMonthNames: ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."], /* AM/PM Designators */ amDesignator: "", pmDesignator: "", firstDayOfWeek: 1, twoDigitYearMax: 2029, /** * The dateElementOrder is based on the order of the * format specifiers in the formatPatterns.DatePattern. * * Example: <pre> shortDatePattern dateElementOrder ------------------ ---------------- "M/d/yyyy" "mdy" "dd/MM/yyyy" "dmy" "yyyy-MM-dd" "ymd" </pre> * * The correct dateElementOrder is required by the parser to * determine the expected order of the date elements in the * string being parsed. */ dateElementOrder: "dmy", /* Standard date and time format patterns */ formatPatterns: { shortDate: "dd/MM/yyyy", longDate: "dddd d MMMM yyyy", shortTime: "HH:mm", longTime: "HH:mm:ss", fullDateTime: "dddd d MMMM yyyy HH:mm:ss", sortableDateTime: "yyyy-MM-ddTHH:mm:ss", universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", monthDay: "d MMMM", yearMonth: "MMMM yyyy" }, /** * NOTE: If a string format is not parsing correctly, but * you would expect it parse, the problem likely lies below. * * The following regex patterns control most of the string matching * within the parser. * * The Month name and Day name patterns were automatically generated * and in general should be (mostly) correct. * * Beyond the month and day name patterns are natural language strings. * Example: "next", "today", "months" * * These natural language string may NOT be correct for this culture. * If they are not correct, please translate and edit this file * providing the correct regular expression pattern. * * If you modify this file, please post your revised CultureInfo file * to the Datejs Forum located at http://www.datejs.com/forums/. * * Please mark the subject of the post with [CultureInfo]. Example: * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) * * We will add the modified patterns to the master source files. * * As well, please review the list of "Future Strings" section below. */ regexPatterns: { jan: /^janv(\.|ier)?/i, feb: /^févr(\.|ier)?/i, mar: /^mars/i, apr: /^avr(\.|il)?/i, may: /^mai/i, jun: /^juin/i, jul: /^juil(\.|let)?/i, aug: /^août/i, sep: /^sept(\.|embre)?/i, oct: /^oct(\.|obre)?/i, nov: /^nov(\.|embre)?/i, dec: /^déc(\.|embre)?/i, sun: /^di(\.|m|m\.|anche)?/i, mon: /^lu(\.|n|n\.|di)?/i, tue: /^ma(\.|r|r\.|di)?/i, wed: /^me(\.|r|r\.|credi)?/i, thu: /^je(\.|u|u\.|di)?/i, fri: /^ve(\.|n|n\.|dredi)?/i, sat: /^sa(\.|m|m\.|edi)?/i, future: /^next/i, past: /^last|past|prev(ious)?/i, add: /^(\+|aft(er)?|from|hence)/i, subtract: /^(\-|bef(ore)?|ago)/i, yesterday: /^yes(terday)?/i, today: /^t(od(ay)?)?/i, tomorrow: /^tom(orrow)?/i, now: /^n(ow)?/i, millisecond: /^ms|milli(second)?s?/i, second: /^sec(ond)?s?/i, minute: /^mn|min(ute)?s?/i, hour: /^h(our)?s?/i, week: /^w(eek)?s?/i, month: /^m(onth)?s?/i, day: /^d(ay)?s?/i, year: /^y(ear)?s?/i, shortMeridian: /^(a|p)/i, longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, ordinalSuffix: /^\s*(st|nd|rd|th)/i, timeContext: /^\s*(\:|a(?!u|p)|p)/i }, timezones: [{name:"UTC", offset:"-000"}, {name:"GMT", offset:"-000"}, {name:"EST", offset:"-0500"}, {name:"EDT", offset:"-0400"}, {name:"CST", offset:"-0600"}, {name:"CDT", offset:"-0500"}, {name:"MST", offset:"-0700"}, {name:"MDT", offset:"-0600"}, {name:"PST", offset:"-0800"}, {name:"PDT", offset:"-0700"}] }; /******************** ** Future Strings ** ******************** * * The following list of strings may not be currently being used, but * may be incorporated into the Datejs library later. * * We would appreciate any help translating the strings below. * * If you modify this file, please post your revised CultureInfo file * to the Datejs Forum located at http://www.datejs.com/forums/. * * Please mark the subject of the post with [CultureInfo]. Example: * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b * * English Name Translated * ------------------ ----------------- * about about * ago ago * date date * time time * calendar calendar * show show * hourly hourly * daily daily * weekly weekly * bi-weekly bi-weekly * fortnight fortnight * monthly monthly * bi-monthly bi-monthly * quarter quarter * quarterly quarterly * yearly yearly * annual annual * annually annually * annum annum * again again * between between * after after * from now from now * repeat repeat * times times * per per * min (abbrev minute) min * morning morning * noon noon * night night * midnight midnight * mid-night mid-night * evening evening * final final * future future * spring spring * summer summer * fall fall * winter winter * end of end of * end end * long long * short short */
TDXDigital/TPS
js/Datejs-master/src/globalization/fr-FR.js
JavaScript
mit
6,781
[ 30522, 3058, 1012, 3226, 2378, 14876, 1027, 1063, 1013, 1008, 3226, 2171, 1008, 1013, 2171, 1024, 1000, 10424, 1011, 10424, 1000, 1010, 2394, 18442, 1024, 1000, 2413, 1006, 2605, 1007, 1000, 1010, 3128, 18442, 1024, 1000, 22357, 1006, 2605,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (C) 2015 Federico Iosue (federico.iosue@gmail.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package it.feio.android.omninotes; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import it.feio.android.omninotes.utils.Constants; public class ShortcutActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent shortcutIntent = new Intent(this, MainActivity.class); shortcutIntent.setAction(Constants.ACTION_SHORTCUT_WIDGET); Intent.ShortcutIconResource iconResource = Intent.ShortcutIconResource.fromContext(this, R.drawable .shortcut_icon); Intent intent = new Intent(); intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.add_note)); intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource); setResult(RESULT_OK, intent); finish(); } }
jfreax/Omni-Notes
omniNotes/src/main/java/it/feio/android/omninotes/ShortcutActivity.java
Java
gpl-3.0
1,592
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2325, 20493, 16380, 5657, 1006, 20493, 1012, 16380, 5657, 1030, 20917, 4014, 1012, 4012, 1007, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// This file is automatically generated. // Please do not change this file! interface CssExports { 'button': string; 'buttonItemCount': string; 'checked': string; 'level': string; 'selector': string; } export const cssExports: CssExports; export default cssExports;
DestinyItemManager/DIM
src/app/organizer/ItemTypeSelector.m.scss.d.ts
TypeScript
mit
276
[ 30522, 1013, 1013, 2023, 5371, 2003, 8073, 7013, 1012, 1013, 1013, 3531, 30524, 5164, 1025, 1005, 6462, 4221, 12458, 21723, 1005, 1024, 5164, 1025, 1005, 7039, 1005, 1024, 5164, 1025, 1005, 2504, 1005, 1024, 5164, 1025, 1005, 27000, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# What To Look For We are forming a model of a planet transit in order to make some calculations what to expect. Our model will be fairly crude, but it will suffices for understanding key characteristics of light curves. This section has some math in it. It is used to understand how a light curve will look when a planet transits. Feel free to skip to the result if you feel inclined. ## Light Curve A [light curve](https://en.wikipedia.org/wiki/Light_curve) is > a graph of light intensity of a celestial object or region, as a function of > time. It graphs how bright some object appears in the sky over time. Our goal is to understand what the light curve looks like when a planet transits a star. ## Model We are modeling our planet transit in the following crude manner. We assume the star to be a square which radiates uniformly. The total luminosity is \\(I_{0}\\). So the luminosity per area \\(\rho = \frac{I_{0}}{A}\\), where \\(A\\) is the total area of the star. We model our planet as a square as well. We will also assume that the planet will move with uniform speed across the stars image during the transit. When the planet is fully in front of the star, it block some of the rays of the star diminishing the luminosity to \\(I_{t} = \rho \left(A - a\right)\\), where \\(a\\) is the area of the planet. We are interested in the relative drop in luminosity so we will divide \\(I_{t}\\) by \\(I_{0}\\) to get \\[ \frac{I_{t}}{I_{0}} = \frac{\rho \left(A - a\right)}{\rho A} = 1 - \frac{a}{A} \\] So the entire light curve looks something like this. ![A light curve for a planet transition](image/light-curve.png) ## Characteristics Even though our model is crude it does portrait important characteristics. We expect to find a dip in the luminosity when a planet transits its star. When a bigger planets transits a star we expect the dip to be more pronounced, since more of the star light is blocked from our view. Our model predicts this as well. Astronomers have made far better models of planets, but our model will do just fine in finding the period of exo-planets. ## How big dip to expect Let's plug in some values of a star and a planet we know to see how big a dip we would expect. Jupiter orbits our Sun, so a distant observer could try to infer Jupiter's existence by observing the sun's luminosity. We will calculate the dip they can expect. | Celestial Object | Radius (km) | Area | |------------------|-------------|---------------| | Sun | 696392 | 1.5235525e+12 | | Jupiter | 69911 | 1.5354684e+10 | The table above lists the radius and area of the sun and Jupiter. Plugging this into our model we determine that \\[ 1 - \frac{a}{A} = 1 - \frac{1.5\mathrm{e}{+10}}{1.5\mathrm{e}{+12}} = 1 - 1\mathrm{e}{-2} \approx 0.99 \\] That is only a one percentage drop!
fifth-postulate/finding-the-planets
book/manuscript/transit/light_curve.md
Markdown
mit
2,854
[ 30522, 1001, 2054, 2000, 2298, 2005, 2057, 2024, 5716, 1037, 2944, 1997, 1037, 4774, 6671, 1999, 2344, 2000, 2191, 2070, 16268, 2054, 2000, 5987, 1012, 2256, 2944, 2097, 2022, 7199, 13587, 1010, 2021, 2009, 2097, 10514, 26989, 9623, 2005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* =========================================================================== Doom 3 BFG Edition GPL Source Code Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ #ifndef __SWF_SPRITEINSTANCE_H__ #define __SWF_SPRITEINSTANCE_H__ /* ================================================ There can be multiple instances of a single sprite running ================================================ */ class idSWFSpriteInstance { public: idSWFSpriteInstance(); ~idSWFSpriteInstance(); void Init( idSWFSprite* sprite, idSWFSpriteInstance* parent, int depth ); bool Run(); bool RunActions(); const char* GetName() const { return name.c_str(); } idSWFScriptObject* GetScriptObject() { return scriptObject; } void SetAlignment( float x, float y ) { xOffset = x; yOffset = y; } void SetMaterial( const idMaterial* material, int width = -1, int height = -1 ); void SetVisible( bool visible ); bool IsVisible() { return isVisible; } void PlayFrame( const idSWFParmList& parms ); void PlayFrame( const char* frameName ) { idSWFParmList parms; parms.Append( frameName ); PlayFrame( parms ); } void PlayFrame( const int frameNum ) { idSWFParmList parms; parms.Append( frameNum ); PlayFrame( parms ); } void StopFrame( const idSWFParmList& parms ); void StopFrame( const char* frameName ) { idSWFParmList parms; parms.Append( frameName ); StopFrame( parms ); } void StopFrame( const int frameNum ) { idSWFParmList parms; parms.Append( frameNum ); StopFrame( parms ); } // FIXME: Why do all the Set functions have defaults of -1.0f? This seems arbitrar. // Probably better to not have a default at all, so any non-parametized calls throw a // compilation error. float GetXPos() const; float GetYPos( bool overallPos = false ) const; void SetXPos( float xPos = -1.0f ); void SetYPos( float yPos = -1.0f ); void SetPos( float xPos = -1.0f, float yPos = -1.0f ); void SetAlpha( float val ); void SetScale( float x = -1.0f, float y = -1.0f ); void SetMoveToScale( float x = -1.0f, float y = -1.0f ); bool UpdateMoveToScale( float speed ); // returns true if the update was successful void SetRotation( float rot ); uint16 GetCurrentFrame() { return currentFrame; } bool IsPlaying() const { return isPlaying; } int GetStereoDepth() { return stereoDepth; } // Removing the private access control statement due to cl 214702 // Apparently MS's C++ compiler supports the newer C++ standard, and GCC supports C++03 // In the new C++ standard, nested members of a friend class have access to private/protected members of the class granting friendship // In C++03, nested members defined in a friend class do NOT have access to private/protected members of the class granting friendship friend class idSWF; bool isPlaying; bool isVisible; bool childrenRunning; bool firstRun; // currentFrame is the frame number currently in the displayList // we use 1 based frame numbers because currentFrame = 0 means nothing is in the display list // it's also convenient because Flash also uses 1 based frame numbers uint16 currentFrame; uint16 frameCount; // the sprite this is an instance of idSWFSprite* sprite; // sprite instances can be nested idSWFSpriteInstance* parent; // depth of this sprite instance in the parent's display list int depth; // if this is set, apply this material when rendering any child shapes int itemIndex; const idMaterial* materialOverride; uint16 materialWidth; uint16 materialHeight; float xOffset; float yOffset; float moveToXScale; float moveToYScale; float moveToSpeed; int stereoDepth; idSWFScriptObject* scriptObject; // children display entries idList< swfDisplayEntry_t, TAG_SWF > displayList; swfDisplayEntry_t* FindDisplayEntry( int depth ); // name of this sprite instance idStr name; struct swfAction_t { const byte* data; uint32 dataLength; }; idList< swfAction_t, TAG_SWF > actions; idSWFScriptFunction_Script* actionScript; idSWFScriptVar onEnterFrame; //idSWFScriptVar onLoad; // Removing the private access control statement due to cl 214702 // Apparently MS's C++ compiler supports the newer C++ standard, and GCC supports C++03 // In the new C++ standard, nested members of a friend class have access to private/protected members of the class granting friendship // In C++03, nested members defined in a friend class do NOT have access to private/protected members of the class granting friendship //---------------------------------- // SWF_PlaceObject.cpp //---------------------------------- void PlaceObject2( idSWFBitStream& bitstream ); void PlaceObject3( idSWFBitStream& bitstream ); void RemoveObject2( idSWFBitStream& bitstream ); //---------------------------------- // SWF_Sounds.cpp //---------------------------------- void StartSound( idSWFBitStream& bitstream ); //---------------------------------- // SWF_SpriteInstance.cpp //---------------------------------- void NextFrame(); void PrevFrame(); void RunTo( int frameNum ); void Play(); void Stop(); void FreeDisplayList(); swfDisplayEntry_t* AddDisplayEntry( int depth, int characterID ); void RemoveDisplayEntry( int depth ); void SwapDepths( int depth1, int depth2 ); void DoAction( idSWFBitStream& bitstream ); idSWFSpriteInstance* FindChildSprite( const char* childName ); idSWFSpriteInstance* ResolveTarget( const char* targetName ); uint32 FindFrame( const char* frameLabel ) const; bool FrameExists( const char* frameLabel ) const; bool IsBetweenFrames( const char* frameLabel1, const char* frameLabel2 ) const; }; /* ================================================ This is the prototype object that all the sprite instance script objects reference ================================================ */ class idSWFScriptObject_SpriteInstancePrototype : public idSWFScriptObject { public: idSWFScriptObject_SpriteInstancePrototype(); #define SWF_SPRITE_FUNCTION_DECLARE( x ) \ class idSWFScriptFunction_##x : public idSWFScriptFunction { \ public: \ void AddRef() {} \ void Release() {} \ idSWFScriptVar Call( idSWFScriptObject * thisObject, const idSWFParmList & parms ); \ } scriptFunction_##x SWF_SPRITE_FUNCTION_DECLARE( duplicateMovieClip ); SWF_SPRITE_FUNCTION_DECLARE( gotoAndPlay ); SWF_SPRITE_FUNCTION_DECLARE( gotoAndStop ); SWF_SPRITE_FUNCTION_DECLARE( swapDepths ); SWF_SPRITE_FUNCTION_DECLARE( nextFrame ); SWF_SPRITE_FUNCTION_DECLARE( prevFrame ); SWF_SPRITE_FUNCTION_DECLARE( play ); SWF_SPRITE_FUNCTION_DECLARE( stop ); SWF_NATIVE_VAR_DECLARE( _x ); SWF_NATIVE_VAR_DECLARE( _y ); SWF_NATIVE_VAR_DECLARE( _xscale ); SWF_NATIVE_VAR_DECLARE( _yscale ); SWF_NATIVE_VAR_DECLARE( _alpha ); SWF_NATIVE_VAR_DECLARE( _brightness ); SWF_NATIVE_VAR_DECLARE( _visible ); SWF_NATIVE_VAR_DECLARE( _width ); SWF_NATIVE_VAR_DECLARE( _height ); SWF_NATIVE_VAR_DECLARE( _rotation ); SWF_NATIVE_VAR_DECLARE_READONLY( _name ); SWF_NATIVE_VAR_DECLARE_READONLY( _currentframe ); SWF_NATIVE_VAR_DECLARE_READONLY( _totalframes ); SWF_NATIVE_VAR_DECLARE_READONLY( _target ); SWF_NATIVE_VAR_DECLARE_READONLY( _framesloaded ); SWF_NATIVE_VAR_DECLARE_READONLY( _droptarget ); SWF_NATIVE_VAR_DECLARE_READONLY( _url ); SWF_NATIVE_VAR_DECLARE_READONLY( _highquality ); SWF_NATIVE_VAR_DECLARE_READONLY( _focusrect ); SWF_NATIVE_VAR_DECLARE_READONLY( _soundbuftime ); SWF_NATIVE_VAR_DECLARE_READONLY( _quality ); SWF_NATIVE_VAR_DECLARE_READONLY( _mousex ); SWF_NATIVE_VAR_DECLARE_READONLY( _mousey ); SWF_NATIVE_VAR_DECLARE( _stereoDepth ); SWF_NATIVE_VAR_DECLARE( _itemindex ); SWF_NATIVE_VAR_DECLARE( material ); SWF_NATIVE_VAR_DECLARE( materialWidth ); SWF_NATIVE_VAR_DECLARE( materialHeight ); SWF_NATIVE_VAR_DECLARE( xOffset ); SWF_NATIVE_VAR_DECLARE( onEnterFrame ); //SWF_NATIVE_VAR_DECLARE( onLoad ); }; #endif
rfare/Skyline
neo/swf/SWF_SpriteInstance.h
C
gpl-3.0
9,360
[ 30522, 1013, 1008, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #ifndef QGRAPHICSBSPTREEINDEX_H #define QGRAPHICSBSPTREEINDEX_H #include <QtCore/qglobal.h> #if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW #include "qgraphicssceneindex_p.h" #include "qgraphicsitem_p.h" #include "qgraphicsscene_bsp_p.h" #include <QtCore/qrect.h> #include <QtCore/qlist.h> QT_BEGIN_NAMESPACE static const int QGRAPHICSSCENE_INDEXTIMER_TIMEOUT = 2000; class QGraphicsScene; class QGraphicsSceneBspTreeIndexPrivate; class Q_AUTOTEST_EXPORT QGraphicsSceneBspTreeIndex : public QGraphicsSceneIndex { Q_OBJECT Q_PROPERTY(int bspTreeDepth READ bspTreeDepth WRITE setBspTreeDepth) public: QGraphicsSceneBspTreeIndex(QGraphicsScene *scene = 0); ~QGraphicsSceneBspTreeIndex(); QList<QGraphicsItem *> estimateItems(const QRectF &rect, Qt::SortOrder order) const; QList<QGraphicsItem *> estimateTopLevelItems(const QRectF &rect, Qt::SortOrder order) const; QList<QGraphicsItem *> items(Qt::SortOrder order = Qt::DescendingOrder) const; int bspTreeDepth(); void setBspTreeDepth(int depth); protected Q_SLOTS: void updateSceneRect(const QRectF &rect); protected: bool event(QEvent *event); void clear(); void addItem(QGraphicsItem *item); void removeItem(QGraphicsItem *item); void prepareBoundingRectChange(const QGraphicsItem *item); void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value); private : Q_DECLARE_PRIVATE(QGraphicsSceneBspTreeIndex) Q_DISABLE_COPY(QGraphicsSceneBspTreeIndex) Q_PRIVATE_SLOT(d_func(), void _q_updateSortCache()) Q_PRIVATE_SLOT(d_func(), void _q_updateIndex()) friend class QGraphicsScene; friend class QGraphicsScenePrivate; }; class QGraphicsSceneBspTreeIndexPrivate : public QGraphicsSceneIndexPrivate { Q_DECLARE_PUBLIC(QGraphicsSceneBspTreeIndex) public: QGraphicsSceneBspTreeIndexPrivate(QGraphicsScene *scene); QGraphicsSceneBspTree bsp; QRectF sceneRect; int bspTreeDepth; int indexTimerId; bool restartIndexTimer; bool regenerateIndex; int lastItemCount; QList<QGraphicsItem *> indexedItems; QList<QGraphicsItem *> unindexedItems; QList<QGraphicsItem *> untransformableItems; QList<int> freeItemIndexes; bool purgePending; QSet<QGraphicsItem *> removedItems; void purgeRemovedItems(); void _q_updateIndex(); void startIndexTimer(int interval = QGRAPHICSSCENE_INDEXTIMER_TIMEOUT); void resetIndex(); void _q_updateSortCache(); bool sortCacheEnabled; bool updatingSortCache; void invalidateSortCache(); void addItem(QGraphicsItem *item, bool recursive = false); void removeItem(QGraphicsItem *item, bool recursive = false, bool moveToUnindexedItems = false); QList<QGraphicsItem *> estimateItems(const QRectF &, Qt::SortOrder, bool b = false); static void climbTree(QGraphicsItem *item, int *stackingOrder); static inline bool closestItemFirst_withCache(const QGraphicsItem *item1, const QGraphicsItem *item2) { return item1->d_ptr->globalStackingOrder < item2->d_ptr->globalStackingOrder; } static inline bool closestItemLast_withCache(const QGraphicsItem *item1, const QGraphicsItem *item2) { return item1->d_ptr->globalStackingOrder >= item2->d_ptr->globalStackingOrder; } static void sortItems(QList<QGraphicsItem *> *itemList, Qt::SortOrder order, bool cached, bool onlyTopLevelItems = false); }; static inline bool QRectF_intersects(const QRectF &s, const QRectF &r) { qreal xp = s.left(); qreal yp = s.top(); qreal w = s.width(); qreal h = s.height(); qreal l1 = xp; qreal r1 = xp; if (w < 0) l1 += w; else r1 += w; qreal l2 = r.left(); qreal r2 = r.left(); if (w < 0) l2 += r.width(); else r2 += r.width(); if (l1 >= r2 || l2 >= r1) return false; qreal t1 = yp; qreal b1 = yp; if (h < 0) t1 += h; else b1 += h; qreal t2 = r.top(); qreal b2 = r.top(); if (r.height() < 0) t2 += r.height(); else b2 += r.height(); return !(t1 >= b2 || t2 >= b1); } QT_END_NAMESPACE #endif // QT_NO_GRAPHICSVIEW #endif // QGRAPHICSBSPTREEINDEX_H
igor-sfdc/qt-wk
src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
C
lgpl-2.1
6,087
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** * @fileoverview New tab page * This is the main code for the new tab page used by touch-enabled Chrome * browsers. For now this is still a prototype. */ // Use an anonymous function to enable strict mode just for this file (which // will be concatenated with other files when embedded in Chrome cr.define('ntp', function() { 'use strict'; /** * NewTabView instance. * @type {!Object|undefined} */ var newTabView; /** * The 'notification-container' element. * @type {!Element|undefined} */ var notificationContainer; /** * If non-null, an info bubble for showing messages to the user. It points at * the Most Visited label, and is used to draw more attention to the * navigation dot UI. * @type {!Element|undefined} */ var promoBubble; /** * If non-null, an bubble confirming that the user has signed into sync. It * points at the login status at the top of the page. * @type {!Element|undefined} */ var loginBubble; /** * true if |loginBubble| should be shown. * @type {boolean} */ var shouldShowLoginBubble = false; /** * The 'other-sessions-menu-button' element. * @type {!Element|undefined} */ var otherSessionsButton; /** * The time when all sections are ready. * @type {number|undefined} * @private */ var startTime; /** * The time in milliseconds for most transitions. This should match what's * in new_tab.css. Unfortunately there's no better way to try to time * something to occur until after a transition has completed. * @type {number} * @const */ var DEFAULT_TRANSITION_TIME = 500; /** * See description for these values in ntp_stats.h. * @enum {number} */ var NtpFollowAction = { CLICKED_TILE: 11, CLICKED_OTHER_NTP_PANE: 12, OTHER: 13 }; /** * Creates a NewTabView object. NewTabView extends PageListView with * new tab UI specific logics. * @constructor * @extends {PageListView} */ function NewTabView() { var pageSwitcherStart = null; var pageSwitcherEnd = null; if (loadTimeData.getValue('showApps')) { pageSwitcherStart = getRequiredElement('page-switcher-start'); pageSwitcherEnd = getRequiredElement('page-switcher-end'); } this.initialize(getRequiredElement('page-list'), getRequiredElement('dot-list'), getRequiredElement('card-slider-frame'), getRequiredElement('trash'), pageSwitcherStart, pageSwitcherEnd); } NewTabView.prototype = { __proto__: ntp.PageListView.prototype, /** @override */ appendTilePage: function(page, title, titleIsEditable, opt_refNode) { ntp.PageListView.prototype.appendTilePage.apply(this, arguments); if (promoBubble) window.setTimeout(promoBubble.reposition.bind(promoBubble), 0); } }; /** * Invoked at startup once the DOM is available to initialize the app. */ function onLoad() { sectionsToWaitFor = 0; if (loadTimeData.getBoolean('showMostvisited')) sectionsToWaitFor++; if (loadTimeData.getBoolean('showApps')) { sectionsToWaitFor++; if (loadTimeData.getBoolean('showAppLauncherPromo')) { $('app-launcher-promo-close-button').addEventListener('click', function() { chrome.send('stopShowingAppLauncherPromo'); }); $('apps-promo-learn-more').addEventListener('click', function() { chrome.send('onLearnMore'); }); } } if (loadTimeData.getBoolean('isDiscoveryInNTPEnabled')) sectionsToWaitFor++; measureNavDots(); // Load the current theme colors. themeChanged(); newTabView = new NewTabView(); notificationContainer = getRequiredElement('notification-container'); notificationContainer.addEventListener( 'webkitTransitionEnd', onNotificationTransitionEnd); if (loadTimeData.getBoolean('showRecentlyClosed')) { cr.ui.decorate($('recently-closed-menu-button'), ntp.RecentMenuButton); chrome.send('getRecentlyClosedTabs'); } else { $('recently-closed-menu-button').hidden = true; } if (loadTimeData.getBoolean('showOtherSessionsMenu')) { otherSessionsButton = getRequiredElement('other-sessions-menu-button'); cr.ui.decorate(otherSessionsButton, ntp.OtherSessionsMenuButton); otherSessionsButton.initialize(loadTimeData.getBoolean('isUserSignedIn')); } else { getRequiredElement('other-sessions-menu-button').hidden = true; } if (loadTimeData.getBoolean('showMostvisited')) { var mostVisited = new ntp.MostVisitedPage(); // Move the footer into the most visited page if we are in "bare minimum" // mode. if (document.body.classList.contains('bare-minimum')) mostVisited.appendFooter(getRequiredElement('footer')); newTabView.appendTilePage(mostVisited, loadTimeData.getString('mostvisited'), false); chrome.send('getMostVisited'); } if (loadTimeData.getBoolean('isDiscoveryInNTPEnabled')) { var suggestionsScript = document.createElement('script'); suggestionsScript.src = 'suggestions_page.js'; suggestionsScript.onload = function() { newTabView.appendTilePage(new ntp.SuggestionsPage(), loadTimeData.getString('suggestions'), false, (newTabView.appsPages.length > 0) ? newTabView.appsPages[0] : null); chrome.send('getSuggestions'); cr.dispatchSimpleEvent(document, 'sectionready', true, true); }; document.querySelector('head').appendChild(suggestionsScript); } if (!loadTimeData.getBoolean('showWebStoreIcon')) { var webStoreIcon = $('chrome-web-store-link'); // Not all versions of the NTP have a footer, so this may not exist. if (webStoreIcon) webStoreIcon.hidden = true; } else { var webStoreLink = loadTimeData.getString('webStoreLink'); var url = appendParam(webStoreLink, 'utm_source', 'chrome-ntp-launcher'); $('chrome-web-store-link').href = url; $('chrome-web-store-link').addEventListener('click', onChromeWebStoreButtonClick); } // We need to wait for all the footer menu setup to be completed before // we can compute its layout. layoutFooter(); if (loadTimeData.getString('login_status_message')) { loginBubble = new cr.ui.Bubble; loginBubble.anchorNode = $('login-container'); loginBubble.arrowLocation = cr.ui.ArrowLocation.TOP_END; loginBubble.bubbleAlignment = cr.ui.BubbleAlignment.BUBBLE_EDGE_TO_ANCHOR_EDGE; loginBubble.deactivateToDismissDelay = 2000; loginBubble.closeButtonVisible = false; $('login-status-advanced').onclick = function() { chrome.send('showAdvancedLoginUI'); }; $('login-status-dismiss').onclick = loginBubble.hide.bind(loginBubble); var bubbleContent = $('login-status-bubble-contents'); loginBubble.content = bubbleContent; // The anchor node won't be updated until updateLogin is called so don't // show the bubble yet. shouldShowLoginBubble = true; } if (loadTimeData.valueExists('bubblePromoText')) { promoBubble = new cr.ui.Bubble; promoBubble.anchorNode = getRequiredElement('promo-bubble-anchor'); promoBubble.arrowLocation = cr.ui.ArrowLocation.BOTTOM_START; promoBubble.bubbleAlignment = cr.ui.BubbleAlignment.ENTIRELY_VISIBLE; promoBubble.deactivateToDismissDelay = 2000; promoBubble.content = parseHtmlSubset( loadTimeData.getString('bubblePromoText'), ['BR']); var bubbleLink = promoBubble.querySelector('a'); if (bubbleLink) { bubbleLink.addEventListener('click', function(e) { chrome.send('bubblePromoLinkClicked'); }); } promoBubble.handleCloseEvent = function() { promoBubble.hide(); chrome.send('bubblePromoClosed'); }; promoBubble.show(); chrome.send('bubblePromoViewed'); } var loginContainer = getRequiredElement('login-container'); loginContainer.addEventListener('click', showSyncLoginUI); if (loadTimeData.getBoolean('shouldShowSyncLogin')) chrome.send('initializeSyncLogin'); doWhenAllSectionsReady(function() { // Tell the slider about the pages. newTabView.updateSliderCards(); // Mark the current page. newTabView.cardSlider.currentCardValue.navigationDot.classList.add( 'selected'); if (loadTimeData.valueExists('notificationPromoText')) { var promoText = loadTimeData.getString('notificationPromoText'); var tags = ['IMG']; var attrs = { src: function(node, value) { return node.tagName == 'IMG' && /^data\:image\/(?:png|gif|jpe?g)/.test(value); }, }; var promo = parseHtmlSubset(promoText, tags, attrs); var promoLink = promo.querySelector('a'); if (promoLink) { promoLink.addEventListener('click', function(e) { chrome.send('notificationPromoLinkClicked'); }); } showNotification(promo, [], function() { chrome.send('notificationPromoClosed'); }, 60000); chrome.send('notificationPromoViewed'); } cr.dispatchSimpleEvent(document, 'ntpLoaded', true, true); document.documentElement.classList.remove('starting-up'); startTime = Date.now(); }); preventDefaultOnPoundLinkClicks(); // From webui/js/util.js. cr.ui.FocusManager.disableMouseFocusOnButtons(); } /** * Launches the chrome web store app with the chrome-ntp-launcher * source. * @param {Event} e The click event. */ function onChromeWebStoreButtonClick(e) { chrome.send('recordAppLaunchByURL', [encodeURIComponent(this.href), ntp.APP_LAUNCH.NTP_WEBSTORE_FOOTER]); } /* * The number of sections to wait on. * @type {number} */ var sectionsToWaitFor = -1; /** * Queued callbacks which lie in wait for all sections to be ready. * @type {array} */ var readyCallbacks = []; /** * Fired as each section of pages becomes ready. * @param {Event} e Each page's synthetic DOM event. */ document.addEventListener('sectionready', function(e) { if (--sectionsToWaitFor <= 0) { while (readyCallbacks.length) { readyCallbacks.shift()(); } } }); /** * This is used to simulate a fire-once event (i.e. $(document).ready() in * jQuery or Y.on('domready') in YUI. If all sections are ready, the callback * is fired right away. If all pages are not ready yet, the function is queued * for later execution. * @param {function} callback The work to be done when ready. */ function doWhenAllSectionsReady(callback) { assert(typeof callback == 'function'); if (sectionsToWaitFor > 0) readyCallbacks.push(callback); else window.setTimeout(callback, 0); // Do soon after, but asynchronously. } /** * Measure the width of a nav dot with a given title. * @param {string} id The loadTimeData ID of the desired title. * @return {number} The width of the nav dot. */ function measureNavDot(id) { var measuringDiv = $('fontMeasuringDiv'); measuringDiv.textContent = loadTimeData.getString(id); // The 4 is for border and padding. return Math.max(measuringDiv.clientWidth * 1.15 + 4, 80); } /** * Fills in an invisible div with the longest dot title string so that * its length may be measured and the nav dots sized accordingly. */ function measureNavDots() { var pxWidth = measureNavDot('appDefaultPageName'); if (loadTimeData.getBoolean('showMostvisited')) pxWidth = Math.max(measureNavDot('mostvisited'), pxWidth); var styleElement = document.createElement('style'); styleElement.type = 'text/css'; // max-width is used because if we run out of space, the nav dots will be // shrunk. styleElement.textContent = '.dot { max-width: ' + pxWidth + 'px; }'; document.querySelector('head').appendChild(styleElement); } /** * Layout the footer so that the nav dots stay centered. */ function layoutFooter() { // We need the image to be loaded. var logo = $('logo-img'); var logoImg = logo.querySelector('img'); if (!logoImg.complete) { logoImg.onload = layoutFooter; return; } var menu = $('footer-menu-container'); if (menu.clientWidth > logoImg.width) logo.style.WebkitFlex = '0 1 ' + menu.clientWidth + 'px'; else menu.style.WebkitFlex = '0 1 ' + logoImg.width + 'px'; } function themeChanged(opt_hasAttribution) { $('themecss').href = 'chrome://theme/css/new_tab_theme.css?' + Date.now(); if (typeof opt_hasAttribution != 'undefined') { document.documentElement.setAttribute('hasattribution', opt_hasAttribution); } updateAttribution(); } function setBookmarkBarAttached(attached) { document.documentElement.setAttribute('bookmarkbarattached', attached); } /** * Attributes the attribution image at the bottom left. */ function updateAttribution() { var attribution = $('attribution'); if (document.documentElement.getAttribute('hasattribution') == 'true') { attribution.hidden = false; } else { attribution.hidden = true; } } /** * Timeout ID. * @type {number} */ var notificationTimeout = 0; /** * Shows the notification bubble. * @param {string|Node} message The notification message or node to use as * message. * @param {Array.<{text: string, action: function()}>} links An array of * records describing the links in the notification. Each record should * have a 'text' attribute (the display string) and an 'action' attribute * (a function to run when the link is activated). * @param {Function} opt_closeHandler The callback invoked if the user * manually dismisses the notification. */ function showNotification(message, links, opt_closeHandler, opt_timeout) { window.clearTimeout(notificationTimeout); var span = document.querySelector('#notification > span'); if (typeof message == 'string') { span.textContent = message; } else { span.textContent = ''; // Remove all children. span.appendChild(message); } var linksBin = $('notificationLinks'); linksBin.textContent = ''; for (var i = 0; i < links.length; i++) { var link = linksBin.ownerDocument.createElement('div'); link.textContent = links[i].text; link.action = links[i].action; link.onclick = function() { this.action(); hideNotification(); }; link.setAttribute('role', 'button'); link.setAttribute('tabindex', 0); link.className = 'link-button'; linksBin.appendChild(link); } function closeFunc(e) { if (opt_closeHandler) opt_closeHandler(); hideNotification(); } document.querySelector('#notification button').onclick = closeFunc; document.addEventListener('dragstart', closeFunc); notificationContainer.hidden = false; showNotificationOnCurrentPage(); newTabView.cardSlider.frame.addEventListener( 'cardSlider:card_change_ended', onCardChangeEnded); var timeout = opt_timeout || 10000; notificationTimeout = window.setTimeout(hideNotification, timeout); } /** * Hide the notification bubble. */ function hideNotification() { notificationContainer.classList.add('inactive'); newTabView.cardSlider.frame.removeEventListener( 'cardSlider:card_change_ended', onCardChangeEnded); } /** * Happens when 1 or more consecutive card changes end. * @param {Event} e The cardSlider:card_change_ended event. */ function onCardChangeEnded(e) { // If we ended on the same page as we started, ignore. if (newTabView.cardSlider.currentCardValue.notification) return; // Hide the notification the old page. notificationContainer.classList.add('card-changed'); showNotificationOnCurrentPage(); } /** * Move and show the notification on the current page. */ function showNotificationOnCurrentPage() { var page = newTabView.cardSlider.currentCardValue; doWhenAllSectionsReady(function() { if (page != newTabView.cardSlider.currentCardValue) return; // NOTE: This moves the notification to inside of the current page. page.notification = notificationContainer; // Reveal the notification and instruct it to hide itself if ignored. notificationContainer.classList.remove('inactive'); // Gives the browser time to apply this rule before we remove it (causing // a transition). window.setTimeout(function() { notificationContainer.classList.remove('card-changed'); }, 0); }); } /** * When done fading out, set hidden to true so the notification can't be * tabbed to or clicked. * @param {Event} e The webkitTransitionEnd event. */ function onNotificationTransitionEnd(e) { if (notificationContainer.classList.contains('inactive')) notificationContainer.hidden = true; } function setRecentlyClosedTabs(dataItems) { $('recently-closed-menu-button').dataItems = dataItems; layoutFooter(); } function setMostVisitedPages(data, hasBlacklistedUrls) { newTabView.mostVisitedPage.data = data; cr.dispatchSimpleEvent(document, 'sectionready', true, true); } function setSuggestionsPages(data, hasBlacklistedUrls) { newTabView.suggestionsPage.data = data; } /** * Set the dominant color for a node. This will be called in response to * getFaviconDominantColor. The node represented by |id| better have a setter * for stripeColor. * @param {string} id The ID of a node. * @param {string} color The color represented as a CSS string. */ function setFaviconDominantColor(id, color) { var node = $(id); if (node) node.stripeColor = color; } /** * Updates the text displayed in the login container. If there is no text then * the login container is hidden. * @param {string} loginHeader The first line of text. * @param {string} loginSubHeader The second line of text. * @param {string} iconURL The url for the login status icon. If this is null then the login status icon is hidden. * @param {boolean} isUserSignedIn Indicates if the user is signed in or not. */ function updateLogin(loginHeader, loginSubHeader, iconURL, isUserSignedIn) { if (loginHeader || loginSubHeader) { $('login-container').hidden = false; $('login-status-header').innerHTML = loginHeader; $('login-status-sub-header').innerHTML = loginSubHeader; $('card-slider-frame').classList.add('showing-login-area'); if (iconURL) { $('login-status-header-container').style.backgroundImage = url(iconURL); $('login-status-header-container').classList.add('login-status-icon'); } else { $('login-status-header-container').style.backgroundImage = 'none'; $('login-status-header-container').classList.remove( 'login-status-icon'); } } else { $('login-container').hidden = true; $('card-slider-frame').classList.remove('showing-login-area'); } if (shouldShowLoginBubble) { window.setTimeout(loginBubble.show.bind(loginBubble), 0); chrome.send('loginMessageSeen'); shouldShowLoginBubble = false; } else if (loginBubble) { loginBubble.reposition(); } if (otherSessionsButton) { otherSessionsButton.updateSignInState(isUserSignedIn); layoutFooter(); } } /** * Show the sync login UI. * @param {Event} e The click event. */ function showSyncLoginUI(e) { var rect = e.currentTarget.getBoundingClientRect(); chrome.send('showSyncLoginUI', [rect.left, rect.top, rect.width, rect.height]); } /** * Logs the time to click for the specified item. * @param {string} item The item to log the time-to-click. */ function logTimeToClick(item) { var timeToClick = Date.now() - startTime; chrome.send('logTimeToClick', ['NewTabPage.TimeToClick' + item, timeToClick]); } /** * Wrappers to forward the callback to corresponding PageListView member. */ function appAdded() { return newTabView.appAdded.apply(newTabView, arguments); } function appMoved() { return newTabView.appMoved.apply(newTabView, arguments); } function appRemoved() { return newTabView.appRemoved.apply(newTabView, arguments); } function appsPrefChangeCallback() { return newTabView.appsPrefChangedCallback.apply(newTabView, arguments); } function appLauncherPromoPrefChangeCallback() { return newTabView.appLauncherPromoPrefChangeCallback.apply(newTabView, arguments); } function appsReordered() { return newTabView.appsReordered.apply(newTabView, arguments); } function enterRearrangeMode() { return newTabView.enterRearrangeMode.apply(newTabView, arguments); } function setForeignSessions(sessionList, isTabSyncEnabled) { if (otherSessionsButton) { otherSessionsButton.setForeignSessions(sessionList, isTabSyncEnabled); layoutFooter(); } } function getAppsCallback() { return newTabView.getAppsCallback.apply(newTabView, arguments); } function getAppsPageIndex() { return newTabView.getAppsPageIndex.apply(newTabView, arguments); } function getCardSlider() { return newTabView.cardSlider; } function leaveRearrangeMode() { return newTabView.leaveRearrangeMode.apply(newTabView, arguments); } function saveAppPageName() { return newTabView.saveAppPageName.apply(newTabView, arguments); } function setAppToBeHighlighted(appId) { newTabView.highlightAppId = appId; } // Return an object with all the exports return { appAdded: appAdded, appMoved: appMoved, appRemoved: appRemoved, appsPrefChangeCallback: appsPrefChangeCallback, appLauncherPromoPrefChangeCallback: appLauncherPromoPrefChangeCallback, enterRearrangeMode: enterRearrangeMode, getAppsCallback: getAppsCallback, getAppsPageIndex: getAppsPageIndex, getCardSlider: getCardSlider, onLoad: onLoad, leaveRearrangeMode: leaveRearrangeMode, logTimeToClick: logTimeToClick, NtpFollowAction: NtpFollowAction, saveAppPageName: saveAppPageName, setAppToBeHighlighted: setAppToBeHighlighted, setBookmarkBarAttached: setBookmarkBarAttached, setForeignSessions: setForeignSessions, setMostVisitedPages: setMostVisitedPages, setSuggestionsPages: setSuggestionsPages, setRecentlyClosedTabs: setRecentlyClosedTabs, setFaviconDominantColor: setFaviconDominantColor, showNotification: showNotification, themeChanged: themeChanged, updateLogin: updateLogin }; }); document.addEventListener('DOMContentLoaded', ntp.onLoad); var toCssPx = cr.ui.toCssPx;
s20121035/rk3288_android5.1_repo
external/chromium_org/chrome/browser/resources/ntp4/new_tab.js
JavaScript
gpl-3.0
23,568
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2262, 1996, 10381, 21716, 5007, 6048, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 2008, 2064, 2022, 1013, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Collections.Generic; namespace EventStreams.Projection { using Core; using EventHandling; using Transformation; public interface IProjector { IEventSequenceTransformer Transformations { get; } TModel Project<TModel>(IEnumerable<IStreamedEvent> events, Func<TModel, EventHandler> eventHandlerFactory) where TModel : class; TModel Project<TModel>(Guid identity, IEnumerable<IStreamedEvent> events, Func<TModel, EventHandler> eventHandlerFactory) where TModel : class; } }
nbevans/EventStreams
EventStreams/Projection/IProjector.cs
C#
mit
590
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 3415, 15327, 2824, 25379, 2015, 1012, 13996, 1063, 2478, 4563, 1025, 2478, 2724, 11774, 2989, 1025, 2478, 8651, 1025, 2270, 8278, 12997, 3217, 20614, 2953, 1063, 29464, 153...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace PHPFHIRGenerated\FHIRDomainResource; /*! * This class was generated with the PHPFHIR library (https://github.com/dcarbone/php-fhir) using * class definitions from HL7 FHIR (https://www.hl7.org/fhir/) * * Class creation date: April 7th, 2016 * * PHPFHIR Copyright: * * Copyright 2016 Daniel Carbone (daniel.p.carbone@gmail.com) * * 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. * * * FHIR Copyright Notice: * * Copyright (c) 2011+, HL7, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of HL7 nor the names of its contributors may be used to * endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * * Generated on Sat, Oct 24, 2015 07:41+1100 for FHIR v1.0.2 * * Note: the schemas & schematrons do not contain all of the rules about what makes resources * valid. Implementers will still need to be familiar with the content of the specification and with * any profiles that apply to the resources in order to make a conformant implementation. * */ use PHPFHIRGenerated\FHIRResource\FHIRDomainResource; use PHPFHIRGenerated\JsonSerializable; /** * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. * If the element is present, it must have either a @value, an @id, or extensions */ class FHIRImagingObjectSelection extends FHIRDomainResource implements JsonSerializable { /** * Instance UID of the DICOM KOS SOP Instances represented in this resource. * @var \PHPFHIRGenerated\FHIRElement\FHIROid */ public $uid = null; /** * A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection. * @var \PHPFHIRGenerated\FHIRElement\FHIRReference */ public $patient = null; /** * The reason for, or significance of, the selection of objects referenced in the resource. * @var \PHPFHIRGenerated\FHIRElement\FHIRCodeableConcept */ public $title = null; /** * Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. * @var \PHPFHIRGenerated\FHIRElement\FHIRString */ public $description = null; /** * Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. * @var \PHPFHIRGenerated\FHIRElement\FHIRReference */ public $author = null; /** * Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). * @var \PHPFHIRGenerated\FHIRElement\FHIRDateTime */ public $authoringTime = null; /** * Study identity and locating information of the DICOM SOP instances in the selection. * @var \PHPFHIRGenerated\FHIRResource\FHIRImagingObjectSelection\FHIRImagingObjectSelectionStudy[] */ public $study = array(); /** * @var string */ private $_fhirElementName = 'ImagingObjectSelection'; /** * Instance UID of the DICOM KOS SOP Instances represented in this resource. * @return \PHPFHIRGenerated\FHIRElement\FHIROid */ public function getUid() { return $this->uid; } /** * Instance UID of the DICOM KOS SOP Instances represented in this resource. * @param \PHPFHIRGenerated\FHIRElement\FHIROid $uid * @return $this */ public function setUid($uid) { $this->uid = $uid; return $this; } /** * A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection. * @return \PHPFHIRGenerated\FHIRElement\FHIRReference */ public function getPatient() { return $this->patient; } /** * A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection. * @param \PHPFHIRGenerated\FHIRElement\FHIRReference $patient * @return $this */ public function setPatient($patient) { $this->patient = $patient; return $this; } /** * The reason for, or significance of, the selection of objects referenced in the resource. * @return \PHPFHIRGenerated\FHIRElement\FHIRCodeableConcept */ public function getTitle() { return $this->title; } /** * The reason for, or significance of, the selection of objects referenced in the resource. * @param \PHPFHIRGenerated\FHIRElement\FHIRCodeableConcept $title * @return $this */ public function setTitle($title) { $this->title = $title; return $this; } /** * Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. * @return \PHPFHIRGenerated\FHIRElement\FHIRString */ public function getDescription() { return $this->description; } /** * Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. * @param \PHPFHIRGenerated\FHIRElement\FHIRString $description * @return $this */ public function setDescription($description) { $this->description = $description; return $this; } /** * Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. * @return \PHPFHIRGenerated\FHIRElement\FHIRReference */ public function getAuthor() { return $this->author; } /** * Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. * @param \PHPFHIRGenerated\FHIRElement\FHIRReference $author * @return $this */ public function setAuthor($author) { $this->author = $author; return $this; } /** * Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). * @return \PHPFHIRGenerated\FHIRElement\FHIRDateTime */ public function getAuthoringTime() { return $this->authoringTime; } /** * Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). * @param \PHPFHIRGenerated\FHIRElement\FHIRDateTime $authoringTime * @return $this */ public function setAuthoringTime($authoringTime) { $this->authoringTime = $authoringTime; return $this; } /** * Study identity and locating information of the DICOM SOP instances in the selection. * @return \PHPFHIRGenerated\FHIRResource\FHIRImagingObjectSelection\FHIRImagingObjectSelectionStudy[] */ public function getStudy() { return $this->study; } /** * Study identity and locating information of the DICOM SOP instances in the selection. * @param \PHPFHIRGenerated\FHIRResource\FHIRImagingObjectSelection\FHIRImagingObjectSelectionStudy[] $study * @return $this */ public function addStudy($study) { $this->study[] = $study; return $this; } /** * @return string */ public function get_fhirElementName() { return $this->_fhirElementName; } /** * @return string */ public function __toString() { return $this->get_fhirElementName(); } /** * @return array */ public function jsonSerialize() { $json = parent::jsonSerialize(); $json['resourceType'] = $this->_fhirElementName; if (null !== $this->uid) $json['uid'] = $this->uid->jsonSerialize(); if (null !== $this->patient) $json['patient'] = $this->patient->jsonSerialize(); if (null !== $this->title) $json['title'] = $this->title->jsonSerialize(); if (null !== $this->description) $json['description'] = $this->description->jsonSerialize(); if (null !== $this->author) $json['author'] = $this->author->jsonSerialize(); if (null !== $this->authoringTime) $json['authoringTime'] = $this->authoringTime->jsonSerialize(); if (0 < count($this->study)) { $json['study'] = array(); foreach($this->study as $study) { $json['study'][] = $study->jsonSerialize(); } } return $json; } /** * @param boolean $returnSXE * @param \SimpleXMLElement $sxe * @return string|\SimpleXMLElement */ public function xmlSerialize($returnSXE = false, $sxe = null) { if (null === $sxe) $sxe = new \SimpleXMLElement('<ImagingObjectSelection xmlns="http://hl7.org/fhir"></ImagingObjectSelection>'); parent::xmlSerialize(true, $sxe); if (null !== $this->uid) $this->uid->xmlSerialize(true, $sxe->addChild('uid')); if (null !== $this->patient) $this->patient->xmlSerialize(true, $sxe->addChild('patient')); if (null !== $this->title) $this->title->xmlSerialize(true, $sxe->addChild('title')); if (null !== $this->description) $this->description->xmlSerialize(true, $sxe->addChild('description')); if (null !== $this->author) $this->author->xmlSerialize(true, $sxe->addChild('author')); if (null !== $this->authoringTime) $this->authoringTime->xmlSerialize(true, $sxe->addChild('authoringTime')); if (0 < count($this->study)) { foreach($this->study as $study) { $study->xmlSerialize(true, $sxe->addChild('study')); } } if ($returnSXE) return $sxe; return $sxe->saveXML(); } }
LibreHealthIO/ehr-fhir-api
src/PHPFHIRGenerated/FHIRDomainResource/FHIRImagingObjectSelection.php
PHP
mit
13,589
[ 30522, 1026, 1029, 25718, 3415, 15327, 25718, 2546, 11961, 6914, 16848, 1032, 1042, 11961, 9527, 8113, 6072, 8162, 3401, 1025, 1013, 1008, 999, 1008, 2023, 2465, 2001, 7013, 2007, 1996, 25718, 2546, 11961, 3075, 1006, 16770, 1024, 1013, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!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_25) on Thu Sep 12 10:51:18 BST 2013 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Interface com.hp.hpl.jena.rdf.model.ModelGraphInterface (Apache Jena)</title> <meta name="date" content="2013-09-12"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface com.hp.hpl.jena.rdf.model.ModelGraphInterface (Apache Jena)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../com/hp/hpl/jena/rdf/model/ModelGraphInterface.html" title="interface in com.hp.hpl.jena.rdf.model">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?com/hp/hpl/jena/rdf/model/class-use/ModelGraphInterface.html" target="_top">Frames</a></li> <li><a href="ModelGraphInterface.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface com.hp.hpl.jena.rdf.model.ModelGraphInterface" class="title">Uses of Interface<br>com.hp.hpl.jena.rdf.model.ModelGraphInterface</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../com/hp/hpl/jena/rdf/model/ModelGraphInterface.html" title="interface in com.hp.hpl.jena.rdf.model">ModelGraphInterface</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#com.hp.hpl.jena.ontology">com.hp.hpl.jena.ontology</a></td> <td class="colLast"> <div class="block"> Provides a set of abstractions and convenience classes for accessing and manipluating ontologies represented in RDF.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#com.hp.hpl.jena.rdf.model">com.hp.hpl.jena.rdf.model</a></td> <td class="colLast"> <div class="block">A package for creating and manipulating RDF graphs.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#com.hp.hpl.jena.rdf.model.impl">com.hp.hpl.jena.rdf.model.impl</a></td> <td class="colLast"> <div class="block">This package contains implementations of the interfaces defined in the .model package, eg ModelCom for Model, ResourceImpl for Resource, and so on.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#com.hp.hpl.jena.util">com.hp.hpl.jena.util</a></td> <td class="colLast"> <div class="block"> Miscellaneous collection of utility classes.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="com.hp.hpl.jena.ontology"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../com/hp/hpl/jena/rdf/model/ModelGraphInterface.html" title="interface in com.hp.hpl.jena.rdf.model">ModelGraphInterface</a> in <a href="../../../../../../../com/hp/hpl/jena/ontology/package-summary.html">com.hp.hpl.jena.ontology</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subinterfaces, and an explanation"> <caption><span>Subinterfaces of <a href="../../../../../../../com/hp/hpl/jena/rdf/model/ModelGraphInterface.html" title="interface in com.hp.hpl.jena.rdf.model">ModelGraphInterface</a> in <a href="../../../../../../../com/hp/hpl/jena/ontology/package-summary.html">com.hp.hpl.jena.ontology</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Interface and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>interface&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../com/hp/hpl/jena/ontology/OntModel.html" title="interface in com.hp.hpl.jena.ontology">OntModel</a></strong></code> <div class="block"> An enhanced view of a Jena model that is known to contain ontology data, under a given ontology <a href="../../../../../../../com/hp/hpl/jena/ontology/Profile.html" title="interface in com.hp.hpl.jena.ontology"><code>vocabulary</code></a> (such as OWL).</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="com.hp.hpl.jena.rdf.model"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../com/hp/hpl/jena/rdf/model/ModelGraphInterface.html" title="interface in com.hp.hpl.jena.rdf.model">ModelGraphInterface</a> in <a href="../../../../../../../com/hp/hpl/jena/rdf/model/package-summary.html">com.hp.hpl.jena.rdf.model</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subinterfaces, and an explanation"> <caption><span>Subinterfaces of <a href="../../../../../../../com/hp/hpl/jena/rdf/model/ModelGraphInterface.html" title="interface in com.hp.hpl.jena.rdf.model">ModelGraphInterface</a> in <a href="../../../../../../../com/hp/hpl/jena/rdf/model/package-summary.html">com.hp.hpl.jena.rdf.model</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Interface and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>interface&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../com/hp/hpl/jena/rdf/model/InfModel.html" title="interface in com.hp.hpl.jena.rdf.model">InfModel</a></strong></code> <div class="block">An extension to the normal Model interface that supports access to any underlying inference capability.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>interface&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../com/hp/hpl/jena/rdf/model/Model.html" title="interface in com.hp.hpl.jena.rdf.model">Model</a></strong></code> <div class="block">An RDF Model.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="com.hp.hpl.jena.rdf.model.impl"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../com/hp/hpl/jena/rdf/model/ModelGraphInterface.html" title="interface in com.hp.hpl.jena.rdf.model">ModelGraphInterface</a> in com.hp.hpl.jena.rdf.model.impl</h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in com.hp.hpl.jena.rdf.model.impl that implement <a href="../../../../../../../com/hp/hpl/jena/rdf/model/ModelGraphInterface.html" title="interface in com.hp.hpl.jena.rdf.model">ModelGraphInterface</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong>com.hp.hpl.jena.rdf.model.impl.ModelCom</strong></code> <div class="block">Common methods for model implementations.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="com.hp.hpl.jena.util"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../com/hp/hpl/jena/rdf/model/ModelGraphInterface.html" title="interface in com.hp.hpl.jena.rdf.model">ModelGraphInterface</a> in <a href="../../../../../../../com/hp/hpl/jena/util/package-summary.html">com.hp.hpl.jena.util</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../../com/hp/hpl/jena/util/package-summary.html">com.hp.hpl.jena.util</a> that implement <a href="../../../../../../../com/hp/hpl/jena/rdf/model/ModelGraphInterface.html" title="interface in com.hp.hpl.jena.rdf.model">ModelGraphInterface</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../com/hp/hpl/jena/util/MonitorModel.html" title="class in com.hp.hpl.jena.util">MonitorModel</a></strong></code> <div class="block">Model wrapper which provides normal access to an underlying model but also maintains a snapshot of the triples it was last known to contain.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../com/hp/hpl/jena/rdf/model/ModelGraphInterface.html" title="interface in com.hp.hpl.jena.rdf.model">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?com/hp/hpl/jena/rdf/model/class-use/ModelGraphInterface.html" target="_top">Frames</a></li> <li><a href="ModelGraphInterface.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Licenced under the Apache License, Version 2.0</small></p> </body> </html>
vuk/Clojure-Movies
resources/apache-jena/javadoc-core/com/hp/hpl/jena/rdf/model/class-use/ModelGraphInterface.html
HTML
epl-1.0
11,830
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/********************************************************************* * * Software License Agreement (BSD License) * * Copyright (c) 2010, Robert Bosch LLC. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the Robert Bosch nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Authors: Benjamin Pitzer, Robert Bosch LLC * *********************************************************************/ /** * Flag for CommStateMachine transitions * @constant */ ros.actionlib.NO_TRANSITION = -1; /** * Flag for CommStateMachine transitions * @constant */ ros.actionlib.INVALID_TRANSITION = -2; /** * Client side state machine to track the action client's state * * @class * @augments Class */ ros.actionlib.CommStateMachine = Class.extend( /** @lends ros.actionlib.CommStateMachine# */ { /** * Constructs a CommStateMachine and initializes its state with WAITING_FOR_GOAL_ACK. * * @param {ros.actionlib.ActionGoal} action_goal the action goal * @param transition_cb callback function that is being called at state transitions * @param feedback_cb callback function that is being called at the arrival of a feedback message * @param send_goal_fn function will send the goal message to the action server * @param send_cancel_fn function will send the cancel message to the action server */ init: function(action_goal, transition_cb, feedback_cb, send_goal_fn, send_cancel_fn) { this.action_goal = action_goal; this.transition_cb = transition_cb; this.feedback_cb = feedback_cb; this.send_goal_fn = send_goal_fn; this.send_cancel_fn = send_cancel_fn; this.state = ros.actionlib.CommState.WAITING_FOR_GOAL_ACK; this.latest_goal_status = ros.actionlib.GoalStatus.PENDING; this.latest_result = null; this.set_transitions(); }, /** * Helper method to construct the transition matrix. */ set_transitions: function() { this.transitions = new Array(); for(var i=0;i<8;i++) { this.transitions.push(new Array()); for(var j=0;j<9;j++) { this.transitions[i].push(new Array()); } switch(i) { case ros.actionlib.CommState.WAITING_FOR_GOAL_ACK: this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.CommState.PENDING]; this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.CommState.ACTIVE]; this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.CommState.PENDING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.CommState.PENDING, ros.actionlib.CommState.RECALLING]; this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.CommState.PENDING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.PREEMPTING]; break; case ros.actionlib.CommState.PENDING: this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.CommState.ACTIVE]; this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.CommState.RECALLING]; this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.CommState.RECALLING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.PREEMPTING]; break; case ros.actionlib.CommState.ACTIVE: this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.CommState.PREEMPTING]; break; case ros.actionlib.CommState.WAITING_FOR_RESULT: this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.INVALID_TRANSITION]; break; case ros.actionlib.CommState.WAITING_FOR_CANCEL_ACK: this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.CommState.RECALLING]; this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.CommState.RECALLING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.CommState.PREEMPTING]; break; case ros.actionlib.CommState.RECALLING: this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.CommState.PREEMPTING]; break; case ros.actionlib.CommState.PREEMPTING: this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.NO_TRANSITION]; break; case ros.actionlib.CommState.DONE: this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.INVALID_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.NO_TRANSITION]; this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.INVALID_TRANSITION]; break; default: ros_error("Unknown CommState "+i); } } }, /** * returns true if the other CommStateMachine is identical to this one * * @param {ros.actionlib.CommStateMachine} other other CommStateMachine * @returns {Boolean} true if the other CommStateMachine is identical to this one */ isEqualTo: function(other) { return this.action_goal.goal_id.id == other.action_goal.goal_id.id; }, /** * Manually set the state * * @param {ros.actionlib.CommState} state the new state for the CommStateMachine */ set_state: function(state) { ros_debug("Transitioning CommState from "+this.state+" to "+state); this.state = state; }, /** * Finds the status of a goal by its id * * @param {ros.actionlib.GoalStatusArray} status_array the status array * @param {Integer} id the goal id */ _find_status_by_goal_id: function(status_array, id) { for(s in status_array.status_list) { var status = status_array.status_list[s]; if(status.goal_id.id == id) { return status; } } return null; }, /** * Main function to update the state machine by processing the goal status array * * @param {ros.actionlib.GoalStatusArray} status_array the status array */ update_status: function(status_array) { if(this.state == ros.actionlib.CommState.DONE) { return; } var status = this._find_status_by_goal_id(status_array, this.action_goal.goal_id.id); // You mean you haven't heard of me? if(!status) { if(!(this.state in [ros.actionlib.CommState.WAITING_FOR_GOAL_ACK, ros.actionlib.CommState.WAITING_FOR_RESULT, ros.actionlib.CommState.DONE])) { this._mark_as_lost(); } return; } this.latest_goal_status = status; // Determines the next state from the lookup table if(this.state >= this.transitions.length) { ros_error("CommStateMachine is in a funny state: " + this.state); return; } if(status.status >= this.transitions[this.state].length) { ros_error("Got an unknown status from the ActionServer: " + status.status); return; } next_states = this.transitions[this.state][status.status]; // Knowing the next state, what should we do? if(next_states[0] == ros.actionlib.NO_TRANSITION) { } else if(next_states[0] == ros.actionlib.INVALID_TRANSITION) { ros_error("Invalid goal status transition from "+this.state+" to "+status.status); } else { for(s in next_states) { var state = next_states[s]; this.transition_to(state); } } }, /** * Make state machine transition to a new state * * @param {ros.actionlib.CommState} state the new state for the CommStateMachine */ transition_to: function (state) { ros_debug("Transitioning to "+state+" (from "+this.state+", goal: "+this.action_goal.goal_id.id+")"); this.state = state; if(this.transition_cb) { this.transition_cb(new ros.actionlib.ClientGoalHandle(this)); } }, /** * Mark state machine as lost */ _mark_as_lost: function() { this.latest_goal_status.status = ros.actionlib.GoalStatus.LOST; this.transition_to(ros.actionlib.CommState.DONE); }, /** * Main function to update the results by processing the action result * * @param action_result the action result */ update_result: function(action_result) { // Might not be for us if(this.action_goal.goal_id.id != action_result.status.goal_id.id) return; this.latest_goal_status = action_result.status; this.latest_result = action_result; if(this.state in [ros.actionlib.CommState.WAITING_FOR_GOAL_ACK, ros.actionlib.CommState.WAITING_FOR_CANCEL_ACK, ros.actionlib.CommState.PENDING, ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.WAITING_FOR_RESULT, ros.actionlib.CommState.RECALLING, ros.actionlib.CommState.PREEMPTING]) { // Stuffs the goal status in the result into a GoalStatusArray var status_array = new ros.actionlib.GoalStatusArray(); status_array.status_list.push(action_result.status); this.update_status(status_array); this.transition_to(ros.actionlib.CommState.DONE); } else if(this.state == ros.actionlib.CommState.DONE) { ros_error("Got a result when we were already in the DONE state"); } else { ros_error("In a funny state: "+this.state); } }, /** * Function to process the action feedback message * * @param action_feedback an action feedback message */ update_feedback: function(action_feedback) { // Might not be for us if(this.action_goal.goal_id.id != action_feedback.status.goal_id.id) { return; } if(this.feedback_cb) { this.feedback_cb(new ros.actionlib.ClientGoalHandle(this), action_feedback.feedback); } }, });
gt-ros-pkg/rcommander-pr2
rcommander_web/html/js/ros/actionlib/commstatemachine.js
JavaScript
bsd-3-clause
17,673
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
function main() while true do print('Hello') end end live.patch('main', main) live.start(main)
zentner-kyle/lua-live
example/hello1.lua
Lua
mit
105
[ 30522, 3853, 2364, 1006, 1007, 2096, 2995, 2079, 6140, 1006, 1005, 7592, 1005, 1007, 2203, 2203, 2444, 1012, 8983, 1006, 1005, 2364, 1005, 1010, 2364, 1007, 2444, 1012, 2707, 1006, 2364, 1007, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package li.strolch.utils; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; /** * Simple {@link ThreadFactory} which allocates as a pool and has a name for each pool */ public class NamedThreadPoolFactory implements ThreadFactory { private final ThreadGroup group; private final AtomicInteger threadNumber = new AtomicInteger(1); private final String poolName; public NamedThreadPoolFactory(String poolName) { SecurityManager s = System.getSecurityManager(); this.group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); this.poolName = poolName + "-"; } @Override public Thread newThread(Runnable r) { Thread t = new Thread(this.group, r, this.poolName + this.threadNumber.getAndIncrement(), 0); if (t.isDaemon()) t.setDaemon(false); if (t.getPriority() != Thread.NORM_PRIORITY) t.setPriority(Thread.NORM_PRIORITY); return t; } }
4treesCH/strolch
li.strolch.utils/src/main/java/li/strolch/utils/NamedThreadPoolFactory.java
Java
apache-2.0
934
[ 30522, 7427, 5622, 1012, 2358, 13153, 2818, 1012, 21183, 12146, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 16483, 1012, 11689, 21450, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 16483, 1012, 9593, 1012, 9593, 18447, 26320, 1025, 1013, 1008, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// SuperTux - Worldmap Direction // Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef HEADER_SUPERTUX_WORLDMAP_DIRECTION_HPP #define HEADER_SUPERTUX_WORLDMAP_DIRECTION_HPP #include <string> namespace worldmap { enum Direction { D_NONE, D_WEST, D_EAST, D_NORTH, D_SOUTH }; Direction reverse_dir(Direction direction); Direction string_to_direction(const std::string& directory); std::string direction_to_string(Direction direction); } // namespace worldmap #endif /* EOF */
mahboi/supertux
src/worldmap/direction.hpp
C++
gpl-3.0
1,187
[ 30522, 1013, 1013, 3565, 8525, 2595, 1011, 2088, 2863, 2361, 3257, 1013, 1013, 9385, 1006, 1039, 1007, 2294, 21428, 25158, 2099, 1026, 21428, 1012, 25158, 2099, 1030, 2294, 1012, 4654, 20781, 2015, 1012, 7160, 24844, 18349, 24073, 1012, 213...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace Scalr\Tests\Service\Aws; use Scalr\Service\Aws\Client\ClientException; use Scalr\Service\Aws\Client\ClientResponseInterface; use Scalr\Service\Aws; use Scalr\Service\Aws\S3\DataType\ObjectData; use Scalr\Service\Aws\S3; use Scalr\Tests\Service\AwsTestCase; use \SplFileInfo; /** * Amazon A3 Test * * @author Vitaliy Demidov <vitaliy@scalr.com> * @since 12.11.2012 */ class S3Test extends AwsTestCase { const CLASS_S3 = 'Scalr\\Service\\Aws\\S3'; const CLASS_S3_BUCKET_DATA = "Scalr\\Service\\Aws\\S3\\DataType\\BucketData"; const CLASS_S3_BUCKET_LIST = "Scalr\\Service\\Aws\\S3\\DataType\\BucketList"; const CLASS_S3_OBJECT_DATA = "Scalr\\Service\\Aws\\S3\\DataType\\ObjectData"; const CLASS_S3_OBJECT_LIST = "Scalr\\Service\\Aws\\S3\\DataType\\ObjectList"; const CLASS_S3_OWNER_DATA = "Scalr\\Service\\Aws\\S3\\DataType\\OwnerData"; const CLASS_S3_ACCESS_CONTROL_POLICY_DATA = "Scalr\\Service\\Aws\\S3\\DataType\\AccessControlPolicyData"; const OBJECT_NAME_DUMMY = 'dummy/юникод'; /** * @var S3 */ private $s3; /** * {@inheritdoc} * @see Scalr\Tests\Service.AwsTestCase::setUp() */ protected function setUp() { parent::setUp(); if (!$this->isSkipFunctionalTests()) { $this->s3 = $this->getEnvironment()->aws(AwsTestCase::REGION)->s3; $this->s3->enableEntityManager(); } } /** * {@inheritdoc} * @see Scalr\Tests\Service.AwsTestCase::tearDown() */ protected function tearDown() { unset($this->s3); parent::tearDown(); } /** * {@inheritdoc} * @see Scalr\Tests\Service.AwsTestCase::getFixturesDirectory() */ public function getFixturesDirectory() { return parent::getFixturesDirectory() . '/S3'; } /** * {@inheritdoc} * @see Scalr\Tests\Service.AwsTestCase::getFixtureFilePath() */ public function getFixtureFilePath($filename) { return $this->getFixturesDirectory() . '/' . S3::API_VERSION_CURRENT . '/' . $filename; } /** * Gets S3 class name * * @param string $suffix Suffix * @return string */ public function getS3ClassName($suffix) { return 'Scalr\\Service\\Aws\\S3\\' . $suffix; } /** * Gets S3 Mock * * @param callback $callback * @return S3 Returns S3 Mock class */ public function getS3Mock($callback = null) { return $this->getServiceInterfaceMock('S3'); } /** * @test */ public function testFunctionalErrorMessageShouldContainAction() { $this->skipIfEc2PlatformDisabled(); try { $object = $this->s3->object->create('unexistent-bucket', '- illegal name -', 'content'); $this->assertTrue(false, 'ClientException must be thrown here.'); } catch (ClientException $e) { $this->assertContains('Request AddObject failed.', $e->getMessage()); } } /** * @test */ public function testFunctionalS3 () { $this->skipIfEc2PlatformDisabled(); $client = $this->s3->getApiHandler()->getClient(); //AP region aws instance $awsap = $this->getEnvironment()->aws(Aws::REGION_AP_SOUTHEAST_1); $awsap->s3->enableEntityManager(); $bucketList = $this->s3->bucket->getList(); $this->assertInstanceOf(self::CLASS_S3_BUCKET_LIST, $bucketList); $this->assertInstanceOf(self::CLASS_S3, $bucketList->getS3()); $this->assertInstanceOf(self::CLASS_S3_OWNER_DATA, $bucketList->getOwner()); $bucket = $this->s3->bucket->get(self::getTestName('bucket')); if ($bucket !== null) { $list = $awsap->s3->bucket->listObjects($bucket->bucketName); /* @var $object ObjectData */ foreach ($list as $object) { if ($object->objectName == self::getTestName(self::OBJECT_NAME_DUMMY)) { //Removes dummy object $object->delete(); } } //Removes bucket $awsap->s3->bucket->delete($bucket->bucketName); unset($bucket); unset($list); } $bucket = $this->s3->bucket->get(self::getTestName('bucket-copy')); if ($bucket !== null) { $list = $awsap->s3->bucket->listObjects($bucket->bucketName); foreach ($list as $object) { if ($object->objectName == self::getTestName(self::OBJECT_NAME_DUMMY)) { $object->delete(); } } $awsap->s3->bucket->delete($bucket->bucketName); unset($bucket); unset($list); } //Tests creation of the bucket $bucket = $awsap->s3->bucket->create(self::getTestName('bucket')); $this->assertInstanceOf(self::CLASS_S3_BUCKET_DATA, $bucket); $this->assertInstanceOf(self::CLASS_S3, $bucket->getS3()); $this->assertEquals(self::getTestName('bucket'), $bucket->bucketName); $this->assertNotEmpty($bucket->creationDate); $bucketCopy = $awsap->s3->bucket->create(self::getTestName('bucket-copy')); $this->assertInstanceOf(self::CLASS_S3_BUCKET_DATA, $bucketCopy); $this->assertInstanceOf(self::CLASS_S3, $bucketCopy->getS3()); //Checks location $this->assertEquals(Aws::REGION_AP_SOUTHEAST_1, $bucket->getLocation()); $acl = $bucket->getAcl(); $this->assertInstanceOf(self::CLASS_S3_ACCESS_CONTROL_POLICY_DATA, $acl); $this->assertNotEmpty($acl->toXml()); //Checks that generated document is properly constructed. $dom = new \DOMDocument(); $dom->loadXML($acl->getOriginalXml()); $this->assertEqualXMLStructure($acl->toXml(true)->firstChild, $dom->firstChild); //Applies canned ACL $ret = $bucket->setAcl(array('x-amz-acl' => 'authenticated-read')); $this->assertTrue($ret); $acl2 = $bucket->getAcl(); $this->assertInstanceOf(self::CLASS_S3_ACCESS_CONTROL_POLICY_DATA, $acl2); //Restores acl to previous state $ret = $bucket->setAcl($acl); $this->assertTrue($ret); //Compare restored with its stored value $this->assertEqualXMLStructure($bucket->getAcl()->toXml(true)->firstChild, $dom->firstChild); //Create object test $fileInfo = new SplFileInfo($this->getFixturesDirectory() . '/dummy'); /* @var $response ClientResponseInterface */ $response = $bucket->addObject(self::getTestName(self::OBJECT_NAME_DUMMY), $fileInfo, array('Content-Type' => 'text/plain; charset:UTF-8')); $this->assertInstanceOf($this->getAwsClassName('Client\\ClientResponseInterface'), $response); $this->assertNotEmpty($response->getHeader('ETag')); /* @var $dresponse ClientResponseInterface */ $dresponse = $bucket->getObject(self::getTestName(self::OBJECT_NAME_DUMMY)); $this->assertInstanceOf($this->getAwsClassName('Client\\ClientResponseInterface'), $dresponse); $objectContent = $dresponse->getRawContent(); $this->assertContains('This is a dummy file', $objectContent); unset($dresponse); $objList = $bucket->listObjects(); $this->assertInstanceOf($this->getS3ClassName('DataType\\ObjectList'), $objList); $object = $awsap->s3->object->get(array(self::getTestName('bucket'), self::getTestName(self::OBJECT_NAME_DUMMY))); $this->assertInstanceOf($this->getS3ClassName('DataType\\ObjectData'), $object); $this->assertSame($object, $objList[0]); $arr = $awsap->s3->bucket->getObjectsFromStorage(self::getTestName('bucket')); $this->assertSame($object, $arr[0]); unset($arr); $objectAcl = $object->getAcl(); $this->assertInstanceOf(self::CLASS_S3_ACCESS_CONTROL_POLICY_DATA, $objectAcl); $ret = $object->setAcl(array('x-amz-acl' => 'public-read')); $this->assertTrue($ret); $objectAclChanged = $object->getAcl(); $this->assertInstanceOf(self::CLASS_S3_ACCESS_CONTROL_POLICY_DATA, $objectAclChanged); $this->assertContains('xsi:type="CanonicalUser"', $objectAclChanged->toXml()); unset($objectAclChanged); unset($objectAcl); $rmetadata = $object->getMetadata(); $this->assertInstanceOf($this->getAwsClassName('Client\\ClientResponseInterface'), $rmetadata); $this->assertNotEmpty($rmetadata->getHeader('ETag')); $this->assertNotEmpty($rmetadata->getHeader('Last-Modified')); unset($rmetadata); $copyResponse = $object->copy($bucketCopy, self::getTestName(self::OBJECT_NAME_DUMMY)); $this->assertInstanceOf($this->getS3ClassName('DataType\\CopyObjectResponseData'), $copyResponse); $this->assertInstanceOf(self::CLASS_S3, $copyResponse->getS3()); $this->assertEquals(self::getTestName('bucket-copy'), $copyResponse->bucketName); $this->assertEquals(self::getTestName(self::OBJECT_NAME_DUMMY), $copyResponse->objectName); $this->assertNotEmpty($copyResponse->eTag); $this->assertInstanceOf('DateTime', $copyResponse->lastModified); $this->assertInternalType('array', $copyResponse->headers); unset($copyResponse); $dresponse = $bucket->deleteObject(self::getTestName(self::OBJECT_NAME_DUMMY)); $this->assertInstanceOf($this->getAwsClassName('Client\\ClientResponseInterface'), $dresponse); $this->assertEquals(204, $dresponse->getResponseCode()); unset($dresponse); unset($objList); unset($object); //Object must be detached from entity storage after deletion. $object = $awsap->s3->object->get(array(self::getTestName('bucket'), self::getTestName(self::OBJECT_NAME_DUMMY))); $this->assertNull($object); $dresponse = $bucketCopy->deleteObject(self::getTestName(self::OBJECT_NAME_DUMMY)); $this->assertInstanceOf($this->getAwsClassName('Client\\ClientResponseInterface'), $dresponse); $this->assertEquals(204, $dresponse->getResponseCode()); unset($dresponse); $ret = $bucket->delete(); $this->assertTrue($ret); $this->assertNull($this->s3->bucket->get(self::getTestName('bucket'))); unset($bucket); $ret = $bucketCopy->delete(); $this->assertTrue($ret); $this->assertNull($this->s3->bucket->get(self::getTestName('bucket-copy'))); unset($bucketCopy); } }
kikov79/scalr
app/src/Scalr/Tests/Service/Aws/S3Test.php
PHP
apache-2.0
10,613
[ 30522, 1026, 1029, 25718, 3415, 15327, 8040, 2389, 2099, 1032, 5852, 1032, 2326, 1032, 22091, 2015, 1025, 2224, 8040, 2389, 2099, 1032, 2326, 1032, 22091, 2015, 1032, 7396, 1032, 7396, 10288, 24422, 1025, 2224, 8040, 2389, 2099, 1032, 2326,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * drivers/video/tegra/host/gk20a/mm_gk20a.c * * GK20A memory management * * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ #include <linux/delay.h> #include <linux/highmem.h> #include <linux/log2.h> #include <linux/nvhost.h> #include <linux/pm_runtime.h> #include <linux/scatterlist.h> #include <linux/nvmap.h> #include <linux/tegra-soc.h> #include <linux/vmalloc.h> #include <linux/dma-buf.h> #include <asm/cacheflush.h> #include "gk20a.h" #include "mm_gk20a.h" #include "hw_gmmu_gk20a.h" #include "hw_fb_gk20a.h" #include "hw_bus_gk20a.h" #include "hw_ram_gk20a.h" #include "hw_mc_gk20a.h" #include "hw_flush_gk20a.h" #include "hw_ltc_gk20a.h" #include "kind_gk20a.h" #ifdef CONFIG_ARM64 #define outer_flush_range(a, b) #define __cpuc_flush_dcache_area __flush_dcache_area #endif /* * GPU mapping life cycle * ====================== * * Kernel mappings * --------------- * * Kernel mappings are created through vm.map(..., false): * * - Mappings to the same allocations are reused and refcounted. * - This path does not support deferred unmapping (i.e. kernel must wait for * all hw operations on the buffer to complete before unmapping). * - References to dmabuf are owned and managed by the (kernel) clients of * the gk20a_vm layer. * * * User space mappings * ------------------- * * User space mappings are created through as.map_buffer -> vm.map(..., true): * * - Mappings to the same allocations are reused and refcounted. * - This path supports deferred unmapping (i.e. we delay the actual unmapping * until all hw operations have completed). * - References to dmabuf are owned and managed by the vm_gk20a * layer itself. vm.map acquires these refs, and sets * mapped_buffer->own_mem_ref to record that we must release the refs when we * actually unmap. * */ static inline int vm_aspace_id(struct vm_gk20a *vm) { /* -1 is bar1 or pmu, etc. */ return vm->as_share ? vm->as_share->id : -1; } static inline u32 hi32(u64 f) { return (u32)(f >> 32); } static inline u32 lo32(u64 f) { return (u32)(f & 0xffffffff); } #define FLUSH_CPU_DCACHE(va, pa, size) \ do { \ __cpuc_flush_dcache_area((void *)(va), (size_t)(size)); \ outer_flush_range(pa, pa + (size_t)(size)); \ } while (0) static void gk20a_vm_unmap_locked(struct mapped_buffer_node *mapped_buffer); void __gk20a_mm_tlb_invalidate(struct vm_gk20a *vm); static struct mapped_buffer_node *find_mapped_buffer_locked( struct rb_root *root, u64 addr); static struct mapped_buffer_node *find_mapped_buffer_reverse_locked( struct rb_root *root, struct dma_buf *dmabuf, u32 kind); static int update_gmmu_ptes_locked(struct vm_gk20a *vm, enum gmmu_pgsz_gk20a pgsz_idx, struct sg_table *sgt, u64 buffer_offset, u64 first_vaddr, u64 last_vaddr, u8 kind_v, u32 ctag_offset, bool cacheable, int rw_flag); static void update_gmmu_pde_locked(struct vm_gk20a *vm, u32 i); static void gk20a_vm_remove_support(struct vm_gk20a *vm); /* note: keep the page sizes sorted lowest to highest here */ static const u32 gmmu_page_sizes[gmmu_nr_page_sizes] = { SZ_4K, SZ_128K }; static const u32 gmmu_page_shifts[gmmu_nr_page_sizes] = { 12, 17 }; static const u64 gmmu_page_offset_masks[gmmu_nr_page_sizes] = { 0xfffLL, 0x1ffffLL }; static const u64 gmmu_page_masks[gmmu_nr_page_sizes] = { ~0xfffLL, ~0x1ffffLL }; struct gk20a_comptags { u32 offset; u32 lines; }; struct gk20a_dmabuf_priv { struct mutex lock; struct gk20a_allocator *comptag_allocator; struct gk20a_comptags comptags; struct dma_buf_attachment *attach; struct sg_table *sgt; int pin_count; }; static void gk20a_mm_delete_priv(void *_priv) { struct gk20a_dmabuf_priv *priv = _priv; if (!priv) return; if (priv->comptags.lines) { BUG_ON(!priv->comptag_allocator); priv->comptag_allocator->free(priv->comptag_allocator, priv->comptags.offset, priv->comptags.lines); } kfree(priv); } struct sg_table *gk20a_mm_pin(struct device *dev, struct dma_buf *dmabuf) { struct gk20a_dmabuf_priv *priv; priv = dma_buf_get_drvdata(dmabuf, dev); if (WARN_ON(!priv)) return ERR_PTR(-EINVAL); mutex_lock(&priv->lock); if (priv->pin_count == 0) { priv->attach = dma_buf_attach(dmabuf, dev); if (IS_ERR(priv->attach)) { mutex_unlock(&priv->lock); return (struct sg_table *)priv->attach; } priv->sgt = dma_buf_map_attachment(priv->attach, DMA_BIDIRECTIONAL); if (IS_ERR(priv->sgt)) { dma_buf_detach(dmabuf, priv->attach); mutex_unlock(&priv->lock); return priv->sgt; } } priv->pin_count++; mutex_unlock(&priv->lock); return priv->sgt; } void gk20a_mm_unpin(struct device *dev, struct dma_buf *dmabuf, struct sg_table *sgt) { struct gk20a_dmabuf_priv *priv = dma_buf_get_drvdata(dmabuf, dev); dma_addr_t dma_addr; if (IS_ERR(priv) || !priv) return; mutex_lock(&priv->lock); WARN_ON(priv->sgt != sgt); priv->pin_count--; WARN_ON(priv->pin_count < 0); dma_addr = sg_dma_address(priv->sgt->sgl); if (priv->pin_count == 0) { dma_buf_unmap_attachment(priv->attach, priv->sgt, DMA_BIDIRECTIONAL); dma_buf_detach(dmabuf, priv->attach); } mutex_unlock(&priv->lock); } static void gk20a_get_comptags(struct device *dev, struct dma_buf *dmabuf, struct gk20a_comptags *comptags) { struct gk20a_dmabuf_priv *priv = dma_buf_get_drvdata(dmabuf, dev); if (!comptags) return; if (!priv) { comptags->lines = 0; comptags->offset = 0; return; } *comptags = priv->comptags; } static int gk20a_alloc_comptags(struct device *dev, struct dma_buf *dmabuf, struct gk20a_allocator *allocator, int lines) { struct gk20a_dmabuf_priv *priv = dma_buf_get_drvdata(dmabuf, dev); u32 offset = 0; int err; if (!priv) return -ENOSYS; if (!lines) return -EINVAL; /* store the allocator so we can use it when we free the ctags */ priv->comptag_allocator = allocator; err = allocator->alloc(allocator, &offset, lines); if (!err) { priv->comptags.lines = lines; priv->comptags.offset = offset; } return err; } static int gk20a_init_mm_reset_enable_hw(struct gk20a *g) { gk20a_dbg_fn(""); if (g->ops.fb.reset) g->ops.fb.reset(g); if (g->ops.fb.init_fs_state) g->ops.fb.init_fs_state(g); return 0; } void gk20a_remove_mm_support(struct mm_gk20a *mm) { struct gk20a *g = mm->g; struct device *d = dev_from_gk20a(g); struct vm_gk20a *vm = &mm->bar1.vm; struct inst_desc *inst_block = &mm->bar1.inst_block; gk20a_dbg_fn(""); if (inst_block->cpuva) dma_free_coherent(d, inst_block->size, inst_block->cpuva, inst_block->iova); inst_block->cpuva = NULL; inst_block->iova = 0; gk20a_vm_remove_support(vm); } int gk20a_init_mm_setup_sw(struct gk20a *g) { struct mm_gk20a *mm = &g->mm; int i; gk20a_dbg_fn(""); if (mm->sw_ready) { gk20a_dbg_fn("skip init"); return 0; } mm->g = g; mutex_init(&mm->l2_op_lock); mm->big_page_size = gmmu_page_sizes[gmmu_page_size_big]; mm->compression_page_size = gmmu_page_sizes[gmmu_page_size_big]; mm->pde_stride = mm->big_page_size << 10; mm->pde_stride_shift = ilog2(mm->pde_stride); BUG_ON(mm->pde_stride_shift > 31); /* we have assumptions about this */ for (i = 0; i < ARRAY_SIZE(gmmu_page_sizes); i++) { u32 num_ptes, pte_space, num_pages; /* assuming "full" page tables */ num_ptes = mm->pde_stride / gmmu_page_sizes[i]; pte_space = num_ptes * gmmu_pte__size_v(); /* allocate whole pages */ pte_space = roundup(pte_space, PAGE_SIZE); num_pages = pte_space / PAGE_SIZE; /* make sure "order" is viable */ BUG_ON(!is_power_of_2(num_pages)); mm->page_table_sizing[i].num_ptes = num_ptes; mm->page_table_sizing[i].order = ilog2(num_pages); } /*TBD: make channel vm size configurable */ mm->channel.size = 1ULL << NV_GMMU_VA_RANGE; gk20a_dbg_info("channel vm size: %dMB", (int)(mm->channel.size >> 20)); gk20a_dbg_info("small page-size (%dKB) pte array: %dKB", gmmu_page_sizes[gmmu_page_size_small] >> 10, (mm->page_table_sizing[gmmu_page_size_small].num_ptes * gmmu_pte__size_v()) >> 10); gk20a_dbg_info("big page-size (%dKB) pte array: %dKB", gmmu_page_sizes[gmmu_page_size_big] >> 10, (mm->page_table_sizing[gmmu_page_size_big].num_ptes * gmmu_pte__size_v()) >> 10); gk20a_init_bar1_vm(mm); mm->remove_support = gk20a_remove_mm_support; mm->sw_ready = true; gk20a_dbg_fn("done"); return 0; } /* make sure gk20a_init_mm_support is called before */ static int gk20a_init_mm_setup_hw(struct gk20a *g) { struct mm_gk20a *mm = &g->mm; struct inst_desc *inst_block = &mm->bar1.inst_block; phys_addr_t inst_pa = inst_block->cpu_pa; gk20a_dbg_fn(""); /* set large page size in fb * note this is very early on, can we defer it ? */ { u32 fb_mmu_ctrl = gk20a_readl(g, fb_mmu_ctrl_r()); if (gmmu_page_sizes[gmmu_page_size_big] == SZ_128K) fb_mmu_ctrl = (fb_mmu_ctrl & ~fb_mmu_ctrl_vm_pg_size_f(~0x0)) | fb_mmu_ctrl_vm_pg_size_128kb_f(); else BUG_ON(1); /* no support/testing for larger ones yet */ gk20a_writel(g, fb_mmu_ctrl_r(), fb_mmu_ctrl); } inst_pa = (u32)(inst_pa >> bar1_instance_block_shift_gk20a()); gk20a_dbg_info("bar1 inst block ptr: 0x%08x", (u32)inst_pa); gk20a_writel(g, bus_bar1_block_r(), bus_bar1_block_target_vid_mem_f() | bus_bar1_block_mode_virtual_f() | bus_bar1_block_ptr_f(inst_pa)); if (gk20a_mm_fb_flush(g) || gk20a_mm_fb_flush(g)) return -EBUSY; gk20a_dbg_fn("done"); return 0; } int gk20a_init_mm_support(struct gk20a *g) { u32 err; err = gk20a_init_mm_reset_enable_hw(g); if (err) return err; err = gk20a_init_mm_setup_sw(g); if (err) return err; err = gk20a_init_mm_setup_hw(g); if (err) return err; return err; } #ifdef CONFIG_GK20A_PHYS_PAGE_TABLES static int alloc_gmmu_pages(struct vm_gk20a *vm, u32 order, void **handle, struct sg_table **sgt, size_t *size) { u32 num_pages = 1 << order; u32 len = num_pages * PAGE_SIZE; int err; struct page *pages; gk20a_dbg_fn(""); pages = alloc_pages(GFP_KERNEL, order); if (!pages) { gk20a_dbg(gpu_dbg_pte, "alloc_pages failed\n"); goto err_out; } *sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); if (!sgt) { gk20a_dbg(gpu_dbg_pte, "cannot allocate sg table"); goto err_alloced; } err = sg_alloc_table(*sgt, 1, GFP_KERNEL); if (err) { gk20a_dbg(gpu_dbg_pte, "sg_alloc_table failed\n"); goto err_sg_table; } sg_set_page((*sgt)->sgl, pages, len, 0); *handle = page_address(pages); memset(*handle, 0, len); *size = len; FLUSH_CPU_DCACHE(*handle, sg_phys((*sgt)->sgl), len); return 0; err_sg_table: kfree(*sgt); err_alloced: __free_pages(pages, order); err_out: return -ENOMEM; } static void free_gmmu_pages(struct vm_gk20a *vm, void *handle, struct sg_table *sgt, u32 order, size_t size) { gk20a_dbg_fn(""); BUG_ON(sgt == NULL); free_pages((unsigned long)handle, order); sg_free_table(sgt); kfree(sgt); } static int map_gmmu_pages(void *handle, struct sg_table *sgt, void **va, size_t size) { FLUSH_CPU_DCACHE(handle, sg_phys(sgt->sgl), sgt->sgl->length); *va = handle; return 0; } static void unmap_gmmu_pages(void *handle, struct sg_table *sgt, void *va) { FLUSH_CPU_DCACHE(handle, sg_phys(sgt->sgl), sgt->sgl->length); } #else static int alloc_gmmu_pages(struct vm_gk20a *vm, u32 order, void **handle, struct sg_table **sgt, size_t *size) { struct device *d = dev_from_vm(vm); u32 num_pages = 1 << order; u32 len = num_pages * PAGE_SIZE; dma_addr_t iova; DEFINE_DMA_ATTRS(attrs); struct page **pages; void *cpuva; int err = 0; gk20a_dbg_fn(""); *size = len; if (IS_ENABLED(CONFIG_ARM64)) { cpuva = dma_zalloc_coherent(d, len, &iova, GFP_KERNEL); if (!cpuva) { gk20a_err(d, "memory allocation failed\n"); goto err_out; } err = gk20a_get_sgtable(d, sgt, cpuva, iova, len); if (err) { gk20a_err(d, "sgt allocation failed\n"); goto err_free; } *handle = cpuva; } else { dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &attrs); pages = dma_alloc_attrs(d, len, &iova, GFP_KERNEL, &attrs); if (!pages) { gk20a_err(d, "memory allocation failed\n"); goto err_out; } err = gk20a_get_sgtable_from_pages(d, sgt, pages, iova, len); if (err) { gk20a_err(d, "sgt allocation failed\n"); goto err_free; } *handle = (void *)pages; } return 0; err_free: if (IS_ENABLED(CONFIG_ARM64)) { dma_free_coherent(d, len, handle, iova); cpuva = NULL; } else { dma_free_attrs(d, len, pages, iova, &attrs); pages = NULL; } iova = 0; err_out: return -ENOMEM; } static void free_gmmu_pages(struct vm_gk20a *vm, void *handle, struct sg_table *sgt, u32 order, size_t size) { struct device *d = dev_from_vm(vm); u64 iova; DEFINE_DMA_ATTRS(attrs); struct page **pages; gk20a_dbg_fn(""); BUG_ON(sgt == NULL); iova = sg_dma_address(sgt->sgl); gk20a_free_sgtable(&sgt); if (IS_ENABLED(CONFIG_ARM64)) { dma_free_coherent(d, size, handle, iova); } else { pages = (struct page **)handle; dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &attrs); dma_free_attrs(d, size, pages, iova, &attrs); pages = NULL; } handle = NULL; iova = 0; } static int map_gmmu_pages(void *handle, struct sg_table *sgt, void **kva, size_t size) { int count = PAGE_ALIGN(size) >> PAGE_SHIFT; struct page **pages; gk20a_dbg_fn(""); if (IS_ENABLED(CONFIG_ARM64)) { *kva = handle; } else { pages = (struct page **)handle; *kva = vmap(pages, count, 0, pgprot_dmacoherent(PAGE_KERNEL)); if (!(*kva)) return -ENOMEM; } return 0; } static void unmap_gmmu_pages(void *handle, struct sg_table *sgt, void *va) { gk20a_dbg_fn(""); if (!IS_ENABLED(CONFIG_ARM64)) vunmap(va); va = NULL; } #endif /* allocate a phys contig region big enough for a full * sized gmmu page table for the given gmmu_page_size. * the whole range is zeroed so it's "invalid"/will fault */ static int zalloc_gmmu_page_table_gk20a(struct vm_gk20a *vm, enum gmmu_pgsz_gk20a gmmu_pgsz_idx, struct page_table_gk20a *pte) { int err; u32 pte_order; void *handle = NULL; struct sg_table *sgt; size_t size; gk20a_dbg_fn(""); /* allocate enough pages for the table */ pte_order = vm->mm->page_table_sizing[gmmu_pgsz_idx].order; err = alloc_gmmu_pages(vm, pte_order, &handle, &sgt, &size); if (err) return err; gk20a_dbg(gpu_dbg_pte, "pte = 0x%p, addr=%08llx, size %d", pte, gk20a_mm_iova_addr(sgt->sgl), pte_order); pte->ref = handle; pte->sgt = sgt; pte->size = size; return 0; } /* given address range (inclusive) determine the pdes crossed */ static inline void pde_range_from_vaddr_range(struct vm_gk20a *vm, u64 addr_lo, u64 addr_hi, u32 *pde_lo, u32 *pde_hi) { *pde_lo = (u32)(addr_lo >> vm->mm->pde_stride_shift); *pde_hi = (u32)(addr_hi >> vm->mm->pde_stride_shift); gk20a_dbg(gpu_dbg_pte, "addr_lo=0x%llx addr_hi=0x%llx pde_ss=%d", addr_lo, addr_hi, vm->mm->pde_stride_shift); gk20a_dbg(gpu_dbg_pte, "pde_lo=%d pde_hi=%d", *pde_lo, *pde_hi); } static inline u32 *pde_from_index(struct vm_gk20a *vm, u32 i) { return (u32 *) (((u8 *)vm->pdes.kv) + i*gmmu_pde__size_v()); } static inline u32 pte_index_from_vaddr(struct vm_gk20a *vm, u64 addr, enum gmmu_pgsz_gk20a pgsz_idx) { u32 ret; /* mask off pde part */ addr = addr & ((((u64)1) << vm->mm->pde_stride_shift) - ((u64)1)); /* shift over to get pte index. note assumption that pte index * doesn't leak over into the high 32b */ ret = (u32)(addr >> gmmu_page_shifts[pgsz_idx]); gk20a_dbg(gpu_dbg_pte, "addr=0x%llx pte_i=0x%x", addr, ret); return ret; } static inline void pte_space_page_offset_from_index(u32 i, u32 *pte_page, u32 *pte_offset) { /* ptes are 8B regardless of pagesize */ /* pte space pages are 4KB. so 512 ptes per 4KB page*/ *pte_page = i >> 9; /* this offset is a pte offset, not a byte offset */ *pte_offset = i & ((1<<9)-1); gk20a_dbg(gpu_dbg_pte, "i=0x%x pte_page=0x%x pte_offset=0x%x", i, *pte_page, *pte_offset); } /* * given a pde index/page table number make sure it has * backing store and if not go ahead allocate it and * record it in the appropriate pde */ static int validate_gmmu_page_table_gk20a_locked(struct vm_gk20a *vm, u32 i, enum gmmu_pgsz_gk20a gmmu_pgsz_idx) { int err; struct page_table_gk20a *pte = vm->pdes.ptes[gmmu_pgsz_idx] + i; gk20a_dbg_fn(""); /* if it's already in place it's valid */ if (pte->ref) return 0; gk20a_dbg(gpu_dbg_pte, "alloc %dKB ptes for pde %d", gmmu_page_sizes[gmmu_pgsz_idx]/1024, i); err = zalloc_gmmu_page_table_gk20a(vm, gmmu_pgsz_idx, pte); if (err) return err; /* rewrite pde */ update_gmmu_pde_locked(vm, i); return 0; } static struct vm_reserved_va_node *addr_to_reservation(struct vm_gk20a *vm, u64 addr) { struct vm_reserved_va_node *va_node; list_for_each_entry(va_node, &vm->reserved_va_list, reserved_va_list) if (addr >= va_node->vaddr_start && addr < (u64)va_node->vaddr_start + (u64)va_node->size) return va_node; return NULL; } int gk20a_vm_get_buffers(struct vm_gk20a *vm, struct mapped_buffer_node ***mapped_buffers, int *num_buffers) { struct mapped_buffer_node *mapped_buffer; struct mapped_buffer_node **buffer_list; struct rb_node *node; int i = 0; mutex_lock(&vm->update_gmmu_lock); buffer_list = kzalloc(sizeof(*buffer_list) * vm->num_user_mapped_buffers, GFP_KERNEL); if (!buffer_list) { mutex_unlock(&vm->update_gmmu_lock); return -ENOMEM; } node = rb_first(&vm->mapped_buffers); while (node) { mapped_buffer = container_of(node, struct mapped_buffer_node, node); if (mapped_buffer->user_mapped) { buffer_list[i] = mapped_buffer; kref_get(&mapped_buffer->ref); i++; } node = rb_next(&mapped_buffer->node); } BUG_ON(i != vm->num_user_mapped_buffers); *num_buffers = vm->num_user_mapped_buffers; *mapped_buffers = buffer_list; mutex_unlock(&vm->update_gmmu_lock); return 0; } static void gk20a_vm_unmap_locked_kref(struct kref *ref) { struct mapped_buffer_node *mapped_buffer = container_of(ref, struct mapped_buffer_node, ref); gk20a_vm_unmap_locked(mapped_buffer); } void gk20a_vm_put_buffers(struct vm_gk20a *vm, struct mapped_buffer_node **mapped_buffers, int num_buffers) { int i; mutex_lock(&vm->update_gmmu_lock); for (i = 0; i < num_buffers; ++i) kref_put(&mapped_buffers[i]->ref, gk20a_vm_unmap_locked_kref); mutex_unlock(&vm->update_gmmu_lock); kfree(mapped_buffers); } static void gk20a_vm_unmap_user(struct vm_gk20a *vm, u64 offset) { struct device *d = dev_from_vm(vm); int retries; struct mapped_buffer_node *mapped_buffer; mutex_lock(&vm->update_gmmu_lock); mapped_buffer = find_mapped_buffer_locked(&vm->mapped_buffers, offset); if (!mapped_buffer) { mutex_unlock(&vm->update_gmmu_lock); gk20a_err(d, "invalid addr to unmap 0x%llx", offset); return; } if (mapped_buffer->flags & NVHOST_AS_MAP_BUFFER_FLAGS_FIXED_OFFSET) { mutex_unlock(&vm->update_gmmu_lock); retries = 1000; while (retries) { if (atomic_read(&mapped_buffer->ref.refcount) == 1) break; retries--; udelay(50); } if (!retries) gk20a_err(d, "sync-unmap failed on 0x%llx", offset); mutex_lock(&vm->update_gmmu_lock); } mapped_buffer->user_mapped--; if (mapped_buffer->user_mapped == 0) vm->num_user_mapped_buffers--; kref_put(&mapped_buffer->ref, gk20a_vm_unmap_locked_kref); mutex_unlock(&vm->update_gmmu_lock); } static u64 gk20a_vm_alloc_va(struct vm_gk20a *vm, u64 size, enum gmmu_pgsz_gk20a gmmu_pgsz_idx) { struct gk20a_allocator *vma = &vm->vma[gmmu_pgsz_idx]; int err; u64 offset; u32 start_page_nr = 0, num_pages; u64 gmmu_page_size = gmmu_page_sizes[gmmu_pgsz_idx]; if (gmmu_pgsz_idx >= ARRAY_SIZE(gmmu_page_sizes)) { dev_warn(dev_from_vm(vm), "invalid page size requested in gk20a vm alloc"); return -EINVAL; } if ((gmmu_pgsz_idx == gmmu_page_size_big) && !vm->big_pages) { dev_warn(dev_from_vm(vm), "unsupportd page size requested"); return -EINVAL; } /* be certain we round up to gmmu_page_size if needed */ /* TBD: DIV_ROUND_UP -> undefined reference to __aeabi_uldivmod */ size = (size + ((u64)gmmu_page_size - 1)) & ~((u64)gmmu_page_size - 1); gk20a_dbg_info("size=0x%llx @ pgsz=%dKB", size, gmmu_page_sizes[gmmu_pgsz_idx]>>10); /* The vma allocator represents page accounting. */ num_pages = size >> gmmu_page_shifts[gmmu_pgsz_idx]; err = vma->alloc(vma, &start_page_nr, num_pages); if (err) { gk20a_err(dev_from_vm(vm), "%s oom: sz=0x%llx", vma->name, size); return 0; } offset = (u64)start_page_nr << gmmu_page_shifts[gmmu_pgsz_idx]; gk20a_dbg_fn("%s found addr: 0x%llx", vma->name, offset); return offset; } static int gk20a_vm_free_va(struct vm_gk20a *vm, u64 offset, u64 size, enum gmmu_pgsz_gk20a pgsz_idx) { struct gk20a_allocator *vma = &vm->vma[pgsz_idx]; u32 page_size = gmmu_page_sizes[pgsz_idx]; u32 page_shift = gmmu_page_shifts[pgsz_idx]; u32 start_page_nr, num_pages; int err; gk20a_dbg_info("%s free addr=0x%llx, size=0x%llx", vma->name, offset, size); start_page_nr = (u32)(offset >> page_shift); num_pages = (u32)((size + page_size - 1) >> page_shift); err = vma->free(vma, start_page_nr, num_pages); if (err) { gk20a_err(dev_from_vm(vm), "not found: offset=0x%llx, sz=0x%llx", offset, size); } return err; } static int insert_mapped_buffer(struct rb_root *root, struct mapped_buffer_node *mapped_buffer) { struct rb_node **new_node = &(root->rb_node), *parent = NULL; /* Figure out where to put new node */ while (*new_node) { struct mapped_buffer_node *cmp_with = container_of(*new_node, struct mapped_buffer_node, node); parent = *new_node; if (cmp_with->addr > mapped_buffer->addr) /* u64 cmp */ new_node = &((*new_node)->rb_left); else if (cmp_with->addr != mapped_buffer->addr) /* u64 cmp */ new_node = &((*new_node)->rb_right); else return -EINVAL; /* no fair dup'ing */ } /* Add new node and rebalance tree. */ rb_link_node(&mapped_buffer->node, parent, new_node); rb_insert_color(&mapped_buffer->node, root); return 0; } static struct mapped_buffer_node *find_mapped_buffer_reverse_locked( struct rb_root *root, struct dma_buf *dmabuf, u32 kind) { struct rb_node *node = rb_first(root); while (node) { struct mapped_buffer_node *mapped_buffer = container_of(node, struct mapped_buffer_node, node); if (mapped_buffer->dmabuf == dmabuf && kind == mapped_buffer->kind) return mapped_buffer; node = rb_next(&mapped_buffer->node); } return 0; } static struct mapped_buffer_node *find_mapped_buffer_locked( struct rb_root *root, u64 addr) { struct rb_node *node = root->rb_node; while (node) { struct mapped_buffer_node *mapped_buffer = container_of(node, struct mapped_buffer_node, node); if (mapped_buffer->addr > addr) /* u64 cmp */ node = node->rb_left; else if (mapped_buffer->addr != addr) /* u64 cmp */ node = node->rb_right; else return mapped_buffer; } return 0; } static struct mapped_buffer_node *find_mapped_buffer_range_locked( struct rb_root *root, u64 addr) { struct rb_node *node = root->rb_node; while (node) { struct mapped_buffer_node *m = container_of(node, struct mapped_buffer_node, node); if (m->addr <= addr && m->addr + m->size > addr) return m; else if (m->addr > addr) /* u64 cmp */ node = node->rb_left; else node = node->rb_right; } return 0; } #define BFR_ATTRS (sizeof(nvmap_bfr_param)/sizeof(nvmap_bfr_param[0])) struct buffer_attrs { struct sg_table *sgt; u64 size; u64 align; u32 ctag_offset; u32 ctag_lines; int pgsz_idx; u8 kind_v; u8 uc_kind_v; }; static void gmmu_select_page_size(struct buffer_attrs *bfr) { int i; /* choose the biggest first (top->bottom) */ for (i = (gmmu_nr_page_sizes-1); i >= 0; i--) if (!(gmmu_page_offset_masks[i] & bfr->align)) { /* would like to add this too but nvmap returns the * original requested size not the allocated size. * (!(gmmu_page_offset_masks[i] & bfr->size)) */ bfr->pgsz_idx = i; break; } } static int setup_buffer_kind_and_compression(struct device *d, u32 flags, struct buffer_attrs *bfr, enum gmmu_pgsz_gk20a pgsz_idx) { bool kind_compressible; if (unlikely(bfr->kind_v == gmmu_pte_kind_invalid_v())) bfr->kind_v = gmmu_pte_kind_pitch_v(); if (unlikely(!gk20a_kind_is_supported(bfr->kind_v))) { gk20a_err(d, "kind 0x%x not supported", bfr->kind_v); return -EINVAL; } bfr->uc_kind_v = gmmu_pte_kind_invalid_v(); /* find a suitable uncompressed kind if it becomes necessary later */ kind_compressible = gk20a_kind_is_compressible(bfr->kind_v); if (kind_compressible) { bfr->uc_kind_v = gk20a_get_uncompressed_kind(bfr->kind_v); if (unlikely(bfr->uc_kind_v == gmmu_pte_kind_invalid_v())) { /* shouldn't happen, but it is worth cross-checking */ gk20a_err(d, "comptag kind 0x%x can't be" " downgraded to uncompressed kind", bfr->kind_v); return -EINVAL; } } /* comptags only supported for suitable kinds, 128KB pagesize */ if (unlikely(kind_compressible && (gmmu_page_sizes[pgsz_idx] != 128*1024))) { /* gk20a_warn(d, "comptags specified" " but pagesize being used doesn't support it");*/ /* it is safe to fall back to uncompressed as functionality is not harmed */ bfr->kind_v = bfr->uc_kind_v; kind_compressible = false; } if (kind_compressible) bfr->ctag_lines = ALIGN(bfr->size, COMP_TAG_LINE_SIZE) >> COMP_TAG_LINE_SIZE_SHIFT; else bfr->ctag_lines = 0; return 0; } static int validate_fixed_buffer(struct vm_gk20a *vm, struct buffer_attrs *bfr, u64 map_offset, u64 map_size) { struct device *dev = dev_from_vm(vm); struct vm_reserved_va_node *va_node; struct mapped_buffer_node *buffer; if (map_offset & gmmu_page_offset_masks[bfr->pgsz_idx]) { gk20a_err(dev, "map offset must be buffer page size aligned 0x%llx", map_offset); return -EINVAL; } /* find the space reservation */ va_node = addr_to_reservation(vm, map_offset); if (!va_node) { gk20a_warn(dev, "fixed offset mapping without space allocation"); return -EINVAL; } /* check that this mappings does not collide with existing * mappings by checking the overlapping area between the current * buffer and all other mapped buffers */ list_for_each_entry(buffer, &va_node->va_buffers_list, va_buffers_list) { s64 begin = max(buffer->addr, map_offset); s64 end = min(buffer->addr + buffer->size, map_offset + map_size); if (end - begin > 0) { gk20a_warn(dev, "overlapping buffer map requested"); return -EINVAL; } } return 0; } static u64 __locked_gmmu_map(struct vm_gk20a *vm, u64 map_offset, struct sg_table *sgt, u64 buffer_offset, u64 size, int pgsz_idx, u8 kind_v, u32 ctag_offset, u32 flags, int rw_flag) { int err = 0, i = 0; bool allocated = false; u32 pde_lo, pde_hi; struct device *d = dev_from_vm(vm); /* Allocate (or validate when map_offset != 0) the virtual address. */ if (!map_offset) { map_offset = gk20a_vm_alloc_va(vm, size, pgsz_idx); if (!map_offset) { gk20a_err(d, "failed to allocate va space"); err = -ENOMEM; goto fail_alloc; } allocated = true; } pde_range_from_vaddr_range(vm, map_offset, map_offset + size - 1, &pde_lo, &pde_hi); /* mark the addr range valid (but with 0 phys addr, which will fault) */ for (i = pde_lo; i <= pde_hi; i++) { err = validate_gmmu_page_table_gk20a_locked(vm, i, pgsz_idx); if (err) { gk20a_err(d, "failed to validate page table %d: %d", i, err); goto fail_validate; } } err = update_gmmu_ptes_locked(vm, pgsz_idx, sgt, buffer_offset, map_offset, map_offset + size - 1, kind_v, ctag_offset, flags & NVHOST_MAP_BUFFER_FLAGS_CACHEABLE_TRUE, rw_flag); if (err) { gk20a_err(d, "failed to update ptes on map"); goto fail_validate; } return map_offset; fail_validate: if (allocated) gk20a_vm_free_va(vm, map_offset, size, pgsz_idx); fail_alloc: gk20a_err(d, "%s: failed with err=%d\n", __func__, err); return 0; } static void __locked_gmmu_unmap(struct vm_gk20a *vm, u64 vaddr, u64 size, int pgsz_idx, bool va_allocated, int rw_flag) { int err = 0; struct gk20a *g = gk20a_from_vm(vm); if (va_allocated) { err = gk20a_vm_free_va(vm, vaddr, size, pgsz_idx); if (err) { dev_err(dev_from_vm(vm), "failed to free va"); return; } } /* unmap here needs to know the page size we assigned at mapping */ err = update_gmmu_ptes_locked(vm, pgsz_idx, 0, /* n/a for unmap */ 0, vaddr, vaddr + size - 1, 0, 0, false /* n/a for unmap */, rw_flag); if (err) dev_err(dev_from_vm(vm), "failed to update gmmu ptes on unmap"); /* detect which if any pdes/ptes can now be released */ /* flush l2 so any dirty lines are written out *now*. * also as we could potentially be switching this buffer * from nonvolatile (l2 cacheable) to volatile (l2 non-cacheable) at * some point in the future we need to invalidate l2. e.g. switching * from a render buffer unmap (here) to later using the same memory * for gmmu ptes. note the positioning of this relative to any smmu * unmapping (below). */ gk20a_mm_l2_flush(g, true); } static u64 gk20a_vm_map_duplicate_locked(struct vm_gk20a *vm, struct dma_buf *dmabuf, u64 offset_align, u32 flags, int kind, struct sg_table **sgt, bool user_mapped, int rw_flag) { struct mapped_buffer_node *mapped_buffer = 0; mapped_buffer = find_mapped_buffer_reverse_locked(&vm->mapped_buffers, dmabuf, kind); if (!mapped_buffer) return 0; if (mapped_buffer->flags != flags) return 0; if (flags & NVHOST_AS_MAP_BUFFER_FLAGS_FIXED_OFFSET && mapped_buffer->addr != offset_align) return 0; BUG_ON(mapped_buffer->vm != vm); /* mark the buffer as used */ if (user_mapped) { if (mapped_buffer->user_mapped == 0) vm->num_user_mapped_buffers++; mapped_buffer->user_mapped++; /* If the mapping comes from user space, we own * the handle ref. Since we reuse an * existing mapping here, we need to give back those * refs once in order not to leak. */ if (mapped_buffer->own_mem_ref) dma_buf_put(mapped_buffer->dmabuf); else mapped_buffer->own_mem_ref = true; } kref_get(&mapped_buffer->ref); gk20a_dbg(gpu_dbg_map, "reusing as=%d pgsz=%d flags=0x%x ctags=%d " "start=%d gv=0x%x,%08x -> 0x%x,%08x -> 0x%x,%08x " "own_mem_ref=%d user_mapped=%d", vm_aspace_id(vm), mapped_buffer->pgsz_idx, mapped_buffer->flags, mapped_buffer->ctag_lines, mapped_buffer->ctag_offset, hi32(mapped_buffer->addr), lo32(mapped_buffer->addr), hi32((u64)sg_dma_address(mapped_buffer->sgt->sgl)), lo32((u64)sg_dma_address(mapped_buffer->sgt->sgl)), hi32((u64)sg_phys(mapped_buffer->sgt->sgl)), lo32((u64)sg_phys(mapped_buffer->sgt->sgl)), mapped_buffer->own_mem_ref, user_mapped); if (sgt) *sgt = mapped_buffer->sgt; return mapped_buffer->addr; } u64 gk20a_vm_map(struct vm_gk20a *vm, struct dma_buf *dmabuf, u64 offset_align, u32 flags /*NVHOST_AS_MAP_BUFFER_FLAGS_*/, int kind, struct sg_table **sgt, bool user_mapped, int rw_flag, u64 buffer_offset, u64 mapping_size) { struct gk20a *g = gk20a_from_vm(vm); struct gk20a_allocator *ctag_allocator = &g->gr.comp_tags; struct device *d = dev_from_vm(vm); struct mapped_buffer_node *mapped_buffer = 0; bool inserted = false, va_allocated = false; u32 gmmu_page_size = 0; u64 map_offset = 0; int err = 0; struct buffer_attrs bfr = {0}; struct gk20a_comptags comptags; u64 buf_addr; mutex_lock(&vm->update_gmmu_lock); /* check if this buffer is already mapped */ map_offset = gk20a_vm_map_duplicate_locked(vm, dmabuf, offset_align, flags, kind, sgt, user_mapped, rw_flag); if (map_offset) { mutex_unlock(&vm->update_gmmu_lock); return map_offset; } /* pin buffer to get phys/iovmm addr */ bfr.sgt = gk20a_mm_pin(d, dmabuf); if (IS_ERR(bfr.sgt)) { /* Falling back to physical is actually possible * here in many cases if we use 4K phys pages in the * gmmu. However we have some regions which require * contig regions to work properly (either phys-contig * or contig through smmu io_vaspace). Until we can * track the difference between those two cases we have * to fail the mapping when we run out of SMMU space. */ gk20a_warn(d, "oom allocating tracking buffer"); goto clean_up; } if (sgt) *sgt = bfr.sgt; bfr.kind_v = kind; bfr.size = dmabuf->size; buf_addr = (u64)sg_dma_address(bfr.sgt->sgl); if (unlikely(!buf_addr)) buf_addr = (u64)sg_phys(bfr.sgt->sgl); bfr.align = 1 << __ffs(buf_addr); bfr.pgsz_idx = -1; mapping_size = mapping_size ? mapping_size : bfr.size; /* If FIX_OFFSET is set, pgsz is determined. Otherwise, select * page size according to memory alignment */ if (flags & NVHOST_AS_MAP_BUFFER_FLAGS_FIXED_OFFSET) { bfr.pgsz_idx = NV_GMMU_VA_IS_UPPER(offset_align) ? gmmu_page_size_big : gmmu_page_size_small; } else { if (vm->big_pages) gmmu_select_page_size(&bfr); else bfr.pgsz_idx = gmmu_page_size_small; } /* validate/adjust bfr attributes */ if (unlikely(bfr.pgsz_idx == -1)) { gk20a_err(d, "unsupported page size detected"); goto clean_up; } if (unlikely(bfr.pgsz_idx < gmmu_page_size_small || bfr.pgsz_idx > gmmu_page_size_big)) { BUG_ON(1); err = -EINVAL; goto clean_up; } gmmu_page_size = gmmu_page_sizes[bfr.pgsz_idx]; /* Check if we should use a fixed offset for mapping this buffer */ if (flags & NVHOST_AS_MAP_BUFFER_FLAGS_FIXED_OFFSET) { err = validate_fixed_buffer(vm, &bfr, offset_align, mapping_size); if (err) goto clean_up; map_offset = offset_align; va_allocated = false; } else va_allocated = true; if (sgt) *sgt = bfr.sgt; err = setup_buffer_kind_and_compression(d, flags, &bfr, bfr.pgsz_idx); if (unlikely(err)) { gk20a_err(d, "failure setting up kind and compression"); goto clean_up; } /* bar1 and pmu vm don't need ctag */ if (!vm->enable_ctag) bfr.ctag_lines = 0; gk20a_get_comptags(d, dmabuf, &comptags); if (bfr.ctag_lines && !comptags.lines) { /* allocate compression resources if needed */ err = gk20a_alloc_comptags(d, dmabuf, ctag_allocator, bfr.ctag_lines); if (err) { /* ok to fall back here if we ran out */ /* TBD: we can partially alloc ctags as well... */ bfr.ctag_lines = bfr.ctag_offset = 0; bfr.kind_v = bfr.uc_kind_v; } else { gk20a_get_comptags(d, dmabuf, &comptags); /* init/clear the ctag buffer */ g->ops.ltc.cbc_ctrl(g, gk20a_cbc_op_clear, comptags.offset, comptags.offset + comptags.lines - 1); } } /* store the comptag info */ bfr.ctag_offset = comptags.offset; /* update gmmu ptes */ map_offset = __locked_gmmu_map(vm, map_offset, bfr.sgt, buffer_offset, /* sg offset */ mapping_size, bfr.pgsz_idx, bfr.kind_v, bfr.ctag_offset, flags, rw_flag); if (!map_offset) goto clean_up; gk20a_dbg(gpu_dbg_map, "as=%d pgsz=%d " "kind=0x%x kind_uc=0x%x flags=0x%x " "ctags=%d start=%d gv=0x%x,%08x -> 0x%x,%08x -> 0x%x,%08x", vm_aspace_id(vm), gmmu_page_size, bfr.kind_v, bfr.uc_kind_v, flags, bfr.ctag_lines, bfr.ctag_offset, hi32(map_offset), lo32(map_offset), hi32((u64)sg_dma_address(bfr.sgt->sgl)), lo32((u64)sg_dma_address(bfr.sgt->sgl)), hi32((u64)sg_phys(bfr.sgt->sgl)), lo32((u64)sg_phys(bfr.sgt->sgl))); #if defined(NVHOST_DEBUG) { int i; struct scatterlist *sg = NULL; gk20a_dbg(gpu_dbg_pte, "for_each_sg(bfr.sgt->sgl, sg, bfr.sgt->nents, i)"); for_each_sg(bfr.sgt->sgl, sg, bfr.sgt->nents, i ) { u64 da = sg_dma_address(sg); u64 pa = sg_phys(sg); u64 len = sg->length; gk20a_dbg(gpu_dbg_pte, "i=%d pa=0x%x,%08x da=0x%x,%08x len=0x%x,%08x", i, hi32(pa), lo32(pa), hi32(da), lo32(da), hi32(len), lo32(len)); } } #endif /* keep track of the buffer for unmapping */ /* TBD: check for multiple mapping of same buffer */ mapped_buffer = kzalloc(sizeof(*mapped_buffer), GFP_KERNEL); if (!mapped_buffer) { gk20a_warn(d, "oom allocating tracking buffer"); goto clean_up; } mapped_buffer->dmabuf = dmabuf; mapped_buffer->sgt = bfr.sgt; mapped_buffer->addr = map_offset; mapped_buffer->size = mapping_size; mapped_buffer->pgsz_idx = bfr.pgsz_idx; mapped_buffer->ctag_offset = bfr.ctag_offset; mapped_buffer->ctag_lines = bfr.ctag_lines; mapped_buffer->vm = vm; mapped_buffer->flags = flags; mapped_buffer->kind = kind; mapped_buffer->va_allocated = va_allocated; mapped_buffer->user_mapped = user_mapped ? 1 : 0; mapped_buffer->own_mem_ref = user_mapped; INIT_LIST_HEAD(&mapped_buffer->unmap_list); INIT_LIST_HEAD(&mapped_buffer->va_buffers_list); kref_init(&mapped_buffer->ref); err = insert_mapped_buffer(&vm->mapped_buffers, mapped_buffer); if (err) { gk20a_err(d, "failed to insert into mapped buffer tree"); goto clean_up; } inserted = true; if (user_mapped) vm->num_user_mapped_buffers++; gk20a_dbg_info("allocated va @ 0x%llx", map_offset); if (!va_allocated) { struct vm_reserved_va_node *va_node; /* find the space reservation */ va_node = addr_to_reservation(vm, map_offset); list_add_tail(&mapped_buffer->va_buffers_list, &va_node->va_buffers_list); mapped_buffer->va_node = va_node; } mutex_unlock(&vm->update_gmmu_lock); /* Invalidate kernel mappings immediately */ if (vm_aspace_id(vm) == -1) gk20a_mm_tlb_invalidate(vm); return map_offset; clean_up: if (inserted) { rb_erase(&mapped_buffer->node, &vm->mapped_buffers); if (user_mapped) vm->num_user_mapped_buffers--; } kfree(mapped_buffer); if (va_allocated) gk20a_vm_free_va(vm, map_offset, bfr.size, bfr.pgsz_idx); if (!IS_ERR(bfr.sgt)) gk20a_mm_unpin(d, dmabuf, bfr.sgt); mutex_unlock(&vm->update_gmmu_lock); gk20a_dbg_info("err=%d\n", err); return 0; } u64 gk20a_gmmu_map(struct vm_gk20a *vm, struct sg_table **sgt, u64 size, u32 flags, int rw_flag) { u64 vaddr; mutex_lock(&vm->update_gmmu_lock); vaddr = __locked_gmmu_map(vm, 0, /* already mapped? - No */ *sgt, /* sg table */ 0, /* sg offset */ size, 0, /* page size index = 0 i.e. SZ_4K */ 0, /* kind */ 0, /* ctag_offset */ flags, rw_flag); mutex_unlock(&vm->update_gmmu_lock); if (!vaddr) { gk20a_err(dev_from_vm(vm), "failed to allocate va space"); return 0; } /* Invalidate kernel mappings immediately */ gk20a_mm_tlb_invalidate(vm); return vaddr; } void gk20a_gmmu_unmap(struct vm_gk20a *vm, u64 vaddr, u64 size, int rw_flag) { mutex_lock(&vm->update_gmmu_lock); __locked_gmmu_unmap(vm, vaddr, size, 0, /* page size 4K */ true, /*va_allocated */ rw_flag); mutex_unlock(&vm->update_gmmu_lock); } phys_addr_t gk20a_get_phys_from_iova(struct device *d, u64 dma_addr) { phys_addr_t phys; u64 iova; struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(d); if (!mapping) return dma_addr; iova = dma_addr & PAGE_MASK; phys = iommu_iova_to_phys(mapping->domain, iova); return phys; } /* get sg_table from already allocated buffer */ int gk20a_get_sgtable(struct device *d, struct sg_table **sgt, void *cpuva, u64 iova, size_t size) { int err = 0; *sgt = kzalloc(sizeof(struct sg_table), GFP_KERNEL); if (!(*sgt)) { dev_err(d, "failed to allocate memory\n"); err = -ENOMEM; goto fail; } err = dma_get_sgtable(d, *sgt, cpuva, iova, size); if (err) { dev_err(d, "failed to create sg table\n"); goto fail; } sg_dma_address((*sgt)->sgl) = iova; return 0; fail: if (*sgt) { kfree(*sgt); *sgt = NULL; } return err; } int gk20a_get_sgtable_from_pages(struct device *d, struct sg_table **sgt, struct page **pages, u64 iova, size_t size) { int err = 0; *sgt = kzalloc(sizeof(struct sg_table), GFP_KERNEL); if (!(*sgt)) { dev_err(d, "failed to allocate memory\n"); err = -ENOMEM; goto fail; } err = sg_alloc_table(*sgt, 1, GFP_KERNEL); if (err) { dev_err(d, "failed to allocate sg_table\n"); goto fail; } sg_set_page((*sgt)->sgl, *pages, size, 0); sg_dma_address((*sgt)->sgl) = iova; return 0; fail: if (*sgt) { kfree(*sgt); *sgt = NULL; } return err; } void gk20a_free_sgtable(struct sg_table **sgt) { sg_free_table(*sgt); kfree(*sgt); *sgt = NULL; } u64 gk20a_mm_iova_addr(struct scatterlist *sgl) { u64 result = sg_phys(sgl); #ifdef CONFIG_TEGRA_IOMMU_SMMU if (sg_dma_address(sgl) == DMA_ERROR_CODE) result = 0; else if (sg_dma_address(sgl)) { result = sg_dma_address(sgl) | 1ULL << NV_MC_SMMU_VADDR_TRANSLATION_BIT; } #endif return result; } static int update_gmmu_ptes_locked(struct vm_gk20a *vm, enum gmmu_pgsz_gk20a pgsz_idx, struct sg_table *sgt, u64 buffer_offset, u64 first_vaddr, u64 last_vaddr, u8 kind_v, u32 ctag_offset, bool cacheable, int rw_flag) { int err; u32 pde_lo, pde_hi, pde_i; struct scatterlist *cur_chunk; unsigned int cur_offset; u32 pte_w[2] = {0, 0}; /* invalid pte */ u32 ctag = ctag_offset; u32 ctag_incr; u32 page_size = gmmu_page_sizes[pgsz_idx]; u64 addr = 0; u64 space_to_skip = buffer_offset; bool set_tlb_dirty = false; pde_range_from_vaddr_range(vm, first_vaddr, last_vaddr, &pde_lo, &pde_hi); gk20a_dbg(gpu_dbg_pte, "size_idx=%d, pde_lo=%d, pde_hi=%d", pgsz_idx, pde_lo, pde_hi); /* If ctag_offset !=0 add 1 else add 0. The idea is to avoid a branch * below (per-pte). Note: this doesn't work unless page size (when * comptags are active) is 128KB. We have checks elsewhere for that. */ ctag_incr = !!ctag_offset; cur_offset = 0; if (sgt) { cur_chunk = sgt->sgl; /* space_to_skip must be page aligned */ BUG_ON(space_to_skip & (page_size - 1)); while (space_to_skip > 0 && cur_chunk) { u64 new_addr = gk20a_mm_iova_addr(cur_chunk); if (new_addr) { addr = new_addr; addr += cur_offset; } cur_offset += page_size; addr += page_size; while (cur_chunk && cur_offset >= cur_chunk->length) { cur_offset -= cur_chunk->length; cur_chunk = sg_next(cur_chunk); } space_to_skip -= page_size; } } else cur_chunk = NULL; for (pde_i = pde_lo; pde_i <= pde_hi; pde_i++) { u32 pte_lo, pte_hi; u32 pte_cur; void *pte_kv_cur; struct page_table_gk20a *pte = vm->pdes.ptes[pgsz_idx] + pde_i; set_tlb_dirty = true; if (pde_i == pde_lo) pte_lo = pte_index_from_vaddr(vm, first_vaddr, pgsz_idx); else pte_lo = 0; if ((pde_i != pde_hi) && (pde_hi != pde_lo)) pte_hi = vm->mm->page_table_sizing[pgsz_idx].num_ptes-1; else pte_hi = pte_index_from_vaddr(vm, last_vaddr, pgsz_idx); /* get cpu access to the ptes */ err = map_gmmu_pages(pte->ref, pte->sgt, &pte_kv_cur, pte->size); if (err) { gk20a_err(dev_from_vm(vm), "couldn't map ptes for update as=%d pte_ref_cnt=%d", vm_aspace_id(vm), pte->ref_cnt); goto clean_up; } gk20a_dbg(gpu_dbg_pte, "pte_lo=%d, pte_hi=%d", pte_lo, pte_hi); for (pte_cur = pte_lo; pte_cur <= pte_hi; pte_cur++) { if (likely(sgt)) { u64 new_addr = gk20a_mm_iova_addr(cur_chunk); if (new_addr) { addr = new_addr; addr += cur_offset; } pte_w[0] = gmmu_pte_valid_true_f() | gmmu_pte_address_sys_f(addr >> gmmu_pte_address_shift_v()); pte_w[1] = gmmu_pte_aperture_video_memory_f() | gmmu_pte_kind_f(kind_v) | gmmu_pte_comptagline_f(ctag); if (rw_flag == gk20a_mem_flag_read_only) { pte_w[0] |= gmmu_pte_read_only_true_f(); pte_w[1] |= gmmu_pte_write_disable_true_f(); } else if (rw_flag == gk20a_mem_flag_write_only) { pte_w[1] |= gmmu_pte_read_disable_true_f(); } if (!cacheable) pte_w[1] |= gmmu_pte_vol_true_f(); pte->ref_cnt++; gk20a_dbg(gpu_dbg_pte, "pte_cur=%d addr=0x%x,%08x kind=%d" " ctag=%d vol=%d refs=%d" " [0x%08x,0x%08x]", pte_cur, hi32(addr), lo32(addr), kind_v, ctag, !cacheable, pte->ref_cnt, pte_w[1], pte_w[0]); ctag += ctag_incr; cur_offset += page_size; addr += page_size; while (cur_chunk && cur_offset >= cur_chunk->length) { cur_offset -= cur_chunk->length; cur_chunk = sg_next(cur_chunk); } } else { pte->ref_cnt--; gk20a_dbg(gpu_dbg_pte, "pte_cur=%d ref=%d [0x0,0x0]", pte_cur, pte->ref_cnt); } gk20a_mem_wr32(pte_kv_cur + pte_cur*8, 0, pte_w[0]); gk20a_mem_wr32(pte_kv_cur + pte_cur*8, 1, pte_w[1]); } unmap_gmmu_pages(pte->ref, pte->sgt, pte_kv_cur); if (pte->ref_cnt == 0) { void *pte_ref_ptr = pte->ref; /* It can make sense to keep around one page table for * each flavor (empty)... in case a new map is coming * right back to alloc (and fill it in) again. * But: deferring unmapping should help with pathologic * unmap/map/unmap/map cases where we'd trigger pte * free/alloc/free/alloc. */ pte->ref = NULL; /* rewrite pde */ update_gmmu_pde_locked(vm, pde_i); __gk20a_mm_tlb_invalidate(vm); set_tlb_dirty = false; free_gmmu_pages(vm, pte_ref_ptr, pte->sgt, vm->mm->page_table_sizing[pgsz_idx].order, pte->size); } } smp_mb(); if (set_tlb_dirty) { vm->tlb_dirty = true; gk20a_dbg_fn("set tlb dirty"); } return 0; clean_up: /*TBD: potentially rewrite above to pre-map everything it needs to * as that's the only way it can fail */ return err; } /* for gk20a the "video memory" apertures here are misnomers. */ static inline u32 big_valid_pde0_bits(u64 pte_addr) { u32 pde0_bits = gmmu_pde_aperture_big_video_memory_f() | gmmu_pde_address_big_sys_f( (u32)(pte_addr >> gmmu_pde_address_shift_v())); return pde0_bits; } static inline u32 small_valid_pde1_bits(u64 pte_addr) { u32 pde1_bits = gmmu_pde_aperture_small_video_memory_f() | gmmu_pde_vol_small_true_f() | /* tbd: why? */ gmmu_pde_address_small_sys_f( (u32)(pte_addr >> gmmu_pde_address_shift_v())); return pde1_bits; } /* Given the current state of the ptes associated with a pde, determine value and write it out. There's no checking here to determine whether or not a change was actually made. So, superfluous updates will cause unnecessary pde invalidations. */ static void update_gmmu_pde_locked(struct vm_gk20a *vm, u32 i) { bool small_valid, big_valid; u64 pte_addr[2] = {0, 0}; struct page_table_gk20a *small_pte = vm->pdes.ptes[gmmu_page_size_small] + i; struct page_table_gk20a *big_pte = vm->pdes.ptes[gmmu_page_size_big] + i; u32 pde_v[2] = {0, 0}; u32 *pde; small_valid = small_pte && small_pte->ref; big_valid = big_pte && big_pte->ref; if (small_valid) pte_addr[gmmu_page_size_small] = gk20a_mm_iova_addr(small_pte->sgt->sgl); if (big_valid) pte_addr[gmmu_page_size_big] = gk20a_mm_iova_addr(big_pte->sgt->sgl); pde_v[0] = gmmu_pde_size_full_f(); pde_v[0] |= big_valid ? big_valid_pde0_bits(pte_addr[gmmu_page_size_big]) : (gmmu_pde_aperture_big_invalid_f()); pde_v[1] |= (small_valid ? small_valid_pde1_bits(pte_addr[gmmu_page_size_small]) : (gmmu_pde_aperture_small_invalid_f() | gmmu_pde_vol_small_false_f()) ) | (big_valid ? (gmmu_pde_vol_big_true_f()) : gmmu_pde_vol_big_false_f()); pde = pde_from_index(vm, i); gk20a_mem_wr32(pde, 0, pde_v[0]); gk20a_mem_wr32(pde, 1, pde_v[1]); smp_mb(); FLUSH_CPU_DCACHE(pde, sg_phys(vm->pdes.sgt->sgl) + (i*gmmu_pde__size_v()), sizeof(u32)*2); gk20a_mm_l2_invalidate(vm->mm->g); gk20a_dbg(gpu_dbg_pte, "pde:%d = 0x%x,0x%08x\n", i, pde_v[1], pde_v[0]); vm->tlb_dirty = true; } static int gk20a_vm_put_empty(struct vm_gk20a *vm, u64 vaddr, u32 num_pages, u32 pgsz_idx) { struct mm_gk20a *mm = vm->mm; struct gk20a *g = mm->g; u32 pgsz = gmmu_page_sizes[pgsz_idx]; u32 i; dma_addr_t iova; /* allocate the zero page if the va does not already have one */ if (!vm->zero_page_cpuva) { int err = 0; vm->zero_page_cpuva = dma_alloc_coherent(&g->dev->dev, mm->big_page_size, &iova, GFP_KERNEL); if (!vm->zero_page_cpuva) { dev_err(&g->dev->dev, "failed to allocate zero page\n"); return -ENOMEM; } vm->zero_page_iova = iova; err = gk20a_get_sgtable(&g->dev->dev, &vm->zero_page_sgt, vm->zero_page_cpuva, vm->zero_page_iova, mm->big_page_size); if (err) { dma_free_coherent(&g->dev->dev, mm->big_page_size, vm->zero_page_cpuva, vm->zero_page_iova); vm->zero_page_iova = 0; vm->zero_page_cpuva = NULL; dev_err(&g->dev->dev, "failed to create sg table for zero page\n"); return -ENOMEM; } } for (i = 0; i < num_pages; i++) { u64 page_vaddr = __locked_gmmu_map(vm, vaddr, vm->zero_page_sgt, 0, pgsz, pgsz_idx, 0, 0, NVHOST_AS_ALLOC_SPACE_FLAGS_FIXED_OFFSET, gk20a_mem_flag_none); if (!page_vaddr) { gk20a_err(dev_from_vm(vm), "failed to remap clean buffers!"); goto err_unmap; } vaddr += pgsz; } return 0; err_unmap: WARN_ON(1); /* something went wrong. unmap pages */ while (i--) { vaddr -= pgsz; __locked_gmmu_unmap(vm, vaddr, pgsz, pgsz_idx, 0, gk20a_mem_flag_none); } return -EINVAL; } /* NOTE! mapped_buffers lock must be held */ static void gk20a_vm_unmap_locked(struct mapped_buffer_node *mapped_buffer) { struct vm_gk20a *vm = mapped_buffer->vm; if (mapped_buffer->va_node && mapped_buffer->va_node->sparse) { u64 vaddr = mapped_buffer->addr; u32 pgsz_idx = mapped_buffer->pgsz_idx; u32 num_pages = mapped_buffer->size >> gmmu_page_shifts[pgsz_idx]; /* there is little we can do if this fails... */ gk20a_vm_put_empty(vm, vaddr, num_pages, pgsz_idx); } else __locked_gmmu_unmap(vm, mapped_buffer->addr, mapped_buffer->size, mapped_buffer->pgsz_idx, mapped_buffer->va_allocated, gk20a_mem_flag_none); gk20a_dbg(gpu_dbg_map, "as=%d pgsz=%d gv=0x%x,%08x own_mem_ref=%d", vm_aspace_id(vm), gmmu_page_sizes[mapped_buffer->pgsz_idx], hi32(mapped_buffer->addr), lo32(mapped_buffer->addr), mapped_buffer->own_mem_ref); gk20a_mm_unpin(dev_from_vm(vm), mapped_buffer->dmabuf, mapped_buffer->sgt); /* remove from mapped buffer tree and remove list, free */ rb_erase(&mapped_buffer->node, &vm->mapped_buffers); if (!list_empty(&mapped_buffer->va_buffers_list)) list_del(&mapped_buffer->va_buffers_list); /* keep track of mapped buffers */ if (mapped_buffer->user_mapped) vm->num_user_mapped_buffers--; if (mapped_buffer->own_mem_ref) dma_buf_put(mapped_buffer->dmabuf); kfree(mapped_buffer); return; } void gk20a_vm_unmap(struct vm_gk20a *vm, u64 offset) { struct device *d = dev_from_vm(vm); struct mapped_buffer_node *mapped_buffer; mutex_lock(&vm->update_gmmu_lock); mapped_buffer = find_mapped_buffer_locked(&vm->mapped_buffers, offset); if (!mapped_buffer) { mutex_unlock(&vm->update_gmmu_lock); gk20a_err(d, "invalid addr to unmap 0x%llx", offset); return; } kref_put(&mapped_buffer->ref, gk20a_vm_unmap_locked_kref); mutex_unlock(&vm->update_gmmu_lock); } static void gk20a_vm_remove_support(struct vm_gk20a *vm) { struct gk20a *g = vm->mm->g; struct mapped_buffer_node *mapped_buffer; struct vm_reserved_va_node *va_node, *va_node_tmp; struct rb_node *node; int i; gk20a_dbg_fn(""); mutex_lock(&vm->update_gmmu_lock); /* TBD: add a flag here for the unmap code to recognize teardown * and short-circuit any otherwise expensive operations. */ node = rb_first(&vm->mapped_buffers); while (node) { mapped_buffer = container_of(node, struct mapped_buffer_node, node); gk20a_vm_unmap_locked(mapped_buffer); node = rb_first(&vm->mapped_buffers); } /* destroy remaining reserved memory areas */ list_for_each_entry_safe(va_node, va_node_tmp, &vm->reserved_va_list, reserved_va_list) { list_del(&va_node->reserved_va_list); kfree(va_node); } /* unmapping all buffers above may not actually free * all vm ptes. jettison them here for certain... */ for (i = 0; i < vm->pdes.num_pdes; i++) { struct page_table_gk20a *pte = &vm->pdes.ptes[gmmu_page_size_small][i]; if (pte->ref) { free_gmmu_pages(vm, pte->ref, pte->sgt, vm->mm->page_table_sizing[gmmu_page_size_small].order, pte->size); pte->ref = NULL; } pte = &vm->pdes.ptes[gmmu_page_size_big][i]; if (pte->ref) { free_gmmu_pages(vm, pte->ref, pte->sgt, vm->mm->page_table_sizing[gmmu_page_size_big].order, pte->size); pte->ref = NULL; } } unmap_gmmu_pages(vm->pdes.ref, vm->pdes.sgt, vm->pdes.kv); free_gmmu_pages(vm, vm->pdes.ref, vm->pdes.sgt, 0, vm->pdes.size); kfree(vm->pdes.ptes[gmmu_page_size_small]); kfree(vm->pdes.ptes[gmmu_page_size_big]); gk20a_allocator_destroy(&vm->vma[gmmu_page_size_small]); gk20a_allocator_destroy(&vm->vma[gmmu_page_size_big]); mutex_unlock(&vm->update_gmmu_lock); /* release zero page if used */ if (vm->zero_page_cpuva) dma_free_coherent(&g->dev->dev, vm->mm->big_page_size, vm->zero_page_cpuva, vm->zero_page_iova); /* vm is not used anymore. release it. */ kfree(vm); } static void gk20a_vm_remove_support_kref(struct kref *ref) { struct vm_gk20a *vm = container_of(ref, struct vm_gk20a, ref); gk20a_vm_remove_support(vm); } void gk20a_vm_get(struct vm_gk20a *vm) { kref_get(&vm->ref); } void gk20a_vm_put(struct vm_gk20a *vm) { kref_put(&vm->ref, gk20a_vm_remove_support_kref); } /* address space interfaces for the gk20a module */ int gk20a_vm_alloc_share(struct gk20a_as_share *as_share) { struct gk20a_as *as = as_share->as; struct gk20a *g = gk20a_from_as(as); struct mm_gk20a *mm = &g->mm; struct vm_gk20a *vm; u64 vma_size; u32 num_pages, low_hole_pages; char name[32]; int err; gk20a_dbg_fn(""); vm = kzalloc(sizeof(*vm), GFP_KERNEL); if (!vm) return -ENOMEM; as_share->vm = vm; vm->mm = mm; vm->as_share = as_share; vm->big_pages = true; vm->va_start = mm->pde_stride; /* create a one pde hole */ vm->va_limit = mm->channel.size; /* note this means channel.size is really just the max */ { u32 pde_lo, pde_hi; pde_range_from_vaddr_range(vm, 0, vm->va_limit-1, &pde_lo, &pde_hi); vm->pdes.num_pdes = pde_hi + 1; } vm->pdes.ptes[gmmu_page_size_small] = kzalloc(sizeof(struct page_table_gk20a) * vm->pdes.num_pdes, GFP_KERNEL); vm->pdes.ptes[gmmu_page_size_big] = kzalloc(sizeof(struct page_table_gk20a) * vm->pdes.num_pdes, GFP_KERNEL); if (!(vm->pdes.ptes[gmmu_page_size_small] && vm->pdes.ptes[gmmu_page_size_big])) return -ENOMEM; gk20a_dbg_info("init space for va_limit=0x%llx num_pdes=%d", vm->va_limit, vm->pdes.num_pdes); /* allocate the page table directory */ err = alloc_gmmu_pages(vm, 0, &vm->pdes.ref, &vm->pdes.sgt, &vm->pdes.size); if (err) return -ENOMEM; err = map_gmmu_pages(vm->pdes.ref, vm->pdes.sgt, &vm->pdes.kv, vm->pdes.size); if (err) { free_gmmu_pages(vm, vm->pdes.ref, vm->pdes.sgt, 0, vm->pdes.size); return -ENOMEM; } gk20a_dbg(gpu_dbg_pte, "pdes.kv = 0x%p, pdes.phys = 0x%llx", vm->pdes.kv, gk20a_mm_iova_addr(vm->pdes.sgt->sgl)); /* we could release vm->pdes.kv but it's only one page... */ /* low-half: alloc small pages */ /* high-half: alloc big pages */ vma_size = mm->channel.size >> 1; snprintf(name, sizeof(name), "gk20a_as_%d-%dKB", as_share->id, gmmu_page_sizes[gmmu_page_size_small]>>10); num_pages = (u32)(vma_size >> gmmu_page_shifts[gmmu_page_size_small]); /* num_pages above is without regard to the low-side hole. */ low_hole_pages = (vm->va_start >> gmmu_page_shifts[gmmu_page_size_small]); gk20a_allocator_init(&vm->vma[gmmu_page_size_small], name, low_hole_pages, /* start */ num_pages - low_hole_pages, /* length */ 1); /* align */ snprintf(name, sizeof(name), "gk20a_as_%d-%dKB", as_share->id, gmmu_page_sizes[gmmu_page_size_big]>>10); num_pages = (u32)(vma_size >> gmmu_page_shifts[gmmu_page_size_big]); gk20a_allocator_init(&vm->vma[gmmu_page_size_big], name, num_pages, /* start */ num_pages, /* length */ 1); /* align */ vm->mapped_buffers = RB_ROOT; mutex_init(&vm->update_gmmu_lock); kref_init(&vm->ref); INIT_LIST_HEAD(&vm->reserved_va_list); vm->enable_ctag = true; return 0; } int gk20a_vm_release_share(struct gk20a_as_share *as_share) { struct vm_gk20a *vm = as_share->vm; gk20a_dbg_fn(""); vm->as_share = NULL; /* put as reference to vm */ gk20a_vm_put(vm); as_share->vm = NULL; return 0; } int gk20a_vm_alloc_space(struct gk20a_as_share *as_share, struct nvhost_as_alloc_space_args *args) { int err = -ENOMEM; int pgsz_idx; u32 start_page_nr; struct gk20a_allocator *vma; struct vm_gk20a *vm = as_share->vm; struct vm_reserved_va_node *va_node; u64 vaddr_start = 0; gk20a_dbg_fn("flags=0x%x pgsz=0x%x nr_pages=0x%x o/a=0x%llx", args->flags, args->page_size, args->pages, args->o_a.offset); /* determine pagesz idx */ for (pgsz_idx = gmmu_page_size_small; pgsz_idx < gmmu_nr_page_sizes; pgsz_idx++) { if (gmmu_page_sizes[pgsz_idx] == args->page_size) break; } if (pgsz_idx >= gmmu_nr_page_sizes) { err = -EINVAL; goto clean_up; } va_node = kzalloc(sizeof(*va_node), GFP_KERNEL); if (!va_node) { err = -ENOMEM; goto clean_up; } if (args->flags & NVHOST_AS_ALLOC_SPACE_FLAGS_SPARSE && pgsz_idx != gmmu_page_size_big) { err = -ENOSYS; kfree(va_node); goto clean_up; } start_page_nr = 0; if (args->flags & NVHOST_AS_ALLOC_SPACE_FLAGS_FIXED_OFFSET) start_page_nr = (u32)(args->o_a.offset >> gmmu_page_shifts[pgsz_idx]); vma = &vm->vma[pgsz_idx]; err = vma->alloc(vma, &start_page_nr, args->pages); if (err) { kfree(va_node); goto clean_up; } vaddr_start = (u64)start_page_nr << gmmu_page_shifts[pgsz_idx]; va_node->vaddr_start = vaddr_start; va_node->size = (u64)args->page_size * (u64)args->pages; va_node->pgsz_idx = args->page_size; INIT_LIST_HEAD(&va_node->va_buffers_list); INIT_LIST_HEAD(&va_node->reserved_va_list); mutex_lock(&vm->update_gmmu_lock); /* mark that we need to use sparse mappings here */ if (args->flags & NVHOST_AS_ALLOC_SPACE_FLAGS_SPARSE) { err = gk20a_vm_put_empty(vm, vaddr_start, args->pages, pgsz_idx); if (err) { mutex_unlock(&vm->update_gmmu_lock); vma->free(vma, start_page_nr, args->pages); kfree(va_node); goto clean_up; } va_node->sparse = true; } list_add_tail(&va_node->reserved_va_list, &vm->reserved_va_list); mutex_unlock(&vm->update_gmmu_lock); args->o_a.offset = vaddr_start; clean_up: return err; } int gk20a_vm_free_space(struct gk20a_as_share *as_share, struct nvhost_as_free_space_args *args) { int err = -ENOMEM; int pgsz_idx; u32 start_page_nr; struct gk20a_allocator *vma; struct vm_gk20a *vm = as_share->vm; struct vm_reserved_va_node *va_node; gk20a_dbg_fn("pgsz=0x%x nr_pages=0x%x o/a=0x%llx", args->page_size, args->pages, args->offset); /* determine pagesz idx */ for (pgsz_idx = gmmu_page_size_small; pgsz_idx < gmmu_nr_page_sizes; pgsz_idx++) { if (gmmu_page_sizes[pgsz_idx] == args->page_size) break; } if (pgsz_idx >= gmmu_nr_page_sizes) { err = -EINVAL; goto clean_up; } start_page_nr = (u32)(args->offset >> gmmu_page_shifts[pgsz_idx]); vma = &vm->vma[pgsz_idx]; err = vma->free(vma, start_page_nr, args->pages); if (err) goto clean_up; mutex_lock(&vm->update_gmmu_lock); va_node = addr_to_reservation(vm, args->offset); if (va_node) { struct mapped_buffer_node *buffer; /* there is no need to unallocate the buffers in va. Just * convert them into normal buffers */ list_for_each_entry(buffer, &va_node->va_buffers_list, va_buffers_list) list_del_init(&buffer->va_buffers_list); list_del(&va_node->reserved_va_list); /* if this was a sparse mapping, free the va */ if (va_node->sparse) __locked_gmmu_unmap(vm, va_node->vaddr_start, va_node->size, va_node->pgsz_idx, false, gk20a_mem_flag_none); kfree(va_node); } mutex_unlock(&vm->update_gmmu_lock); clean_up: return err; } int gk20a_vm_bind_channel(struct gk20a_as_share *as_share, struct channel_gk20a *ch) { int err = 0; struct vm_gk20a *vm = as_share->vm; gk20a_dbg_fn(""); ch->vm = vm; err = channel_gk20a_commit_va(ch); if (err) ch->vm = 0; return err; } int gk20a_dmabuf_alloc_drvdata(struct dma_buf *dmabuf, struct device *dev) { struct gk20a_dmabuf_priv *priv; static DEFINE_MUTEX(priv_lock); priv = dma_buf_get_drvdata(dmabuf, dev); if (likely(priv)) return 0; mutex_lock(&priv_lock); priv = dma_buf_get_drvdata(dmabuf, dev); if (priv) goto priv_exist_or_err; priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) { priv = ERR_PTR(-ENOMEM); goto priv_exist_or_err; } mutex_init(&priv->lock); dma_buf_set_drvdata(dmabuf, dev, priv, gk20a_mm_delete_priv); priv_exist_or_err: mutex_unlock(&priv_lock); if (IS_ERR(priv)) return -ENOMEM; return 0; } static int gk20a_dmabuf_get_kind(struct dma_buf *dmabuf) { int kind = 0; #ifdef CONFIG_TEGRA_NVMAP int err; u64 nvmap_param; err = nvmap_get_dmabuf_param(dmabuf, NVMAP_HANDLE_PARAM_KIND, &nvmap_param); kind = err ? kind : nvmap_param; #endif return kind; } int gk20a_vm_map_buffer(struct gk20a_as_share *as_share, int dmabuf_fd, u64 *offset_align, u32 flags, /*NVHOST_AS_MAP_BUFFER_FLAGS_*/ int kind, u64 buffer_offset, u64 mapping_size) { int err = 0; struct vm_gk20a *vm = as_share->vm; struct dma_buf *dmabuf; u64 ret_va; gk20a_dbg_fn(""); /* get ref to the mem handle (released on unmap_locked) */ dmabuf = dma_buf_get(dmabuf_fd); if (!dmabuf) return 0; err = gk20a_dmabuf_alloc_drvdata(dmabuf, dev_from_vm(vm)); if (err) { dma_buf_put(dmabuf); return err; } if (kind == -1) kind = gk20a_dmabuf_get_kind(dmabuf); ret_va = gk20a_vm_map(vm, dmabuf, *offset_align, flags, kind, NULL, true, gk20a_mem_flag_none, buffer_offset, mapping_size); *offset_align = ret_va; if (!ret_va) { dma_buf_put(dmabuf); err = -EINVAL; } return err; } int gk20a_vm_unmap_buffer(struct gk20a_as_share *as_share, u64 offset) { struct vm_gk20a *vm = as_share->vm; gk20a_dbg_fn(""); gk20a_vm_unmap_user(vm, offset); return 0; } int gk20a_init_bar1_vm(struct mm_gk20a *mm) { int err; phys_addr_t inst_pa; void *inst_ptr; struct vm_gk20a *vm = &mm->bar1.vm; struct gk20a *g = gk20a_from_mm(mm); struct device *d = dev_from_gk20a(g); struct inst_desc *inst_block = &mm->bar1.inst_block; u64 pde_addr; u32 pde_addr_lo; u32 pde_addr_hi; dma_addr_t iova; vm->mm = mm; mm->bar1.aperture_size = bar1_aperture_size_mb_gk20a() << 20; gk20a_dbg_info("bar1 vm size = 0x%x", mm->bar1.aperture_size); vm->va_start = mm->pde_stride * 1; vm->va_limit = mm->bar1.aperture_size; { u32 pde_lo, pde_hi; pde_range_from_vaddr_range(vm, 0, vm->va_limit-1, &pde_lo, &pde_hi); vm->pdes.num_pdes = pde_hi + 1; } /* bar1 is likely only to ever use/need small page sizes. */ /* But just in case, for now... arrange for both.*/ vm->pdes.ptes[gmmu_page_size_small] = kzalloc(sizeof(struct page_table_gk20a) * vm->pdes.num_pdes, GFP_KERNEL); vm->pdes.ptes[gmmu_page_size_big] = kzalloc(sizeof(struct page_table_gk20a) * vm->pdes.num_pdes, GFP_KERNEL); if (!(vm->pdes.ptes[gmmu_page_size_small] && vm->pdes.ptes[gmmu_page_size_big])) return -ENOMEM; gk20a_dbg_info("init space for bar1 va_limit=0x%llx num_pdes=%d", vm->va_limit, vm->pdes.num_pdes); /* allocate the page table directory */ err = alloc_gmmu_pages(vm, 0, &vm->pdes.ref, &vm->pdes.sgt, &vm->pdes.size); if (err) goto clean_up; err = map_gmmu_pages(vm->pdes.ref, vm->pdes.sgt, &vm->pdes.kv, vm->pdes.size); if (err) { free_gmmu_pages(vm, vm->pdes.ref, vm->pdes.sgt, 0, vm->pdes.size); goto clean_up; } gk20a_dbg(gpu_dbg_pte, "bar 1 pdes.kv = 0x%p, pdes.phys = 0x%llx", vm->pdes.kv, gk20a_mm_iova_addr(vm->pdes.sgt->sgl)); /* we could release vm->pdes.kv but it's only one page... */ pde_addr = gk20a_mm_iova_addr(vm->pdes.sgt->sgl); pde_addr_lo = u64_lo32(pde_addr >> 12); pde_addr_hi = u64_hi32(pde_addr); gk20a_dbg_info("pde pa=0x%llx pde_addr_lo=0x%x pde_addr_hi=0x%x", (u64)gk20a_mm_iova_addr(vm->pdes.sgt->sgl), pde_addr_lo, pde_addr_hi); /* allocate instance mem for bar1 */ inst_block->size = ram_in_alloc_size_v(); inst_block->cpuva = dma_alloc_coherent(d, inst_block->size, &iova, GFP_KERNEL); if (!inst_block->cpuva) { gk20a_err(d, "%s: memory allocation failed\n", __func__); err = -ENOMEM; goto clean_up; } inst_block->iova = iova; inst_block->cpu_pa = gk20a_get_phys_from_iova(d, inst_block->iova); if (!inst_block->cpu_pa) { gk20a_err(d, "%s: failed to get phys address\n", __func__); err = -ENOMEM; goto clean_up; } inst_pa = inst_block->cpu_pa; inst_ptr = inst_block->cpuva; gk20a_dbg_info("bar1 inst block physical phys = 0x%llx, kv = 0x%p", (u64)inst_pa, inst_ptr); memset(inst_ptr, 0, ram_fc_size_val_v()); gk20a_mem_wr32(inst_ptr, ram_in_page_dir_base_lo_w(), ram_in_page_dir_base_target_vid_mem_f() | ram_in_page_dir_base_vol_true_f() | ram_in_page_dir_base_lo_f(pde_addr_lo)); gk20a_mem_wr32(inst_ptr, ram_in_page_dir_base_hi_w(), ram_in_page_dir_base_hi_f(pde_addr_hi)); gk20a_mem_wr32(inst_ptr, ram_in_adr_limit_lo_w(), u64_lo32(vm->va_limit) | 0xFFF); gk20a_mem_wr32(inst_ptr, ram_in_adr_limit_hi_w(), ram_in_adr_limit_hi_f(u64_hi32(vm->va_limit))); gk20a_dbg_info("bar1 inst block ptr: %08llx", (u64)inst_pa); gk20a_allocator_init(&vm->vma[gmmu_page_size_small], "gk20a_bar1", 1,/*start*/ (vm->va_limit >> 12) - 1 /* length*/, 1); /* align */ /* initialize just in case we try to use it anyway */ gk20a_allocator_init(&vm->vma[gmmu_page_size_big], "gk20a_bar1-unused", 0x0badc0de, /* start */ 1, /* length */ 1); /* align */ vm->mapped_buffers = RB_ROOT; mutex_init(&vm->update_gmmu_lock); kref_init(&vm->ref); INIT_LIST_HEAD(&vm->reserved_va_list); return 0; clean_up: /* free, etc */ if (inst_block->cpuva) dma_free_coherent(d, inst_block->size, inst_block->cpuva, inst_block->iova); inst_block->cpuva = NULL; inst_block->iova = 0; return err; } /* pmu vm, share channel_vm interfaces */ int gk20a_init_pmu_vm(struct mm_gk20a *mm) { int err; phys_addr_t inst_pa; void *inst_ptr; struct vm_gk20a *vm = &mm->pmu.vm; struct gk20a *g = gk20a_from_mm(mm); struct device *d = dev_from_gk20a(g); struct inst_desc *inst_block = &mm->pmu.inst_block; u64 pde_addr; u32 pde_addr_lo; u32 pde_addr_hi; dma_addr_t iova; vm->mm = mm; mm->pmu.aperture_size = GK20A_PMU_VA_SIZE; gk20a_dbg_info("pmu vm size = 0x%x", mm->pmu.aperture_size); vm->va_start = GK20A_PMU_VA_START; vm->va_limit = vm->va_start + mm->pmu.aperture_size; { u32 pde_lo, pde_hi; pde_range_from_vaddr_range(vm, 0, vm->va_limit-1, &pde_lo, &pde_hi); vm->pdes.num_pdes = pde_hi + 1; } /* The pmu is likely only to ever use/need small page sizes. */ /* But just in case, for now... arrange for both.*/ vm->pdes.ptes[gmmu_page_size_small] = kzalloc(sizeof(struct page_table_gk20a) * vm->pdes.num_pdes, GFP_KERNEL); vm->pdes.ptes[gmmu_page_size_big] = kzalloc(sizeof(struct page_table_gk20a) * vm->pdes.num_pdes, GFP_KERNEL); if (!(vm->pdes.ptes[gmmu_page_size_small] && vm->pdes.ptes[gmmu_page_size_big])) return -ENOMEM; gk20a_dbg_info("init space for pmu va_limit=0x%llx num_pdes=%d", vm->va_limit, vm->pdes.num_pdes); /* allocate the page table directory */ err = alloc_gmmu_pages(vm, 0, &vm->pdes.ref, &vm->pdes.sgt, &vm->pdes.size); if (err) goto clean_up; err = map_gmmu_pages(vm->pdes.ref, vm->pdes.sgt, &vm->pdes.kv, vm->pdes.size); if (err) { free_gmmu_pages(vm, vm->pdes.ref, vm->pdes.sgt, 0, vm->pdes.size); goto clean_up; } gk20a_dbg_info("pmu pdes phys @ 0x%llx", (u64)gk20a_mm_iova_addr(vm->pdes.sgt->sgl)); /* we could release vm->pdes.kv but it's only one page... */ pde_addr = gk20a_mm_iova_addr(vm->pdes.sgt->sgl); pde_addr_lo = u64_lo32(pde_addr >> 12); pde_addr_hi = u64_hi32(pde_addr); gk20a_dbg_info("pde pa=0x%llx pde_addr_lo=0x%x pde_addr_hi=0x%x", (u64)pde_addr, pde_addr_lo, pde_addr_hi); /* allocate instance mem for pmu */ inst_block->size = GK20A_PMU_INST_SIZE; inst_block->cpuva = dma_alloc_coherent(d, inst_block->size, &iova, GFP_KERNEL); if (!inst_block->cpuva) { gk20a_err(d, "%s: memory allocation failed\n", __func__); err = -ENOMEM; goto clean_up; } inst_block->iova = iova; inst_block->cpu_pa = gk20a_get_phys_from_iova(d, inst_block->iova); if (!inst_block->cpu_pa) { gk20a_err(d, "%s: failed to get phys address\n", __func__); err = -ENOMEM; goto clean_up; } inst_pa = inst_block->cpu_pa; inst_ptr = inst_block->cpuva; gk20a_dbg_info("pmu inst block physical addr: 0x%llx", (u64)inst_pa); memset(inst_ptr, 0, GK20A_PMU_INST_SIZE); gk20a_mem_wr32(inst_ptr, ram_in_page_dir_base_lo_w(), ram_in_page_dir_base_target_vid_mem_f() | ram_in_page_dir_base_vol_true_f() | ram_in_page_dir_base_lo_f(pde_addr_lo)); gk20a_mem_wr32(inst_ptr, ram_in_page_dir_base_hi_w(), ram_in_page_dir_base_hi_f(pde_addr_hi)); gk20a_mem_wr32(inst_ptr, ram_in_adr_limit_lo_w(), u64_lo32(vm->va_limit) | 0xFFF); gk20a_mem_wr32(inst_ptr, ram_in_adr_limit_hi_w(), ram_in_adr_limit_hi_f(u64_hi32(vm->va_limit))); gk20a_allocator_init(&vm->vma[gmmu_page_size_small], "gk20a_pmu", (vm->va_start >> 12), /* start */ (vm->va_limit - vm->va_start) >> 12, /*length*/ 1); /* align */ /* initialize just in case we try to use it anyway */ gk20a_allocator_init(&vm->vma[gmmu_page_size_big], "gk20a_pmu-unused", 0x0badc0de, /* start */ 1, /* length */ 1); /* align */ vm->mapped_buffers = RB_ROOT; mutex_init(&vm->update_gmmu_lock); kref_init(&vm->ref); INIT_LIST_HEAD(&vm->reserved_va_list); return 0; clean_up: /* free, etc */ if (inst_block->cpuva) dma_free_coherent(d, inst_block->size, inst_block->cpuva, inst_block->iova); inst_block->cpuva = NULL; inst_block->iova = 0; return err; } int gk20a_mm_fb_flush(struct gk20a *g) { struct mm_gk20a *mm = &g->mm; u32 data; s32 retry = 100; int ret = 0; gk20a_dbg_fn(""); mutex_lock(&mm->l2_op_lock); /* Make sure all previous writes are committed to the L2. There's no guarantee that writes are to DRAM. This will be a sysmembar internal to the L2. */ gk20a_writel(g, flush_fb_flush_r(), flush_fb_flush_pending_busy_f()); do { data = gk20a_readl(g, flush_fb_flush_r()); if (flush_fb_flush_outstanding_v(data) == flush_fb_flush_outstanding_true_v() || flush_fb_flush_pending_v(data) == flush_fb_flush_pending_busy_v()) { gk20a_dbg_info("fb_flush 0x%x", data); retry--; usleep_range(20, 40); } else break; } while (retry >= 0 || !tegra_platform_is_silicon()); if (retry < 0) { gk20a_warn(dev_from_gk20a(g), "fb_flush too many retries"); ret = -EBUSY; } mutex_unlock(&mm->l2_op_lock); return ret; } static void gk20a_mm_l2_invalidate_locked(struct gk20a *g) { u32 data; s32 retry = 200; /* Invalidate any clean lines from the L2 so subsequent reads go to DRAM. Dirty lines are not affected by this operation. */ gk20a_writel(g, flush_l2_system_invalidate_r(), flush_l2_system_invalidate_pending_busy_f()); do { data = gk20a_readl(g, flush_l2_system_invalidate_r()); if (flush_l2_system_invalidate_outstanding_v(data) == flush_l2_system_invalidate_outstanding_true_v() || flush_l2_system_invalidate_pending_v(data) == flush_l2_system_invalidate_pending_busy_v()) { gk20a_dbg_info("l2_system_invalidate 0x%x", data); retry--; usleep_range(20, 40); } else break; } while (retry >= 0 || !tegra_platform_is_silicon()); if (retry < 0) gk20a_warn(dev_from_gk20a(g), "l2_system_invalidate too many retries"); } void gk20a_mm_l2_invalidate(struct gk20a *g) { struct mm_gk20a *mm = &g->mm; mutex_lock(&mm->l2_op_lock); gk20a_mm_l2_invalidate_locked(g); mutex_unlock(&mm->l2_op_lock); } void gk20a_mm_l2_flush(struct gk20a *g, bool invalidate) { struct mm_gk20a *mm = &g->mm; u32 data; s32 retry = 200; gk20a_dbg_fn(""); mutex_lock(&mm->l2_op_lock); /* Flush all dirty lines from the L2 to DRAM. Lines are left in the L2 as clean, so subsequent reads might hit in the L2. */ gk20a_writel(g, flush_l2_flush_dirty_r(), flush_l2_flush_dirty_pending_busy_f()); do { data = gk20a_readl(g, flush_l2_flush_dirty_r()); if (flush_l2_flush_dirty_outstanding_v(data) == flush_l2_flush_dirty_outstanding_true_v() || flush_l2_flush_dirty_pending_v(data) == flush_l2_flush_dirty_pending_busy_v()) { gk20a_dbg_info("l2_flush_dirty 0x%x", data); retry--; usleep_range(20, 40); } else break; } while (retry >= 0 || !tegra_platform_is_silicon()); if (retry < 0) gk20a_warn(dev_from_gk20a(g), "l2_flush_dirty too many retries"); if (invalidate) gk20a_mm_l2_invalidate_locked(g); mutex_unlock(&mm->l2_op_lock); } int gk20a_vm_find_buffer(struct vm_gk20a *vm, u64 gpu_va, struct dma_buf **dmabuf, u64 *offset) { struct mapped_buffer_node *mapped_buffer; gk20a_dbg_fn("gpu_va=0x%llx", gpu_va); mutex_lock(&vm->update_gmmu_lock); mapped_buffer = find_mapped_buffer_range_locked(&vm->mapped_buffers, gpu_va); if (!mapped_buffer) { mutex_unlock(&vm->update_gmmu_lock); return -EINVAL; } *dmabuf = mapped_buffer->dmabuf; *offset = gpu_va - mapped_buffer->addr; mutex_unlock(&vm->update_gmmu_lock); return 0; } void __gk20a_mm_tlb_invalidate(struct vm_gk20a *vm) { struct gk20a *g = gk20a_from_vm(vm); u32 addr_lo = u64_lo32(gk20a_mm_iova_addr(vm->pdes.sgt->sgl) >> 12); u32 data; s32 retry = 200; static DEFINE_MUTEX(tlb_lock); gk20a_dbg_fn(""); if (!g->power_on) return; mutex_lock(&tlb_lock); do { data = gk20a_readl(g, fb_mmu_ctrl_r()); if (fb_mmu_ctrl_pri_fifo_space_v(data) != 0) break; usleep_range(20, 40); retry--; } while (retry >= 0 || !tegra_platform_is_silicon()); if (retry < 0) { gk20a_warn(dev_from_gk20a(g), "wait mmu fifo space too many retries"); goto out; } gk20a_writel(g, fb_mmu_invalidate_pdb_r(), fb_mmu_invalidate_pdb_addr_f(addr_lo) | fb_mmu_invalidate_pdb_aperture_vid_mem_f()); gk20a_writel(g, fb_mmu_invalidate_r(), fb_mmu_invalidate_all_va_true_f() | fb_mmu_invalidate_trigger_true_f()); do { data = gk20a_readl(g, fb_mmu_ctrl_r()); if (fb_mmu_ctrl_pri_fifo_empty_v(data) != fb_mmu_ctrl_pri_fifo_empty_false_f()) break; retry--; usleep_range(20, 40); } while (retry >= 0 || !tegra_platform_is_silicon()); if (retry < 0) gk20a_warn(dev_from_gk20a(g), "mmu invalidate too many retries"); out: mutex_unlock(&tlb_lock); } void gk20a_mm_tlb_invalidate(struct vm_gk20a *vm) { struct gk20a *g = gk20a_from_vm(vm); gk20a_dbg_fn(""); /* pagetables are considered sw states which are preserved after prepare_poweroff. When gk20a deinit releases those pagetables, common code in vm unmap path calls tlb invalidate that touches hw. Use the power_on flag to skip tlb invalidation when gpu power is turned off */ if (!g->power_on) return; /* No need to invalidate if tlb is clean */ mutex_lock(&vm->update_gmmu_lock); if (!vm->tlb_dirty) { mutex_unlock(&vm->update_gmmu_lock); return; } vm->tlb_dirty = false; mutex_unlock(&vm->update_gmmu_lock); __gk20a_mm_tlb_invalidate(vm); } int gk20a_mm_suspend(struct gk20a *g) { gk20a_dbg_fn(""); g->ops.ltc.elpg_flush(g); gk20a_dbg_fn("done"); return 0; } void gk20a_mm_ltc_isr(struct gk20a *g) { u32 intr; intr = gk20a_readl(g, ltc_ltc0_ltss_intr_r()); gk20a_err(dev_from_gk20a(g), "ltc: %08x\n", intr); gk20a_writel(g, ltc_ltc0_ltss_intr_r(), intr); } bool gk20a_mm_mmu_debug_mode_enabled(struct gk20a *g) { u32 debug_ctrl = gk20a_readl(g, fb_mmu_debug_ctrl_r()); return fb_mmu_debug_ctrl_debug_v(debug_ctrl) == fb_mmu_debug_ctrl_debug_enabled_v(); }
libing64/manifold_linux
drivers/gpu/nvgpu/gk20a/mm_gk20a.c
C
gpl-2.0
77,416
[ 30522, 1013, 1008, 1008, 6853, 1013, 2678, 1013, 8915, 17643, 1013, 3677, 1013, 1043, 2243, 11387, 2050, 1013, 3461, 1035, 1043, 2243, 11387, 2050, 1012, 1039, 1008, 1008, 1043, 2243, 11387, 2050, 3638, 2968, 1008, 1008, 9385, 1006, 1039, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace App\Modules\Friends\Providers; use App; use Illuminate\Support\ServiceProvider; use Lang; use View; class ModuleServiceProvider extends ServiceProvider { public function register() { App::register('App\Modules\Friends\Providers\RouteServiceProvider'); Lang::addNamespace('friends', realpath(__DIR__.'/../Resources/Lang')); View::addNamespace('friends', realpath(__DIR__.'/../Resources/Views')); } }
Contentify/Contentify
app/Modules/Friends/Providers/ModuleServiceProvider.php
PHP
mit
457
[ 30522, 1026, 1029, 25718, 3415, 15327, 10439, 1032, 14184, 1032, 2814, 1032, 11670, 1025, 2224, 10439, 1025, 2224, 5665, 12717, 12556, 1032, 2490, 1032, 2326, 21572, 17258, 2121, 1025, 2224, 11374, 1025, 2224, 3193, 1025, 2465, 14184, 2121, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE415_Double_Free__new_delete_long_41.cpp Label Definition File: CWE415_Double_Free__new_delete.label.xml Template File: sources-sinks-41.tmpl.cpp */ /* * @description * CWE: 415 Double Free * BadSource: Allocate data using new and Deallocae data using delete * GoodSource: Allocate data using new * Sinks: * GoodSink: do nothing * BadSink : Deallocate data using delete * Flow Variant: 41 Data flow: data passed as an argument from one function to another in the same source file * * */ #include "std_testcase.h" #include <wchar.h> namespace CWE415_Double_Free__new_delete_long_41 { #ifndef OMITBAD static void badSink(long * data) { /* POTENTIAL FLAW: Possibly deleting memory twice */ delete data; } void bad() { long * data; /* Initialize data */ data = NULL; data = new long; /* POTENTIAL FLAW: delete data in the source - the bad sink deletes data as well */ delete data; badSink(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B() uses the GoodSource with the BadSink */ static void goodG2BSink(long * data) { /* POTENTIAL FLAW: Possibly deleting memory twice */ delete data; } static void goodG2B() { long * data; /* Initialize data */ data = NULL; data = new long; /* FIX: Do NOT delete data in the source - the bad sink deletes data */ goodG2BSink(data); } /* goodB2G() uses the BadSource with the GoodSink */ static void goodB2GSink(long * data) { /* do nothing */ /* FIX: Don't attempt to delete the memory */ ; /* empty statement needed for some flow variants */ } static void goodB2G() { long * data; /* Initialize data */ data = NULL; data = new long; /* POTENTIAL FLAW: delete data in the source - the bad sink deletes data as well */ delete data; goodB2GSink(data); } void good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE415_Double_Free__new_delete_long_41; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
JianpingZeng/xcc
xcc/test/juliet/testcases/CWE415_Double_Free/s02/CWE415_Double_Free__new_delete_long_41.cpp
C++
bsd-3-clause
2,863
[ 30522, 1013, 1008, 23561, 7013, 3231, 18382, 5371, 5371, 18442, 1024, 19296, 2063, 23632, 2629, 1035, 3313, 1035, 2489, 1035, 1035, 2047, 1035, 3972, 12870, 1035, 2146, 1035, 4601, 1012, 18133, 2361, 3830, 6210, 5371, 1024, 19296, 2063, 236...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
.boxHeader{ width:100%; height: 20%; display: flex; justify-content: space-around; border-bottom:1px solid gray; align-items: center; color:black; } .boxHeader h1{ font-size:1.5rem; opacity: 0.5; color:#AD95D5 } .boxHeader button{ display: flex; justify-content: center; align-items: center; height: 30px; width:35px; } .boxHeader small{ font-size:0.8rem; } .event{ border-bottom: 1px solid gray; border-top:4rem; width:100%; } .event ul { display: flex; flex-direction: column; width:100%; justify-content: center; align-items: center; } .meetings{ width:100%; display: flex; height:60%; justify-content: center; } .meetings .event-name{ font-size:1.1rem; color: black; font-family: leto; padding-top:5px; } .event-date{ opacity: 0.5; font-family: 0.7rem; font-family: raleway; color:black; } .event-time{ opacity: 0.5; font-family: raleway; font-size:0.5rem; color:black; }
gilhoffman/starterpack
src/app/dashboard/dash-meeting-box/dash-meeting-box.component.css
CSS
mit
954
[ 30522, 1012, 3482, 4974, 2121, 1063, 9381, 1024, 2531, 1003, 1025, 4578, 1024, 2322, 1003, 1025, 4653, 1024, 23951, 1025, 16114, 1011, 4180, 1024, 2686, 1011, 2105, 1025, 3675, 1011, 3953, 1024, 1015, 2361, 2595, 5024, 3897, 1025, 25705, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/module.h> #include <linux/interrupt.h> #include <linux/spinlock.h> #include <linux/delay.h> #include <linux/io.h> #include <linux/dma-mapping.h> #include <linux/slab.h> #include <linux/iopoll.h> #include <linux/interrupt.h> #include <linux/of_device.h> #include "dsi_v2.h" #include "dsi_io_v2.h" #include "dsi_host_v2.h" #include "mdss_debug.h" #include "mdp3.h" #define DSI_POLL_SLEEP_US 1000 #define DSI_POLL_TIMEOUT_US 16000 #define DSI_ESC_CLK_RATE 19200000 #define DSI_DMA_CMD_TIMEOUT_MS 200 #define VSYNC_PERIOD 17 #define DSI_MAX_PKT_SIZE 10 #define DSI_SHORT_PKT_DATA_SIZE 2 #define DSI_MAX_BYTES_TO_READ 16 struct dsi_host_v2_private { int irq_no; unsigned char *dsi_base; size_t dsi_reg_size; struct device dis_dev; int clk_count; int dsi_on; void (*debug_enable_clk)(int on); }; static struct dsi_host_v2_private *dsi_host_private; static int msm_dsi_clk_ctrl(struct mdss_panel_data *pdata, int enable); int msm_dsi_init(void) { if (!dsi_host_private) { dsi_host_private = kzalloc(sizeof(struct dsi_host_v2_private), GFP_KERNEL); if (!dsi_host_private) { pr_err("fail to alloc dsi host private data\n"); return -ENOMEM; } } return 0; } void msm_dsi_deinit(void) { kfree(dsi_host_private); dsi_host_private = NULL; } void msm_dsi_ack_err_status(unsigned char *ctrl_base) { u32 status; status = MIPI_INP(ctrl_base + DSI_ACK_ERR_STATUS); if (status) { MIPI_OUTP(ctrl_base + DSI_ACK_ERR_STATUS, status); /* Writing of an extra 0 needed to clear error bits */ MIPI_OUTP(ctrl_base + DSI_ACK_ERR_STATUS, 0); pr_err("%s: status=%x\n", __func__, status); } } void msm_dsi_timeout_status(unsigned char *ctrl_base) { u32 status; status = MIPI_INP(ctrl_base + DSI_TIMEOUT_STATUS); if (status & 0x0111) { MIPI_OUTP(ctrl_base + DSI_TIMEOUT_STATUS, status); pr_err("%s: status=%x\n", __func__, status); } } void msm_dsi_dln0_phy_err(unsigned char *ctrl_base) { u32 status; status = MIPI_INP(ctrl_base + DSI_DLN0_PHY_ERR); if (status & 0x011111) { MIPI_OUTP(ctrl_base + DSI_DLN0_PHY_ERR, status); pr_err("%s: status=%x\n", __func__, status); } } void msm_dsi_fifo_status(unsigned char *ctrl_base) { u32 status; status = MIPI_INP(ctrl_base + DSI_FIFO_STATUS); if (status & 0x44444489) { MIPI_OUTP(ctrl_base + DSI_FIFO_STATUS, status); pr_err("%s: status=%x\n", __func__, status); } } void msm_dsi_status(unsigned char *ctrl_base) { u32 status; status = MIPI_INP(ctrl_base + DSI_STATUS); if (status & 0x80000000) { MIPI_OUTP(ctrl_base + DSI_STATUS, status); pr_err("%s: status=%x\n", __func__, status); } } void msm_dsi_error(unsigned char *ctrl_base) { msm_dsi_ack_err_status(ctrl_base); msm_dsi_timeout_status(ctrl_base); msm_dsi_fifo_status(ctrl_base); msm_dsi_status(ctrl_base); msm_dsi_dln0_phy_err(ctrl_base); } static void msm_dsi_set_irq_mask(struct mdss_dsi_ctrl_pdata *ctrl, u32 mask) { u32 intr_ctrl; intr_ctrl = MIPI_INP(dsi_host_private->dsi_base + DSI_INT_CTRL); intr_ctrl |= mask; MIPI_OUTP(dsi_host_private->dsi_base + DSI_INT_CTRL, intr_ctrl); } static void msm_dsi_clear_irq_mask(struct mdss_dsi_ctrl_pdata *ctrl, u32 mask) { u32 intr_ctrl; intr_ctrl = MIPI_INP(dsi_host_private->dsi_base + DSI_INT_CTRL); intr_ctrl &= ~mask; MIPI_OUTP(dsi_host_private->dsi_base + DSI_INT_CTRL, intr_ctrl); } static void msm_dsi_set_irq(struct mdss_dsi_ctrl_pdata *ctrl, u32 mask) { unsigned long flags; spin_lock_irqsave(&ctrl->irq_lock, flags); if (ctrl->dsi_irq_mask & mask) { spin_unlock_irqrestore(&ctrl->irq_lock, flags); return; } if (ctrl->dsi_irq_mask == 0) { enable_irq(dsi_host_private->irq_no); pr_debug("%s: IRQ Enable, mask=%x term=%x\n", __func__, (int)ctrl->dsi_irq_mask, (int)mask); } msm_dsi_set_irq_mask(ctrl, mask); ctrl->dsi_irq_mask |= mask; spin_unlock_irqrestore(&ctrl->irq_lock, flags); } static void msm_dsi_clear_irq(struct mdss_dsi_ctrl_pdata *ctrl, u32 mask) { unsigned long flags; spin_lock_irqsave(&ctrl->irq_lock, flags); if (!(ctrl->dsi_irq_mask & mask)) { spin_unlock_irqrestore(&ctrl->irq_lock, flags); return; } ctrl->dsi_irq_mask &= ~mask; if (ctrl->dsi_irq_mask == 0) { disable_irq(dsi_host_private->irq_no); pr_debug("%s: IRQ Disable, mask=%x term=%x\n", __func__, (int)ctrl->dsi_irq_mask, (int)mask); } msm_dsi_clear_irq_mask(ctrl, mask); spin_unlock_irqrestore(&ctrl->irq_lock, flags); } irqreturn_t msm_dsi_isr_handler(int irq, void *ptr) { u32 isr; struct mdss_dsi_ctrl_pdata *ctrl = (struct mdss_dsi_ctrl_pdata *)ptr; spin_lock(&ctrl->mdp_lock); if (ctrl->dsi_irq_mask == 0) { spin_unlock(&ctrl->mdp_lock); return IRQ_HANDLED; } isr = MIPI_INP(dsi_host_private->dsi_base + DSI_INT_CTRL); MIPI_OUTP(dsi_host_private->dsi_base + DSI_INT_CTRL, isr); pr_debug("%s: isr=%x", __func__, isr); if (isr & DSI_INTR_ERROR) { pr_err("%s: isr=%x %x", __func__, isr, (int)DSI_INTR_ERROR); msm_dsi_error(dsi_host_private->dsi_base); } if (isr & DSI_INTR_VIDEO_DONE) complete(&ctrl->video_comp); if (isr & DSI_INTR_CMD_DMA_DONE) complete(&ctrl->dma_comp); if (isr & DSI_INTR_BTA_DONE) complete(&ctrl->bta_comp); if (isr & DSI_INTR_CMD_MDP_DONE) complete(&ctrl->mdp_comp); spin_unlock(&ctrl->mdp_lock); return IRQ_HANDLED; } int msm_dsi_irq_init(struct device *dev, int irq_no, struct mdss_dsi_ctrl_pdata *ctrl) { int ret; u32 isr; msm_dsi_ahb_ctrl(1); isr = MIPI_INP(dsi_host_private->dsi_base + DSI_INT_CTRL); isr &= ~DSI_INTR_ALL_MASK; MIPI_OUTP(dsi_host_private->dsi_base + DSI_INT_CTRL, isr); msm_dsi_ahb_ctrl(0); ret = devm_request_irq(dev, irq_no, msm_dsi_isr_handler, IRQF_DISABLED, "DSI", ctrl); if (ret) { pr_err("msm_dsi_irq_init request_irq() failed!\n"); return ret; } dsi_host_private->irq_no = irq_no; disable_irq(irq_no); return 0; } static void msm_dsi_get_cmd_engine(struct mdss_dsi_ctrl_pdata *ctrl) { unsigned char *ctrl_base = dsi_host_private->dsi_base; u32 dsi_ctrl; if (ctrl->panel_mode == DSI_VIDEO_MODE) { dsi_ctrl = MIPI_INP(ctrl_base + DSI_CTRL); MIPI_OUTP(ctrl_base + DSI_CTRL, dsi_ctrl | 0x04); } } static void msm_dsi_release_cmd_engine(struct mdss_dsi_ctrl_pdata *ctrl) { unsigned char *ctrl_base = dsi_host_private->dsi_base; u32 dsi_ctrl; if (ctrl->panel_mode == DSI_VIDEO_MODE) { dsi_ctrl = MIPI_INP(ctrl_base + DSI_CTRL); dsi_ctrl &= ~0x04; MIPI_OUTP(ctrl_base + DSI_CTRL, dsi_ctrl); } } static int msm_dsi_wait4mdp_done(struct mdss_dsi_ctrl_pdata *ctrl) { int rc; unsigned long flag; spin_lock_irqsave(&ctrl->mdp_lock, flag); INIT_COMPLETION(ctrl->mdp_comp); msm_dsi_set_irq(ctrl, DSI_INTR_CMD_MDP_DONE_MASK); spin_unlock_irqrestore(&ctrl->mdp_lock, flag); rc = wait_for_completion_timeout(&ctrl->mdp_comp, msecs_to_jiffies(VSYNC_PERIOD * 4)); if (rc == 0) { pr_err("DSI wait 4 mdp done time out\n"); rc = -ETIME; } else if (!IS_ERR_VALUE(rc)) { rc = 0; } msm_dsi_clear_irq(ctrl, DSI_INTR_CMD_MDP_DONE_MASK); return rc; } void msm_dsi_cmd_mdp_busy(struct mdss_dsi_ctrl_pdata *ctrl) { int rc; u32 dsi_status; unsigned char *ctrl_base = dsi_host_private->dsi_base; if (ctrl->panel_mode == DSI_VIDEO_MODE) return; dsi_status = MIPI_INP(ctrl_base + DSI_STATUS); if (dsi_status & 0x04) { pr_debug("dsi command engine is busy\n"); rc = msm_dsi_wait4mdp_done(ctrl); if (rc) pr_err("Timed out waiting for mdp done"); } } static int msm_dsi_wait4video_done(struct mdss_dsi_ctrl_pdata *ctrl) { int rc; unsigned long flag; spin_lock_irqsave(&ctrl->mdp_lock, flag); INIT_COMPLETION(ctrl->video_comp); msm_dsi_set_irq(ctrl, DSI_INTR_VIDEO_DONE_MASK); spin_unlock_irqrestore(&ctrl->mdp_lock, flag); rc = wait_for_completion_timeout(&ctrl->video_comp, msecs_to_jiffies(VSYNC_PERIOD * 4)); if (rc == 0) { pr_err("DSI wait 4 video done time out\n"); rc = -ETIME; } else if (!IS_ERR_VALUE(rc)) { rc = 0; } msm_dsi_clear_irq(ctrl, DSI_INTR_VIDEO_DONE_MASK); return rc; } static int msm_dsi_wait4video_eng_busy(struct mdss_dsi_ctrl_pdata *ctrl) { int rc = 0; u32 dsi_status; unsigned char *ctrl_base = dsi_host_private->dsi_base; if (ctrl->panel_mode == DSI_CMD_MODE) return rc; dsi_status = MIPI_INP(ctrl_base + DSI_STATUS); if (dsi_status & 0x08) { pr_debug("dsi command in video mode wait for active region\n"); rc = msm_dsi_wait4video_done(ctrl); /* delay 4-5 ms to skip BLLP */ if (!rc) usleep_range(4000, 5000); } return rc; } void msm_dsi_host_init(struct mipi_panel_info *pinfo) { u32 dsi_ctrl, data; unsigned char *ctrl_base = dsi_host_private->dsi_base; pr_debug("msm_dsi_host_init\n"); pinfo->rgb_swap = DSI_RGB_SWAP_RGB; if (pinfo->mode == DSI_VIDEO_MODE) { data = 0; if (pinfo->pulse_mode_hsa_he) data |= BIT(28); if (pinfo->hfp_power_stop) data |= BIT(24); if (pinfo->hbp_power_stop) data |= BIT(20); if (pinfo->hsa_power_stop) data |= BIT(16); if (pinfo->eof_bllp_power_stop) data |= BIT(15); if (pinfo->bllp_power_stop) data |= BIT(12); data |= ((pinfo->traffic_mode & 0x03) << 8); data |= ((pinfo->dst_format & 0x03) << 4); /* 2 bits */ data |= (pinfo->vc & 0x03); MIPI_OUTP(ctrl_base + DSI_VIDEO_MODE_CTRL, data); data = 0; data |= ((pinfo->rgb_swap & 0x07) << 12); if (pinfo->b_sel) data |= BIT(8); if (pinfo->g_sel) data |= BIT(4); if (pinfo->r_sel) data |= BIT(0); MIPI_OUTP(ctrl_base + DSI_VIDEO_MODE_DATA_CTRL, data); } else if (pinfo->mode == DSI_CMD_MODE) { data = 0; data |= ((pinfo->interleave_max & 0x0f) << 20); data |= ((pinfo->rgb_swap & 0x07) << 16); if (pinfo->b_sel) data |= BIT(12); if (pinfo->g_sel) data |= BIT(8); if (pinfo->r_sel) data |= BIT(4); data |= (pinfo->dst_format & 0x0f); /* 4 bits */ MIPI_OUTP(ctrl_base + DSI_COMMAND_MODE_MDP_CTRL, data); /* DSI_COMMAND_MODE_MDP_DCS_CMD_CTRL */ data = pinfo->wr_mem_continue & 0x0ff; data <<= 8; data |= (pinfo->wr_mem_start & 0x0ff); if (pinfo->insert_dcs_cmd) data |= BIT(16); MIPI_OUTP(ctrl_base + DSI_COMMAND_MODE_MDP_DCS_CMD_CTRL, data); } else pr_err("%s: Unknown DSI mode=%d\n", __func__, pinfo->mode); dsi_ctrl = BIT(8) | BIT(2); /* clock enable & cmd mode */ if (pinfo->crc_check) dsi_ctrl |= BIT(24); if (pinfo->ecc_check) dsi_ctrl |= BIT(20); if (pinfo->data_lane3) dsi_ctrl |= BIT(7); if (pinfo->data_lane2) dsi_ctrl |= BIT(6); if (pinfo->data_lane1) dsi_ctrl |= BIT(5); if (pinfo->data_lane0) dsi_ctrl |= BIT(4); /* from frame buffer, low power mode */ /* DSI_COMMAND_MODE_DMA_CTRL */ MIPI_OUTP(ctrl_base + DSI_COMMAND_MODE_DMA_CTRL, 0x14000000); data = 0; if (pinfo->te_sel) data |= BIT(31); data |= pinfo->mdp_trigger << 4;/* cmd mdp trigger */ data |= pinfo->dma_trigger; /* cmd dma trigger */ data |= (pinfo->stream & 0x01) << 8; MIPI_OUTP(ctrl_base + DSI_TRIG_CTRL, data); /* DSI_LAN_SWAP_CTRL */ MIPI_OUTP(ctrl_base + DSI_LANE_SWAP_CTRL, pinfo->dlane_swap); /* clock out ctrl */ data = pinfo->t_clk_post & 0x3f; /* 6 bits */ data <<= 8; data |= pinfo->t_clk_pre & 0x3f; /* 6 bits */ /* DSI_CLKOUT_TIMING_CTRL */ MIPI_OUTP(ctrl_base + DSI_CLKOUT_TIMING_CTRL, data); data = 0; if (pinfo->rx_eot_ignore) data |= BIT(4); if (pinfo->tx_eot_append) data |= BIT(0); MIPI_OUTP(ctrl_base + DSI_EOT_PACKET_CTRL, data); /* allow only ack-err-status to generate interrupt */ /* DSI_ERR_INT_MASK0 */ MIPI_OUTP(ctrl_base + DSI_ERR_INT_MASK0, 0x13ff3fe0); /* turn esc, byte, dsi, pclk, sclk, hclk on */ MIPI_OUTP(ctrl_base + DSI_CLK_CTRL, 0x23f); dsi_ctrl |= BIT(0); /* enable dsi */ MIPI_OUTP(ctrl_base + DSI_CTRL, dsi_ctrl); wmb(); } void dsi_set_tx_power_mode(int mode) { u32 data; unsigned char *ctrl_base = dsi_host_private->dsi_base; data = MIPI_INP(ctrl_base + DSI_COMMAND_MODE_DMA_CTRL); if (mode == 0) data &= ~BIT(26); else data |= BIT(26); MIPI_OUTP(ctrl_base + DSI_COMMAND_MODE_DMA_CTRL, data); } void msm_dsi_sw_reset(void) { u32 dsi_ctrl; unsigned char *ctrl_base = dsi_host_private->dsi_base; pr_debug("msm_dsi_sw_reset\n"); dsi_ctrl = MIPI_INP(ctrl_base + DSI_CTRL); dsi_ctrl &= ~0x01; MIPI_OUTP(ctrl_base + DSI_CTRL, dsi_ctrl); wmb(); /* turn esc, byte, dsi, pclk, sclk, hclk on */ MIPI_OUTP(ctrl_base + DSI_CLK_CTRL, 0x23f); wmb(); MIPI_OUTP(ctrl_base + DSI_SOFT_RESET, 0x01); wmb(); MIPI_OUTP(ctrl_base + DSI_SOFT_RESET, 0x00); wmb(); } void msm_dsi_controller_cfg(int enable) { u32 dsi_ctrl, status; unsigned char *ctrl_base = dsi_host_private->dsi_base; pr_debug("msm_dsi_controller_cfg\n"); /* Check for CMD_MODE_DMA_BUSY */ if (readl_poll_timeout((ctrl_base + DSI_STATUS), status, ((status & 0x02) == 0), DSI_POLL_SLEEP_US, DSI_POLL_TIMEOUT_US)) { pr_err("%s: DSI status=%x failed\n", __func__, status); pr_err("%s: Doing sw reset\n", __func__); msm_dsi_sw_reset(); } /* Check for x_HS_FIFO_EMPTY */ if (readl_poll_timeout((ctrl_base + DSI_FIFO_STATUS), status, ((status & 0x11111000) == 0x11111000), DSI_POLL_SLEEP_US, DSI_POLL_TIMEOUT_US)) pr_err("%s: FIFO status=%x failed\n", __func__, status); /* Check for VIDEO_MODE_ENGINE_BUSY */ if (readl_poll_timeout((ctrl_base + DSI_STATUS), status, ((status & 0x08) == 0), DSI_POLL_SLEEP_US, DSI_POLL_TIMEOUT_US)) { pr_err("%s: DSI status=%x\n", __func__, status); pr_err("%s: Doing sw reset\n", __func__); msm_dsi_sw_reset(); } dsi_ctrl = MIPI_INP(ctrl_base + DSI_CTRL); if (enable) dsi_ctrl |= 0x01; else dsi_ctrl &= ~0x01; MIPI_OUTP(ctrl_base + DSI_CTRL, dsi_ctrl); wmb(); } void msm_dsi_op_mode_config(int mode, struct mdss_panel_data *pdata) { u32 dsi_ctrl; unsigned char *ctrl_base = dsi_host_private->dsi_base; pr_debug("msm_dsi_op_mode_config\n"); dsi_ctrl = MIPI_INP(ctrl_base + DSI_CTRL); if (dsi_ctrl & DSI_VIDEO_MODE_EN) dsi_ctrl &= ~(DSI_CMD_MODE_EN|DSI_EN); else dsi_ctrl &= ~(DSI_CMD_MODE_EN|DSI_VIDEO_MODE_EN|DSI_EN); if (mode == DSI_VIDEO_MODE) { dsi_ctrl |= (DSI_VIDEO_MODE_EN|DSI_EN); } else { /* command mode */ dsi_ctrl |= (DSI_CMD_MODE_EN|DSI_EN); /*For Video mode panel, keep Video and Cmd mode ON */ if (pdata->panel_info.type == MIPI_VIDEO_PANEL) dsi_ctrl |= DSI_VIDEO_MODE_EN; } pr_debug("%s: dsi_ctrl=%x\n", __func__, dsi_ctrl); MIPI_OUTP(ctrl_base + DSI_CTRL, dsi_ctrl); wmb(); } int msm_dsi_cmd_dma_tx(struct mdss_dsi_ctrl_pdata *ctrl, struct dsi_buf *tp) { int len, rc; unsigned long size, addr; unsigned char *ctrl_base = dsi_host_private->dsi_base; unsigned long flag; len = ALIGN(tp->len, 4); size = ALIGN(tp->len, SZ_4K); tp->dmap = dma_map_single(&dsi_host_private->dis_dev, tp->data, size, DMA_TO_DEVICE); if (dma_mapping_error(&dsi_host_private->dis_dev, tp->dmap)) { pr_err("%s: dmap mapp failed\n", __func__); return -ENOMEM; } addr = tp->dmap; msm_dsi_get_cmd_engine(ctrl); spin_lock_irqsave(&ctrl->mdp_lock, flag); INIT_COMPLETION(ctrl->dma_comp); msm_dsi_set_irq(ctrl, DSI_INTR_CMD_DMA_DONE_MASK); spin_unlock_irqrestore(&ctrl->mdp_lock, flag); MIPI_OUTP(ctrl_base + DSI_DMA_CMD_OFFSET, addr); MIPI_OUTP(ctrl_base + DSI_DMA_CMD_LENGTH, len); wmb(); MIPI_OUTP(ctrl_base + DSI_CMD_MODE_DMA_SW_TRIGGER, 0x01); wmb(); rc = wait_for_completion_timeout(&ctrl->dma_comp, msecs_to_jiffies(DSI_DMA_CMD_TIMEOUT_MS)); if (rc == 0) { pr_err("DSI command transaction time out\n"); rc = -ETIME; } else if (!IS_ERR_VALUE(rc)) { rc = 0; } dma_unmap_single(&dsi_host_private->dis_dev, tp->dmap, size, DMA_TO_DEVICE); tp->dmap = 0; msm_dsi_clear_irq(ctrl, DSI_INTR_CMD_DMA_DONE_MASK); msm_dsi_release_cmd_engine(ctrl); return rc; } /* MIPI_DSI_MRPS, Maximum Return Packet Size */ static char max_pktsize[2] = {0x00, 0x00}; /* LSB tx first, 10 bytes */ static struct dsi_cmd_desc pkt_size_cmd = { {DTYPE_MAX_PKTSIZE, 1, 0, 0, 0, sizeof(max_pktsize)}, max_pktsize, }; int msm_dsi_cmd_dma_rx(struct mdss_dsi_ctrl_pdata *ctrl, struct dsi_buf *rp, int rlen) { u32 *lp, data, *temp; int i, j = 0, off, cnt; unsigned char *ctrl_base = dsi_host_private->dsi_base; char reg[16]; int repeated_bytes = 0; lp = (u32 *)rp->data; temp = (u32 *)reg; cnt = rlen; cnt += 3; cnt >>= 2; if (cnt > 4) cnt = 4; /* 4 x 32 bits registers only */ if (rlen == 4) rp->read_cnt = 4; else rp->read_cnt = (max_pktsize[0] + 6); if (rp->read_cnt > 16) { int bytes_shifted, data_lost = 0, rem_header_bytes = 0; /* Any data more than 16 bytes will be shifted out */ bytes_shifted = rp->read_cnt - rlen; if (bytes_shifted >= 4) data_lost = bytes_shifted - 4; /* remove dcs header */ else rem_header_bytes = 4 - bytes_shifted; /* rem header */ /* * (rp->len - 4) -> current rx buffer data length. * If data_lost > 0, then ((rp->len - 4) - data_lost) will be * the number of repeating bytes. * If data_lost == 0, then ((rp->len - 4) + rem_header_bytes) * will be the number of bytes repeating in between rx buffer * and the current RDBK_DATA registers. We need to skip the * repeating bytes. */ repeated_bytes = (rp->len - 4) - data_lost + rem_header_bytes; } off = DSI_RDBK_DATA0; off += ((cnt - 1) * 4); for (i = 0; i < cnt; i++) { data = (u32)MIPI_INP(ctrl_base + off); /* to network byte order */ if (!repeated_bytes) *lp++ = ntohl(data); else *temp++ = ntohl(data); pr_debug("%s: data = 0x%x and ntohl(data) = 0x%x\n", __func__, data, ntohl(data)); off -= 4; if (rlen == 4) rp->len += sizeof(*lp); } /* Skip duplicates and append other data to the rx buffer */ if (repeated_bytes) { for (i = repeated_bytes; i < 16; i++) rp->data[j++] = reg[i]; } return rlen; } static int msm_dsi_cmds_tx(struct mdss_dsi_ctrl_pdata *ctrl, struct dsi_cmd_desc *cmds, int cnt) { struct dsi_buf *tp; struct dsi_cmd_desc *cm; struct dsi_ctrl_hdr *dchdr; int len; int rc = 0; tp = &ctrl->tx_buf; mdss_dsi_buf_init(tp); cm = cmds; len = 0; while (cnt--) { dchdr = &cm->dchdr; mdss_dsi_buf_reserve(tp, len); len = mdss_dsi_cmd_dma_add(tp, cm); if (!len) { pr_err("%s: failed to add cmd = 0x%x\n", __func__, cm->payload[0]); rc = -EINVAL; goto dsi_cmds_tx_err; } if (dchdr->last) { tp->data = tp->start; /* begin of buf */ rc = msm_dsi_wait4video_eng_busy(ctrl); if (rc) { pr_err("%s: wait4video_eng failed\n", __func__); goto dsi_cmds_tx_err; } rc = msm_dsi_cmd_dma_tx(ctrl, tp); if (IS_ERR_VALUE(len)) { pr_err("%s: failed to call cmd_dma_tx for cmd = 0x%x\n", __func__, cmds->payload[0]); goto dsi_cmds_tx_err; } if (dchdr->wait) usleep(dchdr->wait * 1000); mdss_dsi_buf_init(tp); len = 0; } cm++; } dsi_cmds_tx_err: return rc; } static int msm_dsi_parse_rx_response(struct dsi_buf *rp) { int rc = 0; unsigned char cmd; cmd = rp->data[0]; switch (cmd) { case DTYPE_ACK_ERR_RESP: pr_debug("%s: rx ACK_ERR_PACLAGE\n", __func__); rc = -EINVAL; break; case DTYPE_GEN_READ1_RESP: case DTYPE_DCS_READ1_RESP: mdss_dsi_short_read1_resp(rp); break; case DTYPE_GEN_READ2_RESP: case DTYPE_DCS_READ2_RESP: mdss_dsi_short_read2_resp(rp); break; case DTYPE_GEN_LREAD_RESP: case DTYPE_DCS_LREAD_RESP: mdss_dsi_long_read_resp(rp); break; default: rc = -EINVAL; pr_warn("%s: Unknown cmd received\n", __func__); break; } return rc; } static int msm_dsi_set_max_packet_size(struct mdss_dsi_ctrl_pdata *ctrl, int size) { struct dsi_buf *tp; int rc; tp = &ctrl->tx_buf; mdss_dsi_buf_init(tp); max_pktsize[0] = size; rc = mdss_dsi_cmd_dma_add(tp, &pkt_size_cmd); if (!rc) { pr_err("%s: failed to add max_pkt_size\n", __func__); return -EINVAL; } rc = msm_dsi_wait4video_eng_busy(ctrl); if (rc) { pr_err("%s: failed to wait4video_eng\n", __func__); return rc; } rc = msm_dsi_cmd_dma_tx(ctrl, tp); if (IS_ERR_VALUE(rc)) { pr_err("%s: failed to tx max_pkt_size\n", __func__); return rc; } pr_debug("%s: max_pkt_size=%d sent\n", __func__, size); return rc; } /* read data length is less than or equal to 10 bytes*/ static int msm_dsi_cmds_rx_1(struct mdss_dsi_ctrl_pdata *ctrl, struct dsi_cmd_desc *cmds, int rlen) { int rc; struct dsi_buf *tp, *rp; int rx_byte = 0; if (rlen <= 2) rx_byte = 4; else rx_byte = DSI_MAX_BYTES_TO_READ; tp = &ctrl->tx_buf; rp = &ctrl->rx_buf; mdss_dsi_buf_init(rp); rc = msm_dsi_set_max_packet_size(ctrl, rlen); if (rc) { pr_err("%s: dsi_set_max_pkt failed\n", __func__); rc = -EINVAL; goto dsi_cmds_rx_1_error; } mdss_dsi_buf_init(tp); rc = mdss_dsi_cmd_dma_add(tp, cmds); if (!rc) { pr_err("%s: dsi_cmd_dma_add failed\n", __func__); rc = -EINVAL; goto dsi_cmds_rx_1_error; } rc = msm_dsi_wait4video_eng_busy(ctrl); if (rc) { pr_err("%s: wait4video_eng failed\n", __func__); goto dsi_cmds_rx_1_error; } rc = msm_dsi_cmd_dma_tx(ctrl, tp); if (IS_ERR_VALUE(rc)) { pr_err("%s: msm_dsi_cmd_dma_tx failed\n", __func__); goto dsi_cmds_rx_1_error; } if (rlen <= DSI_SHORT_PKT_DATA_SIZE) { msm_dsi_cmd_dma_rx(ctrl, rp, rx_byte); } else { msm_dsi_cmd_dma_rx(ctrl, rp, rx_byte); rp->len = rx_byte - 2; /*2 bytes for CRC*/ rp->len = rp->len - (DSI_MAX_PKT_SIZE - rlen); rp->data = rp->start + (16 - (rlen + 2 + DSI_HOST_HDR_SIZE)); } rc = msm_dsi_parse_rx_response(rp); dsi_cmds_rx_1_error: if (rc) rp->len = 0; return rc; } /* read data length is more than 10 bytes, which requires multiple DSI read*/ static int msm_dsi_cmds_rx_2(struct mdss_dsi_ctrl_pdata *ctrl, struct dsi_cmd_desc *cmds, int rlen) { int rc; struct dsi_buf *tp, *rp; int pkt_size, data_bytes, dlen, end = 0, diff; tp = &ctrl->tx_buf; rp = &ctrl->rx_buf; mdss_dsi_buf_init(rp); pkt_size = DSI_MAX_PKT_SIZE; data_bytes = MDSS_DSI_LEN; while (!end) { rc = msm_dsi_set_max_packet_size(ctrl, pkt_size); if (rc) break; mdss_dsi_buf_init(tp); rc = mdss_dsi_cmd_dma_add(tp, cmds); if (!rc) { pr_err("%s: dsi_cmd_dma_add failed\n", __func__); rc = -EINVAL; break; } rc = msm_dsi_wait4video_eng_busy(ctrl); if (rc) { pr_err("%s: wait4video_eng failed\n", __func__); break; } rc = msm_dsi_cmd_dma_tx(ctrl, tp); if (IS_ERR_VALUE(rc)) { pr_err("%s: msm_dsi_cmd_dma_tx failed\n", __func__); break; } msm_dsi_cmd_dma_rx(ctrl, rp, DSI_MAX_BYTES_TO_READ); if (rlen <= data_bytes) { diff = data_bytes - rlen; end = 1; } else { diff = 0; rlen -= data_bytes; } dlen = DSI_MAX_BYTES_TO_READ - 2; dlen -= diff; rp->data += dlen; rp->len += dlen; if (!end) { data_bytes = 14; if (rlen < data_bytes) pkt_size += rlen; else pkt_size += data_bytes; } pr_debug("%s: rp data=%x len=%d dlen=%d diff=%d\n", __func__, (int) (unsigned long) rp->data, rp->len, dlen, diff); } if (!rc) { rp->data = rp->start; rc = msm_dsi_parse_rx_response(rp); } if (rc) rp->len = 0; return rc; } int msm_dsi_cmds_rx(struct mdss_dsi_ctrl_pdata *ctrl, struct dsi_cmd_desc *cmds, int rlen) { int rc; if (rlen <= DSI_MAX_PKT_SIZE) rc = msm_dsi_cmds_rx_1(ctrl, cmds, rlen); else rc = msm_dsi_cmds_rx_2(ctrl, cmds, rlen); return rc; } void msm_dsi_cmdlist_tx(struct mdss_dsi_ctrl_pdata *ctrl, struct dcs_cmd_req *req) { int ret; ret = msm_dsi_cmds_tx(ctrl, req->cmds, req->cmds_cnt); if (req->cb) req->cb(ret); } void msm_dsi_cmdlist_rx(struct mdss_dsi_ctrl_pdata *ctrl, struct dcs_cmd_req *req) { struct dsi_buf *rp; int len = 0; if (req->rbuf) { rp = &ctrl->rx_buf; len = msm_dsi_cmds_rx(ctrl, req->cmds, req->rlen); memcpy(req->rbuf, rp->data, rp->len); } else { pr_err("%s: No rx buffer provided\n", __func__); } if (req->cb) req->cb(len); } int msm_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) { struct dcs_cmd_req *req; int dsi_on; int ret = -EINVAL; mutex_lock(&ctrl->mutex); dsi_on = dsi_host_private->dsi_on; mutex_unlock(&ctrl->mutex); if (!dsi_on) { pr_err("try to send DSI commands while dsi is off\n"); return ret; } mutex_lock(&ctrl->cmd_mutex); req = mdss_dsi_cmdlist_get(ctrl); if (!req) { mutex_unlock(&ctrl->cmd_mutex); return ret; } /* * mdss interrupt is generated in mdp core clock domain * mdp clock need to be enabled to receive dsi interrupt * also, axi bus bandwidth need since dsi controller will * fetch dcs commands from axi bus */ mdp3_res_update(1, 1, MDP3_CLIENT_DMA_P); msm_dsi_clk_ctrl(&ctrl->panel_data, 1); if (0 == (req->flags & CMD_REQ_LP_MODE)) dsi_set_tx_power_mode(0); if (req->flags & CMD_REQ_RX) msm_dsi_cmdlist_rx(ctrl, req); else msm_dsi_cmdlist_tx(ctrl, req); if (0 == (req->flags & CMD_REQ_LP_MODE)) dsi_set_tx_power_mode(1); msm_dsi_clk_ctrl(&ctrl->panel_data, 0); mdp3_res_update(0, 1, MDP3_CLIENT_DMA_P); mutex_unlock(&ctrl->cmd_mutex); return 0; } static int msm_dsi_cal_clk_rate(struct mdss_panel_data *pdata, u32 *bitclk_rate, u32 *dsiclk_rate, u32 *byteclk_rate, u32 *pclk_rate) { struct mdss_panel_info *pinfo; struct mipi_panel_info *mipi; u32 hbp, hfp, vbp, vfp, hspw, vspw, width, height; int lanes; pinfo = &pdata->panel_info; mipi = &pdata->panel_info.mipi; hbp = pdata->panel_info.lcdc.h_back_porch; hfp = pdata->panel_info.lcdc.h_front_porch; vbp = pdata->panel_info.lcdc.v_back_porch; vfp = pdata->panel_info.lcdc.v_front_porch; hspw = pdata->panel_info.lcdc.h_pulse_width; vspw = pdata->panel_info.lcdc.v_pulse_width; width = pdata->panel_info.xres; height = pdata->panel_info.yres; lanes = 0; if (mipi->data_lane0) lanes++; if (mipi->data_lane1) lanes++; if (mipi->data_lane2) lanes++; if (mipi->data_lane3) lanes++; if (lanes == 0) return -EINVAL; *bitclk_rate = (width + hbp + hfp + hspw) * (height + vbp + vfp + vspw); *bitclk_rate *= mipi->frame_rate; *bitclk_rate *= pdata->panel_info.bpp; *bitclk_rate /= lanes; *byteclk_rate = *bitclk_rate / 8; *dsiclk_rate = *byteclk_rate * lanes; *pclk_rate = *byteclk_rate * lanes * 8 / pdata->panel_info.bpp; pr_debug("dsiclk_rate=%u, byteclk=%u, pck_=%u\n", *dsiclk_rate, *byteclk_rate, *pclk_rate); return 0; } static int msm_dsi_on(struct mdss_panel_data *pdata) { int ret = 0; u32 clk_rate; struct mdss_panel_info *pinfo; struct mipi_panel_info *mipi; u32 hbp, hfp, vbp, vfp, hspw, vspw, width, height; u32 ystride, bpp, data; u32 dummy_xres, dummy_yres; u32 bitclk_rate = 0, byteclk_rate = 0, pclk_rate = 0, dsiclk_rate = 0; unsigned char *ctrl_base = dsi_host_private->dsi_base; struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL; pr_debug("msm_dsi_on\n"); pinfo = &pdata->panel_info; ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata, panel_data); mutex_lock(&ctrl_pdata->mutex); if (!pdata->panel_info.dynamic_switch_pending) { ret = msm_dss_enable_vreg( ctrl_pdata->power_data.vreg_config, ctrl_pdata->power_data.num_vreg, 1); if (ret) { pr_err("%s: DSI power on failed\n", __func__); mutex_unlock(&ctrl_pdata->mutex); return ret; } } msm_dsi_ahb_ctrl(1); msm_dsi_phy_sw_reset(dsi_host_private->dsi_base); msm_dsi_phy_init(dsi_host_private->dsi_base, pdata); msm_dsi_cal_clk_rate(pdata, &bitclk_rate, &dsiclk_rate, &byteclk_rate, &pclk_rate); msm_dsi_clk_set_rate(DSI_ESC_CLK_RATE, dsiclk_rate, byteclk_rate, pclk_rate); msm_dsi_prepare_clocks(); msm_dsi_clk_enable(); clk_rate = pdata->panel_info.clk_rate; clk_rate = min(clk_rate, pdata->panel_info.clk_max); hbp = pdata->panel_info.lcdc.h_back_porch; hfp = pdata->panel_info.lcdc.h_front_porch; vbp = pdata->panel_info.lcdc.v_back_porch; vfp = pdata->panel_info.lcdc.v_front_porch; hspw = pdata->panel_info.lcdc.h_pulse_width; vspw = pdata->panel_info.lcdc.v_pulse_width; width = pdata->panel_info.xres; height = pdata->panel_info.yres; mipi = &pdata->panel_info.mipi; if (pdata->panel_info.type == MIPI_VIDEO_PANEL) { dummy_xres = pdata->panel_info.lcdc.xres_pad; dummy_yres = pdata->panel_info.lcdc.yres_pad; MIPI_OUTP(ctrl_base + DSI_VIDEO_MODE_ACTIVE_H, ((hspw + hbp + width + dummy_xres) << 16 | (hspw + hbp))); MIPI_OUTP(ctrl_base + DSI_VIDEO_MODE_ACTIVE_V, ((vspw + vbp + height + dummy_yres) << 16 | (vspw + vbp))); MIPI_OUTP(ctrl_base + DSI_VIDEO_MODE_TOTAL, (vspw + vbp + height + dummy_yres + vfp - 1) << 16 | (hspw + hbp + width + dummy_xres + hfp - 1)); MIPI_OUTP(ctrl_base + DSI_VIDEO_MODE_HSYNC, (hspw << 16)); MIPI_OUTP(ctrl_base + DSI_VIDEO_MODE_VSYNC, 0); MIPI_OUTP(ctrl_base + DSI_VIDEO_MODE_VSYNC_VPOS, (vspw << 16)); } else { /* command mode */ if (mipi->dst_format == DSI_CMD_DST_FORMAT_RGB888) bpp = 3; else if (mipi->dst_format == DSI_CMD_DST_FORMAT_RGB666) bpp = 3; else if (mipi->dst_format == DSI_CMD_DST_FORMAT_RGB565) bpp = 2; else bpp = 3; /* Default format set to RGB888 */ ystride = width * bpp + 1; data = (ystride << 16) | (mipi->vc << 8) | DTYPE_DCS_LWRITE; MIPI_OUTP(ctrl_base + DSI_COMMAND_MODE_MDP_STREAM0_CTRL, data); MIPI_OUTP(ctrl_base + DSI_COMMAND_MODE_MDP_STREAM1_CTRL, data); data = height << 16 | width; MIPI_OUTP(ctrl_base + DSI_COMMAND_MODE_MDP_STREAM1_TOTAL, data); MIPI_OUTP(ctrl_base + DSI_COMMAND_MODE_MDP_STREAM0_TOTAL, data); } msm_dsi_sw_reset(); msm_dsi_host_init(mipi); if (mipi->force_clk_lane_hs) { u32 tmp; tmp = MIPI_INP(ctrl_base + DSI_LANE_CTRL); tmp |= (1<<28); MIPI_OUTP(ctrl_base + DSI_LANE_CTRL, tmp); wmb(); } msm_dsi_op_mode_config(mipi->mode, pdata); msm_dsi_set_irq(ctrl_pdata, DSI_INTR_ERROR_MASK); dsi_host_private->clk_count = 1; dsi_host_private->dsi_on = 1; mutex_unlock(&ctrl_pdata->mutex); return ret; } static int msm_dsi_off(struct mdss_panel_data *pdata) { int ret = 0; struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL; if (pdata == NULL) { pr_err("%s: Invalid input data\n", __func__); ret = -EINVAL; return ret; } ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata, panel_data); pr_debug("msm_dsi_off\n"); mutex_lock(&ctrl_pdata->mutex); msm_dsi_clear_irq(ctrl_pdata, ctrl_pdata->dsi_irq_mask); msm_dsi_controller_cfg(0); msm_dsi_clk_set_rate(DSI_ESC_CLK_RATE, 0, 0, 0); msm_dsi_clk_disable(); msm_dsi_unprepare_clocks(); msm_dsi_phy_off(dsi_host_private->dsi_base); msm_dsi_ahb_ctrl(0); if (!pdata->panel_info.dynamic_switch_pending) { ret = msm_dss_enable_vreg( ctrl_pdata->power_data.vreg_config, ctrl_pdata->power_data.num_vreg, 0); if (ret) { pr_err("%s: Panel power off failed\n", __func__); } } dsi_host_private->clk_count = 0; dsi_host_private->dsi_on = 0; mutex_unlock(&ctrl_pdata->mutex); return ret; } static int msm_dsi_cont_on(struct mdss_panel_data *pdata) { struct mdss_panel_info *pinfo; int ret = 0; struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL; if (pdata == NULL) { pr_err("%s: Invalid input data\n", __func__); ret = -EINVAL; return ret; } pr_debug("%s:\n", __func__); ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata, panel_data); pinfo = &pdata->panel_info; mutex_lock(&ctrl_pdata->mutex); ret = msm_dss_enable_vreg( ctrl_pdata->power_data.vreg_config, ctrl_pdata->power_data.num_vreg, 1); if (ret) { pr_err("%s: DSI power on failed\n", __func__); mutex_unlock(&ctrl_pdata->mutex); return ret; } pinfo->panel_power_on = 1; ret = mdss_dsi_panel_reset(pdata, 1); if (ret) { pr_err("%s: Panel reset failed\n", __func__); mutex_unlock(&ctrl_pdata->mutex); return ret; } msm_dsi_ahb_ctrl(1); msm_dsi_prepare_clocks(); msm_dsi_clk_enable(); msm_dsi_set_irq(ctrl_pdata, DSI_INTR_ERROR_MASK); dsi_host_private->clk_count = 1; dsi_host_private->dsi_on = 1; mutex_unlock(&ctrl_pdata->mutex); return 0; } static int msm_dsi_read_status(struct mdss_dsi_ctrl_pdata *ctrl) { struct dcs_cmd_req cmdreq; memset(&cmdreq, 0, sizeof(cmdreq)); cmdreq.cmds = ctrl->status_cmds.cmds; cmdreq.cmds_cnt = ctrl->status_cmds.cmd_cnt; cmdreq.flags = CMD_REQ_COMMIT | CMD_CLK_CTRL | CMD_REQ_RX; cmdreq.rlen = 1; cmdreq.cb = NULL; cmdreq.rbuf = ctrl->status_buf.data; return mdss_dsi_cmdlist_put(ctrl, &cmdreq); } /** * msm_dsi_reg_status_check() - Check dsi panel status through reg read * @ctrl_pdata: pointer to the dsi controller structure * * This function can be used to check the panel status through reading the * status register from the panel. * * Return: positive value if the panel is in good state, negative value or * zero otherwise. */ int msm_dsi_reg_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata) { int ret = 0; if (ctrl_pdata == NULL) { pr_err("%s: Invalid input data\n", __func__); return 0; } pr_debug("%s: Checking Register status\n", __func__); msm_dsi_clk_ctrl(&ctrl_pdata->panel_data, 1); if (ctrl_pdata->status_cmds.link_state == DSI_HS_MODE) dsi_set_tx_power_mode(0); ret = msm_dsi_read_status(ctrl_pdata); if (ctrl_pdata->status_cmds.link_state == DSI_HS_MODE) dsi_set_tx_power_mode(1); if (ret == 0) { if (ctrl_pdata->status_buf.data[0] != ctrl_pdata->status_value) { pr_err("%s: Read back value from panel is incorrect\n", __func__); ret = -EINVAL; } else { ret = 1; } } else { pr_err("%s: Read status register returned error\n", __func__); } msm_dsi_clk_ctrl(&ctrl_pdata->panel_data, 0); pr_debug("%s: Read register done with ret: %d\n", __func__, ret); return ret; } /** * msm_dsi_bta_status_check() - Check dsi panel status through bta check * @ctrl_pdata: pointer to the dsi controller structure * * This function can be used to check status of the panel using bta check * for the panel. * * Return: positive value if the panel is in good state, negative value or * zero otherwise. */ static int msm_dsi_bta_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata) { int ret = 0; if (ctrl_pdata == NULL) { pr_err("%s: Invalid input data\n", __func__); return 0; } mutex_lock(&ctrl_pdata->cmd_mutex); msm_dsi_clk_ctrl(&ctrl_pdata->panel_data, 1); msm_dsi_cmd_mdp_busy(ctrl_pdata); msm_dsi_set_irq(ctrl_pdata, DSI_INTR_BTA_DONE_MASK); INIT_COMPLETION(ctrl_pdata->bta_comp); /* BTA trigger */ MIPI_OUTP(dsi_host_private->dsi_base + DSI_CMD_MODE_BTA_SW_TRIGGER, 0x01); wmb(); ret = wait_for_completion_killable_timeout(&ctrl_pdata->bta_comp, HZ/10); msm_dsi_clear_irq(ctrl_pdata, DSI_INTR_BTA_DONE_MASK); msm_dsi_clk_ctrl(&ctrl_pdata->panel_data, 0); mutex_unlock(&ctrl_pdata->cmd_mutex); if (ret <= 0) pr_err("%s: DSI BTA error: %i\n", __func__, __LINE__); pr_debug("%s: BTA done with ret: %d\n", __func__, ret); return ret; } static void msm_dsi_debug_enable_clock(int on) { if (dsi_host_private->debug_enable_clk) dsi_host_private->debug_enable_clk(on); if (on) msm_dsi_ahb_ctrl(1); else msm_dsi_ahb_ctrl(0); } static int msm_dsi_debug_init(void) { int rc; if (!mdss_res) return 0; dsi_host_private->debug_enable_clk = mdss_res->debug_inf.debug_enable_clock; mdss_res->debug_inf.debug_enable_clock = msm_dsi_debug_enable_clock; rc = mdss_debug_register_base("dsi0", dsi_host_private->dsi_base, dsi_host_private->dsi_reg_size); return rc; } static int dsi_get_panel_cfg(char *panel_cfg) { int rc; struct mdss_panel_cfg *pan_cfg = NULL; if (!panel_cfg) return MDSS_PANEL_INTF_INVALID; pan_cfg = mdp3_panel_intf_type(MDSS_PANEL_INTF_DSI); if (IS_ERR(pan_cfg)) { panel_cfg[0] = 0; return PTR_ERR(pan_cfg); } else if (!pan_cfg) { panel_cfg[0] = 0; return 0; } pr_debug("%s:%d: cfg:[%s]\n", __func__, __LINE__, pan_cfg->arg_cfg); rc = strlcpy(panel_cfg, pan_cfg->arg_cfg, MDSS_MAX_PANEL_LEN); return rc; } static struct device_node *dsi_pref_prim_panel( struct platform_device *pdev) { struct device_node *dsi_pan_node = NULL; pr_debug("%s:%d: Select primary panel from dt\n", __func__, __LINE__); dsi_pan_node = of_parse_phandle(pdev->dev.of_node, "qcom,dsi-pref-prim-pan", 0); if (!dsi_pan_node) pr_err("%s:can't find panel phandle\n", __func__); return dsi_pan_node; } /** * dsi_find_panel_of_node(): find device node of dsi panel * @pdev: platform_device of the dsi ctrl node * @panel_cfg: string containing intf specific config data * * Function finds the panel device node using the interface * specific configuration data. This configuration data is * could be derived from the result of bootloader's GCDB * panel detection mechanism. If such config data doesn't * exist then this panel returns the default panel configured * in the device tree. * * returns pointer to panel node on success, NULL on error. */ static struct device_node *dsi_find_panel_of_node( struct platform_device *pdev, char *panel_cfg) { int l; char *panel_name; struct device_node *dsi_pan_node = NULL, *mdss_node = NULL; if (!panel_cfg) return NULL; l = strlen(panel_cfg); if (!l) { /* no panel cfg chg, parse dt */ pr_debug("%s:%d: no cmd line cfg present\n", __func__, __LINE__); dsi_pan_node = dsi_pref_prim_panel(pdev); } else { if (panel_cfg[0] != '0') { pr_err("%s:%d:ctrl id=[%d] not supported\n", __func__, __LINE__, panel_cfg[0]); return NULL; } /* * skip first two chars '<dsi_ctrl_id>' and * ':' to get to the panel name */ panel_name = panel_cfg + 2; pr_debug("%s:%d:%s:%s\n", __func__, __LINE__, panel_cfg, panel_name); mdss_node = of_parse_phandle(pdev->dev.of_node, "qcom,mdss-mdp", 0); if (!mdss_node) { pr_err("%s: %d: mdss_node null\n", __func__, __LINE__); return NULL; } dsi_pan_node = of_find_node_by_name(mdss_node, panel_name); if (!dsi_pan_node) { pr_err("%s: invalid pan node\n", __func__); dsi_pan_node = dsi_pref_prim_panel(pdev); } } return dsi_pan_node; } static int msm_dsi_clk_ctrl(struct mdss_panel_data *pdata, int enable) { u32 bitclk_rate = 0, byteclk_rate = 0, pclk_rate = 0, dsiclk_rate = 0; struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL; pr_debug("%s:\n", __func__); ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata, panel_data); mutex_lock(&ctrl_pdata->mutex); if (enable) { dsi_host_private->clk_count++; if (dsi_host_private->clk_count == 1) { msm_dsi_ahb_ctrl(1); msm_dsi_cal_clk_rate(pdata, &bitclk_rate, &dsiclk_rate, &byteclk_rate, &pclk_rate); msm_dsi_clk_set_rate(DSI_ESC_CLK_RATE, dsiclk_rate, byteclk_rate, pclk_rate); msm_dsi_prepare_clocks(); msm_dsi_clk_enable(); } } else { dsi_host_private->clk_count--; if (dsi_host_private->clk_count == 0) { msm_dsi_clear_irq(ctrl_pdata, ctrl_pdata->dsi_irq_mask); msm_dsi_clk_set_rate(DSI_ESC_CLK_RATE, 0, 0, 0); msm_dsi_clk_disable(); msm_dsi_unprepare_clocks(); msm_dsi_ahb_ctrl(0); } } mutex_unlock(&ctrl_pdata->mutex); return 0; } void msm_dsi_ctrl_init(struct mdss_dsi_ctrl_pdata *ctrl) { init_completion(&ctrl->dma_comp); init_completion(&ctrl->mdp_comp); init_completion(&ctrl->bta_comp); init_completion(&ctrl->video_comp); spin_lock_init(&ctrl->irq_lock); spin_lock_init(&ctrl->mdp_lock); mutex_init(&ctrl->mutex); mutex_init(&ctrl->cmd_mutex); complete(&ctrl->mdp_comp); dsi_buf_alloc(&ctrl->tx_buf, SZ_4K); dsi_buf_alloc(&ctrl->rx_buf, SZ_4K); dsi_buf_alloc(&ctrl->status_buf, SZ_4K); ctrl->cmdlist_commit = msm_dsi_cmdlist_commit; ctrl->panel_mode = ctrl->panel_data.panel_info.mipi.mode; if (ctrl->status_mode == ESD_REG) ctrl->check_status = msm_dsi_reg_status_check; else if (ctrl->status_mode == ESD_BTA) ctrl->check_status = msm_dsi_bta_status_check; if (ctrl->status_mode == ESD_MAX) { pr_err("%s: Using default BTA for ESD check\n", __func__); ctrl->check_status = msm_dsi_bta_status_check; } } static int __devinit msm_dsi_probe(struct platform_device *pdev) { struct dsi_interface intf; char panel_cfg[MDSS_MAX_PANEL_LEN]; struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL; int rc = 0; struct device_node *dsi_pan_node = NULL; bool cmd_cfg_cont_splash = false; struct resource *mdss_dsi_mres; pr_debug("%s\n", __func__); rc = msm_dsi_init(); if (rc) return rc; if (!pdev->dev.of_node) { pr_err("%s: Device node is not accessible\n", __func__); rc = -ENODEV; goto error_no_mem; } pdev->id = 0; ctrl_pdata = platform_get_drvdata(pdev); if (!ctrl_pdata) { ctrl_pdata = devm_kzalloc(&pdev->dev, sizeof(struct mdss_dsi_ctrl_pdata), GFP_KERNEL); if (!ctrl_pdata) { pr_err("%s: FAILED: cannot alloc dsi ctrl\n", __func__); rc = -ENOMEM; goto error_no_mem; } platform_set_drvdata(pdev, ctrl_pdata); } mdss_dsi_mres = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mdss_dsi_mres) { pr_err("%s:%d unable to get the MDSS reg resources", __func__, __LINE__); rc = -ENOMEM; goto error_io_resource; } else { dsi_host_private->dsi_reg_size = resource_size(mdss_dsi_mres); dsi_host_private->dsi_base = ioremap(mdss_dsi_mres->start, dsi_host_private->dsi_reg_size); if (!dsi_host_private->dsi_base) { pr_err("%s:%d unable to remap dsi resources", __func__, __LINE__); rc = -ENOMEM; goto error_io_resource; } } mdss_dsi_mres = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!mdss_dsi_mres || mdss_dsi_mres->start == 0) { pr_err("%s:%d unable to get the MDSS irq resources", __func__, __LINE__); rc = -ENODEV; goto error_irq_resource; } rc = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); if (rc) { dev_err(&pdev->dev, "%s: failed to add child nodes, rc=%d\n", __func__, rc); goto error_platform_pop; } /* DSI panels can be different between controllers */ rc = dsi_get_panel_cfg(panel_cfg); if (!rc) /* dsi panel cfg not present */ pr_warn("%s:%d:dsi specific cfg not present\n", __func__, __LINE__); /* find panel device node */ dsi_pan_node = dsi_find_panel_of_node(pdev, panel_cfg); if (!dsi_pan_node) { pr_err("%s: can't find panel node %s\n", __func__, panel_cfg); goto error_pan_node; } cmd_cfg_cont_splash = mdp3_panel_get_boot_cfg() ? true : false; rc = mdss_dsi_panel_init(dsi_pan_node, ctrl_pdata, cmd_cfg_cont_splash); if (rc) { pr_err("%s: dsi panel init failed\n", __func__); goto error_pan_node; } rc = dsi_ctrl_config_init(pdev, ctrl_pdata); if (rc) { dev_err(&pdev->dev, "%s: failed to parse mdss dtsi rc=%d\n", __func__, rc); goto error_pan_node; } rc = msm_dsi_io_init(pdev, &(ctrl_pdata->power_data)); if (rc) { dev_err(&pdev->dev, "%s: failed to init DSI IO, rc=%d\n", __func__, rc); goto error_io_init; } pr_debug("%s: Dsi Ctrl->0 initialized\n", __func__); dsi_host_private->dis_dev = pdev->dev; intf.on = msm_dsi_on; intf.off = msm_dsi_off; intf.cont_on = msm_dsi_cont_on; intf.clk_ctrl = msm_dsi_clk_ctrl; intf.op_mode_config = msm_dsi_op_mode_config; intf.index = 0; intf.private = NULL; dsi_register_interface(&intf); msm_dsi_debug_init(); msm_dsi_ctrl_init(ctrl_pdata); rc = msm_dsi_irq_init(&pdev->dev, mdss_dsi_mres->start, ctrl_pdata); if (rc) { dev_err(&pdev->dev, "%s: failed to init irq, rc=%d\n", __func__, rc); goto error_device_register; } rc = dsi_panel_device_register_v2(pdev, ctrl_pdata); if (rc) { pr_err("%s: dsi panel dev reg failed\n", __func__); goto error_device_register; } pr_debug("%s success\n", __func__); return 0; error_device_register: msm_dsi_io_deinit(pdev, &(ctrl_pdata->power_data)); error_io_init: dsi_ctrl_config_deinit(pdev, ctrl_pdata); error_pan_node: of_node_put(dsi_pan_node); error_platform_pop: msm_dsi_clear_irq(ctrl_pdata, ctrl_pdata->dsi_irq_mask); error_irq_resource: if (dsi_host_private->dsi_base) { iounmap(dsi_host_private->dsi_base); dsi_host_private->dsi_base = NULL; } error_io_resource: devm_kfree(&pdev->dev, ctrl_pdata); error_no_mem: msm_dsi_deinit(); return rc; } static int __devexit msm_dsi_remove(struct platform_device *pdev) { struct mdss_dsi_ctrl_pdata *ctrl_pdata = platform_get_drvdata(pdev); if (!ctrl_pdata) { pr_err("%s: no driver data\n", __func__); return -ENODEV; } msm_dsi_clear_irq(ctrl_pdata, ctrl_pdata->dsi_irq_mask); msm_dsi_io_deinit(pdev, &(ctrl_pdata->power_data)); dsi_ctrl_config_deinit(pdev, ctrl_pdata); iounmap(dsi_host_private->dsi_base); dsi_host_private->dsi_base = NULL; msm_dsi_deinit(); devm_kfree(&pdev->dev, ctrl_pdata); return 0; } static const struct of_device_id msm_dsi_v2_dt_match[] = { {.compatible = "qcom,msm-dsi-v2"}, {} }; MODULE_DEVICE_TABLE(of, msm_dsi_v2_dt_match); static struct platform_driver msm_dsi_v2_driver = { .probe = msm_dsi_probe, .remove = __devexit_p(msm_dsi_remove), .shutdown = NULL, .driver = { .name = "msm_dsi_v2", .of_match_table = msm_dsi_v2_dt_match, }, }; static int msm_dsi_v2_register_driver(void) { return platform_driver_register(&msm_dsi_v2_driver); } static int __init msm_dsi_v2_driver_init(void) { int ret; ret = msm_dsi_v2_register_driver(); if (ret) { pr_err("msm_dsi_v2_register_driver() failed!\n"); return ret; } return ret; } module_init(msm_dsi_v2_driver_init); static void __exit msm_dsi_v2_driver_cleanup(void) { platform_driver_unregister(&msm_dsi_v2_driver); } module_exit(msm_dsi_v2_driver_cleanup);
shakalaca/ASUS_PadFone_PF500KL
kernel/drivers/video/msm/mdss/dsi_host_v2.c
C
gpl-2.0
45,691
[ 30522, 1013, 1008, 9385, 1006, 1039, 1007, 2262, 1011, 2297, 1010, 1996, 11603, 3192, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!-- template designed by Marco Von Ballmoos --> <title>Docs for page DiffBlock.class.php</title> <link rel="stylesheet" href="../../media/stylesheet.css" /> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/> </head> <body> <div class="page-body"> <h2 class="file-name">/fileHandler/DiffBlock.class.php</h2> <a name="sec-description"></a> <div class="info-box"> <div class="info-box-title">Description</div> <div class="nav-bar"> <span class="disabled">Description</span> | <a href="#sec-classes">Classes</a> </div> <div class="info-box-body"> <!-- ========== Info from phpDoc block ========= --> <p class="short-description">This file is part of the phpCollab3 package.</p> <p class="description"><p>(c) 2009 Ideato s.r.l. &lt;phpcollab@ideato.it&gt;</p><p>For the full copyright and license information, please view the LICENSE file that was distributed with this source code.</p><p>DiffBlock</p></p> </div> </div> <a name="sec-classes"></a> <div class="info-box"> <div class="info-box-title">Classes</div> <div class="nav-bar"> <a href="#sec-description">Description</a> | <span class="disabled">Classes</span> </div> <div class="info-box-body"> <table cellpadding="2" cellspacing="0" class="class-table"> <tr> <th class="class-table-header">Class</th> <th class="class-table-header">Description</th> </tr> <tr> <td style="padding-right: 2em; vertical-align: top"> <a href="../../phpCollab3/idRepositoryPlugin/DiffBlock.html">DiffBlock</a> </td> <td> A DiffBlock class manages a set of DiffLine objects to rapresent a sequence of lines retrived from a diff file. </td> </tr> </table> </div> </div> <p class="notes" id="credit"> Documentation generated on Thu, 28 May 2009 17:40:14 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a> </p> </div></body> </html>
ideato/phpcollab3
doc/idRepositoryPlugin-lib/phpCollab3/idRepositoryPlugin/_fileHandler---DiffBlock.class.php.html
HTML
mit
2,233
[ 30522, 1026, 1029, 20950, 2544, 1027, 1000, 1015, 1012, 1014, 1000, 17181, 1027, 1000, 11163, 1011, 6070, 28154, 1011, 1015, 1000, 1029, 1028, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
----------------------------------- -- Area: Upper Delkfutt's Tower -- MOB: Porphyrion ----------------------------------- mixins = {require("scripts/mixins/job_special")}; require("scripts/globals/status"); function onMobSpawn(mob) mob:setLocalVar("mainSpec", dsp.jsa.EES_GIGA); end; function onMobDeath(mob, player, isKiller) end;
waterlgndx/darkstar
scripts/zones/Upper_Delkfutts_Tower/mobs/Porphyrion.lua
Lua
gpl-3.0
340
[ 30522, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 2181, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; public interface EventListener { void ReceiveEvent(EventMessage evt); }
duaiwe/ld36
src/Assets/CommonScripts/EventListener.cs
C#
mit
91
[ 30522, 2478, 2291, 1025, 2270, 8278, 2724, 9863, 24454, 1063, 11675, 4374, 18697, 3372, 1006, 2724, 7834, 3736, 3351, 23408, 2102, 1007, 1025, 1065, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// // LGFLabelHTMLViewController.h // demos // // Created by qddios2 on 16/5/25. // Copyright © 2016年 lvguifeng. All rights reserved. // #import <UIKit/UIKit.h> @interface LGFLabelHTMLViewController : UIViewController<CodeDemosProtocol> @end
LDreame/CodeDemos
CodeDemos/CodeDemos/demos/Label加载HTML/LGFLabelHTMLViewController.h
C
mit
252
[ 30522, 1013, 1013, 1013, 1013, 1048, 25708, 20470, 2884, 11039, 19968, 8584, 8663, 13181, 10820, 1012, 1044, 1013, 1013, 18267, 1013, 1013, 1013, 1013, 2580, 2011, 1053, 14141, 10735, 2475, 2006, 2385, 1013, 1019, 1013, 2423, 1012, 1013, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# snake mini snake en SDL Le but de ce repo est de proposer un algorithme simple pour comprendre une manière de faire un snake, l'utilisation de la librairie graphique SDL n'étant là que pour la mise en place du cadre du jeu. Ce tutoriel se veut se concentrer en particulier sur comment faire facilement bouger le ver, de manière rapide et efficace, sans que cela ne devienne trop compliqué ou lent lorsque le ver devient plus grand.
elekmad/snake
README.md
Markdown
gpl-2.0
441
[ 30522, 1001, 7488, 7163, 7488, 4372, 17371, 2140, 3393, 2021, 2139, 8292, 16360, 2080, 9765, 2139, 16599, 2099, 4895, 9896, 2063, 3722, 10364, 4012, 28139, 4859, 2890, 16655, 23624, 7869, 2139, 4189, 2063, 4895, 7488, 1010, 1048, 1005, 2118...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICH_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICH_HPP #include <cstddef> #include <algorithm> #include <map> #include <set> #include <vector> #ifdef BOOST_GEOMETRY_DEBUG_ENRICH # include <iostream> # include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp> # include <boost/geometry/io/wkt/wkt.hpp> # define BOOST_GEOMETRY_DEBUG_IDENTIFIER #endif #include <boost/range.hpp> #include <boost/geometry/iterators/ever_circling_iterator.hpp> #include <boost/geometry/algorithms/detail/ring_identifier.hpp> #include <boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp> #include <boost/geometry/algorithms/detail/overlay/handle_colocations.hpp> #include <boost/geometry/algorithms/detail/overlay/less_by_segment_ratio.hpp> #include <boost/geometry/algorithms/detail/overlay/overlay_type.hpp> #include <boost/geometry/algorithms/detail/overlay/sort_by_side.hpp> #include <boost/geometry/policies/robustness/robust_type.hpp> #include <boost/geometry/strategies/side.hpp> #ifdef BOOST_GEOMETRY_DEBUG_ENRICH # include <boost/geometry/algorithms/detail/overlay/check_enrich.hpp> #endif namespace boost { namespace geometry { #ifndef DOXYGEN_NO_DETAIL namespace detail { namespace overlay { // Sorts IP-s of this ring on segment-identifier, and if on same segment, // on distance. // Then assigns for each IP which is the next IP on this segment, // plus the vertex-index to travel to, plus the next IP // (might be on another segment) template < bool Reverse1, bool Reverse2, typename Operations, typename Turns, typename Geometry1, typename Geometry2, typename RobustPolicy, typename Strategy > inline void enrich_sort(Operations& operations, Turns const& turns, operation_type for_operation, Geometry1 const& geometry1, Geometry2 const& geometry2, RobustPolicy const& robust_policy, Strategy const& /*strategy*/) { std::sort(boost::begin(operations), boost::end(operations), less_by_segment_ratio < Turns, typename boost::range_value<Operations>::type, Geometry1, Geometry2, RobustPolicy, Reverse1, Reverse2 >(turns, for_operation, geometry1, geometry2, robust_policy)); } template <typename Operations, typename Turns> inline void enrich_assign(Operations& operations, Turns& turns) { typedef typename boost::range_value<Turns>::type turn_type; typedef typename turn_type::turn_operation_type op_type; typedef typename boost::range_iterator<Operations>::type iterator_type; if (operations.size() > 0) { // Assign travel-to-vertex/ip index for each turning point. // Iterator "next" is circular geometry::ever_circling_range_iterator<Operations const> next(operations); ++next; for (iterator_type it = boost::begin(operations); it != boost::end(operations); ++it) { turn_type& turn = turns[it->turn_index]; op_type& op = turn.operations[it->operation_index]; // Normal behaviour: next should point at next turn: if (it->turn_index == next->turn_index) { ++next; } // Cluster behaviour: next should point after cluster, unless // their seg_ids are not the same while (turn.cluster_id != -1 && it->turn_index != next->turn_index && turn.cluster_id == turns[next->turn_index].cluster_id && op.seg_id == turns[next->turn_index].operations[next->operation_index].seg_id) { ++next; } turn_type const& next_turn = turns[next->turn_index]; op_type const& next_op = next_turn.operations[next->operation_index]; op.enriched.travels_to_ip_index = static_cast<signed_size_type>(next->turn_index); op.enriched.travels_to_vertex_index = next->subject->seg_id.segment_index; if (op.seg_id.segment_index == next_op.seg_id.segment_index && op.fraction < next_op.fraction) { // Next turn is located further on same segment // assign next_ip_index // (this is one not circular therefore fraction is considered) op.enriched.next_ip_index = static_cast<signed_size_type>(next->turn_index); } } } // DEBUG #ifdef BOOST_GEOMETRY_DEBUG_ENRICH { for (iterator_type it = boost::begin(operations); it != boost::end(operations); ++it) { op_type& op = turns[it->turn_index] .operations[it->operation_index]; std::cout << it->turn_index << " cl=" << turns[it->turn_index].cluster_id << " meth=" << method_char(turns[it->turn_index].method) << " seg=" << op.seg_id << " dst=" << op.fraction // needs define << " op=" << operation_char(turns[it->turn_index].operations[0].operation) << operation_char(turns[it->turn_index].operations[1].operation) << " (" << operation_char(op.operation) << ")" << " nxt=" << op.enriched.next_ip_index << " / " << op.enriched.travels_to_ip_index << " [vx " << op.enriched.travels_to_vertex_index << "]" << std::boolalpha << turns[it->turn_index].discarded << std::endl; ; } } #endif // END DEBUG } template <typename Turns, typename MappedVector> inline void create_map(Turns const& turns, detail::overlay::operation_type for_operation, MappedVector& mapped_vector) { typedef typename boost::range_value<Turns>::type turn_type; typedef typename turn_type::container_type container_type; typedef typename MappedVector::mapped_type mapped_type; typedef typename boost::range_value<mapped_type>::type indexed_type; std::size_t index = 0; for (typename boost::range_iterator<Turns const>::type it = boost::begin(turns); it != boost::end(turns); ++it, ++index) { // Add all (non discarded) operations on this ring // Blocked operations or uu on clusters (for intersection) // should be included, to block potential paths in clusters turn_type const& turn = *it; if (turn.discarded) { continue; } if (for_operation == operation_intersection && turn.cluster_id == -1 && turn.both(operation_union)) { // Only include uu turns if part of cluster (to block potential paths), // otherwise they can block possibly viable paths continue; } std::size_t op_index = 0; for (typename boost::range_iterator<container_type const>::type op_it = boost::begin(turn.operations); op_it != boost::end(turn.operations); ++op_it, ++op_index) { ring_identifier const ring_id ( op_it->seg_id.source_index, op_it->seg_id.multi_index, op_it->seg_id.ring_index ); mapped_vector[ring_id].push_back ( indexed_type(index, op_index, *op_it, it->operations[1 - op_index].seg_id) ); } } } }} // namespace detail::overlay #endif //DOXYGEN_NO_DETAIL /*! \brief All intersection points are enriched with successor information \ingroup overlay \tparam Turns type of intersection container (e.g. vector of "intersection/turn point"'s) \tparam Clusters type of cluster container \tparam Geometry1 \tparam_geometry \tparam Geometry2 \tparam_geometry \tparam Strategy side strategy type \param turns container containing intersection points \param clusters container containing clusters \param geometry1 \param_geometry \param geometry2 \param_geometry \param robust_policy policy to handle robustness issues \param strategy strategy */ template < bool Reverse1, bool Reverse2, overlay_type OverlayType, typename Turns, typename Clusters, typename Geometry1, typename Geometry2, typename RobustPolicy, typename Strategy > inline void enrich_intersection_points(Turns& turns, Clusters& clusters, Geometry1 const& geometry1, Geometry2 const& geometry2, RobustPolicy const& robust_policy, Strategy const& strategy) { static const detail::overlay::operation_type for_operation = detail::overlay::operation_from_overlay<OverlayType>::value; typedef typename boost::range_value<Turns>::type turn_type; typedef typename turn_type::turn_operation_type op_type; typedef detail::overlay::indexed_turn_operation < op_type > indexed_turn_operation; typedef std::map < ring_identifier, std::vector<indexed_turn_operation> > mapped_vector_type; bool const has_colocations = detail::overlay::handle_colocations<Reverse1, Reverse2>(turns, clusters, geometry1, geometry2); // Discard none turns, if any for (typename boost::range_iterator<Turns>::type it = boost::begin(turns); it != boost::end(turns); ++it) { if (it->both(detail::overlay::operation_none)) { it->discarded = true; } } // Create a map of vectors of indexed operation-types to be able // to sort intersection points PER RING mapped_vector_type mapped_vector; detail::overlay::create_map(turns, for_operation, mapped_vector); // No const-iterator; contents of mapped copy is temporary, // and changed by enrich for (typename mapped_vector_type::iterator mit = mapped_vector.begin(); mit != mapped_vector.end(); ++mit) { #ifdef BOOST_GEOMETRY_DEBUG_ENRICH std::cout << "ENRICH-sort Ring " << mit->first << std::endl; #endif detail::overlay::enrich_sort<Reverse1, Reverse2>( mit->second, turns, for_operation, geometry1, geometry2, robust_policy, strategy); } for (typename mapped_vector_type::iterator mit = mapped_vector.begin(); mit != mapped_vector.end(); ++mit) { #ifdef BOOST_GEOMETRY_DEBUG_ENRICH std::cout << "ENRICH-assign Ring " << mit->first << std::endl; #endif detail::overlay::enrich_assign(mit->second, turns); } if (has_colocations) { detail::overlay::gather_cluster_properties<Reverse1, Reverse2>( clusters, turns, for_operation, geometry1, geometry2); } #ifdef BOOST_GEOMETRY_DEBUG_ENRICH //detail::overlay::check_graph(turns, for_operation); #endif } }} // namespace boost::geometry #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICH_HPP
vovkasm/react-native-web-image
tests/TestApp/Pods/boost-for-react-native/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp
C++
mit
11,595
[ 30522, 1013, 1013, 12992, 1012, 10988, 1006, 9875, 1043, 23296, 1010, 12391, 10988, 3075, 1007, 30524, 1015, 1035, 1014, 1012, 19067, 2102, 2030, 6100, 2012, 1013, 1013, 8299, 1024, 1013, 1013, 7479, 1012, 12992, 1012, 8917, 1013, 6105, 103...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* You may freely copy, distribute, modify and use this class as long as the original author attribution remains intact. See message below. Copyright (C) 1998-2006 Christian Pesch. All Rights Reserved. */ package slash.carcosts; import slash.gui.model.AbstractModel; /** * An CurrencyModel holds a Currency and provides get and set * methods for it. * * @author Christian Pesch */ public class CurrencyModel extends AbstractModel { /** * Construct a new CurrencyModel. */ public CurrencyModel() { this(Currency.getCurrency("DM")); } /** * Construct a new CurrencyModel. */ public CurrencyModel(Currency value) { setValue(value); } /** * Get the Currency value that is holded by the model. */ public Currency getValue() { return value; } /** * Set the Currency value to hold. */ public void setValue(Currency newValue) { if (value != newValue) { this.value = newValue; fireStateChanged(); } } public String toString() { return "CurrencyModel(" + value + ")"; } private Currency value; }
cpesch/CarCosts
car-costs/src/main/java/slash/carcosts/CurrencyModel.java
Java
gpl-2.0
1,184
[ 30522, 1013, 1008, 2017, 2089, 10350, 6100, 1010, 16062, 1010, 19933, 1998, 2224, 2023, 2465, 2004, 2146, 2004, 1996, 2434, 3166, 2012, 18886, 29446, 3464, 10109, 1012, 2156, 4471, 2917, 1012, 9385, 1006, 1039, 1007, 2687, 1011, 2294, 3017,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2012 * All rights reserved * * This file is part of GPAC / DirectX audio and video render module * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * GPAC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ /*driver interfaces*/ #include <gpac/modules/video_out.h> #include <gpac/modules/audio_out.h> #include <gpac/user.h> #include <gpac/list.h> #include <gpac/constants.h> #include <gpac/setup.h> typedef struct { char *pixels; u32 width, height; u32 pixel_format, bpp; Bool passthrough; u32 sample_rate, nb_channels, chan_cfg; } RawContext; #define RAWCTX RawContext *rc = (RawContext *)dr->opaque static GF_Err raw_resize(GF_VideoOutput *dr, u32 w, u32 h) { RAWCTX; if (rc->pixels) gf_free(rc->pixels); rc->width = w; rc->height = h; rc->pixels = (char*)gf_malloc(sizeof(char) * rc->bpp * w * h); if (!rc->pixels) return GF_OUT_OF_MEM; return GF_OK; } static GF_Err RAW_BlitPassthrough(GF_VideoOutput *dr, GF_VideoSurface *video_src, GF_Window *src_wnd, GF_Window *dst_wnd, u32 overlay_type) { return GF_OK; } GF_Err RAW_Setup(GF_VideoOutput *dr, void *os_handle, void *os_display, u32 init_flags) { const char *opt; RAWCTX; opt = gf_modules_get_option((GF_BaseInterface *)dr, "RAWVideo", "RawOutput"); if (opt && !strcmp(opt, "null")) { rc->passthrough = GF_TRUE; dr->Blit = RAW_BlitPassthrough; dr->hw_caps |= GF_VIDEO_HW_HAS_RGB | GF_VIDEO_HW_HAS_RGBA | GF_VIDEO_HW_HAS_STRETCH | GF_VIDEO_HW_HAS_YUV | GF_VIDEO_HW_OPENGL | GF_VIDEO_HW_HAS_YUV_OVERLAY; } if (init_flags & GF_TERM_WINDOW_TRANSPARENT) { rc->bpp = 4; rc->pixel_format = GF_PIXEL_ARGB; } else { rc->bpp = 3; rc->pixel_format = GF_PIXEL_RGB_24; } raw_resize(dr, 100, 100); return GF_OK; } static void RAW_Shutdown(GF_VideoOutput *dr) { RAWCTX; if (rc->pixels) gf_free(rc->pixels); rc->pixels = NULL; } static GF_Err RAW_Flush(GF_VideoOutput *dr, GF_Window *dest) { #if 0 RAWCTX; char szName[1024]; sprintf(szName, "test%d.png", gf_sys_clock()); gf_img_png_enc_file(rc->pixels, rc->width, rc->height, rc->width*rc->bpp, rc->pixel_format, szName); #endif return GF_OK; } static GF_Err RAW_LockBackBuffer(GF_VideoOutput *dr, GF_VideoSurface *vi, Bool do_lock) { RAWCTX; if (do_lock) { if (!vi) return GF_BAD_PARAM; memset(vi, 0, sizeof(GF_VideoSurface)); vi->height = rc->height; vi->width = rc->width; vi->video_buffer = rc->pixels; vi->pitch_x = rc->bpp; vi->pitch_y = rc->bpp * vi->width; vi->pixel_format = rc->pixel_format; } return GF_OK; } static GF_Err RAW_ProcessEvent(GF_VideoOutput *dr, GF_Event *evt) { if (evt) { switch (evt->type) { case GF_EVENT_VIDEO_SETUP: if (evt->setup.opengl_mode) return GF_NOT_SUPPORTED; return raw_resize(dr, evt->setup.width, evt->setup.height); } } return GF_OK; } GF_VideoOutput *NewRawVideoOutput() { RawContext *pCtx; GF_VideoOutput *driv = (GF_VideoOutput *) gf_malloc(sizeof(GF_VideoOutput)); memset(driv, 0, sizeof(GF_VideoOutput)); GF_REGISTER_MODULE_INTERFACE(driv, GF_VIDEO_OUTPUT_INTERFACE, "Raw Video Output", "gpac distribution") pCtx = (RawContext*)gf_malloc(sizeof(RawContext)); memset(pCtx, 0, sizeof(RawContext)); driv->opaque = pCtx; driv->Flush = RAW_Flush; driv->LockBackBuffer = RAW_LockBackBuffer; driv->Setup = RAW_Setup; driv->Shutdown = RAW_Shutdown; driv->ProcessEvent = RAW_ProcessEvent; return driv; } void DeleteRawVideoOutput(void *ifce) { RawContext *rc; GF_VideoOutput *driv = (GF_VideoOutput *) ifce; rc = (RawContext *)driv->opaque; gf_free(rc); gf_free(driv); } static GF_Err RAW_AudioSetup(GF_AudioOutput *dr, void *os_handle, u32 num_buffers, u32 total_duration) { return GF_OK; } static void RAW_AudioShutdown(GF_AudioOutput *dr) { } /*we assume what was asked is what we got*/ static GF_Err RAW_ConfigureOutput(GF_AudioOutput *dr, u32 *SampleRate, u32 *NbChannels, u32 *nbBitsPerSample, u32 channel_cfg) { RAWCTX; rc->sample_rate = *SampleRate; rc->nb_channels = *NbChannels; rc->chan_cfg = channel_cfg; return GF_OK; } static void RAW_WriteAudio(GF_AudioOutput *dr) { char buf[4096]; dr->FillBuffer(dr->audio_renderer, buf, 4096); } static void RAW_Play(GF_AudioOutput *dr, u32 PlayType) { } static void RAW_SetVolume(GF_AudioOutput *dr, u32 Volume) { } static void RAW_SetPan(GF_AudioOutput *dr, u32 Pan) { } static GF_Err RAW_QueryOutputSampleRate(GF_AudioOutput *dr, u32 *desired_samplerate, u32 *NbChannels, u32 *nbBitsPerSample) { return GF_OK; } static u32 RAW_GetAudioDelay(GF_AudioOutput *dr) { return 0; } static u32 RAW_GetTotalBufferTime(GF_AudioOutput *dr) { return 0; } void *NewRawAudioOutput() { RawContext *ctx; GF_AudioOutput *driv; ctx = (RawContext*)gf_malloc(sizeof(RawContext)); memset(ctx, 0, sizeof(RawContext)); driv = (GF_AudioOutput*)gf_malloc(sizeof(GF_AudioOutput)); memset(driv, 0, sizeof(GF_AudioOutput)); GF_REGISTER_MODULE_INTERFACE(driv, GF_AUDIO_OUTPUT_INTERFACE, "Raw Audio Output", "gpac distribution") driv->opaque = ctx; driv->SelfThreaded = GF_FALSE; driv->Setup = RAW_AudioSetup; driv->Shutdown = RAW_AudioShutdown; driv->ConfigureOutput = RAW_ConfigureOutput; driv->GetAudioDelay = RAW_GetAudioDelay; driv->GetTotalBufferTime = RAW_GetTotalBufferTime; driv->SetVolume = RAW_SetVolume; driv->SetPan = RAW_SetPan; driv->Play = RAW_Play; driv->QueryOutputSampleRate = RAW_QueryOutputSampleRate; driv->WriteAudio = RAW_WriteAudio; return driv; } void DeleteAudioOutput(void *ifce) { GF_AudioOutput *dr = (GF_AudioOutput *) ifce; RawContext *ctx = (RawContext*)dr->opaque; gf_free(ctx); gf_free(dr); } #ifndef GPAC_STANDALONE_RENDER_2D /*interface query*/ GPAC_MODULE_EXPORT const u32 *QueryInterfaces() { static u32 si [] = { GF_VIDEO_OUTPUT_INTERFACE, GF_AUDIO_OUTPUT_INTERFACE, 0 }; return si; } /*interface create*/ GPAC_MODULE_EXPORT GF_BaseInterface *LoadInterface(u32 InterfaceType) { if (InterfaceType == GF_VIDEO_OUTPUT_INTERFACE) return (GF_BaseInterface *) NewRawVideoOutput(); if (InterfaceType == GF_AUDIO_OUTPUT_INTERFACE) return (GF_BaseInterface *) NewRawAudioOutput(); return NULL; } /*interface destroy*/ GPAC_MODULE_EXPORT void ShutdownInterface(GF_BaseInterface *ifce) { switch (ifce->InterfaceType) { case GF_VIDEO_OUTPUT_INTERFACE: DeleteRawVideoOutput((GF_VideoOutput *)ifce); break; case GF_AUDIO_OUTPUT_INTERFACE: DeleteAudioOutput((GF_AudioOutput *)ifce); break; } } GPAC_MODULE_STATIC_DECLARATION( raw_out ) #endif
psteinb/gpac
modules/raw_out/raw_video.c
C
lgpl-2.1
7,166
[ 30522, 1013, 1008, 1008, 14246, 6305, 1011, 14959, 7705, 1039, 17371, 2243, 1008, 1008, 6048, 1024, 3744, 3393, 10768, 2226, 12229, 1008, 9385, 1006, 1039, 1007, 18126, 3000, 15007, 2456, 1011, 2262, 1008, 2035, 2916, 9235, 1008, 1008, 2023...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Registration agent for Difio, preconfigured for dotCloud / Ruby applications. It compiles a list of installed packages and sends it to http://www.dif.io. Installing on your dotCloud Ruby application ----------------------------------------------------- - Create an account at http://www.dif.io - Create your Ruby application in dotCloud and push it - Configure your Difio userID. You can get it from https://difio-otb.rhcloud.com/profiles/mine/ dotcloud var set <app name> DIFIO_USER_ID=UserID - Generate a unique identifier for this application and save the value as environmental variable. dotcloud var set <app name> DIFIO_UUID=`uuidgen` - Add a dependency in your application's Gemfile ... gem 'difio-dotcloud-ruby' ... - Enable the registration script in your postinstall hook. **Note:** If you are using an "approot" your `postinstall` script should be in the directory pointed by the “approot” directive of your `dotcloud.yml`. For more information about `postinstall` turn to http://docs.dotcloud.com/guides/postinstall/. If a file named `postinstall` doesn't already exist, create it and add the following: #!/bin/sh cd /home/dotcloud/code bundle exec difio-dotcloud - Make `postinstall` executable chmod a+x postinstall - Commit your changes (if using git): git add . git commit -m "enable Difio registration" - Then push your application to dotCloud dotcloud push <app name> - If everything goes well you should see something like: 19:55:10 [www.0] Running postinstall script... 19:55:13 [www.0] response:200 19:55:13 [www.0] Difio: Success, registered/updated application with uuid 7676711b-9d3b-4ef5-81e2-cf0287632a29 That's it, you can now check your application statistics at http://www.dif.io
difio/difio-dotcloud-ruby
README.md
Markdown
mit
1,857
[ 30522, 8819, 4005, 2005, 4487, 8873, 2080, 1010, 3653, 8663, 8873, 27390, 2098, 2005, 11089, 20464, 19224, 1013, 10090, 5097, 1012, 2009, 4012, 22090, 2015, 1037, 2862, 1997, 5361, 14555, 1998, 10255, 2009, 2000, 8299, 1024, 1013, 1013, 747...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#region Copyright (c) 2009 S. van Deursen /* The CuttingEdge.Conditions library enables developers to validate pre- and postconditions in a fluent * manner. * * To contact me, please visit my blog at http://www.cuttingedge.it/blogs/steven/ * * Copyright (c) 2009 S. van Deursen * * 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. */ #endregion using System; using System.ComponentModel; namespace CuttingEdge.Conditions { /// <summary> /// The RequiresValidator can be used for precondition checks. /// </summary> /// <typeparam name="T">The type of the argument to be validated</typeparam> internal class RequiresValidator<T> : ConditionValidator<T> { internal RequiresValidator(string argumentName, T value) : base(argumentName, value) { } internal virtual Exception BuildExceptionBasedOnViolationType(ConstraintViolationType type, string message) { switch (type) { case ConstraintViolationType.OutOfRangeViolation: return new ArgumentOutOfRangeException(this.ArgumentName, message); case ConstraintViolationType.InvalidEnumViolation: string enumMessage = this.BuildInvalidEnumArgumentExceptionMessage(message); return new InvalidEnumArgumentException(enumMessage); default: if (this.Value != null) { return new ArgumentException(message, this.ArgumentName); } else { return new ArgumentNullException(this.ArgumentName, message); } } } /// <summary>Throws an exception.</summary> /// <param name="condition">Describes the condition that doesn't hold, e.g., "Value should not be /// null".</param> /// <param name="additionalMessage">An additional message that will be appended to the exception /// message, e.g. "The actual value is 3.". This value may be null or empty.</param> /// <param name="type">Gives extra information on the exception type that must be build. The actual /// implementation of the validator may ignore some or all values.</param> protected override void ThrowExceptionCore(string condition, string additionalMessage, ConstraintViolationType type) { string message = BuildExceptionMessage(condition, additionalMessage); Exception exceptionToThrow = this.BuildExceptionBasedOnViolationType(type, message); throw exceptionToThrow; } private static string BuildExceptionMessage(string condition, string additionalMessage) { if (!String.IsNullOrEmpty(additionalMessage)) { return condition + ". " + additionalMessage; } else { return condition + "."; } } private string BuildInvalidEnumArgumentExceptionMessage(string message) { ArgumentException argumentException = new ArgumentException(message, this.ArgumentName); // Returns the message formatted according to the current culture. // Note that the 'Parameter name' part of the message is culture sensitive. return argumentException.Message; } } }
conditions/conditions
CuttingEdge.Conditions/RequiresValidator.cs
C#
mit
4,490
[ 30522, 1001, 2555, 9385, 1006, 1039, 1007, 2268, 1055, 1012, 3158, 2139, 28393, 2078, 1013, 1008, 1996, 6276, 24225, 1012, 3785, 3075, 12939, 9797, 2000, 9398, 3686, 3653, 1011, 1998, 2695, 8663, 20562, 2015, 1999, 1037, 19376, 1008, 5450, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Auto Shift: Why Do We Need a Shift Key? Tap a key and you get its character. Tap a key, but hold it *slightly* longer and you get its shifted state. Voilà! No shift key needed! ## Why Auto Shift? Many people suffer from various forms of RSI. A common cause is stretching your fingers repetitively long distances. For us on the keyboard, the pinky does that all too often when reaching for the shift key. Auto Shift looks to alleviate that problem. ## How Does It Work? When you tap a key, it stays depressed for a short period of time before it is then released. This depressed time is a different length for everyone. Auto Shift defines a constant `AUTO_SHIFT_TIMEOUT` which is typically set to twice your normal pressed state time. When you press a key, a timer starts and then stops when you release the key. If the time depressed is greater than or equal to the `AUTO_SHIFT_TIMEOUT`, then a shifted version of the key is emitted. If the time is less than the `AUTO_SHIFT_TIMEOUT` time, then the normal state is emitted. ## Are There Limitations to Auto Shift? Yes, unfortunately. 1. Key repeat will cease to work. For example, before if you wanted 20 'a' characters, you could press and hold the 'a' key for a second or two. This no longer works with Auto Shift because it is timing your depressed time instead of emitting a depressed key state to your operating system. 2. You will have characters that are shifted when you did not intend on shifting, and other characters you wanted shifted, but were not. This simply comes down to practice. As we get in a hurry, we think we have hit the key long enough for a shifted version, but we did not. On the other hand, we may think we are tapping the keys, but really we have held it for a little longer than anticipated. ## How Do I Enable Auto Shift? Add to your `rules.mk` in the keymap folder: AUTO_SHIFT_ENABLE = yes If no `rules.mk` exists, you can create one. Then compile and install your new firmware with Auto Key enabled! That's it! ## Modifiers By default, Auto Shift is disabled for any key press that is accompanied by one or more modifiers. Thus, Ctrl+A that you hold for a really long time is not the same as Ctrl+Shift+A. You can re-enable Auto Shift for modifiers by adding a define to your `config.h` ```c #define AUTO_SHIFT_MODIFIERS ``` In which case, Ctrl+A held past the `AUTO_SHIFT_TIMEOUT` will be sent as Ctrl+Shift+A ## Configuring Auto Shift If desired, there is some configuration that can be done to change the behavior of Auto Shift. This is done by setting various variables the `config.h` file located in your keymap folder. If no `config.h` file exists, you can create one. A sample is ```c #pragma once #define AUTO_SHIFT_TIMEOUT 150 #define NO_AUTO_SHIFT_SPECIAL ``` ### AUTO_SHIFT_TIMEOUT (Value in ms) This controls how long you have to hold a key before you get the shifted state. Obviously, this is different for everyone. For the common person, a setting of 135 to 150 works great. However, one should start with a value of at least 175, which is the default value. Then work down from there. The idea is to have the shortest time required to get the shifted state without having false positives. Play with this value until things are perfect. Many find that all will work well at a given value, but one or two keys will still emit the shifted state on occasion. This is simply due to habit and holding some keys a little longer than others. Once you find this value, work on tapping your problem keys a little quicker than normal and you will be set. ?> Auto Shift has three special keys that can help you get this value right very quick. See "Auto Shift Setup" for more details! ### NO_AUTO_SHIFT_SPECIAL (simple define) Do not Auto Shift special keys, which include -\_, =+, [{, ]}, ;:, '", ,<, .>, and /? ### NO_AUTO_SHIFT_NUMERIC (simple define) Do not Auto Shift numeric keys, zero through nine. ### NO_AUTO_SHIFT_ALPHA (simple define) Do not Auto Shift alpha characters, which include A through Z. ## Using Auto Shift Setup This will enable you to define three keys temporarily to increase, decrease and report your `AUTO_SHIFT_TIMEOUT`. ### Setup Map three keys temporarily in your keymap: | Key Name | Description | |----------|-----------------------------------------------------| | KC_ASDN | Lower the Auto Shift timeout variable (down) | | KC_ASUP | Raise the Auto Shift timeout variable (up) | | KC_ASRP | Report your current Auto Shift timeout value | | KC_ASON | Turns on the Auto Shift Function | | KC_ASOFF | Turns off the Auto Shift Function | | KC_ASTG | Toggles the state of the Auto Shift feature | Compile and upload your new firmware. ### Use It is important to note that during these tests, you should be typing completely normal and with no intention of shifted keys. 1. Type multiple sentences of alphabetical letters. 2. Observe any upper case letters. 3. If there are none, press the key you have mapped to `KC_ASDN` to decrease time Auto Shift timeout value and go back to step 1. 4. If there are some upper case letters, decide if you need to work on tapping those keys with less down time, or if you need to increase the timeout. 5. If you decide to increase the timeout, press the key you have mapped to `KC_ASUP` and go back to step 1. 6. Once you are happy with your results, press the key you have mapped to `KC_ASRP`. The keyboard will type by itself the value of your `AUTO_SHIFT_TIMEOUT`. 7. Update `AUTO_SHIFT_TIMEOUT` in your `config.h` with the value reported. 8. Remove `AUTO_SHIFT_SETUP` from your `config.h`. 9. Remove the key bindings `KC_ASDN`, `KC_ASUP` and `KC_ASRP`. 10. Compile and upload your new firmware. #### An Example Run hello world. my name is john doe. i am a computer programmer playing with keyboards right now. [PRESS KC_ASDN quite a few times] heLLo woRLd. mY nAMe is JOHn dOE. i AM A compUTeR proGRaMMER PlAYiNG witH KEYboArDS RiGHT NOw. [PRESS KC_ASUP a few times] hello world. my name is john Doe. i am a computer programmer playing with keyboarDs right now. [PRESS KC_ASRP] 115 The keyboard typed `115` which represents your current `AUTO_SHIFT_TIMEOUT` value. You are now set! Practice on the *D* key a little bit that showed up in the testing and you'll be golden.
chancegrissom/qmk_firmware
docs/feature_auto_shift.md
Markdown
gpl-2.0
6,477
[ 30522, 1001, 8285, 5670, 1024, 2339, 2079, 2057, 2342, 1037, 5670, 3145, 1029, 11112, 1037, 3145, 1998, 2017, 2131, 2049, 2839, 1012, 11112, 1037, 3145, 1010, 2021, 2907, 2009, 1008, 3621, 1008, 2936, 1998, 2017, 2131, 2049, 5429, 2110, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ 'use strict'; /* global createProcessedMediaStreamTrack */ // defined in main.js /** * Wrapper around createProcessedMediaStreamTrack to apply transform to a * MediaStream. * @param {!MediaStream} sourceStream the video stream to be transformed. The * first video track will be used. * @param {!FrameTransformFn} transform the transform to apply to the * sourceStream. * @param {!AbortSignal} signal can be used to stop processing * @return {!MediaStream} holds a single video track of the transformed video * frames */ function createProcessedMediaStream(sourceStream, transform, signal) { // For this sample, we're only dealing with video tracks. /** @type {!MediaStreamTrack} */ const sourceTrack = sourceStream.getVideoTracks()[0]; const processedTrack = createProcessedMediaStreamTrack(sourceTrack, transform, signal); // Create a new MediaStream to hold our processed track. const processedStream = new MediaStream(); processedStream.addTrack(processedTrack); return processedStream; } /** * Interface implemented by all video sources the user can select. A common * interface allows the user to choose a source independently of the transform * and sink. * @interface */ class MediaStreamSource { // eslint-disable-line no-unused-vars /** * Sets the path to this object from the debug global var. * @param {string} path */ setDebugPath(path) {} /** * Indicates if the source video should be mirrored/displayed on the page. If * false (the default), any element producing frames will not be a child of * the document. * @param {boolean} visible whether to add the raw source video to the page */ setVisibility(visible) {} /** * Initializes and returns the MediaStream for this source. * @return {!Promise<!MediaStream>} */ async getMediaStream() {} /** Frees any resources used by this object. */ destroy() {} } /** * Interface implemented by all video transforms that the user can select. A * common interface allows the user to choose a transform independently of the * source and sink. * @interface */ class FrameTransform { // eslint-disable-line no-unused-vars /** Initializes state that is reused across frames. */ async init() {} /** * Applies the transform to frame. Queues the output frame (if any) using the * controller. * @param {!VideoFrame} frame the input frame * @param {!TransformStreamDefaultController<!VideoFrame>} controller */ async transform(frame, controller) {} /** Frees any resources used by this object. */ destroy() {} } /** * Interface implemented by all video sinks that the user can select. A common * interface allows the user to choose a sink independently of the source and * transform. * @interface */ class MediaStreamSink { // eslint-disable-line no-unused-vars /** * @param {!MediaStream} stream */ async setMediaStream(stream) {} /** Frees any resources used by this object. */ destroy() {} } /** * Assembles a MediaStreamSource, FrameTransform, and MediaStreamSink together. */ class Pipeline { // eslint-disable-line no-unused-vars constructor() { /** @private {?MediaStreamSource} set by updateSource*/ this.source_ = null; /** @private {?FrameTransform} set by updateTransform */ this.frameTransform_ = null; /** @private {?MediaStreamSink} set by updateSink */ this.sink_ = null; /** @private {!AbortController} may used to stop all processing */ this.abortController_ = new AbortController(); /** * @private {?MediaStream} set in maybeStartPipeline_ after all of source_, * frameTransform_, and sink_ are set */ this.processedStream_ = null; } /** @return {?MediaStreamSource} */ getSource() { return this.source_; } /** * Sets a new source for the pipeline. * @param {!MediaStreamSource} mediaStreamSource */ async updateSource(mediaStreamSource) { if (this.source_) { this.abortController_.abort(); this.abortController_ = new AbortController(); this.source_.destroy(); this.processedStream_ = null; } this.source_ = mediaStreamSource; this.source_.setDebugPath('debug.pipeline.source_'); console.log( '[Pipeline] Updated source.', 'debug.pipeline.source_ = ', this.source_); await this.maybeStartPipeline_(); } /** @private */ async maybeStartPipeline_() { if (this.processedStream_ || !this.source_ || !this.frameTransform_ || !this.sink_) { return; } const sourceStream = await this.source_.getMediaStream(); await this.frameTransform_.init(); try { this.processedStream_ = createProcessedMediaStream( sourceStream, async (frame, controller) => { if (this.frameTransform_) { await this.frameTransform_.transform(frame, controller); } }, this.abortController_.signal); } catch (e) { this.destroy(); return; } await this.sink_.setMediaStream(this.processedStream_); console.log( '[Pipeline] Pipeline started.', 'debug.pipeline.abortController_ =', this.abortController_); } /** * Sets a new transform for the pipeline. * @param {!FrameTransform} frameTransform */ async updateTransform(frameTransform) { if (this.frameTransform_) this.frameTransform_.destroy(); this.frameTransform_ = frameTransform; console.log( '[Pipeline] Updated frame transform.', 'debug.pipeline.frameTransform_ = ', this.frameTransform_); if (this.processedStream_) { await this.frameTransform_.init(); } else { await this.maybeStartPipeline_(); } } /** * Sets a new sink for the pipeline. * @param {!MediaStreamSink} mediaStreamSink */ async updateSink(mediaStreamSink) { if (this.sink_) this.sink_.destroy(); this.sink_ = mediaStreamSink; console.log( '[Pipeline] Updated sink.', 'debug.pipeline.sink_ = ', this.sink_); if (this.processedStream_) { await this.sink_.setMediaStream(this.processedStream_); } else { await this.maybeStartPipeline_(); } } /** Frees any resources used by this object. */ destroy() { console.log('[Pipeline] Destroying Pipeline'); this.abortController_.abort(); if (this.source_) this.source_.destroy(); if (this.frameTransform_) this.frameTransform_.destroy(); if (this.sink_) this.sink_.destroy(); } }
webrtc/samples
src/content/insertable-streams/video-processing/js/pipeline.js
JavaScript
bsd-3-clause
6,704
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 12609, 1996, 4773, 5339, 2278, 2622, 6048, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 1008, 2008, 2064, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
## # This file is part of WhatWeb and may be subject to # redistribution and commercial restrictions. Please see the WhatWeb # web site for more information on licensing and terms of use. # http://www.morningstarsecurity.com/research/whatweb ## Plugin.define "SQLiteManager" do author "Brendan Coles <bcoles@gmail.com>" # 2012-01-14 version "0.1" description "SQLiteManager - Web-based SQLite administration - Homepage: http://www.sqlitemanager.org" # Google results as at 2012-01-14 # # 33 for intitle:"SQLite version" "Welcome to SQLiteManager version" # 26 for inurl:"main.php?dbsel=" # Dorks # dorks [ 'intitle:"SQLite version" "Welcome to SQLiteManager version"' ] # Matches # matches [ # HTML Comments { :text=>'<!-- SQLiteFunctionProperties.class.php : propView() -->' }, { :text=>'<!-- common.lib.php : displayMenuTitle() -->' }, # Form { :text=>'<td style="white-space: nowrap"> <form name="database" action="main.php" enctype="multipart/form-data" method="POST" onSubmit="checkPath();" target="main">' }, # h2 class="sqlmVersion" { :text=>'<h2 class="sqlmVersion">Database : <a href="main.php?dbsel=' }, # Title # SQLite Version Detection { :string=>/<title>(SQLite version [\d\.\s-]+)(undefined)?<\/title>/ }, # h2 class="sqlmVersion" # Version Detection { :version=>/<h2 class="sqlmVersion">Welcome to <a href="http:\/\/www\.sqlitemanager\.org" target="_blank">SQLiteManager<\/a> version ([^\s^>]+)<\/h2>/ }, # h4 class="serverInfo" # SQLite Version Detection { :string=>/<h4 class="serverInfo">(SQLite version [\d\.\s-]+)(undefined)? \/ PHP version 5.2.17<\/h4>/ }, # h4 class="serverInfo" # SQLite Version Detection { :string=>/<h4 class="serverInfo">SQLite version [\d\.\s-]+(undefined)? \/ (PHP version [^\s^<]+)<\/h4>/, :offset=>1 }, ] end
tempbottle/WhatWeb
plugins/SQLiteManager.rb
Ruby
gpl-2.0
1,772
[ 30522, 1001, 1001, 1001, 2023, 5371, 2003, 2112, 1997, 2054, 8545, 2497, 1998, 2089, 2022, 3395, 2000, 1001, 25707, 1998, 3293, 9259, 1012, 3531, 2156, 1996, 2054, 8545, 2497, 1001, 4773, 2609, 2005, 2062, 2592, 2006, 13202, 1998, 3408, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10095, -2973.16, -21.0658, 190.085, 3.63401, 1, 'montmulgore'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10094, 9450.69, 65.4357, 18.6532, 3.75495, 1, 'retrievalally'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10092, -1859.96, -4139.58, 10.7204, 4.52634, 0, 'merinterdite'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10091, -4828.17, -982.03, 464.709, 3.9015, 0, 'EldestIronforge'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10090, -11372.9, -4729.71, 5.04762, 3.44946, 1, 'iledelunah'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10087, 9463.68, 66.9378, 19.3721, 2.76772, 1, 'evangeline'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10086, -1833.26, -4198.24, 3.81099, 1.62944, 0, 'cedrix'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10085, -3991.53, -1306.78, 147.66, 3.42565, 0, 'bulle'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10084, 16303.8, 16317.3, 69.4447, 3.95691, 451, 'programmer'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10083, 16303.5, -16173.5, 40.4365, 4.48784, 451, 'designer'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10082, 2212.57, -5110.05, 235.914, 4.37593, 571, 'loveyou'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10081, 2212.57, -5110.05, 235.914, 0.056245, 571, 'tuesunemauvaise'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10080, -5513.16, 930.636, 396.782, 3.28808, 0, 'EventMograine'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10079, 5440.62, -2791.63, 1474.01, 0.994314, 1, 'hyjalarena'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10078, 4418.91, -2522.02, 1123.48, 0.165595, 1, 'hyjalarene'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10077, 4426.23, -2511.4, 1125.03, 0.117803, 1, 'Hyjal tournois'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10076, -13258.7, 279.552, 33.2427, 5.97963, 0, 'Allypxp'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10075, -5086.68, -1702.21, 497.885, 4.13885, 0, 'KTK'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10074, -9826.97, 2567.91, 22.2774, 5.93439, 1, 'sadnessel'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10073, -10772.1, 2183.32, 3.33876, 0.029769, 1, 'Chaussette'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10072, 238.79, 869.559, 121.7, 4.87649, 0, 'retrieval'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10071, 5129.85, -3800.41, 1971.05, 1.68194, 1, 'Sommethyjal'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10070, 2383.68, -5645.17, 421.806, 0.779895, 0, 'acherus'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10069, 1497.92, -24.0304, 421.368, 0.014686, 603, 'vousetesmauvais'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10068, 1497.92, -24.0304, 421.368, 0.014686, 603, 'dansulduar'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10067, 7526.79, 1834.83, 685.055, 4.72038, 571, 'testmog'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10066, -108.961, 25.2245, -63.3502, 0.005686, 13, 'test1'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10065, 3009.27, -5086.37, 732.537, 6.00983, 571, 'noel'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10064, -10738.7, 2437.38, 7.05442, 3.31185, 1, 'Agmagor'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10063, 2166.08, -4706.11, 74.8039, 3.82289, 0, 'Event Maz'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10062, -8621.1, 742.933, 96.7918, 3.11445, 0, 'orphelinally'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10061, -11820.1, -4744.13, 6.74256, 3.52564, 1, 'iledemograine'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10060, 16232.3, 16403.5, -64.3789, 3.07557, 1, 'tribunal'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10059, -9713.21, -4642.26, 19.9119, 2.68797, 1, 'bateau3'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10058, -9712.6, -4641.17, 19.6332, 3.73647, 1, 'bateau4'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10057, -10049.2, -4546.71, 42.0294, 6.07974, 1, 'bns1'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10056, -9464.41, -4706.54, 54.9513, 0.999026, 1, 'BNS'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10055, 16053.3, 16198.8, 5.92209, 3.72675, 1, 'bateau0'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10054, -9638.28, -4686.16, 17.9324, 3.75439, 1, 'bateau2'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10053, 16224.2, 16173, 10.164, 5.82628, 1, 'bateau1'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10052, 5745.47, 3097.24, 316.595, 4.90944, 571, 'faible'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10051, -11350.6, -4728.47, 6.18444, 3.08188, 1, 'Ile tanaris'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10050, -4765.19, -1665.34, 503.324, 0.32606, 0, 'aeroport'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10049, 5706.63, 3427.42, 300.842, 1.67478, 571, 'zonetelemaillon2'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10048, 5710.54, 3389.96, 300.842, 4.82737, 571, 'zonetelemaillon'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10047, -4732.56, -1546.22, 98.3497, 0.52324, 1, 'Cocabox'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10046, 1023.59, 288.158, 332.004, 3.54831, 37, 'agmaevent'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10045, -4819.33, -974.58, 464.709, 0.691372, 0, 'QGdworkin'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10044, 323.337, 169.505, 234.944, 5.14283, 37, 'eventunnutz'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10043, -4816.21, -971.918, 464.709, 3.87829, 0, 'QG2'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10042, 5062.36, -5572.05, 0.000176, 5.09297, 530, 'dworkin11'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10041, 5058.07, -5561.33, 0.000176, 5.09689, 530, 'zonetest'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10040, 4130.36, -3669.49, 45.5482, 1.08652, 0, 'dworkin10'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10039, -2923.34, -3609.87, 178.876, 3.82757, 0, 'dworkin9'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10038, -4244.13, -4503.6, 131.407, 0.238299, 0, 'dworkin8'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10037, -6991.95, 1114.32, 131.396, 3.17022, 0, 'dworkin7*'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10036, -7637.5, -105.542, 59.4568, 0.990743, 0, 'dworkin6'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10035, -7545.66, -1254.35, 481.528, 0.623149, 0, 'dworkin5'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10034, 10374.1, -6408.33, 163.458, 0.226115, 530, 'maisonmograine'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10033, -8680.03, -1167.88, 8.87751, 3.32598, 1, 'enormezone'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10032, -5444.08, -4319.32, 325.784, 2.77644, 1, 'dworkinmj'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10031, 376.233, 866.837, 178.872, 6.21471, 1, 'dworkin4'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10030, 495.349, -737.974, 68.7487, 1.44735, 1, 'dworkin3'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10029, 1736.44, 1934.12, 131.406, 0.371381, 1, 'dworkin2'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10028, -5468.38, -4316.08, 86.1112, 3.89956, 1, 'Dworkin'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10027, -4541.9, -1481.95, 88.0295, 2.87846, 1, 'Cocatrone'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10026, -4547.5, -1462.23, 87.4237, 2.7405, 1, 'Cocahorde'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10025, -4561.49, -1502.51, 92.3065, 0.803512, 1, 'Cocaally'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10024, -4556.61, -1484.48, 87.9318, 1.11472, 1, 'Coca'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10023, 1056.12, -4739.21, 131.171, 2.38611, 0, 'Test2'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10021, 1877.52, 1392.34, 142.147, 1.68047, 1, 'eventpvp1'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10020, -1035.66, 1587.06, 54.0382, 2.58963, 0, 'testgob2'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10019, -1064.93, 1582.08, 66.5807, 3.25722, 0, 'testgob'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10018, 6135.09, 5676.97, 5.15026, 3.86762, 571, 'zonetelebanquet1'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10017, 6171.31, 5709.33, 5.15026, 0.721311, 571, 'zonetelebanquet'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10016, -410.464, -12.5369, 308.466, 2.79667, 37, 'zonetelemariage'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10015, 6235.77, 5764.88, -6.33749, 0.869625, 571, 'banquet'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10014, -5232.07, 1041.33, 393.854, 5.33832, 0, 'event1'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10013, -306.878, -306.384, 295.928, 4.68613, 37, 'mariage!'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10012, -229.042, 501.283, 189.958, 4.87649, 0, 'recup'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10011, -9043.14, 375.864, 137.484, 0.795174, 0, 'toursw'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10010, -5534.36, -1355.33, 398.664, 5.13288, 0, 'freya'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10009, 6471.82, 2379.13, 462.567, 3.69145, 571, 'campargent'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10008, 8510.31, 1031.64, 547.301, 5.33137, 571, 'tournoi'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10001, 16197, 16199.6, 10203.5, 0.881942, 1, 'chute'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (10000, 16228, 16403.4, -63.8851, 3.59132, 1, 'Gmbox'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (9999, 240.101, 870.046, 121.701, 3.0978, 0, 'hordezone'); INSERT INTO `game_tele` (`id`, `position_x`, `position_y`, `position_z`, `orientation`, `map`, `name`) VALUES (9998, -229.382, 509.039, 189.958, 2.16503, 0, 'allyzone');
Stroff/Odyss-e-Serveur
sql/OdySQL/Backup/game_tele_copy.sql
SQL
gpl-2.0
15,166
[ 30522, 19274, 2046, 1036, 2208, 1035, 10093, 2063, 1036, 1006, 1036, 8909, 1036, 1010, 1036, 2597, 1035, 1060, 1036, 1010, 1036, 2597, 1035, 1061, 1036, 1010, 1036, 2597, 1035, 1062, 1036, 1010, 1036, 10296, 1036, 1010, 1036, 4949, 1036, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require File.expand_path('../../../spec_helper', __FILE__) describe Instagram::Client do Instagram::Configuration::VALID_FORMATS.each do |format| context ".new(:format => '#{format}')" do before do @client = Instagram::Client.new(:format => format, :client_id => 'CID', :client_secret => 'CS', :access_token => 'AT') end describe ".location" do before do stub_get("locations/514276.#{format}"). with(:query => {:access_token => @client.access_token}). to_return(:body => fixture("location.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"}) end it "should get the correct resource" do @client.location(514276) a_get("locations/514276.#{format}"). with(:query => {:access_token => @client.access_token}). should have_been_made end it "should return extended information of a given location" do location = @client.location(514276) location.name.should == "Instagram" end end describe ".location_recent_media" do before do stub_get("locations/514276/media/recent.#{format}"). with(:query => {:access_token => @client.access_token}). to_return(:body => fixture("location_recent_media.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"}) end it "should get the correct resource" do @client.location_recent_media(514276) a_get("locations/514276/media/recent.#{format}"). with(:query => {:access_token => @client.access_token}). should have_been_made end it "should return a list of media taken at a given location" do media = @client.location_recent_media(514276) media.data.should be_a Array media.data.first.user.username.should == "josh" end end describe ".location_search" do before do stub_get("locations/search.#{format}"). with(:query => {:access_token => @client.access_token}). with(:query => {:lat => "37.7808851", :lng => "-122.3948632"}). to_return(:body => fixture("location_search.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"}) end it "should get the correct resource" do @client.location_search("37.7808851", "-122.3948632") a_get("locations/search.#{format}"). with(:query => {:access_token => @client.access_token}). with(:query => {:lat => "37.7808851", :lng => "-122.3948632"}). should have_been_made end it "should return an array of user search results" do locations = @client.location_search("37.7808851", "-122.3948632") locations.should be_a Array locations.first.name.should == "Instagram" end end end end end
mitukiii/undersky
vendor/gems/instagram-0.8/spec/instagram/client/locations_spec.rb
Ruby
mit
2,992
[ 30522, 5478, 5371, 1012, 7818, 1035, 4130, 1006, 1005, 1012, 1012, 1013, 1012, 1012, 1013, 1012, 1012, 1013, 28699, 1035, 2393, 2121, 1005, 1010, 1035, 1035, 5371, 1035, 1035, 1007, 6235, 16021, 23091, 1024, 1024, 7396, 2079, 16021, 23091, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace Neos\Neos\Fusion\Helper; /* * This file is part of the Neos.Neos package. * * (c) Contributors of the Neos Project - www.neos.io * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which was distributed with this * source code. */ use Neos\Eel\ProtectedContextAwareInterface; use Neos\ContentRepository\Domain\Model\NodeInterface; use Neos\Neos\Domain\Exception; /** * Eel helper for ContentRepository Nodes */ class NodeHelper implements ProtectedContextAwareInterface { /** * Check if the given node is already a collection, find collection by nodePath otherwise, throw exception * if no content collection could be found * * @param NodeInterface $node * @param string $nodePath * @return NodeInterface * @throws Exception */ public function nearestContentCollection(NodeInterface $node, $nodePath) { $contentCollectionType = 'Neos.Neos:ContentCollection'; if ($node->getNodeType()->isOfType($contentCollectionType)) { return $node; } else { if ((string)$nodePath === '') { throw new Exception(sprintf('No content collection of type %s could be found in the current node and no node path was provided. You might want to configure the nodePath property with a relative path to the content collection.', $contentCollectionType), 1409300545); } $subNode = $node->getNode($nodePath); if ($subNode !== null && $subNode->getNodeType()->isOfType($contentCollectionType)) { return $subNode; } else { throw new Exception(sprintf('No content collection of type %s could be found in the current node (%s) or at the path "%s". You might want to adjust your node type configuration and create the missing child node through the "flow node:repair --node-type %s" command.', $contentCollectionType, $node->getPath(), $nodePath, (string)$node->getNodeType()), 1389352984); } } } /** * Generate a label for a node with a chaining mechanism. To be used in nodetype definitions. * * @param NodeInterface|null $node * @return NodeLabelToken */ public function labelForNode(NodeInterface $node = null): NodeLabelToken { return new NodeLabelToken($node); } /** * If this node type or any of the direct or indirect super types * has the given name. * * @param NodeInterface $node * @param string $nodeType * @return bool */ public function isOfType(NodeInterface $node, string $nodeType): bool { return $node->getNodeType()->isOfType($nodeType); } /** * @param string $methodName * @return boolean */ public function allowsCallOfMethod($methodName) { return true; } }
daniellienert/neos-development-collection
Neos.Neos/Classes/Fusion/Helper/NodeHelper.php
PHP
gpl-3.0
2,915
[ 30522, 1026, 1029, 25718, 3415, 15327, 9253, 2015, 1032, 9253, 2015, 1032, 10077, 1032, 2393, 2121, 1025, 1013, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 1996, 9253, 2015, 1012, 9253, 2015, 7427, 1012, 1008, 1008, 1006, 1039, 1007, 16884, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package info.knigoed.dao; import info.knigoed.config.DataSourceConfig; import info.knigoed.config.OtherConfig; import info.knigoed.config.RequestContext; import info.knigoed.config.WebConfig; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import java.sql.SQLException; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {WebConfig.class, OtherConfig.class, DataSourceConfig.class, RequestContext.class}) @WebAppConfiguration @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class SearchSphinxDaoTest { // @Autowired private SearchSphinxDao searchSphinxDao; @Test public void testARunSearch() throws SQLException { assertTrue(searchSphinxDao.runSearch("а", 0, 10)); } @Test public void testGetYears() throws SQLException { assertThat(searchSphinxDao.getYears().isEmpty(), is(false)); } @Test public void testGetBooksId() throws SQLException { assertNotNull(searchSphinxDao.getBooksId()); } @Test public void testGetShopsId() throws SQLException { assertThat(searchSphinxDao.getShopsId().isEmpty(), is(false)); } }
iormark/Knigoed
src/test/java/info/knigoed/dao/SearchSphinxDaoTest.java
Java
apache-2.0
1,655
[ 30522, 7427, 18558, 1012, 14161, 14031, 2098, 1012, 4830, 2080, 1025, 12324, 18558, 1012, 14161, 14031, 2098, 1012, 9530, 8873, 2290, 1012, 2951, 6499, 3126, 3401, 8663, 8873, 2290, 1025, 12324, 18558, 1012, 14161, 14031, 2098, 1012, 9530, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace BankId\Merchant\Library\Schemas\saml\protocol; /** * Class representing ArtifactResolveType * * * XSD Type: ArtifactResolveType */ class ArtifactResolveType extends RequestAbstractType { /** * @property string $artifact */ private $artifact = null; /** * Gets as artifact * * @return string */ public function getArtifact() { return $this->artifact; } /** * Sets a new artifact * * @param string $artifact * @return self */ public function setArtifact($artifact) { $this->artifact = $artifact; return $this; } }
notarynodes/idintt
hackathon-module/idintt-php-module/library/Schemas/saml/protocol/ArtifactResolveType.php
PHP
apache-2.0
704
[ 30522, 1026, 1029, 25718, 3415, 15327, 2924, 3593, 1032, 6432, 1032, 3075, 1032, 8040, 28433, 2015, 1032, 3520, 2140, 1032, 8778, 1025, 1013, 1008, 1008, 1008, 2465, 5052, 20785, 6072, 4747, 19510, 18863, 1008, 1008, 1008, 1060, 16150, 2828...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import _plotly_utils.basevalidators class TicktextsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="ticktextsrc", parent_name="layout.xaxis", **kwargs): super(TicktextsrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=kwargs.pop("edit_type", "none"), **kwargs )
plotly/plotly.py
packages/python/plotly/plotly/validators/layout/xaxis/_ticktextsrc.py
Python
mit
410
[ 30522, 12324, 1035, 5436, 2135, 1035, 21183, 12146, 1012, 2918, 10175, 8524, 6591, 2465, 16356, 18209, 21338, 2278, 10175, 8524, 4263, 1006, 1035, 5436, 2135, 1035, 21183, 12146, 1012, 2918, 10175, 8524, 6591, 1012, 5034, 2278, 10175, 30524, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# %# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) %# %# %# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have %# been provided with this software, but in any event can be snarfed %# from www.gnu.org. %# %# This work is distributed in the hope that it will be useful, but %# WITHOUT ANY WARRANTY; without even the implied warranty of %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA %# 02110-1301 or visit their web page on the internet at %# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: %# %# (The following paragraph is not intended to limit the rights granted %# to you to modify and distribute this software under the terms of %# the GNU General Public License and is only of importance to you if %# you choose to contribute your changes and enhancements to the %# community by submitting them to Best Practical Solutions, LLC.) %# %# By intentionally submitting any modifications, corrections or %# derivatives to this work, or any other work intended for use with %# Request Tracker, to Best Practical Solutions, LLC, you confirm that %# you are the copyright holder for those contributions and you grant %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, %# royalty-free, perpetual, license to use, copy, create derivative %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('Preferences') &> <& /Elements/ListActions, actions => \@results &> <form method="post"> <table width="100%" border="0"> <tr> <td valign="top" class="boxcontainer" width=50%> <&| /Widgets/TitleBox, title => loc('Locale'), id => "user-prefs-identity" &> <table cellspacing="0" cellpadding="0"> <tr> <td class="label"><&|/l&>Language</&>:</td> <td class="value"><& /Elements/SelectLang, Name => 'Lang', Default => $user->Lang &></td> </tr> <tr> <td class="label"><&|/l&>Timezone</&>:</td> <td class="value"><& /Elements/SelectTimezone, Name => 'Timezone', Default => $user->Timezone &></td> </tr> </table> </&> </td> <td valign="top"> <&| /Widgets/TitleBox, title => loc('Change password') &> % if ( $user->__Value('Password') ne '*NO-PASSWORD*' ) { <& /Elements/EditPassword, User => $user, Name => [qw(CurrentPass NewPass1 NewPass2)], &> % } </&> </td></tr></table> <br /> <& /Elements/Submit, Label => loc('Save Changes') &> </form> <%INIT> my @results; my $user = $session{'CurrentUser'}->UserObj; if (defined $NewPass1 && length $NewPass1 ) { my ($status, $msg) = $user->SafeSetPassword( Current => $CurrentPass, New => $NewPass1, Confirmation => $NewPass2, ); push @results, loc("Password: [_1]", $msg); } my @fields = qw( Lang Timezone ); $m->callback( CallbackName => 'UpdateLogic', fields => \@fields, results => \@results, UserObj => $user, ARGSRef => \%ARGS, ); push @results, UpdateRecordObject ( AttributesRef => \@fields, Object => $user, ARGSRef => \%ARGS, ); if ( $Lang ) { $session{'CurrentUser'}->LanguageHandle($Lang); $session{'CurrentUser'} = $session{'CurrentUser'}; # force writeback } if ($Signature) { $Signature =~ s/(\r\n|\r)/\n/g; if ($Signature ne $user->Signature) { my ($val, $msg) = $user->SetSignature($Signature); push (@results, "Signature: ".$msg); } } #A hack to make sure that session gets rewritten. $session{'i'}++; </%INIT> <%ARGS> $Signature => undef $CurrentPass => undef $NewPass1 => undef $NewPass2 => undef $Lang => undef </%ARGS>
morallo/rt
share/html/SelfService/Prefs.html
HTML
gpl-2.0
4,253
[ 30522, 1003, 1001, 4088, 17531, 2015, 26610, 3796, 1063, 1063, 1063, 1003, 1001, 1003, 1001, 9385, 1024, 1003, 1001, 1003, 1001, 2023, 4007, 2003, 9385, 1006, 1039, 1007, 2727, 1011, 2418, 30524, 1001, 1003, 1001, 1003, 1001, 6105, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php // ------------------------------------------------------------------------------- // | net2ftp: a web based FTP client | // | Copyright (c) 2003-2013 by David Gartner | // | | // | This program is free software; you can redistribute it and/or | // | modify it under the terms of the GNU General Public License | // | as published by the Free Software Foundation; either version 2 | // | of the License, or (at your option) any later version. | // | | // ------------------------------------------------------------------------------- // ************************************************************************************** // ************************************************************************************** // ** ** // ** ** function net2ftp_module_sendHttpHeaders() { // -------------- // This function sends HTTP headers // -------------- // global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result; } // end net2ftp_sendHttpHeaders // ** ** // ** ** // ************************************************************************************** // ************************************************************************************** // ************************************************************************************** // ************************************************************************************** // ** ** // ** ** function net2ftp_module_printJavascript() { // -------------- // This function prints Javascript code and includes // -------------- // global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result; // Code // echo "<script type=\"text/javascript\"><!--\n"; // echo "//--></script>\n"; // Include // echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n"; } // end net2ftp_printJavascript // ** ** // ** ** // ************************************************************************************** // ************************************************************************************** // ************************************************************************************** // ************************************************************************************** // ** ** // ** ** function net2ftp_module_printCss() { // -------------- // This function prints CSS code and includes // -------------- global $net2ftp_settings, $net2ftp_globals; // Include echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n"; } // end net2ftp_printCssInclude // ** ** // ** ** // ************************************************************************************** // ************************************************************************************** // ************************************************************************************** // ************************************************************************************** // ** ** // ** ** function net2ftp_module_printBodyOnload() { // -------------- // This function prints the <body onload="" actions // -------------- // global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result; // echo ""; } // end net2ftp_printBodyOnload // ** ** // ** ** // ************************************************************************************** // ************************************************************************************** // ************************************************************************************** // ************************************************************************************** // ** ** // ** ** function net2ftp_module_printBody() { // -------------- // This function prints the login screen // -------------- // ------------------------------------------------------------------------- // Global variables // ------------------------------------------------------------------------- global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output; if (isset($_POST["list"]) == true) { $list = getSelectedEntries($_POST["list"]); } else { $list = ""; } // ------------------------------------------------------------------------- // Variables // ------------------------------------------------------------------------- // Title $title = __("Size of selected directories and files"); // Form name, back and forward buttons $formname = "CalculateSizeForm"; $back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();"; // Open connection setStatus(2, 10, __("Connecting to the FTP server")); $conn_id = ftp_openconnection(); if ($net2ftp_result["success"] == false) { return false; } // Calculate the size $options = array(); $result['size'] = 0; $result['skipped'] = 0; $result = ftp_processfiles("calculatesize", $conn_id, $net2ftp_globals["directory"], $list, $options, $result, 0); // Close connection ftp_closeconnection($conn_id); // Print message $net2ftp_output["calculatesize"][] = __("The total size taken by the selected directories and files is:") . " <b>" . formatFilesize($result['size']) . "</b> (" . $result['size'] . " Bytes)"; if ($result['skipped'] > 0) { $net2ftp_output["calculatesize"][] = __("The number of files which were skipped is:") . " <b>" . $result['skipped'] . "</b>"; } // ------------------------------------------------------------------------- // Print the output // ------------------------------------------------------------------------- require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php"); } // End net2ftp_printBody // ** ** // ** ** // ************************************************************************************** // ************************************************************************************** ?>
hchirona/Antivirus
ftp/modules/calculatesize/calculatesize.inc.php
PHP
gpl-3.0
8,289
[ 30522, 1026, 1029, 25718, 1013, 1013, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Tristachya bequaertii var. vanderystii VARIETY #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Tristachya/Tristachya nodiglumis/ Syn. Tristachya bequaertii vanderystii/README.md
Markdown
apache-2.0
195
[ 30522, 1001, 13012, 9153, 11714, 2050, 2022, 16211, 8743, 6137, 13075, 1012, 3158, 4063, 27268, 6137, 3528, 1001, 1001, 1001, 1001, 3570, 10675, 1001, 1001, 1001, 1001, 2429, 2000, 1996, 10161, 1997, 2166, 1010, 3822, 2254, 2249, 1001, 1001...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright 2014 Travel Modelling Group, Department of Civil Engineering, University of Toronto This file is part of XTMF. XTMF is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. XTMF is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with XTMF. If not, see <http://www.gnu.org/licenses/>. */ using System; using System.Collections.Generic; using XTMF; namespace TMG.Emme { public class ExtraAttributeData : IModule { [Parameter("Domain", "NODE", "Extra attribute domain (type). Accepted values are NODE, LINK, TURN, TRANSIT_LINE, or TRANSIT_SEGMENT")] public string Domain; [Parameter("Id", "@node1", "The 6-character ID string of the extra attribute, including the '@' symbol.")] public string Id; [Parameter("Default", 0.0f, "The default value for the extra attribute.")] public float DefaultValue; private HashSet<string> _AllowedDomains; public ExtraAttributeData() { _AllowedDomains = new HashSet<string> { "NODE", "LINK", "TURN", "TRANSIT_LINE", "TRANSIT_SEGMENT" }; } public string Name { get; set; } public float Progress { get { return 1.0f; } } private static Tuple<byte, byte, byte> _ProgressColour = new Tuple<byte, byte, byte>(100, 100, 150); public Tuple<byte, byte, byte> ProgressColour { get { return _ProgressColour; } } public bool RuntimeValidation(ref string error) { if (!_AllowedDomains.Contains(Domain)) { error = "Domain '" + Domain + "' is not supported. It must be one of NODE, LINK, TURN, TRANSIT_LINE, or TRANSIT_SEGMENT."; return false; } if (!Id.StartsWith("@")) { error = "Extra attribute ID must begin with the '@' symbol (current value is '" + Id + "')."; return false; } return true; } } public class ExtraAttributeContextManager : IEmmeTool { [RunParameter("Scenario", 0, "The number of the Emme scenario.")] public int ScenarioNumber; [Parameter("Delete Flag", true, "Tf set to true, this module will delete the attributes after running. Otherwise, this module will just ensure that the attributes exist and are initialized.")] public bool DeleteFlag; [Parameter("Reset To Default", false, "Reset the attributes to their default values if they already exist.")] public bool ResetToDefault; [SubModelInformation(Description="Attribute to create.")] public List<ExtraAttributeData> AttributesToCreate; [SubModelInformation(Description="Emme tools to run")] public List<IEmmeTool> EmmeToolsToRun; private const string ToolName = "tmg.XTMF_internal.temp_attribute_manager"; private IEmmeTool _RunningTool; private float _Progress; public bool Execute(Controller controller) { _Progress = 0.0f; _RunningTool = null; if (EmmeToolsToRun.Count == 0) return true; var mc = controller as ModellerController; if (mc == null) throw new XTMFRuntimeException(this, "Controller is not a ModellerController!"); float numberOfTasks = AttributesToCreate.Count + 1; bool[] createdAttributes = new bool[AttributesToCreate.Count]; /* def __call__(self, xtmf_ScenarioNumber, xtmf_AttributeId, xtmf_AttributeDomain, xtmf_AttributeDefault, xtmf_DeleteFlag): */ try { for (int i = 0; i < createdAttributes.Length; i++) { var attData = AttributesToCreate[i]; var args = string.Join(" ", ScenarioNumber, attData.Id, attData.Domain, attData.DefaultValue, false, ResetToDefault); createdAttributes[i] = mc.Run(this, ToolName, args); // ReSharper disable once PossibleLossOfFraction _Progress = i / createdAttributes.Length / numberOfTasks; } _Progress = 1.0f / numberOfTasks; foreach (var tool in EmmeToolsToRun) { tool.Execute(mc); _Progress += 1.0f / numberOfTasks; } } finally { if (DeleteFlag) { for (int i = 0; i < createdAttributes.Length; i++) { if (createdAttributes[i]) { var attData = AttributesToCreate[i]; var args = string.Join(" ", ScenarioNumber, attData.Id, attData.Domain, attData.DefaultValue, true, ResetToDefault); mc.Run(this, ToolName, args); } } } } return true; } public string Name { get; set; } public float Progress { get { if (_RunningTool != null) { return _Progress + _RunningTool.Progress / (EmmeToolsToRun.Count); } else { return _Progress; } } } private static Tuple<byte, byte, byte> _ProgressColour = new Tuple<byte, byte, byte>(100, 100, 150); public Tuple<byte, byte, byte> ProgressColour { get { return _ProgressColour; } } public bool RuntimeValidation(ref string error) { if(EmmeToolsToRun.Count == 0 && AttributesToCreate.Count > 0) { error = "In '"+Name+"' you must have at least one tool to run in order for ExtraAttributeContextManager to function properly."; return false; } return true; } } }
TravelModellingGroup/XTMF
Code/TMG.Emme/ExtraAttributeContextManager.cs
C#
gpl-3.0
6,733
[ 30522, 1013, 1008, 9385, 2297, 3604, 19518, 2177, 1010, 2533, 1997, 2942, 3330, 1010, 2118, 1997, 4361, 2023, 5371, 2003, 2112, 1997, 1060, 21246, 2546, 1012, 1060, 21246, 30524, 2011, 1996, 2489, 4007, 3192, 1010, 2593, 2544, 1017, 1997, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
"use strict" const createTileGridConverter = require(`./createTileGridConverter`) const colorDepth = require(`./colorDepth`) module.exports = ({palette, images}) => { const converter = createTileGridConverter({ tileWidth: 7, tileHeight: 9, columns: 19, tileCount: 95, raw32bitData: colorDepth.convert8to32({palette, raw8bitData: images}), }) return { convertToPng: converter.convertToPng } }
chuckrector/mappo
src/converter/createVerge1SmallFntConverter.js
JavaScript
mit
426
[ 30522, 1000, 2224, 9384, 1000, 9530, 3367, 3443, 15286, 16523, 3593, 8663, 16874, 2121, 1027, 5478, 1006, 1036, 1012, 1013, 3443, 15286, 16523, 3593, 8663, 16874, 2121, 1036, 1007, 9530, 3367, 3609, 3207, 13876, 2232, 1027, 5478, 1006, 1036...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (C) 2004-2011 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published * by the Free Software Foundation. */ #include "User.h" class CNickServ : public CModule { public: MODCONSTRUCTOR(CNickServ) { } virtual ~CNickServ() { } virtual bool OnLoad(const CString& sArgs, CString& sMessage) { if (sArgs.empty()) m_sPass = GetNV("Password"); else { m_sPass = sArgs; SetNV("Password", m_sPass); SetArgs(""); } return true; } virtual void OnModCommand(const CString& sCommand) { CString sCmdName = sCommand.Token(0).AsLower(); if (sCmdName == "set") { CString sPass = sCommand.Token(1, true); m_sPass = sPass; SetNV("Password", m_sPass); PutModule("Password set"); } else if (sCmdName == "clear") { m_sPass = ""; DelNV("Password"); } else { PutModule("Commands: set <password>, clear"); } } void HandleMessage(CNick& Nick, const CString& sMessage) { if (!m_sPass.empty() && Nick.GetNick().Equals("NickServ") && (sMessage.find("msg") != CString::npos || sMessage.find("authenticate") != CString::npos) && sMessage.AsUpper().find("IDENTIFY") != CString::npos && sMessage.find("help") == CString::npos) { PutIRC("PRIVMSG NickServ :IDENTIFY " + m_sPass); } } virtual EModRet OnPrivMsg(CNick& Nick, CString& sMessage) { HandleMessage(Nick, sMessage); return CONTINUE; } virtual EModRet OnPrivNotice(CNick& Nick, CString& sMessage) { HandleMessage(Nick, sMessage); return CONTINUE; } private: CString m_sPass; }; MODULEDEFS(CNickServ, "Auths you with NickServ")
rwaldron/znc
modules/nickserv.cpp
C++
gpl-2.0
1,718
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2432, 1011, 2249, 2156, 1996, 6048, 5371, 2005, 4751, 1012, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 2009, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php return array ( 'id' => 'mot_e398b_ver2', 'fallback' => 'mot_e398_ver1', 'capabilities' => array ( 'model_name' => 'E398B', ), );
cuckata23/wurfl-data
data/mot_e398b_ver2.php
PHP
mit
150
[ 30522, 1026, 1029, 25718, 2709, 9140, 1006, 1005, 8909, 1005, 1027, 1028, 1005, 9587, 2102, 1035, 1041, 23499, 2620, 2497, 1035, 2310, 2099, 2475, 1005, 1010, 1005, 2991, 5963, 1005, 1027, 1028, 1005, 9587, 2102, 1035, 1041, 23499, 2620, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Alternate API for adding custom Jasmine matchers This is a more declarative, and, I hope, easier to use API for writing custom Jasmime matchers. ## Documentation Instead of this: ```javascript // TODO: show using the standard Jasmine API for creating a matcher ``` use this: ```javascript let jenh = require('jasmine-add-matcher'); beforeEach(function () { jenh.addMatcher('toBeEven', 'expected {actual} (NOT) to be even', (actual) => actual % 2 === 0); }); it('works', function () { expect(3).toBeEven(); }); ``` ### API ```typescript type CheckFunction = (actual: any, expected: any, util: {}, customEqualityTesters: {}) => boolean type FormatFunction = (actual: any, expected: any, util: {}, customEqualityTesters: {}) => string declare function matcher( name: string, messageTemplates: string | [string, string], checkFn: CheckFunction, formatValueFn?: FormatFunction ): Matcher; declare function addMatcher( name: string, messageTemplates: string | [string, string], checkFn: CheckFunction, formatValueFn?: FormatFunction ): void; ``` ### Misc other features * {actual} and {expected} value interpolation in message * with jasmine.pp or custom formatter * abmidextrous message with (not) token embedded', * or ['normal message', 'inverted message'] ### License MIT
smendola/jasmine-add-matcher
README.md
Markdown
mit
1,305
[ 30522, 1001, 6585, 17928, 2005, 5815, 7661, 14032, 2674, 2545, 2023, 2003, 1037, 2062, 11703, 8017, 8082, 1010, 1998, 1010, 1045, 3246, 1010, 6082, 2000, 2224, 17928, 2005, 3015, 7661, 14855, 6491, 14428, 2674, 2545, 1012, 1001, 1001, 12653...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Locale support -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, // 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 2, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software // library without restriction. Specifically, if other files instantiate // templates or use macros or inline functions from this file, or you compile // this file and link it with other files to produce an executable, this // file does not by itself cause the resulting executable to be covered by // the GNU General Public License. This exception does not however // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. /** @file ctype_noninline.h * This is an internal header file, included by other library headers. * You should not attempt to use it directly. */ // // ISO C++ 14882: 22.1 Locales // // Information as gleaned from /usr/include/ctype.h #if _GLIBCXX_C_LOCALE_GNU const ctype_base::mask* ctype<char>::classic_table() throw() { return _S_get_c_locale()->__ctype_b; } #else const ctype_base::mask* ctype<char>::classic_table() throw() { const ctype_base::mask* __ret; char* __old = setlocale(LC_CTYPE, NULL); char* __sav = NULL; if (__builtin_strcmp(__old, "C")) { const size_t __len = __builtin_strlen(__old) + 1; __sav = new char[__len]; __builtin_memcpy(__sav, __old, __len); setlocale(LC_CTYPE, "C"); } #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) __ret = *__ctype_b_loc(); #else __ret = __ctype_b; #endif if (__sav) { setlocale(LC_CTYPE, __sav); delete [] __sav; } return __ret; } #endif #if _GLIBCXX_C_LOCALE_GNU ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del, size_t __refs) : facet(__refs), _M_c_locale_ctype(_S_clone_c_locale(__cloc)), _M_del(__table != 0 && __del), _M_toupper(_M_c_locale_ctype->__ctype_toupper), _M_tolower(_M_c_locale_ctype->__ctype_tolower), _M_table(__table ? __table : _M_c_locale_ctype->__ctype_b), _M_widen_ok(0), _M_narrow_ok(0) { __builtin_memset(_M_widen, 0, sizeof(_M_widen)); __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); } #else ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) { char* __old = setlocale(LC_CTYPE, NULL); char* __sav = NULL; if (__builtin_strcmp(__old, "C")) { const size_t __len = __builtin_strlen(__old) + 1; __sav = new char[__len]; __builtin_memcpy(__sav, __old, __len); setlocale(LC_CTYPE, "C"); } #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) _M_toupper = *__ctype_toupper_loc(); _M_tolower = *__ctype_tolower_loc(); _M_table = __table ? __table : *__ctype_b_loc(); #else _M_toupper = __ctype_toupper; _M_tolower = __ctype_tolower; _M_table = __table ? __table : __ctype_b; #endif if (__sav) { setlocale(LC_CTYPE, __sav); delete [] __sav; } __builtin_memset(_M_widen, 0, sizeof(_M_widen)); __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); } #endif #if _GLIBCXX_C_LOCALE_GNU ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), _M_del(__table != 0 && __del), _M_toupper(_M_c_locale_ctype->__ctype_toupper), _M_tolower(_M_c_locale_ctype->__ctype_tolower), _M_table(__table ? __table : _M_c_locale_ctype->__ctype_b), _M_widen_ok(0), _M_narrow_ok(0) { __builtin_memset(_M_widen, 0, sizeof(_M_widen)); __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); } #else ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) { char* __old = setlocale(LC_CTYPE, NULL); char* __sav = NULL; if (__builtin_strcmp(__old, "C")) { const size_t __len = __builtin_strlen(__old) + 1; __sav = new char[__len]; __builtin_memcpy(__sav, __old, __len); setlocale(LC_CTYPE, "C"); } #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) _M_toupper = *__ctype_toupper_loc(); _M_tolower = *__ctype_tolower_loc(); _M_table = __table ? __table : *__ctype_b_loc(); #else _M_toupper = __ctype_toupper; _M_tolower = __ctype_tolower; _M_table = __table ? __table : __ctype_b; #endif if (__sav) { setlocale(LC_CTYPE, __sav); delete [] __sav; } __builtin_memset(_M_widen, 0, sizeof(_M_widen)); __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); } #endif char ctype<char>::do_toupper(char __c) const { return _M_toupper[static_cast<unsigned char>(__c)]; } const char* ctype<char>::do_toupper(char* __low, const char* __high) const { while (__low < __high) { *__low = _M_toupper[static_cast<unsigned char>(*__low)]; ++__low; } return __high; } char ctype<char>::do_tolower(char __c) const { return _M_tolower[static_cast<unsigned char>(__c)]; } const char* ctype<char>::do_tolower(char* __low, const char* __high) const { while (__low < __high) { *__low = _M_tolower[static_cast<unsigned char>(*__low)]; ++__low; } return __high; }
epicsdeb/rtems-gcc-newlib
libstdc++-v3/config/os/gnu-linux/ctype_noninline.h
C
gpl-2.0
6,176
[ 30522, 1013, 1013, 2334, 2063, 2490, 1011, 1008, 1011, 1039, 1009, 1009, 1011, 1008, 1011, 1013, 1013, 9385, 1006, 1039, 1007, 2722, 1010, 2687, 1010, 2639, 1010, 2456, 1010, 2541, 1010, 2526, 1010, 2494, 1010, 2432, 1010, 2384, 1010, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (c) DotSpatial Team. All rights reserved. // Licensed under the MIT license. See License.txt file in the project root for full license information. using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms; using System.Windows.Forms.Design; namespace DotSpatial.Symbology.Forms { /// <summary> /// FontFamilyNameEditor. /// </summary> public class FontFamilyNameEditor : UITypeEditor { #region Fields private IWindowsFormsEditorService _dialogProvider; #endregion #region Properties /// <summary> /// Gets a value indicating whether the drop down is resizeable. /// </summary> public override bool IsDropDownResizable => true; #endregion #region Methods /// <summary> /// Edits a value based on some user input which is collected from a character control. /// </summary> /// <param name="context">The type descriptor context.</param> /// <param name="provider">The service provider.</param> /// <param name="value">Not used.</param> /// <returns>The selected font family name.</returns> public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { _dialogProvider = provider?.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService; ListBox cmb = new ListBox(); FontFamily[] fams = FontFamily.Families; cmb.SuspendLayout(); foreach (FontFamily fam in fams) { cmb.Items.Add(fam.Name); } cmb.SelectedValueChanged += CmbSelectedValueChanged; cmb.ResumeLayout(); _dialogProvider?.DropDownControl(cmb); string test = (string)cmb.SelectedItem; return test; } /// <summary> /// Gets the UITypeEditorEditStyle, which in this case is drop down. /// </summary> /// <param name="context">The type descriptor context.</param> /// <returns>The UITypeEditorEditStyle.</returns> public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) { return UITypeEditorEditStyle.DropDown; } private void CmbSelectedValueChanged(object sender, EventArgs e) { _dialogProvider.CloseDropDown(); } #endregion } }
DotSpatial/DotSpatial
Source/DotSpatial.Symbology.Forms/FontFamilyNameEditor.cs
C#
mit
2,604
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 14981, 30524, 9235, 1012, 1013, 1013, 7000, 2104, 1996, 10210, 6105, 1012, 2156, 6105, 1012, 19067, 2102, 5371, 1999, 1996, 2622, 7117, 2005, 2440, 6105, 2592, 1012, 2478, 2291, 1025, 2478, 2291, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
'use strict'; /** * Rounds a number to decimal places * * @param {number} number to be rounded * @param {integer} the number of place to round to * @param {String} the rounding method to be used * @returns {number} the number rounded to places */ function roundto(value, places, roundMethod) { var rtn = 0; var factorial = Math.pow(10, places); roundMethod = typeof roundMethod !== 'undefined' ? roundMethod : 'round'; switch( roundMethod ) { case 'floor': case 'int': rtn = Math.floor( value * factorial ); break; case 'ceiling': rtn = Math.ceil( value * factorial ); break; default: rtn = Math.round( value * factorial ); break; } // Divide number by factorial to get decimal places rtn = rtn / factorial; return rtn; } exports = module.exports = roundto;
mbayfield/roundTo
index.js
JavaScript
mit
805
[ 30522, 1005, 2224, 9384, 1005, 1025, 1013, 1008, 1008, 1008, 6241, 1037, 2193, 2000, 26066, 3182, 1008, 1008, 1030, 11498, 2213, 1063, 2193, 1065, 2193, 2000, 2022, 8352, 1008, 1030, 11498, 2213, 1063, 16109, 1065, 1996, 2193, 1997, 2173, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from textwrap import dedent from pants.backend.core.targets.dependencies import Dependencies from pants.backend.core.targets.doc import Page from pants.backend.core.tasks.filter import Filter from pants.backend.jvm.targets.java_library import JavaLibrary from pants.backend.python.targets.python_library import PythonLibrary from pants.backend.python.targets.python_requirement_library import PythonRequirementLibrary from pants.base.exceptions import TaskError from pants.build_graph.build_file_aliases import BuildFileAliases from pants_test.tasks.task_test_base import ConsoleTaskTestBase class BaseFilterTest(ConsoleTaskTestBase): @property def alias_groups(self): return BuildFileAliases( targets={ 'target': Dependencies, 'java_library': JavaLibrary, 'page': Page, 'python_library': PythonLibrary, 'python_requirement_library': PythonRequirementLibrary, } ) @classmethod def task_type(cls): return Filter class FilterEmptyTargetsTest(BaseFilterTest): def test_no_filters(self): self.assert_console_output() def test_type(self): self.assert_console_output(options={'type': ['page']}) self.assert_console_output(options={'type': ['java_library']}) def test_regex(self): self.assert_console_output(options={'regex': ['^common']}) self.assert_console_output(options={'regex': ['-^common']}) class FilterTest(BaseFilterTest): def setUp(self): super(FilterTest, self).setUp() requirement_injected = set() def add_to_build_file(path, name, *deps): if path not in requirement_injected: self.add_to_build_file(path, "python_requirement_library(name='foo')") requirement_injected.add(path) all_deps = ["'{0}'".format(dep) for dep in deps] + ["':foo'"] self.add_to_build_file(path, dedent(""" python_library(name='{name}', dependencies=[{all_deps}], tags=['{tag}'] ) """.format(name=name, tag=name + "_tag", all_deps=','.join(all_deps)))) add_to_build_file('common/a', 'a') add_to_build_file('common/b', 'b') add_to_build_file('common/c', 'c') add_to_build_file('overlaps', 'one', 'common/a', 'common/b') add_to_build_file('overlaps', 'two', 'common/a', 'common/c') add_to_build_file('overlaps', 'three', 'common/a', 'overlaps:one') def test_roots(self): self.assert_console_output( 'common/a:a', 'common/a:foo', 'common/b:b', 'common/b:foo', 'common/c:c', 'common/c:foo', targets=self.targets('common/::'), extra_targets=self.targets('overlaps/::') ) def test_nodups(self): targets = [self.target('common/b')] * 2 self.assertEqual(2, len(targets)) self.assert_console_output( 'common/b:b', targets=targets ) def test_no_filters(self): self.assert_console_output( 'common/a:a', 'common/a:foo', 'common/b:b', 'common/b:foo', 'common/c:c', 'common/c:foo', 'overlaps:one', 'overlaps:two', 'overlaps:three', 'overlaps:foo', targets=self.targets('::') ) def test_filter_type(self): self.assert_console_output( 'common/a:a', 'common/b:b', 'common/c:c', 'overlaps:one', 'overlaps:two', 'overlaps:three', targets=self.targets('::'), options={'type': ['python_library']} ) self.assert_console_output( 'common/a:foo', 'common/b:foo', 'common/c:foo', 'overlaps:foo', targets=self.targets('::'), options={'type': ['-python_library']} ) self.assert_console_output( 'common/a:a', 'common/a:foo', 'common/b:b', 'common/b:foo', 'common/c:c', 'common/c:foo', 'overlaps:one', 'overlaps:two', 'overlaps:three', 'overlaps:foo', targets=self.targets('::'), # Note that the comma is inside the string, so these are ORed. options={'type': ['python_requirement_library,python_library']} ) def test_filter_multiple_types(self): # A target can only have one type, so the output should be empty. self.assert_console_output( targets=self.targets('::'), options={'type': ['python_requirement_library', 'python_library']} ) def test_filter_target(self): self.assert_console_output( 'common/a:a', 'overlaps:foo', targets=self.targets('::'), options={'target': ['common/a,overlaps/:foo']} ) self.assert_console_output( 'common/a:foo', 'common/b:b', 'common/b:foo', 'common/c:c', 'common/c:foo', 'overlaps:two', 'overlaps:three', targets=self.targets('::'), options={'target': ['-common/a:a,overlaps:one,overlaps:foo']} ) def test_filter_ancestor(self): self.assert_console_output( 'common/a:a', 'common/a:foo', 'common/b:b', 'common/b:foo', 'overlaps:one', 'overlaps:foo', targets=self.targets('::'), options={'ancestor': ['overlaps:one,overlaps:foo']} ) self.assert_console_output( 'common/c:c', 'common/c:foo', 'overlaps:two', 'overlaps:three', targets=self.targets('::'), options={'ancestor': ['-overlaps:one,overlaps:foo']} ) def test_filter_ancestor_out_of_context(self): """Tests that targets outside of the context used as filters are parsed before use.""" # Add an additional un-injected target, and then use it as a filter. self.add_to_build_file("blacklist", "target(name='blacklist', dependencies=['common/a'])") self.assert_console_output( 'common/b:b', 'common/b:foo', 'common/c:c', 'common/c:foo', 'overlaps:one', 'overlaps:two', 'overlaps:three', 'overlaps:foo', targets=self.targets('::'), options={'ancestor': ['-blacklist']} ) def test_filter_ancestor_not_passed_targets(self): """Tests filtering targets based on an ancestor not in that list of targets.""" # Add an additional un-injected target, and then use it as a filter. self.add_to_build_file("blacklist", "target(name='blacklist', dependencies=['common/a'])") self.assert_console_output( 'common/b:b', 'common/b:foo', 'common/c:c', 'common/c:foo', targets=self.targets('common/::'), # blacklist is not in the list of targets options={'ancestor': ['-blacklist']} ) self.assert_console_output( 'common/a:a', # a: _should_ show up if we don't filter. 'common/a:foo', 'common/b:b', 'common/b:foo', 'common/c:c', 'common/c:foo', targets=self.targets('common/::'), options={'ancestor': []} ) def test_filter_regex(self): self.assert_console_output( 'common/a:a', 'common/a:foo', 'common/b:b', 'common/b:foo', 'common/c:c', 'common/c:foo', targets=self.targets('::'), options={'regex': ['^common']} ) self.assert_console_output( 'common/a:foo', 'common/b:foo', 'common/c:foo', 'overlaps:one', 'overlaps:two', 'overlaps:three', 'overlaps:foo', targets=self.targets('::'), options={'regex': ['+foo,^overlaps']} ) self.assert_console_output( 'overlaps:one', 'overlaps:two', 'overlaps:three', targets=self.targets('::'), options={'regex': ['-^common,foo$']} ) # Invalid regex. self.assert_console_raises(TaskError, targets=self.targets('::'), options={'regex': ['abc)']} ) def test_filter_tag_regex(self): # Filter two. self.assert_console_output( 'overlaps:three', targets=self.targets('::'), options={'tag_regex': ['+e(?=e)']} ) # Removals. self.assert_console_output( 'common/a:a', 'common/a:foo', 'common/b:b', 'common/b:foo', 'common/c:c', 'common/c:foo', 'overlaps:foo', 'overlaps:three', targets=self.targets('::'), options={'tag_regex': ['-one|two']} ) # Invalid regex. self.assert_console_raises(TaskError, targets=self.targets('::'), options={'tag_regex': ['abc)']} ) def test_filter_tag(self): # One match. self.assert_console_output( 'common/a:a', targets=self.targets('::'), options={'tag': ['+a_tag']} ) # Two matches. self.assert_console_output( 'common/a:a', 'common/b:b', targets=self.targets('::'), options={'tag': ['+a_tag,b_tag']} ) # One removal. self.assert_console_output( 'common/a:a', 'common/a:foo', 'common/b:b', 'common/b:foo', 'common/c:c', 'common/c:foo', 'overlaps:foo', 'overlaps:two', 'overlaps:three', targets=self.targets('::'), options={'tag': ['-one_tag']} ) # Two removals. self.assert_console_output( 'common/a:a', 'common/a:foo', 'common/b:b', 'common/b:foo', 'common/c:c', 'common/c:foo', 'overlaps:foo', 'overlaps:three', targets=self.targets('::'), options={'tag': ['-one_tag,two_tag']} ) # No match. self.assert_console_output( targets=self.targets('::'), options={'tag': ['+abcdefg_tag']} ) # No match due to AND of separate predicates. self.assert_console_output( targets=self.targets('::'), options={'tag': ['a_tag', 'b_tag']} )
sameerparekh/pants
tests/python/pants_test/backend/core/tasks/test_filter.py
Python
apache-2.0
9,825
[ 30522, 1001, 16861, 1027, 21183, 2546, 1011, 1022, 1001, 9385, 2297, 6471, 2622, 16884, 1006, 2156, 16884, 1012, 9108, 1007, 1012, 1001, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 2156, 6105, 1007, 1012, 2013, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
module.exports = function(knex) { describe('Transactions', function() { it('should be able to commit transactions', function(ok) { var id = null; return knex.transaction(function(t) { knex('accounts') .transacting(t) .returning('id') .insert({ first_name: 'Transacting', last_name: 'User', email:'transaction-test@example.com', logins: 1, about: 'Lorem ipsum Dolore labore incididunt enim.', created_at: new Date(), updated_at: new Date() }).then(function(resp) { return knex('test_table_two').transacting(t).insert({ account_id: (id = resp[0]), details: '', status: 1 }); }).then(function() { t.commit('Hello world'); }); }).then(function(commitMessage) { expect(commitMessage).to.equal('Hello world'); return knex('accounts').where('id', id).select('first_name'); }).then(function(resp) { expect(resp).to.have.length(1); }).otherwise(function(err) { console.log(err); }); }); it('should be able to rollback transactions', function(ok) { var id = null; var err = new Error('error message'); return knex.transaction(function(t) { knex('accounts') .transacting(t) .returning('id') .insert({ first_name: 'Transacting', last_name: 'User2', email:'transaction-test2@example.com', logins: 1, about: 'Lorem ipsum Dolore labore incididunt enim.', created_at: new Date(), updated_at: new Date() }).then(function(resp) { return knex('test_table_two').transacting(t).insert({ account_id: (id = resp[0]), details: '', status: 1 }); }).then(function() { t.rollback(err); }); }).otherwise(function(msg) { expect(msg).to.equal(err); return knex('accounts').where('id', id).select('first_name'); }).then(function(resp) { expect(resp).to.be.empty; }); }); }); };
viniborges/designizando
node_modules/knex/test/integration/builder/transaction.js
JavaScript
mit
2,294
[ 30522, 11336, 1012, 14338, 1027, 3853, 1006, 14161, 10288, 1007, 1063, 6235, 1006, 1005, 11817, 1005, 1010, 3853, 1006, 1007, 1063, 2009, 1006, 1005, 2323, 2022, 2583, 2000, 10797, 11817, 1005, 1010, 3853, 1006, 7929, 1007, 1063, 13075, 890...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
* {} * { margin: 0; padding: 0; } section, article, footer, nav, header, footer, hgroup, aside {display: block;} li { list-style: none; } fieldset { border: 0 solid #fff; } del { font-weight: normal; } address { font-size: 120%; font-style: normal; } img { display: block; border: 0; } form textarea { height: 140px; font-family: arial, helvetica, sans-serif; } /*remove FOUC */ .loading-polyfills body { visibility: hidden; } html.long-loading-polyfills body { visibility: visible; } /* Style the placeholder */ ::-webkit-input-placeholder { color: #999; } :-ms-input-placeholder { color: #999; } :-moz-placeholder { color: #999; } .placeholder-visible { color: #999; } :focus::-webkit-input-placeholder { color: #ddd; } :focus:-ms-input-placeholder { color: #ddd; } /* not supported yet */ :focus:-moz-placeholder { color: #ddd; } .placeholder-focused.placeholder-visible { color: #ddd; } h1, h2, h3, h4, h5, h6, table, input, textarea, label, select { font-size: 100%; } h2, h3, h4, h5 { font-family: Arial, Helvetica, sans-serif; } hgroup { text-align: center; margin: 30px 0 20px; } h2 { margin: 20px 0; font-size: 28px; } h3 { margin: 15px 0 10px; font-size: 22px; } h4 { margin: 10px 0 5px; font-size: 18px; } hgroup :first-child { font-family: Times, serif; margin-bottom: 4px; } hgroup :not(:first-child) { margin-top: 4px; } hgroup h2:first-child { font-size: 40px; } hgroup h3:not(:first-child) { font-size: 15px; } p { margin: 15px 0; } ul, ol { margin: 15px 0 15px 30px; } li { margin: 1px 0; padding: 1px 0; } ul li { list-style: disc } ol li { list-style: decimal; } a { color: #00C6FF; text-decoration: none; } code.block { display: block; white-space: pre; padding: 10px; margin: 12px 0; overflow-x: auto; -moz-border-radius: 10px; border-radius: 10px; background: #F2F2F2; font-size: 14px; } a:hover, a:focus, a:active { text-decoration: underline; } label { font-family: Arial, Helvetica, sans-serif; } .form-element label { display: block; margin: 0 0 3px; } input { box-shadow: none; } input.text, input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="password"], input[type="email"], input[type="url"], textarea, select { border: 1px solid #F2F2F2; padding: 2px 5px; min-height: 1.3em; width: 173px; -moz-box-shadow: 1px 1px 2px rgba(100, 100, 100, 0.9) inset; box-shadow: 1px 1px 2px rgba(100, 100, 100, 0.9) inset; -moz-border-radius: 4px; border-radius: 4px; font-family: "MS Shell Dlg", Arial, Helvetica, sans-serif; } textarea { height: auto; max-width: 605px; } select { border: 1px solid #F2F2F2; padding: 2px; -moz-box-shadow: 1px 1px 2px rgba(100, 100, 100, 0.9) inset; -moz-border-radius: 4px; border-radius: 4px; } .ui-datepicker select { width: auto; } option { padding-right: 3px; } .supported-browser-box:after, .home-box:after { content: " "; display: block; clear: both; } body { font: 16px/1.25 Times, Georgia, serif; background: #fff; } @media only all and (min-width: 920px) { body { width: 100%; overflow-x: hidden; } } .browser-support { position: absolute; top: 0; left: 0; width: 100%; font-size: 19px; font-family: Arial, sans-serif; background: #ffd; text-align: center; color: #000; border-bottom: 2px solid #000; } .browser-support .browser-support-box { padding: 10px; } div.main { position: relative; width: 940px; margin: 40px auto; font-size: 16px; } div.main > nav { position: absolute; top: 0; left: 0; width: 280px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; } div.main > nav ul { margin: 0; } div.main > nav li { border-top: 1px solid #eee; list-style: none; } div.main > nav li:first-child { border-top: 0; } div.main > nav a, div.main > nav strong { display: block; padding: 6px 2px; color: #333740; } div.main > nav a.active, div.main > nav strong { color: #00C6FF; } .main-box { margin-left: 310px; } div.main section { border-top: 1px solid #ccc; margin-top: 30px; } .home div.main section { margin-top: 70px; } div.main section:first-child { border: none; margin-top: 0; } body > header { background: #E9E4D1 url(header-bg.png); } body > header > hgroup { margin: auto; padding: 50px 0; text-align: center; text-transform: uppercase; } body > header h1 { font-size: 60px; text-shadow: 6px 4px 1px rgba(99, 99, 99, 0.8); } body > header h2 { margin: 0; font: 18px arial, helvetica, sans-serif; } body > header nav { background: #343742; min-height: 50px; -moz-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.7); box-shadow: 0 3px 3px rgba(0, 0, 0, 0.7); font-family: Arial, Helvetica, sans-serif; } body > header nav ul { display: block; margin: auto; width: 940px; overflow: hidden; } body > header nav li { float: left; margin: 2px 0; } body > header nav a { display: block; color: #fff; font-weight: bold; font-size: 16px; padding: 14px 5px 10px 0; } body > footer { padding: 15px; min-height: 20px; background: #343742; color: #fff; } body > footer small { display: block; margin: auto; width: 940px; font-size: 18px; } .home-box { display: inline-block; vertical-align: top; margin: 10px 0 30px; width: 430px; } .about-box { font-size: 22px; text-align: center; width: 480px; } .download-box { padding-top: 50px; width: 380px; } .download-box .download-button { float: right; } a.download-button { display: inline-block; margin: 5px 0; color: #000; text-align: center; text-decoration: none; } .download-button strong { display: block; border: 1px solid #7CE0FF; margin: 0 0 5px; padding: 5px 25px; -moz-border-radius: 5px; border-radius: 5px; -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); background: #00C6FF; color: #fff; font-family: Arial, serif; } .concept-box { width: 410px; margin-right: 20px; } .concept-box ul { margin-left: 0; } .concept-box ul li { list-style: none; margin-bottom: 10px; } .concept-box li strong { display: block; margin: 0 0 3px; color: #00C6FF; font-family: Arial, Helvetica, sans-serif; font-size: 18px; } .feature-example { width: 410px; margin-left: 20px; } .feature-example .inner-box { padding: 10px; background: #F2F2F2; -moz-border-radius: 10px; border-radius: 10px; } .feature-example code { font-size: 12px; } .feature-example code input { width: 50px; } .feature-example .hidden-explanation { overflow: hidden; } .supported-browser-box { display: block; margin-top: 0; padding: 10px 5px; background: #343742; color: #fff; width: auto; zoom: 1; font-family: Arial; } .supported-browser-box h3, .supported-browser-box ul { display: inline-block; margin: 0 5px; vertical-align: middle; } .supported-browser-box li { float: left; margin: 0 8px; list-style: none; } .feature-overview { text-align: center; } .feature-overview > div { margin: auto; width: 800px; } .feature-overview article { display: inline-block; vertical-align: top; margin: 5px; } .feature-overview article h3 { margin: 0; } .feature-overview article a { display: block; width: 130px; min-height: 130px; padding: 10px; background: #00C6FF; color: #fff; font-size: 18px; -moz-border-radius: 10px; border-radius: 10px; text-align: center; } .accordion h3.button { margin: 10px 0; padding: 5px; text-align: center; color: #fff; background: #343742; cursor: pointer; } .accordion h3.ui-state-active { cursor: default; } div.panel { overflow: hidden; } .home div.panel { width: 500px !important; margin: auto !important; }
SkaarFace/all-texsupply
css/styles.css
CSS
mit
7,617
[ 30522, 1008, 1063, 1065, 1008, 1063, 7785, 1024, 1014, 1025, 11687, 4667, 1024, 1014, 1025, 1065, 2930, 1010, 3720, 1010, 3329, 2121, 1010, 6583, 2615, 1010, 20346, 1010, 3329, 2121, 1010, 1044, 17058, 1010, 4998, 1063, 4653, 1024, 3796, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#ifndef QIGTLIODEVICEWIDGET_H #define QIGTLIODEVICEWIDGET_H #include <QWidget> // igtlio includes #include "igtlioGUIExport.h" #include <vtkSmartPointer.h> #include <vtkObject.h> #include "qIGTLIOVtkConnectionMacro.h" typedef vtkSmartPointer<class igtlioDevice> igtlioDevicePointer; class qIGTLIODeviceWidget; class OPENIGTLINKIO_GUI_EXPORT vtkIGTLIODeviceWidgetCreator : public vtkObject { public: // Create an instance of the specific device widget, with the given device_id virtual qIGTLIODeviceWidget* Create() = 0; // Return the device_type this factory creates device widgets for. virtual std::string GetDeviceType() const = 0; vtkAbstractTypeMacro(vtkIGTLIODeviceWidgetCreator,vtkObject); }; //--------------------------------------------------------------------------- class OPENIGTLINKIO_GUI_EXPORT qIGTLIODeviceWidget : public QWidget { Q_OBJECT IGTLIO_QVTK_OBJECT public: qIGTLIODeviceWidget(QWidget* parent=NULL); virtual void SetDevice(igtlioDevicePointer device); protected: igtlioDevicePointer Device; virtual void setupUi() = 0; protected slots: virtual void onDeviceModified() = 0; }; #endif // QIGTLIODEVICEWIDGET_H
IGSIO/OpenIGTLinkIO
GUI/DeviceWidgets/qIGTLIODeviceWidget.h
C
apache-2.0
1,172
[ 30522, 1001, 2065, 13629, 2546, 18816, 13512, 12798, 24844, 6610, 9148, 24291, 1035, 1044, 1001, 9375, 18816, 13512, 12798, 24844, 6610, 9148, 24291, 1035, 1044, 1001, 2421, 1026, 1053, 9148, 24291, 1028, 1013, 1013, 1045, 13512, 12798, 2950,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * University of Campinas - Brazil * Institute of Computing * SED group * * date: February 2009 * */ package br.unicamp.ic.sed.mobilemedia.copyphoto.impl; import javax.microedition.lcdui.Command; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.Displayable; import javax.microedition.midlet.MIDlet; import br.unicamp.ic.sed.mobilemedia.copyphoto.spec.prov.IManager; import br.unicamp.ic.sed.mobilemedia.copyphoto.spec.req.IFilesystem; import br.unicamp.ic.sed.mobilemedia.main.spec.dt.IImageData; import br.unicamp.ic.sed.mobilemedia.photo.spec.prov.IPhoto; /** * TODO This whole class must be aspectized */ class PhotoViewController extends AbstractController { private AddPhotoToAlbum addPhotoToAlbum; private static final Command backCommand = new Command("Back", Command.BACK, 0); private Displayable lastScreen = null; private void setAddPhotoToAlbum(AddPhotoToAlbum addPhotoToAlbum) { this.addPhotoToAlbum = addPhotoToAlbum; } String imageName = ""; public PhotoViewController(MIDlet midlet, String imageName) { super( midlet ); this.imageName = imageName; } private AddPhotoToAlbum getAddPhotoToAlbum() { if( this.addPhotoToAlbum == null) this.addPhotoToAlbum = new AddPhotoToAlbum("Copy Photo to Album"); return addPhotoToAlbum; } /* (non-Javadoc) * @see ubc.midp.mobilephoto.core.ui.controller.ControllerInterface#handleCommand(javax.microedition.lcdui.Command, javax.microedition.lcdui.Displayable) */ public boolean handleCommand(Command c) { String label = c.getLabel(); System.out.println( "<*"+this.getClass().getName()+".handleCommand() *> " + label); /** Case: Copy photo to a different album */ if (label.equals("Copy")) { this.initCopyPhotoToAlbum( ); return true; } /** Case: Save a copy in a new album */ else if (label.equals("Save Photo")) { return this.savePhoto(); /* IManager manager = ComponentFactory.createInstance(); IPhoto photo = (IPhoto) manager.getRequiredInterface("IPhoto"); return photo.postCommand( listImagesCommand ); */ }else if( label.equals("Cancel")){ if( lastScreen != null ){ MIDlet midlet = this.getMidlet(); Display.getDisplay( midlet ).setCurrent( lastScreen ); return true; } } return false; } private void initCopyPhotoToAlbum() { String title = new String("Copy Photo to Album"); String labelPhotoPath = new String("Copy to Album:"); AddPhotoToAlbum addPhotoToAlbum = new AddPhotoToAlbum( title ); addPhotoToAlbum.setPhotoName( imageName ); addPhotoToAlbum.setLabelPhotoPath( labelPhotoPath ); this.setAddPhotoToAlbum( addPhotoToAlbum ); //Get all required interfaces for this method MIDlet midlet = this.getMidlet(); //addPhotoToAlbum.setCommandListener( this ); lastScreen = Display.getDisplay( midlet ).getCurrent(); Display.getDisplay( midlet ).setCurrent( addPhotoToAlbum ); addPhotoToAlbum.setCommandListener(this); } private boolean savePhoto() { System.out.println("[PhotoViewController:savePhoto()]"); IManager manager = ComponentFactory.createInstance(); IImageData imageData = null; IFilesystem filesystem = (IFilesystem) manager.getRequiredInterface("IFilesystem"); System.out.println("[PhotoViewController:savePhoto()] filesystem="+filesystem); imageData = filesystem.getImageInfo(imageName); AddPhotoToAlbum addPhotoToAlbum = this.getAddPhotoToAlbum(); String photoName = addPhotoToAlbum.getPhotoName(); String albumName = addPhotoToAlbum.getPath(); filesystem.addImageData(photoName, imageData, albumName); if( lastScreen != null ){ MIDlet midlet = this.getMidlet(); Display.getDisplay( midlet ).setCurrent( lastScreen ); } return true; } }
leotizzei/MobileMedia-Cosmos-VP-v6
src/br/unicamp/ic/sed/mobilemedia/copyphoto/impl/PhotoViewController.java
Java
mit
3,765
[ 30522, 1013, 1008, 1008, 1008, 2118, 1997, 3409, 15227, 1011, 4380, 1008, 2820, 1997, 9798, 1008, 7367, 2094, 2177, 1008, 1008, 3058, 1024, 2337, 2268, 1008, 1008, 1013, 7427, 7987, 1012, 4895, 5555, 8737, 1012, 24582, 1012, 7367, 2094, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2019 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. package org.chromium.chrome.browser.browserservices.ui.splashscreen.trustedwebactivity; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static androidx.browser.trusted.TrustedWebActivityIntentBuilder.EXTRA_SPLASH_SCREEN_PARAMS; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Matrix; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import androidx.browser.customtabs.TrustedWebUtils; import androidx.browser.trusted.TrustedWebActivityIntentBuilder; import androidx.browser.trusted.splashscreens.SplashScreenParamKey; import org.chromium.base.IntentUtils; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; import org.chromium.chrome.browser.browserservices.ui.splashscreen.SplashController; import org.chromium.chrome.browser.browserservices.ui.splashscreen.SplashDelegate; import org.chromium.chrome.browser.customtabs.TranslucentCustomTabActivity; import org.chromium.chrome.browser.tab.Tab; import org.chromium.ui.base.ActivityWindowAndroid; import org.chromium.ui.util.ColorUtils; import javax.inject.Inject; /** * Orchestrates the flow of showing and removing splash screens for apps based on Trusted Web * Activities. * * The flow is as follows: * - TWA client app verifies conditions for showing splash screen. If the checks pass, it shows the * splash screen immediately. * - The client passes the URI to a file with the splash image to * {@link androidx.browser.customtabs.CustomTabsService}. The image is decoded and put into * {@link SplashImageHolder}. * - The client then launches a TWA, at which point the Bitmap is already available. * - ChromeLauncherActivity calls {@link #handleIntent}, which starts * {@link TranslucentCustomTabActivity} - a CustomTabActivity with translucent style. The * translucency is necessary in order to avoid a flash that might be seen when starting the activity * before the splash screen is attached. * - {@link TranslucentCustomTabActivity} creates an instance of {@link TwaSplashController} which * immediately displays the splash screen in an ImageView on top of the rest of view hierarchy. * - It also immediately removes the translucency. See comment in {@link SplashController} for more * details. * - It waits for the page to load, and removes the splash image once first paint (or a failure) * occurs. * * Lifecycle: this class is resolved only once when CustomTabActivity is launched, and is * gc-ed when it finishes its job. * If these lifecycle assumptions change, consider whether @ActivityScope needs to be added. */ public class TwaSplashController implements SplashDelegate { // TODO(pshmakov): move this to AndroidX. private static final String KEY_SHOWN_IN_CLIENT = "androidx.browser.trusted.KEY_SPLASH_SCREEN_SHOWN_IN_CLIENT"; private final SplashController mSplashController; private final Activity mActivity; private final SplashImageHolder mSplashImageCache; private final BrowserServicesIntentDataProvider mIntentDataProvider; @Inject public TwaSplashController(SplashController splashController, Activity activity, ActivityWindowAndroid activityWindowAndroid, SplashImageHolder splashImageCache, BrowserServicesIntentDataProvider intentDataProvider) { mSplashController = splashController; mActivity = activity; mSplashImageCache = splashImageCache; mIntentDataProvider = intentDataProvider; long splashHideAnimationDurationMs = IntentUtils.safeGetInt(getSplashScreenParamsFromIntent(), SplashScreenParamKey.KEY_FADE_OUT_DURATION_MS, 0); mSplashController.setConfig(this, splashHideAnimationDurationMs); } @Override public View buildSplashView() { Bitmap bitmap = mSplashImageCache.takeImage(mIntentDataProvider.getSession()); if (bitmap == null) { return null; } ImageView splashView = new ImageView(mActivity); splashView.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)); splashView.setImageBitmap(bitmap); applyCustomizationsToSplashScreenView(splashView); return splashView; } @Override public void onSplashHidden(Tab tab, long startTimestamp, long endTimestamp) {} @Override public boolean shouldWaitForSubsequentPageLoadToHideSplash() { return false; } private void applyCustomizationsToSplashScreenView(ImageView imageView) { Bundle params = getSplashScreenParamsFromIntent(); int backgroundColor = IntentUtils.safeGetInt( params, SplashScreenParamKey.KEY_BACKGROUND_COLOR, Color.WHITE); imageView.setBackgroundColor(ColorUtils.getOpaqueColor(backgroundColor)); int scaleTypeOrdinal = IntentUtils.safeGetInt(params, SplashScreenParamKey.KEY_SCALE_TYPE, -1); ImageView.ScaleType[] scaleTypes = ImageView.ScaleType.values(); ImageView.ScaleType scaleType; if (scaleTypeOrdinal < 0 || scaleTypeOrdinal >= scaleTypes.length) { scaleType = ImageView.ScaleType.CENTER; } else { scaleType = scaleTypes[scaleTypeOrdinal]; } imageView.setScaleType(scaleType); if (scaleType != ImageView.ScaleType.MATRIX) return; float[] matrixValues = IntentUtils.safeGetFloatArray( params, SplashScreenParamKey.KEY_IMAGE_TRANSFORMATION_MATRIX); if (matrixValues == null || matrixValues.length != 9) return; Matrix matrix = new Matrix(); matrix.setValues(matrixValues); imageView.setImageMatrix(matrix); } private Bundle getSplashScreenParamsFromIntent() { return mIntentDataProvider.getIntent().getBundleExtra(EXTRA_SPLASH_SCREEN_PARAMS); } /** * Returns true if the intent corresponds to a TWA with a splash screen. */ public static boolean intentIsForTwaWithSplashScreen(Intent intent) { boolean isTrustedWebActivity = IntentUtils.safeGetBooleanExtra( intent, TrustedWebUtils.EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY, false); boolean requestsSplashScreen = IntentUtils.safeGetParcelableExtra(intent, EXTRA_SPLASH_SCREEN_PARAMS) != null; return isTrustedWebActivity && requestsSplashScreen; } /** * Handles the intent if it should launch a TWA with splash screen. * @param activity Activity, from which to start the next one. * @param intent Incoming intent. * @return Whether the intent was handled. */ public static boolean handleIntent(Activity activity, Intent intent) { if (!intentIsForTwaWithSplashScreen(intent)) return false; Bundle params = IntentUtils.safeGetBundleExtra( intent, TrustedWebActivityIntentBuilder.EXTRA_SPLASH_SCREEN_PARAMS); boolean shownInClient = IntentUtils.safeGetBoolean(params, KEY_SHOWN_IN_CLIENT, true); // shownInClient is "true" by default for the following reasons: // - For compatibility with older clients which don't use this bundle key. // - Because getting "false" when it should be "true" leads to more severe visual glitches, // than vice versa. if (shownInClient) { // If splash screen was shown in client, we must launch a translucent activity to // ensure smooth transition. intent.setClassName(activity, TranslucentCustomTabActivity.class.getName()); } intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); activity.startActivity(intent); activity.overridePendingTransition(0, 0); return true; } }
ric2b/Vivaldi-browser
chromium/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/splashscreen/trustedwebactivity/TwaSplashController.java
Java
bsd-3-clause
8,032
[ 30522, 1013, 1013, 9385, 10476, 1996, 10381, 21716, 5007, 6048, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 2008, 2064, 2022, 1013, 1013, 2179, 1999, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.github.stuartervine.awssugar; public interface Receiver { void start(String queueName); void stop(); ExplicitReceiver explicit(String queueName); }
stuartervine/aws-sugar
src/com/github/stuartervine/awssugar/Receiver.java
Java
mit
173
[ 30522, 7427, 4012, 1012, 21025, 2705, 12083, 1012, 6990, 2121, 20534, 1012, 22091, 4757, 16377, 2099, 1025, 2270, 8278, 8393, 1063, 11675, 2707, 1006, 5164, 24240, 18442, 1007, 1025, 11675, 2644, 1006, 1007, 1025, 13216, 2890, 3401, 16402, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DataCollector; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\DataCollector\DataCollector; use Symfony\Component\Routing\Matcher\TraceableUrlMatcher; use Symfony\Component\Routing\RouterInterface; /** * RouterDataCollector. * * @author Fabien Potencier <fabien@symfony.com> */ class RouterDataCollector extends DataCollector { private $router; public function __construct(RouterInterface $router = null) { $this->router = $router; } /** * {@inheritdoc} */ public function collect(Request $request, Response $response, \Exception $exception = null) { $this->data['path_info'] = $request->getPathInfo(); if (!$this->router) { $this->data['traces'] = array(); } else { $matcher = new TraceableUrlMatcher($this->router->getRouteCollection(), $this->router->getContext()); $this->data['traces'] = $matcher->getTraces($request->getPathInfo()); } } public function getPathInfo() { return $this->data['path_info']; } public function getTraces() { return $this->data['traces']; } /** * {@inheritdoc} */ public function getName() { return 'router'; } }
lsmith77/symfony
src/Symfony/Bundle/FrameworkBundle/DataCollector/RouterDataCollector.php
PHP
mit
1,606
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 1996, 25353, 2213, 14876, 4890, 7427, 1012, 1008, 1008, 1006, 1039, 1007, 6904, 11283, 2078, 8962, 2368, 19562, 1026, 6904, 11283, 2078, 1030, 25353, 2213, 14876, 489...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2014, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above // copyright notice, this list of conditions and the following // disclaimer. // // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided with // the distribution. // // * Neither the name of John Haddon nor the names of // any other contributors to this software may be used to endorse or // promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////// #include "boost/python.hpp" #include "GafferBindings/DependencyNodeBinding.h" #include "GafferScene/SceneReader.h" #include "GafferSceneBindings/SceneReaderBinding.h" using namespace GafferScene; static boost::python::list supportedExtensions() { std::vector<std::string> e; SceneReader::supportedExtensions( e ); boost::python::list result; for( std::vector<std::string>::const_iterator it = e.begin(), eIt = e.end(); it != eIt; ++it ) { result.append( *it ); } return result; } void GafferSceneBindings::bindSceneReader() { GafferBindings::DependencyNodeClass<SceneReader>() .def( "supportedExtensions", &supportedExtensions ) .staticmethod( "supportedExtensions" ) ; }
davidsminor/gaffer
src/GafferSceneBindings/SceneReaderBinding.cpp
C++
bsd-3-clause
2,552
[ 30522, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>This tests that the querySelector and querySelectorAll fast path for IDs is not overzelous.</title> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> </head> <body> <script src="resources/id-fastpath-strict.js"></script> </body> </html>
scheib/chromium
third_party/blink/web_tests/fast/dom/SelectorAPI/id-fastpath-strict.html
HTML
bsd-3-clause
424
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, 19817, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="zh"> <head> <!-- Generated by javadoc (1.8.0_60) on Sat Jul 30 19:37:08 CST 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>类 com.ryougi.iframe.LoginFrame的使用</title> <meta name="date" content="2016-07-30"> <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="\u7C7B com.ryougi.iframe.LoginFrame\u7684\u4F7F\u7528"; } } catch(err) { } //--> </script> <noscript> <div>您的浏览器已禁用 JavaScript。</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="跳过导航链接">跳过导航链接</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../../../../overview-summary.html">概览</a></li> <li><a href="../package-summary.html">程序包</a></li> <li><a href="../../../../com/ryougi/iframe/LoginFrame.html" title="com.ryougi.iframe中的类">类</a></li> <li class="navBarCell1Rev">使用</li> <li><a href="../package-tree.html">树</a></li> <li><a href="../../../../deprecated-list.html">已过时</a></li> <li><a href="../../../../index-files/index-1.html">索引</a></li> <li><a href="../../../../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>上一个</li> <li>下一个</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/ryougi/iframe/class-use/LoginFrame.html" target="_top">框架</a></li> <li><a href="LoginFrame.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">所有类</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="类的使用 com.ryougi.iframe.LoginFrame" class="title">类的使用<br>com.ryougi.iframe.LoginFrame</h2> </div> <div class="classUseContainer">没有com.ryougi.iframe.LoginFrame的用法</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="跳过导航链接">跳过导航链接</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../../../../overview-summary.html">概览</a></li> <li><a href="../package-summary.html">程序包</a></li> <li><a href="../../../../com/ryougi/iframe/LoginFrame.html" title="com.ryougi.iframe中的类">类</a></li> <li class="navBarCell1Rev">使用</li> <li><a href="../package-tree.html">树</a></li> <li><a href="../../../../deprecated-list.html">已过时</a></li> <li><a href="../../../../index-files/index-1.html">索引</a></li> <li><a href="../../../../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>上一个</li> <li>下一个</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/ryougi/iframe/class-use/LoginFrame.html" target="_top">框架</a></li> <li><a href="LoginFrame.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">所有类</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>
RyougiChan/LibraryManager
docs/com/ryougi/iframe/class-use/LoginFrame.html
HTML
apache-2.0
4,298
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require 'httparty' module DeepThought module Notifier def self.notify(user, message) begin HTTParty.post("#{user.notification_url}", :body => {:message => message}.to_json, :headers => {'Content-Type' => 'application/json'}) rescue 'poop' end end end end
redhotvengeance/deep_thought
lib/deep_thought/notifier.rb
Ruby
mit
302
[ 30522, 5478, 1005, 8299, 23871, 1005, 11336, 2784, 2705, 10593, 2102, 11336, 2025, 18095, 13366, 2969, 1012, 2025, 8757, 1006, 5310, 1010, 4471, 1007, 4088, 8299, 23871, 1012, 2695, 1006, 1000, 1001, 1063, 5310, 1012, 26828, 1035, 24471, 21...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var searchData= [ ['interactiontype',['InteractionType',['../class_student_record.html#a00e060bc8aa9829e5db087e2cba21009',1,'StudentRecord']]] ];
rstals/Unity-SCORM-Integration-Kit
Documentation/search/enums_2.js
JavaScript
apache-2.0
148
[ 30522, 13075, 3945, 2850, 2696, 1027, 1031, 1031, 1005, 8290, 13874, 1005, 1010, 1031, 1005, 8290, 13874, 1005, 1010, 1031, 1005, 1012, 1012, 1013, 2465, 1035, 3076, 1035, 2501, 1012, 16129, 1001, 1037, 8889, 2063, 2692, 16086, 9818, 2620, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* linux/drivers/video/samsung/s3cfb_extdsp.h * * Copyright (c) 2010 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * * Header file for Samsung Display Driver (FIMD) driver * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef _S3CFB_EXTDSP_H #define _S3CFB_EXTDSP_H __FILE__ #ifdef __KERNEL__ #include <linux/mutex.h> #include <linux/fb.h> #ifdef CONFIG_HAS_WAKELOCK #include <linux/wakelock.h> #include <linux/earlysuspend.h> #endif #include <plat/fb-s5p.h> #endif #define S3CFB_EXTDSP_NAME "s3cfb_extdsp" #define POWER_ON 1 #define POWER_OFF 0 enum s3cfb_extdsp_output_t { OUTPUT_RGB, OUTPUT_ITU, OUTPUT_I80LDI0, OUTPUT_I80LDI1, OUTPUT_WB_RGB, OUTPUT_WB_I80LDI0, OUTPUT_WB_I80LDI1, }; enum s3cfb_extdsp_rgb_mode_t { MODE_RGB_P = 0, MODE_BGR_P = 1, MODE_RGB_S = 2, MODE_BGR_S = 3, }; enum s3cfb_extdsp_mem_owner_t { DMA_MEM_NONE = 0, DMA_MEM_FIMD = 1, DMA_MEM_OTHER = 2, }; enum s3cfb_extdsp_buf_status_t { BUF_FREE = 0, BUF_ACTIVE = 1, BUF_LOCKED = 2, }; struct s3cfb_extdsp_lcd_polarity { int rise_vclk; int inv_hsync; int inv_vsync; int inv_vden; }; struct s3cfb_extdsp_lcd { int width; int height; int bpp; }; struct s3cfb_extdsp_extdsp_desc { int state; struct s3cfb_extdsp_global *fbdev[1]; }; struct s3cfb_extdsp_time_stamp { unsigned int phys_addr; struct timeval time_marker; }; struct s3cfb_extdsp_buf_list { unsigned int phys_addr; struct timeval time_marker; int buf_status; }; struct s3cfb_extdsp_global { struct mutex lock; struct device *dev; #ifdef CONFIG_BUSFREQ_OPP struct device *bus_dev; #endif struct fb_info **fb; atomic_t enabled_win; enum s3cfb_extdsp_output_t output; enum s3cfb_extdsp_rgb_mode_t rgb_mode; struct s3cfb_extdsp_lcd *lcd; int system_state; #ifdef CONFIG_HAS_WAKELOCK struct early_suspend early_suspend; struct wake_lock idle_lock; #endif struct s3cfb_extdsp_buf_list buf_list[CONFIG_FB_S5P_EXTDSP_NR_BUFFERS]; unsigned int enabled_tz; unsigned int lock_cnt; }; struct s3cfb_extdsp_window { int id; int enabled; atomic_t in_use; int x; int y; unsigned int pseudo_pal[16]; int power_state; int lock_status; int lock_buf_idx; unsigned int lock_buf_offset; unsigned int free_buf_offset; }; struct s3cfb_extdsp_user_window { int x; int y; }; /* IOCTL commands */ #define S3CFB_EXTDSP_WIN_POSITION _IOW('F', 203, \ struct s3cfb_extdsp_user_window) #define S3CFB_EXTDSP_GET_LCD_WIDTH _IOR('F', 302, int) #define S3CFB_EXTDSP_GET_LCD_HEIGHT _IOR('F', 303, int) #define S3CFB_EXTDSP_SET_WIN_ON _IOW('F', 305, u32) #define S3CFB_EXTDSP_SET_WIN_OFF _IOW('F', 306, u32) #define S3CFB_EXTDSP_SET_WIN_ADDR _IOW('F', 308, unsigned long) #define S3CFB_EXTDSP_GET_FB_PHY_ADDR _IOR('F', 310, unsigned int) #define S3CFB_EXTDSP_LOCK_BUFFER _IOW('F', 320, int) #define S3CFB_EXTDSP_GET_NEXT_INDEX _IOW('F', 321, unsigned int) #define S3CFB_EXTDSP_GET_LOCKED_BUFFER _IOW('F', 322, unsigned int) #define S3CFB_EXTDSP_PUT_TIME_STAMP _IOW('F', 323, \ struct s3cfb_extdsp_time_stamp) #define S3CFB_EXTDSP_GET_TIME_STAMP _IOW('F', 324, \ struct s3cfb_extdsp_time_stamp) #define S3CFB_EXTDSP_GET_TZ_MODE _IOW ('F', 325, unsigned int) #define S3CFB_EXTDSP_SET_TZ_MODE _IOW ('F', 326, unsigned int) #define S3CFB_EXTDSP_GET_LOCKED_NUMBER _IOW ('F', 327, unsigned int) #define S3CFB_EXTDSP_LOCK_AND_GET_BUF _IOW ('F', 328, \ struct s3cfb_extdsp_buf_list) #define S3CFB_EXTDSP_GET_FREE_BUFFER _IOW('F', 329, unsigned int) extern struct fb_ops s3cfb_extdsp_ops; extern inline struct s3cfb_extdsp_global *get_extdsp_global(int id); /* S3CFB_EXTDSP */ extern int s3cfb_extdsp_enable_window(struct s3cfb_extdsp_global *fbdev, int id); extern int s3cfb_extdsp_disable_window(struct s3cfb_extdsp_global *fbdev, int id); extern int s3cfb_extdsp_update_power_state(struct s3cfb_extdsp_global *fbdev, int id, int state); extern int s3cfb_extdsp_init_global(struct s3cfb_extdsp_global *fbdev); extern int s3cfb_extdsp_map_default_video_memory(struct s3cfb_extdsp_global *fbdev, struct fb_info *fb, int extdsp_id); extern int s3cfb_extdsp_unmap_default_video_memory(struct s3cfb_extdsp_global *fbdev, struct fb_info *fb); extern int s3cfb_extdsp_check_var(struct fb_var_screeninfo *var, struct fb_info *fb); extern int s3cfb_extdsp_check_var_window(struct s3cfb_extdsp_global *fbdev, struct fb_var_screeninfo *var, struct fb_info *fb); extern int s3cfb_extdsp_set_par_window(struct s3cfb_extdsp_global *fbdev, struct fb_info *fb); extern int s3cfb_extdsp_set_par(struct fb_info *fb); extern int s3cfb_extdsp_init_fbinfo(struct s3cfb_extdsp_global *fbdev, int id); extern int s3cfb_extdsp_alloc_framebuffer(struct s3cfb_extdsp_global *fbdev, int extdsp_id); extern int s3cfb_extdsp_open(struct fb_info *fb, int user); extern int s3cfb_extdsp_release_window(struct fb_info *fb); extern int s3cfb_extdsp_release(struct fb_info *fb, int user); extern int s3cfb_extdsp_pan_display(struct fb_var_screeninfo *var, struct fb_info *fb); extern int s3cfb_extdsp_blank(int blank_mode, struct fb_info *fb); extern inline unsigned int __chan_to_field(unsigned int chan, struct fb_bitfield bf); extern int s3cfb_extdsp_setcolreg(unsigned int regno, unsigned int red, unsigned int green, unsigned int blue, unsigned int transp, struct fb_info *fb); extern int s3cfb_extdsp_cursor(struct fb_info *fb, struct fb_cursor *cursor); extern int s3cfb_extdsp_ioctl(struct fb_info *fb, unsigned int cmd, unsigned long arg); #ifdef CONFIG_HAS_WAKELOCK #ifdef CONFIG_HAS_EARLYSUSPEND extern void s3cfb_extdsp_early_suspend(struct early_suspend *h); extern void s3cfb_extdsp_late_resume(struct early_suspend *h); #endif #endif #endif /* _S3CFB_EXTDSP_H */
harunjo/galaxsih-kernel-JB-S3
drivers/video/samsung_extdisp/s3cfb_extdsp.h
C
gpl-2.0
5,898
[ 30522, 1013, 1008, 11603, 1013, 6853, 1013, 2678, 1013, 19102, 1013, 1055, 2509, 2278, 26337, 1035, 4654, 2102, 5104, 2361, 1012, 1044, 1008, 1008, 9385, 1006, 1039, 1007, 2230, 19102, 8139, 2522, 1012, 1010, 5183, 1012, 1008, 8299, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2012 Google Inc. All Rights Reserved. // // 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. package com.google.api.ads.dfp.lib.client; import com.google.api.ads.common.lib.client.AdsServiceClient; import com.google.api.ads.common.lib.client.HeaderHandler; import com.google.api.ads.common.lib.soap.SoapClientHandlerInterface; import com.google.api.ads.common.lib.soap.SoapServiceClient; import com.google.api.ads.common.lib.utils.logging.AdsServiceLoggers; import com.google.inject.assistedinject.Assisted; import javax.inject.Inject; /** * Wrapper of underlying SOAP client which allows access for setting * headers retrieved from the session. */ public class DfpServiceClient extends AdsServiceClient<DfpSession, DfpServiceDescriptor> { /** * Constructor. * * @param soapClient the SOAP client * @param dfpServiceDescriptor the DFP service descriptor * @param dfpSession the DFP session * @param soapClientHandler the SOAP client handler * @param dfpHeaderHandler the DFP header handler * @param adsServiceLoggers the ads service loggers */ @SuppressWarnings("unchecked") /* See comments on soapClientHandler argument. */ @Inject public DfpServiceClient( @Assisted("soapClient") Object soapClient, @Assisted("adsServiceDescriptor") DfpServiceDescriptor dfpServiceDescriptor, @Assisted("adsSession") DfpSession dfpSession, @SuppressWarnings("rawtypes") /* Guice binding for SoapClientHandlerInterface does not include * the type argument T because it is bound in the SOAP * toolkit-agnostic configuration module. Therefore, must use * the raw type here. */ SoapClientHandlerInterface soapClientHandler, HeaderHandler<DfpSession, DfpServiceDescriptor> dfpHeaderHandler, AdsServiceLoggers adsServiceLoggers) { super(soapClient, dfpSession, dfpServiceDescriptor, soapClientHandler, dfpHeaderHandler, adsServiceLoggers); } /** * @see SoapServiceClient#handleException */ @Override protected Throwable handleException(Throwable e) { return super.handleException(e); } }
gawkermedia/googleads-java-lib
modules/ads_lib/src/main/java/com/google/api/ads/dfp/lib/client/DfpServiceClient.java
Java
apache-2.0
2,767
[ 30522, 1013, 1013, 9385, 2262, 8224, 4297, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 1013, 1013, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1013, 1013, 2017, 2089, 2025, 2224, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php // Text $_['text_title'] = 'PayPal Express (ieskaitot Kredītkartes un Debetkartes)'; ?>
censam/open_cart
multilanguage/OC-Europa-1-5-1-3-9.part01/upload/catalog/language/latvian/payment/pp_express.php
PHP
gpl-3.0
97
[ 30522, 1026, 1029, 25718, 1013, 1013, 3793, 1002, 1035, 1031, 1005, 3793, 1035, 2516, 1005, 1033, 1027, 1005, 3477, 12952, 4671, 1006, 29464, 8337, 9956, 2102, 1047, 5596, 4183, 6673, 4570, 4895, 2139, 20915, 6673, 4570, 1007, 1005, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import { BaseNumberExtractor, RegExpValue, BasePercentageExtractor } from "../extractors"; import { Constants } from "../constants"; import { LongFormatType } from "../models"; import { ChineseNumeric } from "../../resources/chineseNumeric"; import { RegExpUtility } from "@microsoft/recognizers-text" export enum ChineseNumberExtractorMode { // Number extraction with an allow list that filters what numbers to extract. Default, // Extract all number-related terms aggressively. ExtractAll, } export class ChineseNumberExtractor extends BaseNumberExtractor { protected extractType: string = Constants.SYS_NUM; constructor(mode: ChineseNumberExtractorMode = ChineseNumberExtractorMode.Default) { super(); let regexes = new Array<RegExpValue>(); // Add Cardinal let cardExtract = new ChineseCardinalExtractor(mode); cardExtract.regexes.forEach(r => regexes.push(r)); // Add Fraction let fracExtract = new ChineseFractionExtractor(); fracExtract.regexes.forEach(r => regexes.push(r)); this.regexes = regexes; } } export class ChineseCardinalExtractor extends BaseNumberExtractor { protected extractType: string = Constants.SYS_NUM_CARDINAL; constructor(mode: ChineseNumberExtractorMode = ChineseNumberExtractorMode.Default) { super(); let regexes = new Array<RegExpValue>(); // Add Integer Regexes let intExtract = new ChineseIntegerExtractor(mode); intExtract.regexes.forEach(r => regexes.push(r)); // Add Double Regexes let doubleExtract = new ChineseDoubleExtractor(); doubleExtract.regexes.forEach(r => regexes.push(r)); this.regexes = regexes; } } export class ChineseIntegerExtractor extends BaseNumberExtractor { protected extractType: string = Constants.SYS_NUM_INTEGER; constructor(mode: ChineseNumberExtractorMode = ChineseNumberExtractorMode.Default) { super(); let regexes = new Array<RegExpValue>( { // 123456, -123456 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersSpecialsChars, "gi"), value: "IntegerNum" }, { // 15k, 16 G regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersSpecialsCharsWithSuffix, "gs"), value: "IntegerNum" }, { // 1,234, 2,332,111 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.DottedNumbersSpecialsChar, "gis"), value: "IntegerNum" }, { // 半百 半打 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersWithHalfDozen, "gis"), value: "IntegerChs" }, { // 一打 五十打 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersWithDozen, "gis"), value: "IntegerChs" } ); switch (mode) { case ChineseNumberExtractorMode.Default: regexes.push({ // 一百五十五, 负一亿三百二十二. Uses an allow list to avoid extracting "四" from "四川" regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersWithAllowListRegex, "gi"), value: "IntegerChs" }); break; case ChineseNumberExtractorMode.ExtractAll: regexes.push({ // 一百五十五, 负一亿三百二十二, "四" from "四川". Uses no allow lists and extracts all potential integers (useful in Units, for example). regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersAggressiveRegex, "gi"), value: "IntegerChs" }); break; } this.regexes = regexes; } } export class ChineseDoubleExtractor extends BaseNumberExtractor { protected extractType: string = Constants.SYS_NUM_DOUBLE; constructor() { super(); let regexes = new Array<RegExpValue>( { regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.DoubleSpecialsChars, "gis"), value: "DoubleNum" }, { // (-)2.5, can avoid cases like ip address xx.xx.xx.xx regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), value: "DoubleNum" }, { // (-).2 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.SimpleDoubleSpecialsChars, "gis"), value: "DoubleNum" }, { // 1.0 K regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.DoubleWithMultiplierRegex, "gi"), value: "DoubleNum" }, { // 15.2万 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.DoubleWithThousandsRegex, "gi"), value: "DoubleChs" }, { // 四十五点三三 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.DoubleAllFloatRegex, "gi"), value: "DoubleChs" }, { // 2e6, 21.2e0 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.DoubleExponentialNotationRegex, "gis"), value: "DoublePow" }, { // 2^5 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.DoubleScientificNotationRegex, "gis"), value: "DoublePow" } ); this.regexes = regexes; } } export class ChineseFractionExtractor extends BaseNumberExtractor { protected extractType: string = Constants.SYS_NUM_FRACTION; constructor() { super(); let regexes = new Array<RegExpValue>( { // -4 5/2, 4 6/3 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.FractionNotationSpecialsCharsRegex, "gis"), value: "FracNum" }, { // 8/3 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.FractionNotationRegex, "gis"), value: "FracNum" }, { // 四分之六十五 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.AllFractionNumber, "gi"), value: "FracChs" } ); this.regexes = regexes; } } export class ChineseOrdinalExtractor extends BaseNumberExtractor { protected extractType: string = Constants.SYS_NUM_ORDINAL; constructor() { super(); let regexes = new Array<RegExpValue>( { // 第一百五十四 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.OrdinalRegex, "gi"), value: "OrdinalChs" }, { // 第2565, 第1234 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.OrdinalNumbersRegex, "gi"), value: "OrdinalChs" } ); this.regexes = regexes; } } export class ChinesePercentageExtractor extends BaseNumberExtractor { protected extractType: string = Constants.SYS_NUM_PERCENTAGE; constructor() { super(); let regexes = new Array<RegExpValue>( { // 二十个百分点, 四点五个百分点 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.PercentagePointRegex, "gi"), value: "PerChs" }, { // 百分之五十 百分之一点五 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.SimplePercentageRegex, "gi"), value: "PerChs" }, { // 百分之56.2 百分之12 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersPercentagePointRegex, "gis"), value: "PerNum" }, { // 百分之3,000 百分之1,123 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), value: "PerNum" }, { // 百分之3.2 k regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), value: "PerNum" }, { // 12.56个百分点 0.4个百分点 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.FractionPercentagePointRegex, "gis"), value: "PerNum" }, { // 15,123个百分点 111,111个百分点 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.FractionPercentageWithSeparatorRegex, "gis"), value: "PerNum" }, { // 12.1k个百分点 15.1k个百分点 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.FractionPercentageWithMultiplierRegex, "gi"), value: "PerNum" }, { // 百分之22 百分之120 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.SimpleNumbersPercentageRegex, "gis"), value: "PerNum" }, { // 百分之15k regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), value: "PerNum" }, { // 百分之1,111 百分之9,999 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.SimpleNumbersPercentagePointRegex, "gis"), value: "PerNum" }, { // 12个百分点 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.IntegerPercentageRegex, "gis"), value: "PerNum" }, { // 12k个百分点 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.IntegerPercentageWithMultiplierRegex, "gi"), value: "PerNum" }, { // 2,123个百分点 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersFractionPercentageRegex, "gis"), value: "PerNum" }, { regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.SimpleIntegerPercentageRegex, "gis"), value: "PerNum" }, { // 2折 2.5折 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersFoldsPercentageRegex, "gis"), value: "PerSpe" }, { // 三折 六点五折 七五折 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.FoldsPercentageRegex, "gis"), value: "PerSpe" }, { // 5成 6成半 6成4 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.SimpleFoldsPercentageRegex, "gis"), value: "PerSpe" }, { // 七成半 七成五 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.SpecialsPercentageRegex, "gis"), value: "PerSpe" }, { // 2成 2.5成 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.NumbersSpecialsPercentageRegex, "gis"), value: "PerSpe" }, { // 三成 六点五成 regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.SimpleSpecialsPercentageRegex, "gis"), value: "PerSpe" }, { regExp: RegExpUtility.getSafeRegExp(ChineseNumeric.SpecialsFoldsPercentageRegex, "gis"), value: "PerSpe" } ); this.regexes = regexes; } }
matthewshim-ms/Recognizers-Text
JavaScript/packages/recognizers-number/src/number/chinese/extractors.ts
TypeScript
mit
11,606
[ 30522, 12324, 1063, 2918, 19172, 5677, 10288, 6494, 16761, 1010, 19723, 10288, 2361, 10175, 5657, 1010, 30524, 1025, 12324, 1063, 2146, 14192, 19321, 18863, 1065, 2013, 1000, 1012, 1012, 1013, 4275, 1000, 1025, 12324, 1063, 2822, 19172, 22420...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
window.locales = window.locales || {}; window.locales["de"] = { _error_check: "muss sein", _error_unknown_locale: "unbekannte Sprache -> setze zurück auf standardmäßig vorgegebene Sprache:", _help_at_start_1: "Willkommen zu getstarted.js - entwickelt von @ThomasGreiner", _help_at_start_2: "Geben Sie einfach ein Kommando unterhalb ein, um die Grundlagen zu entdecken, was Sie mit JavaScript tun können.", _help_at_start_3: "Hier ist ein Beispiel, womit Sie sich das BODY Element holen können:", _help_at_start_4: "entdecken Sie alle Möglichkeiten hier:", _info_BODY: "das primäre Seitenelement", _info_different: "ein anderer Typ sein", _info_HTML: "die ganze Seite", _info_HTMLElement: "ein HTML Element (z.B. <b></b> oder <div></div>)", _info_IMG: "ein Bild Element", _info_NodeList: "eine Liste von HTML Elementen (z.B. <b></b> oder <div></div>)", _info_none: "(keine Beschreibung vorhanden für dieses Element)", _info_string: "Text", _msg_more: "das ist", hide_help_at_start: "verstecke_hilfe_beim_start", set_locale: "sprache_festlegen", about_getstarted: "ueber_getstarted", contact_developer: "entwickler_kontaktieren", show_examples: "beispiele_zeigen", add: "fuege_hinzu", and_create_new_element_to_page_that_is: "und_erstelle_neues_element_in_der_seite_vom_typ", existing_element_to_page: "vorhandenes_element_zur_seite", change: "aendere", class_of_element: "class_von_element", content_of: "inhalt_von", each_element: "jedem_element", element: "element", id_of_element: "id_von_element", name_of_element: "name_von_element", text: "text", visibility_of_element_to: "sichtbarkeit_von_element_zu", hidden: "versteckt", the_opposite: "gegenteil", visible: "sichtbar", find_out: "finde_heraus", if_text: "ob_text", contains: "enthaelt", ends_with: "endet_mit", starts_with:"beginnt_mit", more_about_element: "mehr_ueber_element", get: "hole", element_that: "element_mit", has_class: "class", has_id: "id", has_name: "name", is: "typ", elements_that: "elemente_mit", are: "typ", have_class: "class", have_name: "name", have_id: "id", entire_page: "ganze_seite", help: "hilfe", remove: "entferne", when: "wenn", element_is: "element_ist", clicked: "geklickt" }
ThomasGreiner/getstarted.js
_locales/de.js
JavaScript
artistic-2.0
2,357
[ 30522, 3332, 1012, 2334, 2229, 1027, 3332, 1012, 2334, 2229, 1064, 1064, 1063, 1065, 1025, 3332, 1012, 2334, 2229, 1031, 1000, 2139, 1000, 1033, 1027, 1063, 1035, 7561, 1035, 4638, 1024, 1000, 14163, 4757, 7367, 2378, 1000, 1010, 1035, 75...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<span class="entity-icon {{category}}" tooltip="{{category}}" tooltip-append-to-body="true" tooltip-placement="left"> <i class="fa fa-question-circle" ng-show="category=='Other'"></i> <i class="fa fa-suitcase" ng-show="category=='Company'"></i> <i class="fa fa-university" ng-show="category=='Organization'"></i> <i class="fa fa-user" ng-show="category=='Person'"></i> </span>
arc64/datawi.re
frontend/templates/entities/icon.html
HTML
mit
387
[ 30522, 1026, 8487, 2465, 1027, 1000, 9178, 1011, 12696, 1063, 1063, 4696, 1065, 1065, 1000, 6994, 25101, 1027, 1000, 1063, 1063, 4696, 1065, 1065, 1000, 6994, 25101, 1011, 10439, 10497, 1011, 2000, 1011, 2303, 1027, 1000, 2995, 1000, 6994, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Copyright (C) 2012 52°North Initiative for Geospatial Open Source Software GmbH * * 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. */ package org.n52.sos.cache; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import org.n52.oxf.valueDomains.time.ITimePeriod; import org.n52.sos.dataTypes.EnvelopeWrapper; import org.n52.sos.dataTypes.ObservationOffering; import org.n52.sos.db.AccessGDB; public class ObservationOfferingCache extends AbstractEntityCache<ObservationOffering> { private static final String TOKEN_SEP = "@@"; private static ObservationOfferingCache instance; public static synchronized ObservationOfferingCache instance(String dbName) throws FileNotFoundException { if (instance == null) { instance = new ObservationOfferingCache(dbName); } return instance; } public static synchronized ObservationOfferingCache instance() throws FileNotFoundException { return instance; } private boolean cancelled; private ObservationOfferingCache(String dbName) throws FileNotFoundException { super(dbName); } @Override protected String getCacheFileName() { return "observationOfferingsList.cache"; } @Override protected String serializeEntity(ObservationOffering entity) throws CacheException { StringBuilder sb = new StringBuilder(); sb.append(entity.getId()); sb.append(TOKEN_SEP); sb.append(entity.getName()); sb.append(TOKEN_SEP); sb.append(entity.getProcedureIdentifier()); sb.append(TOKEN_SEP); try { sb.append(EnvelopeEncoderDecoder.encode(entity.getObservedArea())); } catch (IOException e) { throw new CacheException(e); } sb.append(TOKEN_SEP); sb.append(Arrays.toString(entity.getObservedProperties())); sb.append(TOKEN_SEP); sb.append(TimePeriodEncoder.encode(entity.getTimeExtent())); return sb.toString(); } @Override protected ObservationOffering deserializeEntity(String line) { String[] values = line.split(TOKEN_SEP); if (values == null || values.length != 6) { return null; } String id = values[0].trim(); String name = values[1].trim(); String proc = values[2].trim(); EnvelopeWrapper env = EnvelopeEncoderDecoder.decode(values[3]); String[] props = decodeStringArray(values[4]); ITimePeriod time = TimePeriodEncoder.decode(values[5]); return new ObservationOffering(id, name, props, proc, env, time); } @Override protected boolean mergeWithPreviousEntries() { return true; } protected Collection<ObservationOffering> getCollectionFromDAO(AccessGDB geoDB) throws IOException { this.cancelled = false; clearTempCacheFile(); geoDB.getOfferingAccess().getNetworksAsObservationOfferingsAsync(new OnOfferingRetrieved() { int count = 0; @Override public void retrieveExpectedOfferingsCount(int c) { setMaximumEntries(c); } @Override public void retrieveOffering(ObservationOffering oo, int currentOfferingIndex) throws RetrievingCancelledException { storeTemporaryEntity(oo); setLatestEntryIndex(currentOfferingIndex); LOGGER.info(String.format("Added ObservationOffering #%s to the cache.", count++)); if (cancelled) { throw new RetrievingCancelledException("Cache update cancelled due to shutdown."); } } }); return Collections.emptyList(); } @Override protected AbstractEntityCache<ObservationOffering> getSingleInstance() { return instance; } @Override public void cancelCurrentExecution() { this.cancelled = true; } }
52North/ArcGIS-Server-SOS-Extension
src/main/java/org/n52/sos/cache/ObservationOfferingCache.java
Java
apache-2.0
4,089
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2262, 4720, 7737, 12131, 2705, 6349, 2005, 20248, 13102, 10450, 2389, 2330, 3120, 4007, 18289, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
from os.path import dirname import numpy as np from ..os import open_file, exists_isdir, makedirs from ..log import get_logger logger = get_logger() def read_or_write(data_f, fallback=None): """Loads the data file if it exists. Otherwise, if fallback is provided, call fallback and save its return to disk. Args: data_f (str): Path to the data file, whose extension will be used for deciding how to load the data. fallback (function, optional): Fallback function used if data file doesn't exist. Its return will be saved to ``data_f`` for future loadings. It should not take arguments, but if yours requires taking arguments, just wrap yours with:: fallback=lambda: your_fancy_func(var0, var1) Returns: Data loaded if ``data_f`` exists; otherwise, ``fallback``'s return (``None`` if no fallback). Writes - Return by the fallback, if provided. """ # Decide data file type ext = data_f.split('.')[-1].lower() def load_func(path): with open_file(path, 'rb') as h: data = np.load(h) return data def save_func(data, path): if ext == 'npy': save = np.save elif ext == 'npz': save = np.savez else: raise NotImplementedError(ext) with open_file(path, 'wb') as h: save(h, data) # Load or call fallback if exists_isdir(data_f)[0]: data = load_func(data_f) msg = "Loaded: " else: msg = "File doesn't exist " if fallback is None: data = None msg += "(fallback not provided): " else: data = fallback() out_dir = dirname(data_f) makedirs(out_dir) save_func(data, data_f) msg += "(fallback provided); fallback return now saved to: " msg += data_f logger.info(msg) return data
google/nerfactor
third_party/xiuminglib/xiuminglib/io/np.py
Python
apache-2.0
1,973
[ 30522, 2013, 9808, 1012, 4130, 12324, 16101, 18442, 12324, 16371, 8737, 2100, 2004, 27937, 2013, 1012, 1012, 9808, 12324, 2330, 1035, 5371, 1010, 6526, 1035, 30524, 1006, 1007, 13366, 3191, 1035, 2030, 1035, 4339, 1006, 2951, 1035, 1042, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="hr"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Bitcoin</source> <translation>O Bitcoinu</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Bitcoin&lt;/b&gt; version</source> <translation>&lt;b&gt;Bitcoin&lt;/b&gt; verzija</translation> </message> <message> <location line="+41"/> <source>Copyright © 2009-2012 The Bitcoin developers</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <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"></translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Adresar</translation> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Dvostruki klik za uređivanje adrese ili oznake</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Dodajte novu adresu</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopiraj trenutno odabranu adresu u međuspremnik</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Nova adresa</translation> </message> <message> <location line="-46"/> <source>These are your Bitcoin 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>Ovo su vaše Bitcoin adrese za primanje isplate. Možda želite dati drukčiju adresu svakom primatelju tako da možete pratiti tko je platio.</translation> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation>&amp;Kopirati adresu</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Prikaži &amp;QR Kôd</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Bitcoin address</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished">&amp;Potpišite poruku</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"></translation> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified Bitcoin address</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"></translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Brisanje</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Kopirati &amp;oznaku</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Izmjeniti</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation>Izvoz podataka adresara</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Datoteka vrijednosti odvojenih zarezom (*. csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Pogreška kod izvoza</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Ne mogu pisati u datoteku %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+142"/> <source>Label</source> <translation>Oznaka</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresa</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(bez oznake)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"></translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Unesite lozinku</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nova lozinka</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Ponovite novu lozinku</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>Unesite novi lozinku za novčanik. &lt;br/&gt; Molimo Vas da koristite zaporku od &lt;b&gt;10 ili više slučajnih znakova,&lt;/b&gt; ili &lt;b&gt;osam ili više riječi.&lt;/b&gt;</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Šifriranje novčanika</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Ova operacija treba lozinku vašeg novčanika kako bi se novčanik otključao.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Otključaj novčanik</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Ova operacija treba lozinku vašeg novčanika kako bi se novčanik dešifrirao.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Dešifriranje novčanika.</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Promjena lozinke</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Unesite staru i novu lozinku za novčanik.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Potvrdi šifriranje novčanika</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 BITCOINS&lt;/b&gt;!</source> <translation>Upozorenje: Ako šifrirate vaš novčanik i izgubite lozinku, &lt;b&gt;IZGUBIT ĆETE SVE SVOJE BITCOINSE!&lt;/b&gt;</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Jeste li sigurni da želite šifrirati svoj novčanik?</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 type="unfinished"></translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"></translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Novčanik šifriran</translation> </message> <message> <location line="-56"/> <source>Bitcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source> <translation>Bitcoin će se sada zatvoriti kako bi dovršio postupak šifriranja. Zapamtite da šifriranje vašeg novčanika ne može u potpunosti zaštititi vaše bitcoine od krađe preko zloćudnog softvera koji bi bio na vašem računalu.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Šifriranje novčanika nije uspjelo</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Šifriranje novčanika nije uspjelo zbog interne pogreške. Vaš novčanik nije šifriran.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>Priložene lozinke se ne podudaraju.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Otključavanje novčanika nije uspjelo</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Lozinka za dešifriranje novčanika nije točna.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Dešifriranje novčanika nije uspjelo</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Lozinka novčanika je uspješno promijenjena.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+257"/> <source>Sign &amp;message...</source> <translation>&amp;Potpišite poruku...</translation> </message> <message> <location line="+237"/> <source>Synchronizing with network...</source> <translation>Usklađivanje s mrežom ...</translation> </message> <message> <location line="-299"/> <source>&amp;Overview</source> <translation>&amp;Pregled</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Prikaži opći pregled novčanika</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;Transakcije</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Pretraži povijest transakcija</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation>&amp;Adresar</translation> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation>Uređivanje popisa pohranjenih adresa i oznaka</translation> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation>&amp;Primanje novca</translation> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation>Prikaži popis adresa za primanje isplate</translation> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation>&amp;Slanje novca</translation> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation>&amp;Izlaz</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Izlazak iz programa</translation> </message> <message> <location line="+4"/> <source>Show information about Bitcoin</source> <translation>Prikaži informacije o Bitcoinu</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Više o &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Prikaži informacije o Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Postavke</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Šifriraj novčanik...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Backup novčanika...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Promijena lozinke...</translation> </message> <message numerus="yes"> <location line="+241"/> <source>~%n block(s) remaining</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation>Preuzeto %1 od %2 blokova povijesti transakcije (%3% done).</translation> </message> <message> <location line="-242"/> <source>&amp;Export...</source> <translation>&amp;Izvoz...</translation> </message> <message> <location line="-58"/> <source>Send coins to a Bitcoin address</source> <translation>Slanje novca na bitcoin adresu</translation> </message> <message> <location line="+45"/> <source>Modify configuration options for Bitcoin</source> <translation>Promijeni postavke konfiguracije za bitcoin</translation> </message> <message> <location line="+14"/> <source>Export the data in the current tab to a file</source> <translation>Izvoz podataka iz trenutnog taba u datoteku</translation> </message> <message> <location line="-10"/> <source>Encrypt or decrypt wallet</source> <translation>Šifriranje ili dešifriranje novčanika</translation> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation>Napravite sigurnosnu kopiju novčanika na drugoj lokaciji</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Promijenite lozinku za šifriranje novčanika</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"></translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation type="unfinished"></translation> </message> <message> <location line="-186"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> <location line="+0"/> <source>Wallet</source> <translation>Novčanik</translation> </message> <message> <location line="+168"/> <source>&amp;About Bitcoin</source> <translation>&amp;O Bitcoinu</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"></translation> </message> <message> <location line="+39"/> <source>&amp;File</source> <translation>&amp;Datoteka</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;Konfiguracija</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Pomoć</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Traka kartica</translation> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation>Traka akcija</translation> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+60"/> <source>Bitcoin client</source> <translation type="unfinished"></translation> </message> <message numerus="yes"> <location line="+69"/> <source>%n active connection(s) to Bitcoin network</source> <translation> <numerusform>%n aktivna veza na Bitcoin mrežu</numerusform> <numerusform>%n aktivne veze na Bitcoin mrežu</numerusform> <numerusform>%n aktivnih veza na Bitcoin mrežu</numerusform> </translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation>Preuzeto %1 blokova povijesti transakcije.</translation> </message> <message numerus="yes"> <location line="+22"/> <source>%n second(s) ago</source> <translation> <numerusform>prije %n sekunde</numerusform> <numerusform>prije %n sekunde</numerusform> <numerusform>prije %n sekundi</numerusform> </translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s) ago</source> <translation> <numerusform>prije %n minute</numerusform> <numerusform>prije %n minute</numerusform> <numerusform>prije %n minuta</numerusform> </translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation> <numerusform>prije %n sata</numerusform> <numerusform>prije %n sata</numerusform> <numerusform>prije %n sati</numerusform> </translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation> <numerusform>prije %n dana</numerusform> <numerusform>prije %n dana</numerusform> <numerusform>prije %n dana</numerusform> </translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation>Ažurno</translation> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation>Ažuriranje...</translation> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation>Zadnji primljeni blok je generiran %1.</translation> </message> <message> <location line="+59"/> <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>Ova transakcija je preko ograničenja veličine. Možete ju ipak poslati za naknadu od %1, koja se daje čvorovima koji procesiraju vaše transakcije i tako podržavate mrežu. Želite li platiti naknadu?</translation> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"></translation> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Poslana transakcija</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Dolazna transakcija</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Datum:%1 Iznos:%2 Tip:%3 Adresa:%4 </translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"></translation> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source> <translation type="unfinished"></translation> </message> <message> <location line="+16"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Novčanik je &lt;b&gt;šifriran&lt;/b&gt; i trenutno &lt;b&gt;otključan&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>Novčanik je &lt;b&gt;šifriran&lt;/b&gt; i trenutno &lt;b&gt;zaključan&lt;/b&gt;</translation> </message> <message> <location line="+23"/> <source>Backup Wallet</source> <translation>Backup novčanika</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Podaci novčanika (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Backup nije uspio</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Došlo je do pogreške kod spremanja podataka novčanika na novu lokaciju.</translation> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+87"/> <source>Network Alert</source> <translation type="unfinished"></translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Izmjeni adresu</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Oznaka</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Oznaka ovog upisa u adresar</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Adresa</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>Adresa ovog upisa u adresar. Može se mjenjati samo kod adresa za slanje.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation>Nova adresa za primanje</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nova adresa za slanje</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Uredi adresu za primanje</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Uredi adresu za slanje</translation> </message> <message> <location line="+60"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Upisana adresa &quot;%1&quot; je već u adresaru.</translation> </message> <message> <location line="+5"/> <source>The entered address &quot;%1&quot; is not a valid Bitcoin address.</source> <translation>Upisana adresa &quot;%1&quot; nije valjana bitcoin adresa.</translation> </message> <message> <location line="+5"/> <source>Could not unlock wallet.</source> <translation>Ne mogu otključati novčanik.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Stvaranje novog ključa nije uspjelo.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+419"/> <location line="+12"/> <source>Bitcoin-Qt</source> <translation type="unfinished"></translation> </message> <message> <location line="-12"/> <source>version</source> <translation>verzija</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Upotreba:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>UI postavke</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Pokreni minimiziran</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"></translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Postavke</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Glavno</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. Fee 0.01 recommended.</source> <translation>Neobavezna naknada za transakciju po kB koja omogućuje da se vaša transakcija obavi brže. Većina transakcija ima 1 kB. Preporučena naknada je 0.01.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Plati &amp;naknadu za transakciju</translation> </message> <message> <location line="+31"/> <source>Automatically start Bitcoin after logging in to the system.</source> <translation>Automatski pokreni Bitcoin kad se uključi računalo</translation> </message> <message> <location line="+3"/> <source>&amp;Start Bitcoin on system login</source> <translation>&amp;Pokreni Bitcoin kod pokretanja sustava</translation> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"></translation> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation type="unfinished"></translation> </message> <message> <location line="+6"/> <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Automatski otvori port Bitcoin klijenta na ruteru. To radi samo ako ruter podržava UPnP i ako je omogućen.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapiraj port koristeći &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Bitcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Spojite se na Bitcon mrežu putem SOCKS proxy-a (npr. kod povezivanja kroz Tor)</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Povezivanje putem SOCKS proxy-a:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"></translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>IP adresa proxy-a (npr. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"></translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Port od proxy-a (npr. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"></translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"></translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Prikaži samo ikonu u sistemskoj traci nakon minimiziranja prozora</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimiziraj u sistemsku traku umjesto u traku programa</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>Minimizirati umjesto izaći iz aplikacije kada je prozor zatvoren. Kada je ova opcija omogućena, aplikacija će biti zatvorena tek nakon odabira Izlaz u izborniku.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimiziraj kod zatvaranja</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Prikaz</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Bitcoin.</source> <translation type="unfinished"></translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Jedinica za prikazivanje iznosa:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Izaberite željeni najmanji dio bitcoina koji će biti prikazan u sučelju i koji će se koristiti za plaćanje.</translation> </message> <message> <location line="+9"/> <source>Whether to show Bitcoin addresses in the transaction list or not.</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Prikaži adrese u popisu transakcija</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation type="unfinished"></translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation type="unfinished"></translation> </message> <message> <location line="+147"/> <location line="+9"/> <source>Warning</source> <translation>Upozorenje</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Bitcoin.</source> <translation type="unfinished"></translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Oblik</translation> </message> <message> <location line="+33"/> <location line="+183"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"></translation> </message> <message> <location line="-141"/> <source>Balance:</source> <translation>Stanje:</translation> </message> <message> <location line="+58"/> <source>Number of transactions:</source> <translation>Broj transakcija:</translation> </message> <message> <location line="-29"/> <source>Unconfirmed:</source> <translation>Nepotvrđene:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Novčanik</translation> </message> <message> <location line="+124"/> <source>Immature:</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"></translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Nedavne transakcije&lt;/b&gt;</translation> </message> <message> <location line="-118"/> <source>Your current balance</source> <translation>Vaše trenutno stanje računa</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>Ukupni iznos transakcija koje tek trebaju biti potvrđene, i još uvijek nisu uračunate u trenutni saldo</translation> </message> <message> <location line="+20"/> <source>Total number of transactions in wallet</source> <translation>Ukupni broj tansakcija u novčaniku</translation> </message> <message> <location filename="../overviewpage.cpp" line="+112"/> <location line="+1"/> <source>out of sync</source> <translation type="unfinished"></translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>QR Code Dijalog</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Zatraži plaćanje</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Iznos:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Oznaka</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Poruka:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Spremi kao...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"></translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"></translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG slike (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"></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="+348"/> <source>N/A</source> <translation type="unfinished"></translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"></translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"></translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"></translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"></translation> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"></translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"></translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Show the Bitcoin-Qt help message to get a list with possible Bitcoin command-line options.</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"></translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"></translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"></translation> </message> <message> <location line="-104"/> <source>Bitcoin - Debug window</source> <translation type="unfinished"></translation> </message> <message> <location line="+25"/> <source>Bitcoin Core</source> <translation type="unfinished"></translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"></translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"></translation> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the Bitcoin RPC console.</source> <translation type="unfinished"></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 type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"></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>Slanje novca</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Pošalji k nekoliko primatelja odjednom</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>&amp;Dodaj primatelja</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Obriši sva polja transakcija</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Obriši &amp;sve</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Stanje:</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>Potvrdi akciju slanja</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Pošalji</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; do %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Potvrdi slanje novca</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Jeste li sigurni da želite poslati %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>i</translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>Adresa primatelja je nevaljala, molimo provjerite je ponovo.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Iznos mora biti veći od 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Iznos je veći od stanja računa.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Iznos je veći od stanja računa kad se doda naknada za transakcije od %1.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Pronašli smo adresu koja se ponavlja. U svakom plaćanju program može svaku adresu koristiti samo jedanput.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation>Greška: priprema transakcije nije uspjela.</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>Generirani novčići moraju pričekati nastanak 120 blokova prije nego što ih je moguće potrošiti. Kad ste generirali taj blok, on je bio emitiran u mrežu kako bi bio dodan postojećim lancima blokova. Ako ne uspije biti dodan, njegov status bit će promijenjen u &quot;nije prihvatljiv&quot; i on neće biti potrošiv. S vremena na vrijeme tako nešto se može desiti ako neki drugi nod približno istovremeno generira blok.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Oblik</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Iznos:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>&amp;Primatelj plaćanja:</translation> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation>Unesite oznaku za ovu adresu kako bi ju dodali u vaš adresar</translation> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation>&amp;Oznaka:</translation> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>Adresa za slanje plaćanja (npr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation>Odaberite adresu iz adresara</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>Zalijepi adresu iz međuspremnika</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>Ukloni ovog primatelja</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>Unesite Bitcoin adresu (npr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>&amp;Potpišite poruku</translation> </message> <message> <location line="-118"/> <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>Možete potpisati poruke sa svojom adresom kako bi dokazali da ih posjedujete. Budite oprezni da ne potpisujete ništa mutno, jer bi vas phishing napadi mogli na prevaru natjerati da prepišete svoj identitet njima. Potpisujte samo detaljno objašnjene izjave sa kojima se slažete.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>Unesite Bitcoin adresu (npr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation>Odaberite adresu iz adresara</translation> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>Zalijepi adresu iz međuspremnika</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>Upišite poruku koju želite potpisati ovdje</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"></translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Bitcoin address</source> <translation type="unfinished"></translation> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Obriši &amp;sve</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation type="unfinished"></translation> </message> <message> <location line="-64"/> <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"></translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>Unesite Bitcoin adresu (npr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Bitcoin address</source> <translation type="unfinished"></translation> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation type="unfinished"></translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>Unesite Bitcoin adresu (npr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Enter Bitcoin signature</source> <translation type="unfinished"></translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"></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 type="unfinished"></translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"></translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"></translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"></translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"></translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"></translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"></translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation>Otvoren do %1</translation> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation> <numerusform>Otvoren za %n bloka</numerusform> <numerusform>Otvoren za %n blokova</numerusform> <numerusform>Otvoren za %n blokova</numerusform> </translation> </message> <message> <location line="+8"/> <source>%1/offline</source> <translation>%1 nije dostupan</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/nepotvrđeno</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 potvrda</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Generiran</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Od</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Za</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"></translation> </message> <message> <location line="-2"/> <source>label</source> <translation>oznaka</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Uplaćeno</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>Nije prihvaćeno</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Zaduženje</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Naknada za transakciju</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Neto iznos</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Poruka</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Komentar</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"></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>Generirani novčići moraju pričekati nastanak 120 blokova prije nego što ih je moguće potrošiti. Kad ste generirali taj blok, on je bio emitiran u mrežu kako bi bio dodan postojećim lancima blokova. Ako ne uspije biti dodan, njegov status bit će promijenjen u &quot;nije prihvaćen&quot; i on neće biti potrošiv. S vremena na vrijeme tako nešto se može desiti ako neki drugi nod generira blok u približno isto vrijeme.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"></translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"></translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Iznos</translation> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"></translation> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation>, još nije bio uspješno emitiran</translation> </message> <message> <location line="+35"/> <source>unknown</source> <translation>nepoznato</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Detalji transakcije</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Ova panela prikazuje detaljni opis transakcije</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tip</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresa</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Iznos</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n block(s)</source> <translation> <numerusform>Otvoren za %n bloka</numerusform> <numerusform>Otvoren za %n blokova</numerusform> <numerusform>Otvoren za %n blokova</numerusform> </translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Otvoren do %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Nije na mreži (%1 potvrda)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Nepotvrđen (%1 od %2 potvrda)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Potvrđen (%1 potvrda)</translation> </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> </translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Generirano - Upozorenje: ovaj blok nije bio primljen od strane bilo kojeg drugog noda i vjerojatno neće biti prihvaćen!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Generirano, ali nije prihvaćeno</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Primljeno s</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Primljeno od</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Poslano za</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Plaćanje samom sebi</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Rudareno</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/d)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status transakcije</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Datum i vrijeme kad je transakcija primljena</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Vrsta transakcije.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Odredište transakcije</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Iznos odbijen od ili dodan k saldu.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation>Sve</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Danas</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Ovaj tjedan</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Ovaj mjesec</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Prošli mjesec</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Ove godine</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Raspon...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Primljeno s</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Poslano za</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Tebi</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Rudareno</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Ostalo</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Unesite adresu ili oznaku za pretraživanje</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Min iznos</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Kopirati adresu</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopirati oznaku</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopiraj iznos</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Izmjeniti oznaku</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"></translation> </message> <message> <location line="+142"/> <source>Export Transaction Data</source> <translation>Izvoz podataka transakcija</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Datoteka podataka odvojenih zarezima (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Potvrđeno</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Datum</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tip</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Oznaka</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Adresa</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Iznos</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Izvoz pogreške</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Ne mogu pisati u datoteku %1.</translation> </message> <message> <location line="+95"/> <source>Range:</source> <translation>Raspon:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>za</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+192"/> <source>Sending...</source> <translation>Slanje...</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+82"/> <source>Bitcoin version</source> <translation>Bitcoin verzija</translation> </message> <message> <location line="+82"/> <source>Usage:</source> <translation>Upotreba:</translation> </message> <message> <location line="-25"/> <source>Send command to -server or bitcoind</source> <translation>Pošalji komandu usluzi -server ili bitcoind</translation> </message> <message> <location line="-19"/> <source>List commands</source> <translation>Prikaži komande</translation> </message> <message> <location line="-11"/> <source>Get help for a command</source> <translation>Potraži pomoć za komandu</translation> </message> <message> <location line="+20"/> <source>Options:</source> <translation>Postavke:</translation> </message> <message> <location line="+23"/> <source>Specify configuration file (default: bitcoin.conf)</source> <translation>Odredi konfiguracijsku datoteku (ugrađeni izbor: bitcoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: bitcoind.pid)</source> <translation>Odredi proces ID datoteku (ugrađeni izbor: bitcoin.pid)</translation> </message> <message> <location line="-47"/> <source>Generate coins</source> <translation>Generiraj novčiće</translation> </message> <message> <location line="-14"/> <source>Don&apos;t generate coins</source> <translation>Ne generiraj novčiće</translation> </message> <message> <location line="+60"/> <source>Specify data directory</source> <translation>Odredi direktorij za datoteke</translation> </message> <message> <location line="-8"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"></translation> </message> <message> <location line="-26"/> <source>Listen for connections on &lt;port&gt; (default: 8333 or testnet: 18333)</source> <translation>Slušaj na &lt;port&gt;u (default: 8333 ili testnet: 18333)</translation> </message> <message> <location line="+4"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Održavaj najviše &lt;n&gt; veza sa članovima (default: 125)</translation> </message> <message> <location line="-33"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"></translation> </message> <message> <location line="+64"/> <source>Specify your own public address</source> <translation type="unfinished"></translation> </message> <message> <location line="-75"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"></translation> </message> <message> <location line="+77"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Prag za odspajanje članova koji se čudno ponašaju (default: 100)</translation> </message> <message> <location line="-112"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Broj sekundi koliko se članovima koji se čudno ponašaju neće dopustiti da se opet spoje (default: 86400)</translation> </message> <message> <location line="-25"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"></translation> </message> <message> <location line="+6"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 8332 or testnet: 18332)</source> <translation>Prihvaćaj JSON-RPC povezivanje na portu broj &lt;port&gt; (ugrađeni izbor: 8332 or testnet: 18332)</translation> </message> <message> <location line="+19"/> <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"></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 type="unfinished"></translation> </message> <message> <location line="+9"/> <source>Accept command line and JSON-RPC commands</source> <translation>Prihvati komande iz tekst moda i JSON-RPC</translation> </message> <message> <location line="+5"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"></translation> </message> <message> <location line="+32"/> <source>Importing blockchain data file.</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <source>Run in the background as a daemon and accept commands</source> <translation>Izvršavaj u pozadini kao uslužnik i prihvaćaj komande</translation> </message> <message> <location line="+33"/> <source>Use the test network</source> <translation>Koristi test mrežu</translation> </message> <message> <location line="-93"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"></translation> </message> <message> <location line="-42"/> <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>Generirani novčići moraju pričekati nastanak 120 blokova prije nego što ih je moguće potrošiti. Kad ste generirali taj blok, on je bio emitiran u mrežu kako bi bio dodan postojećim lancima blokova. Ako ne uspije biti dodan, njegov status bit će promijenjen u &quot;nije prihvatljiv&quot; i on neće biti potrošiv. S vremena na vrijeme tako nešto se može desiti ako neki drugi nod približno istovremeno generira blok.</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>Ova transakcija je preko ograničenja veličine. Možete ju ipak poslati za naknadu od %1, koja se daje čvorovima koji procesiraju vaše transakcije i tako podržavate mrežu. Želite li platiti naknadu?</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"></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>Upozorenje: -paytxfee je podešen na preveliki iznos. To je iznos koji ćete platiti za obradu transakcije.</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 type="unfinished"></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 Bitcoin will not work properly.</source> <translation>Upozorenje: Molimo provjerite jesu li datum i vrijeme na vašem računalu točni. Ako vaš sat ide krivo, Bitcoin neće raditi ispravno.</translation> </message> <message> <location line="+24"/> <source>Block creation options:</source> <translation type="unfinished"></translation> </message> <message> <location line="+6"/> <source>Connect only to the specified node(s)</source> <translation>Poveži se samo sa određenim nodom</translation> </message> <message> <location line="+3"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"></translation> </message> <message> <location line="+8"/> <source>Error: Transaction creation failed </source> <translation>Greška: priprema transakcije nije uspjela</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation type="unfinished"></translation> </message> <message> <location line="+11"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Nevaljala -tor adresa: &apos;%s&apos;</translation> </message> <message> <location line="+9"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Dodaj izlaz debuga na početak sa vremenskom oznakom</translation> </message> <message> <location line="+4"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>SSL postavke: (za detalje o podešavanju SSL opcija vidi Bitcoin Wiki)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Šalji trace/debug informacije na konzolu umjesto u debug.log datoteku</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Pošalji trace/debug informacije u debugger</translation> </message> <message> <location line="+7"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Odredi vremenski prozor za spajanje na mrežu u milisekundama (ugrađeni izbor: 5000)</translation> </message> <message> <location line="+13"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Pokušaj koristiti UPnP da otvoriš port za uslugu (default: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Pokušaj koristiti UPnP da otvoriš port za uslugu (default: 1 when listening)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Korisničko ime za JSON-RPC veze</translation> </message> <message> <location line="+1"/> <source>Verifying database integrity...</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Warning: Disk space is low!</source> <translation>Upozorenje: Malo diskovnog prostora</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"></translation> </message> <message> <location line="-43"/> <source>Password for JSON-RPC connections</source> <translation>Lozinka za JSON-RPC veze</translation> </message> <message> <location line="-53"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Dozvoli JSON-RPC povezivanje s određene IP adrese</translation> </message> <message> <location line="+61"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Pošalji komande nodu na adresi &lt;ip&gt; (ugrađeni izbor: 127.0.0.1)</translation> </message> <message> <location line="-99"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"></translation> </message> <message> <location line="+122"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"></translation> </message> <message> <location line="-15"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Podesi memorijski prostor za ključeve na &lt;n&gt; (ugrađeni izbor: 100)</translation> </message> <message> <location line="-14"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Ponovno pretraži lanac blokova za transakcije koje nedostaju</translation> </message> <message> <location line="-24"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"></translation> </message> <message> <location line="+51"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Koristi OpenSSL (https) za JSON-RPC povezivanje</translation> </message> <message> <location line="-21"/> <source>Server certificate file (default: server.cert)</source> <translation>Uslužnikov SSL certifikat (ugrađeni izbor: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Uslužnikov privatni ključ (ugrađeni izbor: server.pem)</translation> </message> <message> <location line="-127"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Prihvaljivi načini šifriranja (ugrađeni izbor: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+139"/> <source>This help message</source> <translation>Ova poruka za pomoć</translation> </message> <message> <location line="-131"/> <source>Cannot obtain a lock on data directory %s. Bitcoin is probably already running.</source> <translation>Program ne može pristupiti direktoriju s datotekama %s. Bitcoin program je vjerojatno već pokrenut.</translation> </message> <message> <location line="+57"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> <location line="+77"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Program ne može koristiti %s na ovom računalu (bind returned error %d, %s)</translation> </message> <message> <location line="-69"/> <source>Connect through socks proxy</source> <translation>Poveži se kroz socks proxy</translation> </message> <message> <location line="-13"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Dozvoli DNS upite za dodavanje nodova i povezivanje</translation> </message> <message> <location line="+44"/> <source>Loading addresses...</source> <translation>Učitavanje adresa...</translation> </message> <message> <location line="-26"/> <source>Error loading blkindex.dat</source> <translation>Greška kod učitavanja blkindex.dat</translation> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Greška kod učitavanja wallet.dat: Novčanik pokvaren</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Bitcoin</source> <translation>Greška kod učitavanja wallet.dat: Novčanik zahtjeva noviju verziju Bitcoina</translation> </message> <message> <location line="+73"/> <source>Wallet needed to be rewritten: restart Bitcoin to complete</source> <translation>Novčanik je trebao prepravak: ponovo pokrenite Bitcoin</translation> </message> <message> <location line="-75"/> <source>Error loading wallet.dat</source> <translation>Greška kod učitavanja wallet.dat</translation> </message> <message> <location line="+19"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Nevaljala -proxy adresa: &apos;%s&apos;</translation> </message> <message> <location line="+46"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"></translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"></translation> </message> <message> <location line="-74"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"></translation> </message> <message> <location line="+30"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Nevaljali iznos za opciju -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="-15"/> <source>Error: could not start node</source> <translation type="unfinished"></translation> </message> <message> <location line="+40"/> <source>Sending...</source> <translation>Slanje...</translation> </message> <message> <location line="-24"/> <source>Invalid amount</source> <translation>Nevaljali iznos za opciju</translation> </message> <message> <location line="-4"/> <source>Insufficient funds</source> <translation>Nedovoljna sredstva</translation> </message> <message> <location line="+8"/> <source>Loading block index...</source> <translation>Učitavanje indeksa blokova...</translation> </message> <message> <location line="-46"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Unesite nod s kojim se želite spojiti and attempt to keep the connection open</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Bitcoin is probably already running.</source> <translation>Program ne može koristiti %s na ovom računalu. Bitcoin program je vjerojatno već pokrenut.</translation> </message> <message> <location line="+55"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"></translation> </message> <message> <location line="-2"/> <source>Fee per KB to add to transactions you send</source> <translation>Naknada posredniku po KB-u koja će biti dodana svakoj transakciji koju pošalješ</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Učitavanje novčanika...</translation> </message> <message> <location line="-39"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation type="unfinished"></translation> </message> <message> <location line="+46"/> <source>Rescanning...</source> <translation>Rescaniranje</translation> </message> <message> <location line="-40"/> <source>Done loading</source> <translation>Učitavanje gotovo</translation> </message> <message> <location line="+64"/> <source>To use the %s option</source> <translation type="unfinished"></translation> </message> <message> <location line="-150"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=bitcoinrpc rpcpassword=%s (you do not need to remember this password) If the file does not exist, create it with owner-readable-only file permissions. </source> <translation type="unfinished"></translation> </message> <message> <location line="+91"/> <source>Error</source> <translation type="unfinished"></translation> </message> <message> <location line="-30"/> <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"></translation> </message> </context> </TS>
mdslei01/bitcoin-message
src/qt/locale/bitcoin_hr.ts
TypeScript
mit
102,996
[ 30522, 1026, 1029, 20950, 2544, 1027, 1000, 1015, 1012, 1014, 1000, 17181, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1029, 1028, 1026, 999, 9986, 13874, 24529, 1028, 1026, 30524, 1028, 21183, 2546, 1011, 1022, 1026, 1013, 12398, 16044, 227...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
define(function (require) { 'use strict'; /** * Module dependencies */ var defineComponent = require('flight/lib/component'); /** * Module exports */ return defineComponent(switcher); /** * Module function */ function switcher() { this.defaultAttrs({ onClass: 'btn-primary' }); this.turnOn = function() { // 1) add class `this.attr.onClass` // 2) trigger 'buttonOn' event }; this.turnOff = function() { // 3) remove class `this.attr.onClass` // 4) trigger 'buttonOff' event }; this.toggle = function() { // 5) if `this.attr.onClass` is present call `turnOff` otherwise call `turnOn` } this.after('initialize', function () { // 6) listen for 'click' event and call `this.toggle` }); } });
angus-c/flight-exercise
app/js/component/switcher.js
JavaScript
mit
816
[ 30522, 9375, 1006, 3853, 1006, 5478, 1007, 1063, 1005, 2224, 9384, 1005, 1025, 1013, 1008, 1008, 1008, 11336, 12530, 15266, 1008, 1013, 13075, 9375, 9006, 29513, 3372, 1027, 5478, 1006, 1005, 3462, 1013, 5622, 2497, 1013, 6922, 1005, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper') class DomainPredicateTest < SemanticAttributes::TestCase def setup @predicate = Predicates::Domain.new(:foo) end def test_valid_domains %w(example.com www.example.com).each do |domain| assert @predicate.validate(domain, nil), "#{domain} is a valid domain" end end def test_invalid_domains %w(example example.com/foo http://example.com 123.45.6.78).each do |domain| assert !@predicate.validate(domain, nil), "#{domain} is not a valid domain" end end def test_normalize assert_equal "example.com", @predicate.normalize("http://example.com:8080/foo") assert_equal "example.com", @predicate.normalize("example.com/foo") assert_equal nil, @predicate.normalize(nil) assert_equal "", @predicate.normalize("") assert_equal "example.com", @predicate.normalize("example.com") end end
cainlevy/semantic-attributes
test/unit/predicates/domain_predicate_test.rb
Ruby
mit
918
[ 30522, 5478, 5371, 1012, 7818, 1035, 4130, 1006, 5371, 1012, 16101, 18442, 1006, 1035, 1035, 5371, 1035, 1035, 1007, 1009, 1005, 1013, 1012, 1012, 1013, 1012, 1012, 1013, 3231, 1035, 2393, 2121, 1005, 1007, 2465, 5884, 28139, 16467, 22199, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import matplotlib.pyplot as plt import numpy as np import scalpplot from scalpplot import plot_scalp from positions import POS_10_5 from scipy import signal def plot_timeseries(frames, time=None, offset=None, color='k', linestyle='-'): frames = np.asarray(frames) if offset == None: offset = np.max(np.std(frames, axis=0)) * 3 if time == None: time = np.arange(frames.shape[0]) plt.plot(time, frames - np.mean(frames, axis=0) + np.arange(frames.shape[1]) * offset, color=color, ls=linestyle) def plot_scalpgrid(scalps, sensors, locs=POS_10_5, width=None, clim=None, cmap=None, titles=None): ''' Plots a grid with scalpplots. Scalps contains the different scalps in the rows, sensors contains the names for the columns of scalps, locs is a dict that maps the sensor-names to locations. Width determines the width of the grid that contains the plots. Cmap selects a colormap, for example plt.cm.RdBu_r is very useful for AUC-ROC plots. Clim is a list containing the minimim and maximum value mapped to a color. Titles is an optional list with titles for each subplot. Returns a list with subplots for further manipulation. ''' scalps = np.asarray(scalps) assert scalps.ndim == 2 nscalps = scalps.shape[0] subplots = [] if not width: width = int(min(8, np.ceil(np.sqrt(nscalps)))) height = int(np.ceil(nscalps/float(width))) if not clim: clim = [np.min(scalps), np.max(scalps)] plt.clf() for i in range(nscalps): subplots.append(plt.subplot(height, width, i + 1)) plot_scalp(scalps[i], sensors, locs, clim=clim, cmap=cmap) if titles: plt.title(titles[i]) # plot colorbar next to last scalp bb = plt.gca().get_position() plt.colorbar(cax=plt.axes([bb.xmax + bb.width/10, bb.ymin, bb.width/10, bb.height]), ticks=np.linspace(clim[0], clim[1], 5).round(2)) return subplots
breuderink/psychic
psychic/plots.py
Python
bsd-3-clause
1,878
[ 30522, 12324, 13523, 24759, 4140, 29521, 1012, 1052, 22571, 10994, 2004, 20228, 2102, 12324, 16371, 8737, 2100, 2004, 27937, 12324, 21065, 24759, 4140, 2013, 21065, 24759, 4140, 12324, 5436, 1035, 21065, 2013, 4460, 12324, 13433, 2015, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 2011 LinkedIn, 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. */ package cleo.search; /** * SimpleTypeaheadElement * * @author jwu * @since 02/05, 2011 */ public class SimpleTypeaheadElement extends SimpleElement implements TypeaheadElement, Cloneable { private static final long serialVersionUID = 1L; private String line1; private String line2; private String line3; private String media; public SimpleTypeaheadElement(int id) { super(id); } @Override public void setLine1(String line) { this.line1 = line; } @Override public String getLine1() { return line1; } @Override public void setLine2(String line) { this.line2 = line; } @Override public String getLine2() { return line2; } @Override public void setLine3(String line) { this.line3 = line; } @Override public String getLine3() { return line3; } @Override public void setMedia(String media) { this.media = media; } @Override public String getMedia() { return media; } @Override public String toString() { StringBuilder sb = new StringBuilder(super.toString()); sb.append(" line1=\"").append(getLine1()).append("\""); sb.append(" line2=\"").append(getLine2()).append("\""); sb.append(" line3=\"").append(getLine3()).append("\""); sb.append(" media=\"").append(getMedia()).append("\""); return sb.toString(); } @Override public Object clone() { SimpleTypeaheadElement elem = new SimpleTypeaheadElement(getElementId()); elem.setScore(getScore()); elem.setTimestamp(getTimestamp()); elem.setTerms((String[])getTerms().clone()); elem.setLine1(getLine1()); elem.setLine2(getLine2()); elem.setLine3(getLine3()); elem.setMedia(getMedia()); return elem; } }
linkedin/cleo
src/main/java/cleo/search/SimpleTypeaheadElement.java
Java
apache-2.0
2,371
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2249, 5799, 2378, 1010, 4297, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 1008, 2224, 2023, 5371, 32...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Imports Windows.Graphics.Imaging Imports Windows.Storage Imports Windows.Storage.Pickers Imports Windows.Storage.Streams Imports Windows.UI Module Captura Public Async Sub Generar(lv As ListView, tienda As String) Dim picker As New FileSavePicker() picker.FileTypeChoices.Add("PNG File", New List(Of String)() From { ".png" }) picker.SuggestedFileName = tienda.ToLower + DateTime.Today.Day.ToString + DateTime.Now.Hour.ToString + DateTime.Now.Minute.ToString + DateTime.Now.Millisecond.ToString Dim ficheroImagen As StorageFile = Await picker.PickSaveFileAsync() If ficheroImagen Is Nothing Then Return End If lv.Background = New SolidColorBrush(Colors.Gainsboro) Dim stream As IRandomAccessStream = Await ficheroImagen.OpenAsync(FileAccessMode.ReadWrite) Dim render As New RenderTargetBitmap Await render.RenderAsync(lv) Dim buffer As IBuffer = Await render.GetPixelsAsync Dim pixels As Byte() = buffer.ToArray Dim logicalDpi As Single = DisplayInformation.GetForCurrentView().LogicalDpi Dim encoder As BitmapEncoder = Await BitmapEncoder.CreateAsync(BitmapEncoder.PngEncoderId, stream) encoder.SetPixelData(BitmapPixelFormat.Bgra8, BitmapAlphaMode.Ignore, render.PixelWidth, render.PixelHeight, logicalDpi, logicalDpi, pixels) Await encoder.FlushAsync() lv.Background = New SolidColorBrush(Colors.Transparent) End Sub End Module
pepeizq/Steam-Deals
Steam Deals/Modulos/Herramientas/Captura.vb
Visual Basic
lgpl-3.0
1,559
[ 30522, 17589, 3645, 1012, 8389, 1012, 12126, 17589, 3645, 30524, 1012, 21318, 11336, 14408, 4648, 2270, 2004, 6038, 2278, 4942, 11416, 2099, 1006, 1048, 2615, 2004, 2862, 8584, 1010, 5495, 8943, 2004, 5164, 1007, 11737, 4060, 2121, 2004, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * @fileOverview * @name aqicn.js * @author ctgnauh <huangtc@outlook.com> * @license MIT */ var request = require('request'); var cheerio = require('cheerio'); var info = require('./info.json'); /** * 从 aqicn.org 上获取空气信息 * @module aqicn */ module.exports = { // 一些多余的信息 info: info, /** * fetchWebPage 的 callback * @callback module:aqicn~fetchWebPageCallback * @param {object} error - 请求错误 * @param {object} result - 页面文本 */ /** * 抓取移动版 aqicn.org 页面。 * aqicn.org 桌面版在300kb以上,而移动版则不足70kb。所以使用移动版,链接后面加 /m/ 。 * @param {string} city - 城市或地区代码,详见[全部地区](http://aqicn.org/city/all/) * @param {module:aqicn~fetchWebPageCallback} callback */ fetchWebPage: function (city, callback) { 'use strict'; var options = { url: 'http://aqicn.org/city/' + city + '/m/', headers: { 'User-Agent': 'wget' } }; request.get(options, function (err, res, body) { if (err) { callback(err, ''); } else { callback(null, body); } }); }, /** * 分析 html 文件并返回指定的 AQI 值 * @param {string} body - 页面文本 * @param {string} name - 污染物代码:pm25、pm10、o3、no2、so2、co * @returns {number} AQI 值 */ selectAQIText: function (body, name) { 'use strict'; var self = this; var $ = cheerio.load(body); var json; var value; try { json = JSON.parse($('#table script').text().slice(12, -2)); // "genAqiTable({...})" value = self.info.species.indexOf(name); } catch (err) { return NaN; } return json.d[value].iaqi; }, /** * 分析 html 文件并返回更新时间 * @param {string} body - 页面文本 * @returns {string} ISO格式的时间 */ selectUpdateTime: function (body) { 'use strict'; var $ = cheerio.load(body); var json; try { json = JSON.parse($('#table script').text().slice(12, -2)); // "genAqiTable({...})" } catch (err) { return new Date(0).toISOString(); } return json.t; }, /** * 污染等级及相关信息 * @param {number} level - AQI 级别 * @param {string} lang - 语言:cn、en、jp、es、kr、ru、hk、fr、pl(但当前只有 cn 和 en) * @returns {object} 由AQI级别、污染等级、对健康影响情况、建议采取的措施组成的对象 */ selectInfoText: function (level, lang) { 'use strict'; var self = this; if (level > 6 || level < 0) { level = 0; } return { value: level, name: self.info.level[level].name[lang], implication: self.info.level[level].implication[lang], statement: self.info.level[level].statement[lang] }; }, /** * 计算 AQI,这里选取 aqicn.org 采用的算法,选取 AQI 中数值最大的一个 * @param {array} aqis - 包含全部 AQI 数值的数组 * @returns {number} 最大 AQI */ calculateAQI: function (aqis) { 'use strict'; return Math.max.apply(null, aqis); }, /** * 计算空气污染等级,分级标准详见[关于空气质量与空气污染指数](http://aqicn.org/?city=&size=xlarge&aboutaqi) * @param {number} aqi - 最大 AQI * @returns {number} AQI 级别 */ calculateLevel: function (aqi) { 'use strict'; var level = 0; if (aqi >= 0 && aqi <= 50) { level = 1; } else if (aqi >= 51 && aqi <= 100) { level = 2; } else if (aqi >= 101 && aqi <= 150) { level = 3; } else if (aqi >= 151 && aqi <= 200) { level = 4; } else if (aqi >= 201 && aqi <= 300) { level = 5; } else if (aqi > 300) { level = 6; } return level; }, /** * getAQIs 的 callback * @callback module:aqicn~getAQIsCallback * @param {object} error - 请求错误 * @param {object} result - 包含全部污染物信息的对象 */ /** * 获取指定城市的全部 AQI 数值 * @param {string} city - 城市或地区代码,详见[全部地区](http://aqicn.org/city/all/) * @param {string} lang - 语言:cn、en、jp、es、kr、ru、hk、fr、pl(但当前只有 cn 和 en) * @param {module:aqicn~getAQIsCallback} callback */ getAQIs: function (city, lang, callback) { 'use strict'; var self = this; self.fetchWebPage(city, function (err, body) { if (err) { callback(err); } var result = {}; var aqis = []; // 城市代码 result.city = city; // 数据提供时间 result.time = self.selectUpdateTime(body); // 全部 AQI 值 self.info.species.forEach(function (name) { var aqi = self.selectAQIText(body, name); aqis.push(aqi); result[name] = aqi; }); // 主要 AQI 值 result.aqi = self.calculateAQI(aqis); // AQI 等级及其它 var level = self.calculateLevel(result.aqi); var levelInfo = self.selectInfoText(level, lang); result.level = levelInfo; callback(null, result); }); }, /** * getAQIByName 的 callback * @callback module:aqicn~getAQIByNameCallback * @param {object} error - 请求错误 * @param {object} result - 城市或地区代码与指定的 AQI */ /** * 获取指定城市的指定污染物数值 * @param {string} city - 城市或地区代码 * @param {string} name - 污染物代码:pm25、pm10、o3、no2、so2、co * @param {module:aqicn~getAQIByNameCallback} callback */ getAQIByName: function (city, name, callback) { 'use strict'; var self = this; self.getAQIs(city, 'cn', function (err, res) { if (err) { callback(err); } callback(null, { city: city, value: res[name], time: res.time }); }); } };
ctgnauh/aqicn
src/aqicn.js
JavaScript
mit
5,915
[ 30522, 1013, 1008, 1008, 1008, 1030, 5371, 7840, 8584, 1008, 1030, 2171, 1037, 14702, 2278, 2078, 1012, 1046, 2015, 1008, 1030, 3166, 14931, 16989, 27225, 1026, 15469, 13535, 1030, 17680, 1012, 4012, 1028, 1008, 1030, 6105, 10210, 1008, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Android Templates ## Features #### sync When enabled, the sync feature will scaffold all the files necessary to implement a sync adapter within your application.
cfmobile/levo
test-resources/templates/README.md
Markdown
bsd-3-clause
166
[ 30522, 1001, 11924, 23561, 2015, 1001, 1001, 2838, 1001, 1001, 1001, 1001, 26351, 2043, 9124, 1010, 1996, 26351, 3444, 2097, 8040, 10354, 10371, 2035, 1996, 6764, 4072, 2000, 10408, 1037, 26351, 15581, 2121, 2306, 2115, 4646, 1012, 102, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Азбука вкуса</title> <style type="text/css"> .ExternalClass {width:100%;} .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } html, body {-webkit-text-size-adjust:none; -ms-text-size-adjust:none;} body {margin:0; padding:0;} table td {border-collapse:collapse;} p {margin:0; padding:0; margin-bottom:0;} h1, h2, h3, h4, h5, h6 { color: black; line-height: 100%; } a, a:link { color:#2A5DB0; text-decoration: underline; } body, #body_style { background:#f0f1f3; color:#000; font-family:Arial, Helvetica, sans-serif; font-size:12px; } span.yshortcuts { color:#000; background-color:none; border:none;} span.yshortcuts:hover, span.yshortcuts:active, span.yshortcuts:focus {color:#000; background-color:none; border:none;} a:visited { color: #3c96e2; text-decoration: none} a:focus { color: #3c96e2; text-decoration: underline} a:hover { color: #3c96e2; text-decoration: underline} @media only screen and (max-device-width: 480px) { body[yahoo] #container1 {display:block !important} body[yahoo] p {font-size: 10px} } @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { body[yahoo] #container1 {display:block !important} body[yahoo] p {font-size: 12px} } .gmailfix { display:none; display:none!important; } .ExternalClass * {line-height: 100%;} </style> </head> <body bgcolor="#f0f1f3" style="margin-left:0; margin-right: 0; margin-bottom: 0; margin-top: 0;"> <div ems:preheader style="display:none!important;font-size:1px;color:#f0f1f3;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;mso-hide:all">Попробуйте наши самые популярные блюда!</div> <table bgcolor="#f0f1f3" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" bgcolor="#f0f1f3" align="center"> <div style="max-width: 700px;"> <table width="700" cellspacing="0" cellpadding="0" style="width: 700px; min-width: 700px;"> <tr> <!-- preheader --> <td style="padding: 21px 5px 4px;"> <div style="display:none!important;visibility:hidden !important;font-size:1px;color:rgb(107, 112, 117);"> <wbr>&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp; &nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp; &nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp; &nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp; &nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp; &nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌&nbsp;‌ <wbr>&nbsp;‌ </div> <table width="100%" cellspacing="0" cellpadding="0"> <tbody> <tr> <td height="40" valign="middle" style="padding-right: 5px; font-size: 12px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color: rgb(107, 112, 117); text-align: right;"> Если письмо отображается некорректно, посмотрите его на <a href="http://link.av.ru/u/gm.php?UID=$uid$&amp;ID=$ident$" style="color: rgb(107, 112, 117); text-decoration: underline;">сайте</a> </td> </tr> </tbody> </table> </td> </tr> <tr> <td align="center" bgcolor="#ffffff" style="padding-left: 16px;"> <table width="100%" cellspacing="0" cellpadding="0"> <tbody><tr> <td align="left" style="font-size: 20px; line-height: 26px; font-family: Arial, Helvetica, sans-serif; color:#9f9f9f;"> <a href="https://express.av.ru/catalog/" target="_blank" style="color: #4b711d; font-weight: bold; text-decoration: none;"><img width="140" height="40" style="vertical-align: top; border: none;" src="images/logo.png" alt="Экспресс меню"></a> </td> <td align="right"> <table cellspacing="0" cellpadding="0" border="0"> <tbody><tr> <td style="font-size: 17px; line-height: 21px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#000000; text-align: right;"> <img style="display: block; border: none;" width="103" height="90" src="images/img-20-years-of-love.jpg" alt=""> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> <tr><!--banner--> <td bgcolor="#ffffff" width="700" align="center" style="font-size: 28px; line-height: 32px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#000000;width: 700px; min-width: 700px;"> <a href="https://express.av.ru/promo-3x20/" target="_blank" style="color: #ffffff; text-decoration: none;"><img style="display: block; border: none;" width="700" src="images/banner-top.jpg" alt="Насладитесь популярными блюдами &laquo;АВ Экспресс Меню!&raquo;" title="Насладитесь популярными блюдами &laquo;АВ Экспресс Меню!&raquo;"></a> </td> </tr> <tr> <td bgcolor="#ffffff" align="center" style="padding-top: 32px; padding-bottom: 32px;"> <table width="660" cellspacing="0" cellpadding="0" border="0"> <tbody><tr><!--heading--> <td style="padding-bottom: 17px; font-size: 21px; line-height: 25px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> Здравствуйте! </td> </tr> <tr><!--heading text--> <td style="padding-bottom: 20px; font-size: 15px; line-height: 20px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> Нет времени готовить? Заказывайте вкусную и полезную готовую еду в<br>&laquo;АВ Экспресс Меню&raquo;! Чтобы помочь вам с выбором, мы составили подборку самых популярных блюд среди наших покупателей. Выбирайте, делайте заказ, и мы доставим его за 90 минут! </td> </tr> <tr><!--btn--> <td align="center" style="font-size: 15px; line-height: 20px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#000000;"> <a href="https://express.av.ru/catalog/" target="_blank"><img style="vertical-align: top; border: none;" width="188" height="61" src="images/btn-order.png" alt="Оформить заказ"></a> </td> </tr> </tbody></table> </td> </tr> </table> </div> </td> </tr> <!-- promo-box start --> <tr> <td valign="top" align="center"> <div style="max-width: 700px;"> <table width="700" cellspacing="0" cellpadding="0" border="0" style="width: 700px; min-width: 700px;"> <tr> <td style="padding-top: 20px; font-size: 0; line-height: 0;">&nbsp;</td> </tr> <tr> <td bgcolor="#ffffff" align="center" style="padding-bottom: 25px; padding-top: 15px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr><!--block heading--> <td align="center" style="padding-bottom: 18px; font-size: 21px; line-height: 22px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-transform: uppercase;"> <img style="display: block; border: none;" width="660" height="29" src="images/title-presents.png" alt="Любимые блюда покупателей"> </td> </tr> </tbody> </table> <table width="660" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="padding-bottom: 20px;" align="center"> <table cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td valign="top" width="172" style="padding-top: 8px; padding-left: 8px; padding-right: 8px; padding-bottom: 8px; border-style: solid; border-width: 1px; border-color: #dedede;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr><!--photo tovar 1--> <td style="font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> <a href="https://express.av.ru/catalog/cakes-and-bread/237349/" target="_blank"><img style="display: block; border: none;" width="172" height="172" src="images/tovar-1.jpg" alt="Фотография товара"></a> </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-left: 8px; padding-right: 8px; padding-bottom: 8px; border-style: solid; border-width: 1px; border-color: #dedede;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr><!--photo tovar 2--> <td style="font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> <a href="https://express.av.ru/catalog/breakfast/224175/" target="_blank"><img style="display: block; border: none;" width="172" height="172" src="images/tovar-2.jpg" alt="Фотография товара"></a> </td> </tr> </tbody></table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-left: 8px; padding-right: 8px; padding-bottom: 8px; border-style: solid; border-width: 1px; border-color: #dedede;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr><!--photo tovar 3--> <td style="font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> <a href="https://express.av.ru/catalog/salaty/279842/" target="_blank"><img style="display: block; border: none;" width="172" height="172" src="images/tovar-3.jpg" alt="Фотография товара"></a> </td> </tr> </tbody></table> </td> </tr> <tr> <td valign="top" width="172" style="padding-top: 8px; padding-bottom: 8px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr><!-- text description tovar 1--> <td valign="top" style="padding-right: 5px; font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> Пирожки домашние с мясом, 40 г </td> <td valign="top" style="padding-left: 5px; font-size: 21px; line-height: 23px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: right;"> <strong style="white-space: nowrap;">46<sup style="font-size: 11px;">&nbsp;00</sup></strong> <br><span style="color: #000000; font-size: 12px;">1 шт.</span> </td> </tr> </tbody></table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-bottom: 8px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr><!-- text description tovar 1--> <td valign="top" style="padding-right: 5px; font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> Сочник с творогом, 80 г </td> <td valign="top" style="padding-left: 5px; font-size: 21px; line-height: 23px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: right;"> <strong style="white-space: nowrap;">69<sup style="font-size: 11px;">&nbsp;00</sup></strong> <br><span style="color: #000000; font-size: 12px;">1 шт.</span> </td> </tr> </tbody></table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-bottom: 8px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr><!-- text description tovar 1--> <td valign="top" style="padding-right: 5px; font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> Салат из капусты с огурцом, 160 г &laquo;Уже готово&raquo; </td> <td valign="top" style="padding-left: 5px; font-size: 21px; line-height: 23px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: right;"> <strong style="white-space: nowrap;">98<sup style="font-size: 11px;">&nbsp;00</sup></strong> <br><span style="color: #000000; font-size: 12px;">1 шт.</span> </td> </tr> </tbody></table> </td> </tr> <tr> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="padding-bottom: 8px; font-size: 11px; line-height: 15px; font-family: Arial, Helvetica, sans-serif; color:#a7a7a7; text-align: left;"> Внутри воздушных пирожков кроется аппетитная начинка из отборного говяжьего фарша, обжаренного с мелко порубленным репчатым луком. Приготовлены из сдобного теста по традиционному домашнему рецепту. Подайте их в качестве альтернативы хлебу к тарелке супа или к бульону. </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="padding-bottom: 8px; font-size: 11px; line-height: 15px; font-family: Arial, Helvetica, sans-serif; color:#a7a7a7; text-align: left;"> Сочник - аппетитный, румяный пирог начиненный творогом. Отличается притягательным ароматом и нежным, деликатным вкусом. Рекомендуется подавать к чаю или кофе. </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="padding-bottom: 8px; font-size: 11px; line-height: 15px; font-family: Arial, Helvetica, sans-serif; color:#a7a7a7; text-align: left;"> Сочный витаминный салат, приготовленный из хрустящей сладкой капусты и свежих огурцов. Приправлен душистой зеленью укропа и лимонным соком. Это легкое блюдо отличается приятным освежающим вкусом, подарит вам отличное настроение и новые гастрономические впечатления! </td> </tr> </tbody> </table> </td> </tr> <tr> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <!--btn buy tovar 1--> <td align="right" style="font-size: 13px; line-height: 19px; font-family: Arial, Helvetica, sans-serif; color:#000000;"> <a href="https://express.av.ru/catalog/cakes-and-bread/237349/" target="_blank"><img style="vertical-align: top; border: none;" width="90" height="46" src="images/btn-cart.png" alt="В корзину"></a> </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <!--btn buy tovar 2--> <td align="right" style="font-size: 13px; line-height: 19px; font-family: Arial, Helvetica, sans-serif; color:#000000;"> <a href="https://express.av.ru/catalog/breakfast/224175/" target="_blank"><img style="vertical-align: top; border: none;" width="90" height="46" src="images/btn-cart.png" alt="В корзину"></a> </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <!--btn buy tovar 3--> <td align="right" style="font-size: 13px; line-height: 19px; font-family: Arial, Helvetica, sans-serif; color:#000000;"> <a href="https://express.av.ru/catalog/salaty/279842/" target="_blank"><img style="vertical-align: top; border: none;" width="90" height="46" src="images/btn-cart.png" alt="В корзину"></a> </td> </tr> </tbody> </table> </td> </tr> </tbody></table> </td> </tr> <tr> <td style="padding-bottom: 20px;" align="center"> <table cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td valign="top" width="172" style="padding-top: 8px; padding-left: 8px; padding-right: 8px; padding-bottom: 8px; border-style: solid; border-width: 1px; border-color: #dedede;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr><!--photo tovar 4--> <td style="font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> <a href="https://express.av.ru/catalog/supy/256515/" target="_blank"><img style="display: block; border: none;" width="172" height="172" src="images/tovar-4.jpg" alt="Фотография товара"></a> </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-left: 8px; padding-right: 8px; padding-bottom: 8px; border-style: solid; border-width: 1px; border-color: #dedede;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr><!--photo tovar 5--> <td style="font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> <a href="https://express.av.ru/catalog/mainmenu/s-ptitsey/308248/" target="_blank"><img style="display: block; border: none;" width="172" height="172" src="images/tovar-5.jpg" alt="Фотография товара"></a> </td> </tr> </tbody></table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-left: 8px; padding-right: 8px; padding-bottom: 8px; border-style: solid; border-width: 1px; border-color: #dedede;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr><!--photo tovar 6--> <td style="font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> <a href="https://express.av.ru/catalog/dessert/138270/" target="_blank"><img style="display: block; border: none;" width="172" height="172" src="images/tovar-6.jpg" alt="Фотография товара"></a> </td> </tr> </tbody></table> </td> </tr> <tr> <td valign="top" width="172" style="padding-top: 8px; padding-bottom: 8px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr><!-- text description tovar 4--> <td valign="top" style="padding-right: 5px; font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> Лапша куриная, 300 г &quot;Уже готово&quot; </td> <td valign="top" style="padding-left: 5px; font-size: 21px; line-height: 23px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: right;"> <strong style="white-space: nowrap;">121<sup style="font-size: 11px;">&nbsp;00</sup></strong> <br><span style="color: #000000; font-size: 12px;">1 п.</span> </td> </tr> </tbody></table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-bottom: 8px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr><!-- text description tovar 5--> <td valign="top" style="padding-right: 5px; font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> Грудка куриная отварная, 120 г &quot;Уже готово&quot; </td> <td valign="top" style="padding-left: 5px; font-size: 21px; line-height: 23px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: right;"> <strong style="white-space: nowrap;">182<sup style="font-size: 11px;">&nbsp;00</sup></strong> <br><span style="color: #000000; font-size: 12px;">1 шт.</span> </td> </tr> </tbody></table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-bottom: 8px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr><!-- text description tovar 6--> <td valign="top" style="padding-right: 5px; font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> Штрудель яблочный, 150 г </td> <td valign="top" style="padding-left: 5px; font-size: 21px; line-height: 23px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: right;"> <strong style="white-space: nowrap;">220<sup style="font-size: 11px;">&nbsp;00</sup></strong> <br><span style="color: #000000; font-size: 12px;">1 шт.</span> </td> </tr> </tbody></table> </td> </tr> <tr> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="padding-bottom: 8px; font-size: 11px; line-height: 15px; font-family: Arial, Helvetica, sans-serif; color:#a7a7a7; text-align: left;"> Прозрачный ароматный бульон сварен на курином мясе и заправлен обжаренным репчатым луком, яркой морковью и нежной домашней лапшой. Деликатные нотки специй - лаврового листа и душистого черного перца - придают ему особую насыщенность. Аппетитный суп, дополненный кусочками сочного куриного филе, украшен свежей петрушкой. </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="padding-bottom: 8px; font-size: 11px; line-height: 15px; font-family: Arial, Helvetica, sans-serif; color:#a7a7a7; text-align: left;"> Нежная и сочная куриная грудка, приготовленная в бульоне, &mdash; основа сытного и полезного обеда или ужина. Грудка богата белком и содержит небольшое количество калорий! Рекомендуем с легкими овощными салатами или гарнирами. </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="padding-bottom: 8px; font-size: 11px; line-height: 15px; font-family: Arial, Helvetica, sans-serif; color:#a7a7a7; text-align: left;"> Яблочный штрудель, приготовленный по традиционному австрийскому рецепту из тонкого слоеного теста с начинкой из кисло-сладких яблок. Отличается приятным освежающим вкусом с нотками ванили и корицы. </td> </tr> </tbody> </table> </td> </tr> <tr> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <!--btn buy tovar 4--> <td align="right" style="font-size: 13px; line-height: 19px; font-family: Arial, Helvetica, sans-serif; color:#000000;"> <a href="https://express.av.ru/catalog/supy/256515/" target="_blank"><img style="vertical-align: top; border: none;" width="90" height="46" src="images/btn-cart.png" alt="В корзину"></a> </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <!--btn buy tovar 5--> <td align="right" style="font-size: 13px; line-height: 19px; font-family: Arial, Helvetica, sans-serif; color:#000000;"> <a href="https://express.av.ru/catalog/mainmenu/s-ptitsey/308248/" target="_blank"><img style="vertical-align: top; border: none;" width="90" height="46" src="images/btn-cart.png" alt="В корзину"></a> </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <!--btn buy tovar 6--> <td align="right" style="font-size: 13px; line-height: 19px; font-family: Arial, Helvetica, sans-serif; color:#000000;"> <a href="https://express.av.ru/catalog/dessert/138270/" target="_blank"><img style="vertical-align: top; border: none;" width="90" height="46" src="images/btn-cart.png" alt="В корзину"></a> </td> </tr> </tbody> </table> </td> </tr> </tbody></table> </td> </tr> <tr> <td style="padding-bottom: 20px;" align="center"> <table cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td valign="top" width="172" style="padding-top: 8px; padding-left: 8px; padding-right: 8px; padding-bottom: 8px; border-style: solid; border-width: 1px; border-color: #dedede;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr><!--photo tovar 7--> <td style="font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> <a href="https://express.av.ru/catalog/kids/364417/" target="_blank"><img style="display: block; border: none;" width="172" height="172" src="images/tovar-7.jpg" alt="Фотография товара"></a> </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-left: 8px; padding-right: 8px; padding-bottom: 8px; border-style: solid; border-width: 1px; border-color: #dedede;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr><!--photo tovar 8--> <td style="font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> <a href="https://express.av.ru/catalog/mainmenu/s-ryboy/250268/" target="_blank"><img style="display: block; border: none;" width="172" height="172" src="images/tovar-8.jpg" alt="Фотография товара"></a> </td> </tr> </tbody></table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-left: 8px; padding-right: 8px; padding-bottom: 8px; border-style: solid; border-width: 1px; border-color: #dedede;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr><!--photo tovar 9--> <td style="font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> <a href="https://express.av.ru/catalog/mainmenu/249783/" target="_blank"><img style="display: block; border: none;" width="172" height="172" src="images/tovar-9.jpg" alt="Фотография товара"></a> </td> </tr> </tbody></table> </td> </tr> <tr> <td valign="top" width="172" style="padding-top: 8px; padding-bottom: 8px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr><!-- text description tovar 7--> <td valign="top" style="padding-right: 5px; font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> Суфле из кролика и курицы паровое с запеченным картофелем, 270 г &laquo;Уже готово&raquo; </td> <td valign="top" style="padding-left: 5px; font-size: 21px; line-height: 23px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: right;"> <strong style="white-space: nowrap;">248<sup style="font-size: 11px;">&nbsp;00</sup></strong> <br><span style="color: #000000; font-size: 12px;">1 шт.</span> </td> </tr> </tbody></table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-bottom: 8px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr><!-- text description tovar 8--> <td valign="top" style="padding-right: 5px; font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> Паэлья с морепродуктами, 250 г &laquo;Уже готово&raquo; </td> <td valign="top" style="padding-left: 5px; font-size: 21px; line-height: 23px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: right;"> <strong style="white-space: nowrap;">297<sup style="font-size: 11px;">&nbsp;00</sup></strong> <br><span style="color: #000000; font-size: 12px;">1 шт.</span> </td> </tr> </tbody></table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172" style="padding-top: 8px; padding-bottom: 8px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr><!-- text description tovar 9--> <td valign="top" style="padding-right: 5px; font-size: 13px; line-height: 16px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: left;"> Азу из говядины с картофельным пюре, 350 г &laquo;Уже готово&raquo; </td> <td valign="top" style="padding-left: 5px; font-size: 21px; line-height: 23px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-align: right;"> <strong style="white-space: nowrap;">398<sup style="font-size: 11px;">&nbsp;00</sup></strong> <br><span style="color: #000000; font-size: 12px;">1 шт.</span> </td> </tr> </tbody></table> </td> </tr> <tr> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="padding-bottom: 8px; font-size: 11px; line-height: 15px; font-family: Arial, Helvetica, sans-serif; color:#a7a7a7; text-align: left;"> Воздушное суфле из диетического мяса кролика и курицы приготовлено на пару. Идеальный гарнир к суфле &mdash; запеченный картофель с розмарином. Блюдо готовится с использованием соли с пониженным содержанием натрия, обогащенной калием, магнием и йодом. </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="padding-bottom: 8px; font-size: 11px; line-height: 15px; font-family: Arial, Helvetica, sans-serif; color:#a7a7a7; text-align: left;"> Рассыпчатый рис, приготовленный в бульоне с щепоткой пряного шафрана, дополнен зеленым горошком, ярким сладким перцем и отборными морепродуктами &mdash; сочными креветками, нежными мидиями и кальмарами, обжаренными на оливковом масле с чесноком и луком. </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="padding-bottom: 8px; font-size: 11px; line-height: 15px; font-family: Arial, Helvetica, sans-serif; color:#a7a7a7; text-align: left;"> Сочная говядина, нарезанная небольшими брусочками, тушится до мягкости в бульоне с добавлением спелых помидоров, пикантного репчатого лука и перца. Азу прекрасно сочетается с нежным картофельным пюре, приготовленным со сливочным маслом. </td> </tr> </tbody> </table> </td> </tr> <tr> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <!--btn buy tovar 1--> <td align="right" style="font-size: 13px; line-height: 19px; font-family: Arial, Helvetica, sans-serif; color:#000000;"> <a href="https://express.av.ru/catalog/kids/364417/" target="_blank"><img style="vertical-align: top; border: none;" width="90" height="46" src="images/btn-cart.png" alt="В корзину"></a> </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <!--btn buy tovar 2--> <td align="right" style="font-size: 13px; line-height: 19px; font-family: Arial, Helvetica, sans-serif; color:#000000;"> <a href="https://express.av.ru/catalog/mainmenu/s-ryboy/250268/" target="_blank"><img style="vertical-align: top; border: none;" width="90" height="46" src="images/btn-cart.png" alt="В корзину"></a> </td> </tr> </tbody> </table> </td> <td style="padding-left: 30px; font-size: 0; line-height: 0;">&nbsp;</td> <td valign="top" width="172"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <!--btn buy tovar 3--> <td align="right" style="font-size: 13px; line-height: 19px; font-family: Arial, Helvetica, sans-serif; color:#000000;"> <a href="https://express.av.ru/catalog/mainmenu/249783/" target="_blank"><img style="vertical-align: top; border: none;" width="90" height="46" src="images/btn-cart.png" alt="В корзину"></a> </td> </tr> </tbody> </table> </td> </tr> </tbody></table> </td> </tr> <tr> <td style="padding-top: 10px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; line-height: 22px; text-align: center;"> <a href="https://express.av.ru/catalog/" target="_blank" style="color: #000000; text-decoration: underline;">Посмотреть меню</a> </td> </tr> </tbody> </table> </td> </tr> <tr> <td style="padding-top: 20px; font-size: 0; line-height: 0;">&nbsp;</td> </tr> <tr> <td bgcolor="#ffffff" align="center" > <table width="660" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td align="center" style="padding-bottom:18px;padding-top:15px;font-size: 21px; line-height: 22px; font-family: Arial, Helvetica, sans-serif; color:#000000; text-transform: uppercase;"> <img style="display: block; border: none;" width="660" height="29" src="images/title-akcii.gif" alt="Акции"> </td> </tr> <tr> <td style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; line-height: 22px; text-align: center;"> <a href="#" target="_blank" style="color: #000000; text-decoration: underline;"> <img style="border: none;display: block;" src="images/akcii-banner.jpg" alt="Скидка 10% на первый заказ на &laquo;АВ Экспресс Меню!&raquo;" title="Скидка 10% на первый заказ на &laquo;АВ Экспресс Меню!&raquo;" width="700" height="150"/> </a> </td> </tr> </tbody></table> </td> </tr> <tr> <td style="padding-top: 20px; font-size: 0; line-height: 0;">&nbsp;</td> </tr> <!--promocode block--> <!--<tr> <td bgcolor="#ffffff" align="center" style="padding-top: 20px; padding-bottom: 20px;"> <table width="660" cellspacing="0" cellpadding="0" border="0"> <tbody><tr> <td style="font-size: 10px; line-height: 14px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#7c7c7c; text-align: left;"> Акция действует с 12 сентября по 09 октября 2017 года. <br>При покупке любых 3-х блюд &laquo;Уже Готово&raquo; (в любой комбинации) покупателю предоставляется скидка 20%. <br>Товары по акции представлены по всех категориях Экспресс Меню кроме категорий &laquo;Напитки&raquo;, &laquo;Молочные продукты&raquo;, &laquo;Выпечка и хлеб&raquo;, &laquo;Десерты&raquo;. Обратите внимание: данная скидка не суммируется с другими скидками и акциями. В случае наличия в заказе товаров, участвующих в двух акциях при проведении заказа по кассе магазина будет применена акция, дающая большую скидку на данный заказ. <br>Условия акции по <a href="https://express.av.ru/promo-3x20/" target="_blank" style="color: #7c7c7c; text-decoration: underline;">ссылке</a>. </td> </tr> </tbody></table> </td> </tr>--> <tr><!--footer--> <td align="center" style="padding-top: 20px; padding-bottom: 20px;"> <table width="660" cellpadding="0" cellspacing="0" border="0"> <tbody> <tr> <td align="left" valign="top"> <table width="380" align="left" cellpadding="0" cellspacing="0" border="0"> <tbody> <tr> <td style="padding-bottom: 17px; font-size: 11px; line-height: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb(124, 124, 124); text-align: left;"> Данное письмо не является офертой. Цены действительны на момент совершения рассылки. <br>Вы получили это письмо, так как Ваш электронный адрес был указан при подписке на сайте <a href="https://av.ru/?utm_source=newsletter&amp;utm_medium=email&amp;utm_campaign=arbuz_express_msk_24082017" target="_blank" style="color: rgb(124, 124, 124); text-decoration: underline;">av.ru</a> или <a href="https://express.av.ru/?utm_source=newsletter&amp;utm_medium=email&amp;utm_campaign=arbuz_express_msk_24082017" target="_blank" style="color: rgb(124, 124, 124); text-decoration: underline;">express.av.ru</a>. Если это письмо попало к Вам по ошибке, пожалуйста, примите наши искренние извинения. Чтобы не получать более письма с информационными уведомлениями от &laquo;АВ Экспресс меню&raquo;`, перейдите по&nbsp;<a href="http://suite7.emarsys.net/u/un.php?par=$uid$_1433041_$llid$_1" style="color: rgb(124, 124, 124);">ссылке</a>. </td> </tr> </tbody> </table> </td> </tr> <tr> <td style="font-size: 11px; line-height: 19px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb(124, 124, 124); text-align: left;"> &copy; Азбука Вкуса, 2017 </td> </tr> </tbody> </table> </td> </tr> </table> </div> </td> </tr> </table> <div class="gmailfix" style="white-space:nowrap; font:15px courier; line-height:0;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div> </body> </html>
wim-agency/wim-agency.github.io
azbuka_vkusa/2017/azbuka_2017_09_19_express/azbuka_2017_09_19_express.html
HTML
apache-2.0
73,749
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 30524, 8917, 1013, 19817, 1013, 1060, 11039, 19968, 2487, 1013, 26718, 2094, 1013, 1060, 11039, 19968, 2487, 1011, 9384, 1012, 26718, 2094, 1000, 1028, 1026, 16129, 20950, 3619, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# TODOs/Roadmap Roughly in order of descending importance: * Start out by generating React+MobX-based JavaScript (or even TypeScript!) code so it's easy to get things working, but move towards interpreting a model (preferably stored as a flat list of JSON objects) eventually. * Check implementation, especially the grammar w.r.t. scoping (including its global configuration) and validation, for: * Comments up-to-date? * **TODO**s still relevant? * Implementation of outline. * Small tweaks: * `screen` &rarr; `page`; * annotate a `goto-page` with an indication whether that transition is popping from or pushing to the history's stack; * `method` &rarr; `action`?; * give a `component` a "slot" (or even "slots") where you can plug in arbitrary contents?; * more hooks for styling? * Bigger change: declare widgets (components?) in a sort of standard library, instead of making every widget part of the grammar. ## Architecture of generated app Some requirements: * Should not be opinionated about routing and authentication. * Should have minimum interface to "wire in". * Should be functionally callable. * Relies on "ambient" app (supposedly minimal) to call generated code, and render into an HTML element. Some mappings: * `structure` &rarr; a class, with appropriate `@observable` annotations. * `page` or `component` &rarr; a function taking an object which is a composition of the construct's arguments and its internal values (not invariants), and an interface definition for that object. Some considerations: * Use original names, not (generated) IDs.
dslmeinte/UIScript
TODO.md
Markdown
mit
1,604
[ 30522, 1001, 28681, 2891, 1013, 2346, 2863, 2361, 5560, 1999, 2344, 1997, 15127, 5197, 1024, 1008, 2707, 2041, 2011, 11717, 10509, 1009, 11240, 2595, 1011, 2241, 9262, 22483, 1006, 2030, 2130, 4127, 23235, 999, 1007, 3642, 2061, 2009, 1005,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Data Lightweight data binding Example and documentation: http://minutemailer.github.io/data/
minutemailer/data
README.md
Markdown
mit
95
[ 30522, 1001, 2951, 12038, 2951, 8031, 2742, 1998, 12653, 1024, 8299, 1024, 1013, 1013, 3371, 21397, 2121, 1012, 21025, 2705, 12083, 1012, 22834, 1013, 2951, 1013, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* ``The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved via the world wide web at http://www.erlang.org/. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Initial Developer of the Original Code is Ericsson Utvecklings AB. * Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings * AB. All Rights Reserved.'' * * $Id$ */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "sys.h" #include "erl_vm.h" #include "global.h" int main(int argc, char **argv) { erl_start(argc, argv); return 0; }
olikasg/erlang-scala-metrics
otp_src_R12B-5/erts/emulator/sys/unix/erl_main.c
C
lgpl-3.0
973
[ 30522, 1013, 1008, 1036, 1036, 1996, 8417, 1997, 2023, 5371, 2024, 3395, 2000, 1996, 9413, 25023, 2270, 6105, 1010, 1008, 2544, 1015, 1012, 1015, 1010, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package org.apache.spark.carbondata.restructure.vectorreader import java.math.{BigDecimal, RoundingMode} import org.apache.spark.sql.Row import org.apache.spark.sql.common.util.QueryTest import org.scalatest.BeforeAndAfterAll class AddColumnTestCases extends QueryTest with BeforeAndAfterAll { override def beforeAll { sqlContext.setConf("carbon.enable.vector.reader", "true") sql("DROP TABLE IF EXISTS addcolumntest") sql("drop table if exists hivetable") sql( "CREATE TABLE addcolumntest(intField int,stringField string,timestampField timestamp," + "decimalField decimal(6,2)) STORED BY 'carbondata'") sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/restructure/data4.csv' INTO TABLE addcolumntest " + s"options('FILEHEADER'='intField,stringField,timestampField,decimalField')") sql( "Alter table addcolumntest add columns(charField string) TBLPROPERTIES" + "('DICTIONARY_EXCLUDE'='charField', 'DEFAULT.VALUE.charfield'='def')") sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/restructure/data1.csv' INTO TABLE addcolumntest " + s"options('FILEHEADER'='intField,stringField,charField,timestampField,decimalField')") } test("test like query on new column") { checkAnswer(sql("select charField from addcolumntest where charField like 'd%'"), Row("def")) } test("test is not null filter on new column") { checkAnswer(sql("select charField from addcolumntest where charField is not null"), Seq(Row("abc"), Row("def"))) } test("test is null filter on new column") { checkAnswer(sql("select charField from addcolumntest where charField is null"), Seq()) } test("test equals filter on new column") { checkAnswer(sql("select charField from addcolumntest where charField = 'abc'"), Row("abc")) } test("test add dictionary column and test greaterthan/lessthan filter on new column") { sql( "Alter table addcolumntest add columns(intnewField int) TBLPROPERTIES" + "('DICTIONARY_INCLUDE'='intnewField', 'DEFAULT.VALUE.intNewField'='5')") checkAnswer(sql("select charField from addcolumntest where intnewField > 2"), Seq(Row("abc"), Row("def"))) checkAnswer(sql("select charField from addcolumntest where intnewField < 2"), Seq()) } test("test add msr column and check aggregate") { sql( "alter table addcolumntest add columns(msrField decimal(5,2))TBLPROPERTIES ('DEFAULT.VALUE" + ".msrfield'= '123.45')") checkAnswer(sql("select sum(msrField) from addcolumntest"), Row(new BigDecimal("246.90").setScale(2, RoundingMode.HALF_UP))) } test("test compaction after adding new column") { sql("Alter table addcolumntest compact 'major'") checkExistence(sql("show segments for table addcolumntest"), true, "0Compacted") checkExistence(sql("show segments for table addcolumntest"), true, "1Compacted") checkExistence(sql("show segments for table addcolumntest"), true, "0.1Success") checkAnswer(sql("select charField from addcolumntest"), Seq(Row("abc"), Row("def"))) } test("test add and drop column with data loading") { sql("DROP TABLE IF EXISTS carbon_table") sql( "CREATE TABLE carbon_table(intField int,stringField string,charField string,timestampField " + "timestamp,decimalField decimal(6,2))STORED BY 'carbondata' TBLPROPERTIES" + "('DICTIONARY_EXCLUDE'='charField')") sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/restructure/data1.csv' INTO TABLE carbon_table " + s"options('FILEHEADER'='intField,stringField,charField,timestampField,decimalField')") sql("Alter table carbon_table drop columns(timestampField)") sql("select * from carbon_table").collect sql("Alter table carbon_table add columns(timestampField timestamp)") sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/restructure/data5.csv' INTO TABLE carbon_table " + s"options('FILEHEADER'='intField,stringField,charField,decimalField,timestampField')") sql("DROP TABLE IF EXISTS carbon_table") } test("test add/drop and change datatype") { sql("DROP TABLE IF EXISTS carbon_table") sql( "CREATE TABLE carbon_table(intField int,stringField string,charField string,timestampField " + "timestamp,decimalField decimal(6,2))STORED BY 'carbondata' TBLPROPERTIES" + "('DICTIONARY_EXCLUDE'='charField')") sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/restructure/data1.csv' INTO TABLE carbon_table " + s"options('FILEHEADER'='intField,stringField,charField,timestampField,decimalField')") sql("Alter table carbon_table drop columns(charField)") sql("select * from carbon_table").collect sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/restructure/data4.csv' INTO TABLE carbon_table " + s"options('FILEHEADER'='intField,stringField,timestampField,decimalField')") sql( "Alter table carbon_table add columns(charField string) TBLPROPERTIES" + "('DICTIONARY_EXCLUDE'='charField')") sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/restructure/data2.csv' INTO TABLE carbon_table " + s"options('FILEHEADER'='intField,stringField,timestampField,decimalField,charField')") sql("select * from carbon_table").collect sql("ALTER TABLE carbon_table CHANGE decimalField decimalField decimal(22,6)") sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/restructure/data3.csv' INTO TABLE carbon_table " + s"options('FILEHEADER'='intField,stringField,timestampField,decimalField,charField')") sql("DROP TABLE IF EXISTS carbon_table") } override def afterAll { sql("DROP TABLE IF EXISTS addcolumntest") sql("drop table if exists hivetable") sqlContext.setConf("carbon.enable.vector.reader", "false") } }
mayunSaicmotor/incubator-carbondata
integration/spark2/src/test/scala/org/apache/spark/carbondata/restructure/vectorreader/AddColumnTestCases.scala
Scala
apache-2.0
5,716
[ 30522, 7427, 8917, 1012, 15895, 1012, 12125, 1012, 6351, 2850, 2696, 1012, 2717, 6820, 14890, 1012, 9207, 16416, 4063, 12324, 9262, 1012, 8785, 1012, 1063, 2502, 3207, 6895, 9067, 1010, 26939, 5302, 3207, 1065, 12324, 8917, 1012, 15895, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * @package plugins.crossKalturaDistribution * @subpackage lib.batch */ class CrossKalturaEntryObjectsContainer { /** * @var KalturaBaseEntry */ public $entry; /** * @var array<KalturaMetadata> */ public $metadataObjects; /** * @var array<KalturaFlavorAsset> */ public $flavorAssets; /** * @var array<KalturaContentResource> */ public $flavorAssetsContent; /** * @var array<KalturaThumbAsset> */ public $thumbAssets; /** * @var array<KalturaContentResource> */ public $thumbAssetsContent; /** * @var array<KalturaCaptionAsset> */ public $captionAssets; /** * @var array<KalturaContentResource> */ public $captionAssetsContent; /** * @var array<KalturaCuePoint> */ public $cuePoints; /** * Initialize all member variables */ public function __construct() { $this->entry = null; $this->metadataObjects = array(); $this->flavorAssets = array(); $this->flavorAssetsContent = array(); $this->thumbAssets = array(); $this->thumbAssetsContent = array(); $this->captionAssets = array(); $this->captionAssetsContent = array(); $this->cuePoints = array(); } }
ivesbai/server
plugins/content_distribution/providers/cross_kaltura/lib/batch/CrossKalturaEntryObjectsContainer.php
PHP
agpl-3.0
1,370
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 1030, 7427, 13354, 7076, 1012, 2892, 12902, 27431, 10521, 18886, 29446, 1008, 1030, 4942, 23947, 4270, 5622, 2497, 1012, 14108, 1008, 1013, 2465, 2892, 12902, 27431, 4765, 2854, 16429, 20614, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...