Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    TypeError
Message:      Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2011, in _prepare_split_single
                  writer.write_table(table)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 585, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2302, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in cast_table_to_schema
                  arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in <listcomp>
                  arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in <listcomp>
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2122, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
              to
              {'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

text
string
meta
dict
require 'spec_helper' describe GoCardlessPro::Resources::BankDetailsLookup do let(:client) do GoCardlessPro::Client.new( access_token: 'SECRET_TOKEN' ) end let(:response_headers) { { 'Content-Type' => 'application/json' } } describe '#create' do subject(:post_create_response) { client.bank_details_lookups.create(params: new_resource) } context 'with a valid request' do let(:new_resource) do { 'available_debit_schemes' => 'available_debit_schemes-input', 'bank_name' => 'bank_name-input', 'bic' => 'bic-input', } end before do stub_request(:post, %r{.*api.gocardless.com/bank_details_lookups}). with( body: { 'bank_details_lookups' => { 'available_debit_schemes' => 'available_debit_schemes-input', 'bank_name' => 'bank_name-input', 'bic' => 'bic-input', }, } ). to_return( body: { 'bank_details_lookups' => { 'available_debit_schemes' => 'available_debit_schemes-input', 'bank_name' => 'bank_name-input', 'bic' => 'bic-input', }, }.to_json, headers: response_headers ) end it 'creates and returns the resource' do expect(post_create_response).to be_a(GoCardlessPro::Resources::BankDetailsLookup) end end context 'with a request that returns a validation error' do let(:new_resource) { {} } before do stub_request(:post, %r{.*api.gocardless.com/bank_details_lookups}).to_return( body: { error: { type: 'validation_failed', code: 422, errors: [ { message: 'test error message', field: 'test_field' }, ], }, }.to_json, headers: response_headers, status: 422 ) end it 'throws the correct error' do expect { post_create_response }.to raise_error(GoCardlessPro::ValidationError) end end context 'with a request that returns an idempotent creation conflict error' do let(:id) { 'ID123' } let(:new_resource) do { 'available_debit_schemes' => 'available_debit_schemes-input', 'bank_name' => 'bank_name-input', 'bic' => 'bic-input', } end let!(:post_stub) do stub_request(:post, %r{.*api.gocardless.com/bank_details_lookups}).to_return( body: { error: { type: 'invalid_state', code: 409, errors: [ { message: 'A resource has already been created with this idempotency key', reason: 'idempotent_creation_conflict', links: { conflicting_resource_id: id, }, }, ], }, }.to_json, headers: response_headers, status: 409 ) end it 'raises an InvalidStateError' do expect { post_create_response }.to raise_error(GoCardlessPro::InvalidStateError) expect(post_stub).to have_been_requested end end end end
{ "content_hash": "d8ee482595b7b763635b6e3ac793fdae", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 95, "avg_line_length": 27.983471074380166, "alnum_prop": 0.505611340815121, "repo_name": "gocardless/gocardless-pro-ruby", "id": "384566ad1304c7f9fa4733b2487395643bf643ce", "size": "3386", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/resources/bank_details_lookup_spec.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "1221653" } ] }
package io.fabric8.tooling.archetype.commands; import io.fabric8.tooling.archetype.ArchetypeService; import io.fabric8.tooling.archetype.catalog.Archetype; import org.apache.felix.gogo.commands.Argument; import org.apache.felix.gogo.commands.Command; import org.apache.karaf.shell.console.AbstractAction; import static io.fabric8.common.util.Strings.emptyIfNull; import static io.fabric8.tooling.archetype.commands.ArchetypeHelper.toMavenCoordinate; @Command(name = ArchetypeInfo.FUNCTION_VALUE, scope = ArchetypeInfo.SCOPE_VALUE, description = ArchetypeInfo.DESCRIPTION) public class ArchetypeInfoAction extends AbstractAction { static final String FORMAT = "%-30s %s"; @Argument(index = 0, name = "archetype", description = "ArchetypeId or coordinate", required = true, multiValued = false) private String archetypeGAV; private final ArchetypeService archetypeService; public ArchetypeInfoAction(ArchetypeService archetypeService) { this.archetypeService = archetypeService; } @Override protected Object doExecute() throws Exception { // try artifact first Archetype archetype = archetypeService.getArchetypeByArtifact(archetypeGAV); if (archetype == null) { // then by coordinate archetypeService.getArchetype(archetypeGAV); } if (archetype != null) { System.out.println(String.format(FORMAT, "GroupId:", archetype.groupId)); System.out.println(String.format(FORMAT, "ArtifactId:", archetype.artifactId)); System.out.println(String.format(FORMAT, "Version:", archetype.version)); System.out.println(String.format(FORMAT, "Coordinate:", toMavenCoordinate(archetype))); System.out.println(String.format(FORMAT, "Description:", emptyIfNull(archetype.description))); System.out.println(String.format(FORMAT, "Repository:", emptyIfNull(archetype.repository))); } else { System.err.println("No archetype found for: " + archetypeGAV); } return null; } }
{ "content_hash": "93d47044457527e37a77342187dfb369", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 125, "avg_line_length": 42.38775510204081, "alnum_prop": 0.7168993740972557, "repo_name": "jonathanchristison/fabric8", "id": "5f80c022d7cc01fd346293f30adede2a164480ae", "size": "2715", "binary": false, "copies": "3", "ref": "refs/heads/1.2.0.redhat-6-2-x-patch", "path": "tooling/archetype-commands/src/main/java/io/fabric8/tooling/archetype/commands/ArchetypeInfoAction.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "52" }, { "name": "Batchfile", "bytes": "6748" }, { "name": "CSS", "bytes": "10262" }, { "name": "HTML", "bytes": "23749" }, { "name": "Java", "bytes": "8422492" }, { "name": "JavaScript", "bytes": "605777" }, { "name": "Protocol Buffer", "bytes": "899" }, { "name": "Scala", "bytes": "5260" }, { "name": "Shell", "bytes": "22200" } ] }
<?php namespace Anomaly\SelectFieldType\Handler; use Anomaly\SelectFieldType\SelectFieldType; use Illuminate\Contracts\Config\Repository; /** * Class Countries * * @link http://pyrocms.com/ * @author PyroCMS, Inc. <support@pyrocms.com> * @author Ryan Thompson <ryan@pyrocms.com> */ class Countries { /** * Handle the options. * * @param SelectFieldType $fieldType * @param Repository $config */ public function handle(SelectFieldType $fieldType, Repository $config) { $fieldType->setOptions( array_combine( array_keys($config->get('streams::countries.available')), array_map( function ($country) { return 'streams::country.' . $country; }, array_keys($config->get('streams::countries.available')) ) ) ); } }
{ "content_hash": "00daf830ebbc8e9cadf98ef19603de00", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 76, "avg_line_length": 26.61111111111111, "alnum_prop": 0.545929018789144, "repo_name": "anomalylabs/select-field_type", "id": "4c2f01015e9c7ce864034e4a687bafd5a606fd44", "size": "958", "binary": false, "copies": "1", "ref": "refs/heads/2.3", "path": "src/Handler/Countries.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "7980" }, { "name": "JavaScript", "bytes": "8740" }, { "name": "PHP", "bytes": "32252" }, { "name": "SCSS", "bytes": "9762" }, { "name": "Twig", "bytes": "5171" } ] }
/** * */ package io.sovaj.basics.test.random; import java.util.List; import org.junit.Assert; import org.junit.Test; /** * Test for {@link RandomCollectionFactory}. * */ @SuppressWarnings({"unchecked", "rawtypes" }) public class RandomCollectionFactoryTest { /** * Test method for * {@link RandomCollectionFactory#create()} * . */ @Test public void testBoolean() { RandomCollectionFactory<List> factory = new RandomCollectionFactory<List>(List.class, Boolean.class); List<Boolean> results = factory.create(); Assert.assertNotNull("null collection", results); Assert.assertFalse("empty collection", results.isEmpty()); } /** * Test method for * {@link RandomCollectionFactory#create()} * . */ @Test public void testFoo() { RandomCollectionFactory<List> factory = new RandomCollectionFactory<List>(List.class, Foo.class); List<Foo> results = factory.create(); Assert.assertNotNull("null collection", results); Assert.assertFalse("empty collection", results.isEmpty()); } }
{ "content_hash": "a93b71835d985d60155a5f6dc1115a08", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 109, "avg_line_length": 25.431818181818183, "alnum_prop": 0.647899910634495, "repo_name": "sovaj/sovaj.basics", "id": "bac4168d350a88e78b5631ff33ea4b8e138ddc84", "size": "1119", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "basics-test/src/test/java/io/sovaj/basics/test/random/RandomCollectionFactoryTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "284053" } ] }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "5adabc206fde3233475ae5ab70d23a65", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "04fa1961b43cf22c2ca2a8ccba9259d10e41880b", "size": "189", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Taeniophyllum/Taeniophyllum conoceras/README.md", "mode": "33188", "license": "apache-2.0", "language": [] }
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var RecordSchema = new Schema({ patientId : { type : Schema.Types.ObjectId, ref: 'patient' }, doctorId : { type : Schema.Types.ObjectId, ref: 'doctor' }, queixaPrincipal: { type : String, get: global.decrypt, set: global.encrypt }, historicoDoenca: { type : String, get: global.decrypt, set: global.encrypt }, interrogatorio: { type : String, get: global.decrypt, set: global.encrypt }, antecedentesFamiliares: { type : String, get: global.decrypt, set: global.encrypt }, antecedentesPessoais: { type : String, get: global.decrypt, set: global.encrypt }, habitosVida: { type : String, get: global.decrypt, set: global.encrypt }, hipoteseDiagnostica: { type : String, get: global.decrypt, set: global.encrypt }, date: { type : Date, get: global.decrypt, set: global.encrypt } }, { toJSON: { getters: true } }); module.exports = mongoose.model('record', RecordSchema);
{ "content_hash": "bb30b36a841417a90286073c336ea12d", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 56, "avg_line_length": 23.22641509433962, "alnum_prop": 0.5442729488220959, "repo_name": "medhelp-app/api", "id": "a8552f6b14c9455d214673b26fab56c5933adcb1", "size": "1231", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "models/record.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "162065" } ] }
package org.informagen.oswf.descriptors; import org.informagen.oswf.util.XMLHelper; import org.w3c.dom.Element; import java.io.PrintWriter; public class StepConditionDescriptor extends AbstractDescriptor { protected final RestrictionDescriptor restriction; protected final String name; // C O N S T R U C T O R ----------------------------------------------------------------- StepConditionDescriptor(Element stepConditionElement) { try { setId(Integer.parseInt(stepConditionElement.getAttribute("id"))); } catch (NumberFormatException e) { // throw new IllegalArgumentException("Invalid Step Condition id value: " + stepConditionElement.getAttribute("id")); } this.restriction = new RestrictionDescriptor(XMLHelper.getChildElement(stepConditionElement, "restrict-to")); this.name = stepConditionElement.getAttribute("name"); } // M E T H O D S ------------------------------------------------------------------------- public String getName() { return name; } public RestrictionDescriptor getRestriction() { return restriction; } }
{ "content_hash": "8230870da8c31facf9b5f26da4cf1016", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 129, "avg_line_length": 29.425, "alnum_prop": 0.6066270178419712, "repo_name": "will-gilbert/OSWf-OSWorkflow-fork", "id": "fc52018ae28386ba4657d7d0a95df9e6a7ca2ce8", "size": "1177", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "oswf/core/src/main/java/org/informagen/oswf/descriptors/StepConditionDescriptor.java", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "8810" }, { "name": "Groovy", "bytes": "181906" }, { "name": "HTML", "bytes": "127274" }, { "name": "Java", "bytes": "1236737" }, { "name": "JavaScript", "bytes": "3396" } ] }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "508c37e8d4fc50f594ceb915dbcc40e8", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "3c7c34456858393eac76428e1d50e7224013df9c", "size": "180", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Dalea/Dalea urceolata/README.md", "mode": "33188", "license": "apache-2.0", "language": [] }
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="html/html; charset=utf-8" /> <title>MGLPolygon Class Reference</title> <meta id="xcode-display" name="xcode-display" content="render"/> <link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" /> <link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" /> <meta name="generator" content="appledoc 2.2 (build 963)" /> </head> <body> <header id="top_header"> <div id="library" class="hideInXcode"> <h1><a id="libraryTitle" href="../index.html">Mapbox iOS SDK 2.1.2 </a></h1> <a id="developerHome" href="../index.html">Mapbox</a> </div> <div id="title" role="banner"> <h1 class="hideInXcode">MGLPolygon Class Reference</h1> </div> <ul id="headerButtons" role="toolbar"> <li id="toc_button"> <button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button> </li> <li id="jumpto_button" role="navigation"> <select id="jumpTo"> <option value="top">Jump To&#133;</option> <option value="overview">Overview</option> <option value="tasks">Tasks</option> <option value="class_methods">Class Methods</option> <option value="//api/name/polygonWithCoordinates:count:">&nbsp;&nbsp;&nbsp;&nbsp;+ polygonWithCoordinates:count:</option> </select> </li> </ul> </header> <nav id="tocContainer" class="isShowingTOC"> <ul id="toc" role="tree"> <li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li> <li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul> </ul></li> <li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#class_methods">Class Methods</a></span><ul> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/polygonWithCoordinates:count:">polygonWithCoordinates:count:</a></span></li> </ul></li> </ul> </nav> <article> <div id="contents" class="isShowingTOC" role="main"> <a title="MGLPolygon Class Reference" name="top"></a> <div class="main-navigation navigation-top"> <ul> <li><a href="../index.html">Index</a></li> <li><a href="../hierarchy.html">Hierarchy</a></li> </ul> </div> <div id="header"> <div class="section-header"> <h1 class="title title-header">MGLPolygon Class Reference</h1> </div> </div> <div id="container"> <div class="section section-specification"><table cellspacing="0"><tbody> <tr> <td class="specification-title">Inherits from</td> <td class="specification-value"><a href="../Classes/MGLMultiPoint.html">MGLMultiPoint</a> : <a href="../Classes/MGLShape.html">MGLShape</a> : NSObject</td> </tr><tr> <td class="specification-title">Conforms to</td> <td class="specification-value"><a href="../Protocols/MGLOverlay.html">MGLOverlay</a></td> </tr><tr> <td class="specification-title">Declared in</td> <td class="specification-value">MGLPolygon.h</td> </tr> </tbody></table></div> <div class="section section-overview"> <a title="Overview" name="overview"></a> <h2 class="subtitle subtitle-overview">Overview</h2> <p>The <code>MGLPolygon</code> class represents a shape consisting of one or more points that define a closed polygon. The points are connected end-to-end in the order they are provided. The first and last points are connected to each other to create the closed shape.</p> </div> <div class="section section-tasks"> <a title="Tasks" name="tasks"></a> <h2 class="subtitle subtitle-tasks">Tasks</h2> <ul class="task-list"> <li> <span class="tooltip"> <code><a href="#//api/name/polygonWithCoordinates:count:">+&nbsp;polygonWithCoordinates:count:</a></code> </span> </li> </ul> </div> <div class="section section-methods"> <a title="Class Methods" name="class_methods"></a> <h2 class="subtitle subtitle-methods">Class Methods</h2> <div class="section-method"> <a name="//api/name/polygonWithCoordinates:count:" title="polygonWithCoordinates:count:"></a> <h3 class="subsubtitle method-title">polygonWithCoordinates:count:</h3> <div class="method-subsection brief-description"> <p>Creates and returns an <code>MGLPolygon</code> object from the specified set of coordinates.</p> </div> <div class="method-subsection method-declaration"><code>+ (instancetype)polygonWithCoordinates:(CLLocationCoordinate2D *)<em>coords</em> count:(NSUInteger)<em>count</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>coords</em></dt> <dd><p>The array of coordinates defining the shape. The data in this array is copied to the new object.</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>count</em></dt> <dd><p>The number of items in the <em><code>coords</code></em> array.</p></dd> </dl> </div> <div class="method-subsection return"> <h4 class="method-subtitle parameter-title">Return Value</h4> <p>A new polygon object.</p> </div> <div class="method-subsection discussion-section"> <h4 class="method-subtitle">Discussion</h4> <p>Creates and returns an <code>MGLPolygon</code> object from the specified set of coordinates.</p> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">MGLPolygon.h</code><br /> </div> </div> </div> </div> <div class="main-navigation navigation-bottom"> <ul> <li><a href="../index.html">Index</a></li> <li><a href="../hierarchy.html">Hierarchy</a></li> </ul> </div> <div id="footer"> <hr /> <div class="footer-copyright"> <p><span class="copyright">&copy; 2015 Mapbox. All rights reserved. (Last updated: 2015-09-15)</span><br /> <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p> </div> </div> </div> </article> <script type="text/javascript"> function jumpToChange() { window.location.hash = this.options[this.selectedIndex].value; } function toggleTOC() { var contents = document.getElementById('contents'); var tocContainer = document.getElementById('tocContainer'); if (this.getAttribute('class') == 'open') { this.setAttribute('class', ''); contents.setAttribute('class', ''); tocContainer.setAttribute('class', ''); window.name = "hideTOC"; } else { this.setAttribute('class', 'open'); contents.setAttribute('class', 'isShowingTOC'); tocContainer.setAttribute('class', 'isShowingTOC'); window.name = ""; } return false; } function toggleTOCEntryChildren(e) { e.stopPropagation(); var currentClass = this.getAttribute('class'); if (currentClass == 'children') { this.setAttribute('class', 'children open'); } else if (currentClass == 'children open') { this.setAttribute('class', 'children'); } return false; } function tocEntryClick(e) { e.stopPropagation(); return true; } function init() { var selectElement = document.getElementById('jumpTo'); selectElement.addEventListener('change', jumpToChange, false); var tocButton = document.getElementById('table_of_contents'); tocButton.addEventListener('click', toggleTOC, false); var taskTreeItem = document.getElementById('task_treeitem'); if (taskTreeItem.getElementsByTagName('li').length > 0) { taskTreeItem.setAttribute('class', 'children'); taskTreeItem.firstChild.setAttribute('class', 'disclosure'); } var tocList = document.getElementById('toc'); var tocEntries = tocList.getElementsByTagName('li'); for (var i = 0; i < tocEntries.length; i++) { tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false); } var tocLinks = tocList.getElementsByTagName('a'); for (var i = 0; i < tocLinks.length; i++) { tocLinks[i].addEventListener('click', tocEntryClick, false); } if (window.name == "hideTOC") { toggleTOC.call(tocButton); } } window.onload = init; // If showing in Xcode, hide the TOC and Header if (navigator.userAgent.match(/xcode/i)) { document.getElementById("contents").className = "hideInXcode" document.getElementById("tocContainer").className = "hideInXcode" document.getElementById("top_header").className = "hideInXcode" } </script> </body> </html>
{ "content_hash": "ce9fb2b7b0c08033538b7385e0e6deb6", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 278, "avg_line_length": 27.78978978978979, "alnum_prop": 0.6291333477415172, "repo_name": "chrisjmendez/swift-exercises", "id": "7b5211545cdf172ffe0bb0d556763c9aa85354c2", "size": "9254", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "Maps/MyMapbox/Pods/Mapbox-iOS-SDK/Docs/html/Classes/MGLPolygon.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "23648" }, { "name": "C++", "bytes": "5745" }, { "name": "CSS", "bytes": "12635" }, { "name": "HTML", "bytes": "413719" }, { "name": "JavaScript", "bytes": "18180" }, { "name": "Matlab", "bytes": "58" }, { "name": "Objective-C", "bytes": "7357019" }, { "name": "Ruby", "bytes": "23149" }, { "name": "Shell", "bytes": "196610" }, { "name": "Swift", "bytes": "4275872" } ] }
table.post-revisions tr.locked-revision, table.post-revisions tr.current-revision{ background-color:#E1F8DA; } table.post-revisions a.lock, table.post-revisions a.unlock, table.post-revisions a.delete { color:#F00; } table.post-revisions th.check-column { margin: 0 5px; } table.post-revisions th.delete-column { margin-left: 0; padding-left: 0; } table.post-revisions .check-column { font-size: 14px; line-height: 1.3em; padding-bottom: 8px; padding-left: 7px; padding-right: 7px; padding-top: 7px; } h2.center { text-align: center !important; } body.revision-control.iframe .wrap { padding: 10px; }
{ "content_hash": "d28106bc54bcb37cfbb6bfd5a85f9a93", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 41, "avg_line_length": 18.176470588235293, "alnum_prop": 0.7313915857605178, "repo_name": "billcotter/conceptpath", "id": "8077895e7deb8f72982aaa220831aaa6607099d4", "size": "618", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "web/app/plugins/revision-control/revision-control.css", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "740" }, { "name": "CSS", "bytes": "1766395" }, { "name": "HTML", "bytes": "426" }, { "name": "JavaScript", "bytes": "1147644" }, { "name": "PHP", "bytes": "8390512" }, { "name": "Smarty", "bytes": "171120" } ] }
<project name="editor/theme.build" default="build" basedir="."> <description>editor/theme Build File</description> <property name="component.name" value="editor/theme"/> <import file="../../../common.xml"/> <property name="smart-sprites.basedir" location="${tools.dir}/smart-sprites/"/> <taskdef resource="smartsprites.xml"> <classpath> <fileset dir="${smart-sprites.basedir}/lib"> <include name="*.jar"/> </fileset> </classpath> </taskdef> <target name="concat"> <copy todir="${component.src.dir.tmp}"> <fileset dir="${component.src.dir}" includes="**/*"/> </copy> <concat destfile="${component.src.dir.tmp}/cool/editor-pkg.css" encoding="${charset}" outputencoding="${charset}"> <path location="${component.src.dir.tmp}/editor-common.css"/> <fileset dir="${component.src.dir.tmp}/cool" includes="**/*.css"/> <filterchain> <deletecharacters chars="${bom}"/> </filterchain> </concat> <smartsprites cssfilesuffix="-sprite" spritepngie6="true" loglevel="info"> <fileset file="${component.src.dir.tmp}/cool/editor-pkg.css"/> </smartsprites> <move tofile="${component.src.dir.tmp}/cool/editor.css"> <path location="${component.src.dir.tmp}/cool/editor-pkg-sprite.css"/> </move> <delete dir="${component.src.dir.tmp}/cool/" excludes="editor.css,cool.png,cool-ie6.png,text-bg.png"></delete> </target> </project>
{ "content_hash": "af0d7cd162e8bb2e0e77bb37cde3f911", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 83, "avg_line_length": 36.666666666666664, "alnum_prop": 0.5606060606060606, "repo_name": "007slm/kissy", "id": "fe2d46638a4e0c4ade3095bfce70216b75be2ba2", "size": "1650", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/editor/sub-modules/theme/build.xml", "mode": "33188", "license": "mit", "language": [] }
<?php require_once 'vendor/autoload.php'; if (!class_exists('PHPUnit_Framework_TestCase')) { class PHPUnit_Framework_TestCase extends PHPUnit\Framework\TestCase {} }
{ "content_hash": "f59901b335e34f36730f60ff0c8973c2", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 74, "avg_line_length": 21.625, "alnum_prop": 0.7398843930635838, "repo_name": "SURFnet/Stepup-Middleware-clientbundle", "id": "06adc339c9ce837e70f2aa2c5a17a0db3c141756", "size": "769", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "bootstrap.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "228637" } ] }
<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/bookmark_tag" style="@style/card.expand_simple_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="vertical" android:text="@string/bookmark_domain" />
{ "content_hash": "3d1823e450b14cf02381676b98870b4e", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 68, "avg_line_length": 44.5, "alnum_prop": 0.7050561797752809, "repo_name": "arjunswaj/links", "id": "9660d50e74f423711c2e536cbdba2015b620cb2e", "size": "356", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mobile_app/android/links/res/layout/bookmark_tag.xml", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "56200" }, { "name": "CoffeeScript", "bytes": "2143" }, { "name": "Java", "bytes": "606829" }, { "name": "JavaScript", "bytes": "95440" }, { "name": "Ruby", "bytes": "208921" }, { "name": "Shell", "bytes": "327" }, { "name": "TeX", "bytes": "71431" } ] }
# JavaScript Standard Style [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [travis-image]: https://img.shields.io/travis/feross/standard.svg?style=flat [travis-url]: https://travis-ci.org/feross/standard [npm-image]: https://img.shields.io/npm/v/standard.svg?style=flat [npm-url]: https://npmjs.org/package/standard [downloads-image]: https://img.shields.io/npm/dm/standard.svg?style=flat [downloads-url]: https://npmjs.org/package/standard ### One Style to Rule Them All No decisions to make. No `.jshintrc`, `.jscsrc`, or `.eslintrc` files to manage. It just works. This module saves you (and others!) time in two ways: - **No configuration.** The easiest way to enforce consistent style in your module/project. Just drop it in. - **Catch style errors before they're submitted in PRs.** Saves precious code review time by eliminating back-and-forth between maintainer and contributor. Adopting `standard` style means ranking the importance of community conventions higher than personal style, which does not make sense for 100% of projects and development cultures. At the same time, open source can be a hostile place for newbies. Setting up clear, automated contributor expectations makes a project healthier. ## Install ```bash npm install standard ``` ## Rules - **2 spaces** – for indentation - **Single quotes for strings** – except to avoid escaping - **No unused variables** – this one catches *tons* of bugs! - **No semicolons** – [It's][1] [fine.][2] [Really!][3] - **Never start a line with `(` or `[`** - Instead, use `;[1, 2, 3].join(' ')` - This is the **only** gotcha with omitting semicolons – *automatically checked for you!* - **Space after keywords** `if (condition) { ... }` - **Space after function name** `function name (arg) { ... }` - Name the context variable `self` - `var self = this` - Accidental use of [`window.self`][4] is dissallowed (happens when `var self = this` is omitted) - Always use `===` instead of `==` - Except `obj == null` is allowed to check for `null` or `undefined`. - Always handle the node.js `err` function parameter - Always prefix browser globals with `window` – except `document` and `navigator` are okay - Prevents accidental use of poorly-named browser globals like `open`, `length`, `event`, and `name`. - **And more goodness** – *give `standard` a try today!* [1]: http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding [2]: http://inimino.org/~inimino/blog/javascript_semicolons [3]: https://github.com/maxogden/messages/issues/18 [4]: https://developer.mozilla.org/en-US/docs/Web/API/Window.self To get a better idea, take a look at [a sample file](https://github.com/feross/bittorrent-dht/blob/master/client.js) written in JavaScript Standard Style. ## Badge Use this in one of your projects? Include one of these badges in your readme to let people know that your code is using the standard style. [![js-standard-style](https://raw.githubusercontent.com/feross/standard/master/badge.png)](https://github.com/feross/standard) ``` [![js-standard-style](https://raw.githubusercontent.com/feross/standard/master/badge.png)](https://github.com/feross/standard) ``` [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) ```txt [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) ``` ## Usage The easiest way to use JavaScript Standard Style to check your code is to install it globally as a Node command line program. To do so, simply run the following command in your terminal (flag `-g` installs `standard` globally on your system, omit it if you want to install in the current working directory): ```bash npm install standard -g ``` After you've done that you should be able to use the `standard` program. The simplest use case would be checking the style of all JavaScript files in the current working directory: ``` $ standard Error: Code style check failed: lib/torrent.js:950:11: Expected '===' and instead saw '=='. ``` ### Editor plugins First, install `standard`. Then, install the appropriate plugin for your editor: - **[Vim](https://github.com/scrooloose/syntastic)** - Just install [Syntastic](https://github.com/scrooloose/syntastic). - **[Sublime Text](https://github.com/Flet/Sublimelinter-contrib-standard)** - Install [Package Control](https://packagecontrol.io/), [SublimeLinter](http://www.sublimelinter.com/en/latest/), and [SublimeLinter-contrib-standard](https://github.com/Flet/Sublimelinter-contrib-standard). - **[Atom](https://atom.io)** - Install [Linter](https://github.com/AtomLinter/Linter) and [linter-js-standard](https://github.com/ricardofbarros/linter-js-standard). ### What you might do if you're clever 1. Add it to `package.json` ```json { "name": "my-cool-package", "devDependencies": { "standard": "^3.0.0" }, "scripts": { "test": "standard && node my-tests.js" } } ``` 2. Check style automatically when you run `npm test` ``` $ npm test Error: Code style check failed: lib/torrent.js:950:11: Expected '===' and instead saw '=='. ``` 3. Never give style feedback on a pull request again! ## FAQ ### Why would I use JavaScript Standard Style? The beauty of JavaScript Standard Style is that it's simple. No one wants to maintain multiple hundred-line style configuration files for every module/project they work on. Enough of this madness! This module saves you time in two ways: - **No configuration.** The easiest way to enforce consistent style in your module/project. Just drop it in. - **Catch style errors before they're submitted in PRs.** Saves precious code review time by eliminating back-and-forth between maintainer and contributor. ### How do I ignore files? The paths `node_modules/`, `.git/`, `*.min.js`, `bundle.js`, and `coverage/` are automatically excluded when looking for `.js` files to style check. Sometimes you need to ignore additional folders or specific minfied files. To do that, add a `standard.ignore` property to `package.json`: ```json "standard": { "ignore": [ "**/out/**", "**/lib/select2/**", "**/lib/ckeditor/**" ] } ``` ### Is there an automatic formatter? Yes! Just run `standard --format filename.js`. This uses [Max Ogden](https://github.com/maxogden)'s automatic formatter **[`standard-format`](https://github.com/maxogden/standard-format)**, which can automatically fix most code style issues. While most issues can be fixed, some, like not handling errors, must be fixed manually. ### How do I hide a certain warning? In rare cases, you'll need to break a rule and hide the warning generated by `standard`. JavaScript Standard Style uses [`eslint`](http://eslint.org/) and [`jscs`](http://jscs.info/) under-the-hood and you can hide their warnings as you normally would if you used each linter directly. To get verbose output (so you can find the particular rule name to ignore), run: ```bash $ standard --verbose Error: Code style check failed: routes/error.js:20:36: 'file' was used before it was defined. (eslint/no-use-before-define) routes/submit.js:85:2: Expected indentation of 2 characters (jscs/validateIndentation) ``` The first error is from `eslint`. Disable all checks on a specific line: ```js file = 'I know what I am doing' // eslint-disable-line ``` Or, just disable the "no-use-before-define" rule: ```js file = 'I know what I am doing' // eslint-disable-line no-use-before-define ``` Or, disable the rule for multiple lines: ```js /*eslint-disable no-use-before-define */ // offending code here... // offending code here... // offending code here... /*eslint-enable no-use-before-define */ ``` The second error is from `jscs`. In this case, the rule name is "validateIndentation". You can hide it with a `// jscs:disable validateIndentation` comment. Re-enable with a `// jscs:enable validateIndentation` comment. ### Can you please add more config options? No. Use `eslint` or `jscs` directly if you want that. Pro tip: Just use `standard` and move on. There are actual real problems that you could spend your time solving :p ### Why can't I pipe standard to other tools? `standard` prints to `stderr`. This means that tools that read from `stdout` won't be able to read its output. The solution is to make `standard` print to `stdout` instead: ```sh standard 2>&1 | grep variable ``` ## License MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).
{ "content_hash": "d44465f122b15c3c795befc585ba19a0", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 285, "avg_line_length": 35.946058091286304, "alnum_prop": 0.7190349763361422, "repo_name": "driftyco/standard", "id": "2298fc0bf1d77e903fc3d05bb32e4f476fa3cc48", "size": "8677", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "13550" } ] }
 #include <aws/dlm/model/SettablePolicyStateValues.h> #include <aws/core/utils/HashingUtils.h> #include <aws/core/Globals.h> #include <aws/core/utils/EnumParseOverflowContainer.h> using namespace Aws::Utils; namespace Aws { namespace DLM { namespace Model { namespace SettablePolicyStateValuesMapper { static const int ENABLED_HASH = HashingUtils::HashString("ENABLED"); static const int DISABLED_HASH = HashingUtils::HashString("DISABLED"); SettablePolicyStateValues GetSettablePolicyStateValuesForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == ENABLED_HASH) { return SettablePolicyStateValues::ENABLED; } else if (hashCode == DISABLED_HASH) { return SettablePolicyStateValues::DISABLED; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast<SettablePolicyStateValues>(hashCode); } return SettablePolicyStateValues::NOT_SET; } Aws::String GetNameForSettablePolicyStateValues(SettablePolicyStateValues enumValue) { switch(enumValue) { case SettablePolicyStateValues::ENABLED: return "ENABLED"; case SettablePolicyStateValues::DISABLED: return "DISABLED"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue)); } return ""; } } } // namespace SettablePolicyStateValuesMapper } // namespace Model } // namespace DLM } // namespace Aws
{ "content_hash": "2d1b9428a819496be05f5772b9315514", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 94, "avg_line_length": 29.567164179104477, "alnum_prop": 0.629984856133266, "repo_name": "JoyIfBam5/aws-sdk-cpp", "id": "ad6efccd5671e87e262bc16f6b963366b967325d", "size": "2554", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-cpp-sdk-dlm/source/model/SettablePolicyStateValues.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "11868" }, { "name": "C++", "bytes": "167818064" }, { "name": "CMake", "bytes": "591577" }, { "name": "HTML", "bytes": "4471" }, { "name": "Java", "bytes": "271801" }, { "name": "Python", "bytes": "85650" }, { "name": "Shell", "bytes": "5277" } ] }
//////////////////////////////////////////////// /* Provided Code - Please Don't Edit */ //////////////////////////////////////////////// 'use strict'; function getInput() { console.log("Please choose either 'rock', 'paper', or 'scissors'.") return prompt(); } function randomPlay() { var randomNumber = Math.random(); if (randomNumber < 0.33) { return "rock"; } else if (randomNumber < 0.66) { return "paper"; } else { return "scissors"; } } //////////////////////////////////////////////// /* Write Your Code Below */ //////////////////////////////////////////////// function getPlayerMove(move) { // Write an expression that operates on a variable called `move` // If a `move` has a value, your expression should evaluate to that value. // However, if `move` is not specified / is null, your expression should equal `getInput()`. return move || getInput(); } function getComputerMove(move) { // Write an expression that operates on a variable called `move` // If a `move` has a value, your expression should evaluate to that value. // However, if `move` is not specified / is null, your expression should equal `randomPlay()`. return move || randomPlay(); } function getWinner(playerMove, computerMove) { var winner; // Write code that will set winner to either 'player', 'computer', or 'tie' based on the values of playerMove and computerMove. // Assume that the only values playerMove and computerMove can have are 'rock', 'paper', and 'scissors'. // The rules of the game are that 'rock' beats 'scissors', 'scissors' beats 'paper', and 'paper' beats 'rock'. //playerwins if (playerMove === 'rock' && computerMove === 'scissors') { winner = 'player'; } else if (playerMove === 'scissors' && computerMove === 'paper') { winner = 'player'; } else if (playerMove === 'paper' && computerMove === 'rock') { winner = 'player'; } //computerwins else if (computerMove === 'rock' && playerMove === 'scissors') { winner = 'computer'; } else if (computerMove === 'scissors' && playerMove === 'paper') { winner = 'computer'; } else if (computerMove === 'paper' && playerMove === 'rock') { winner = 'computer'; } //tie else if (playerMove === computerMove) { winner = 'tie'; } return winner; } function playToFive() { var playerWins = 0; var computerWins = 0; // Write code that plays 'Rock, Paper, Scissors' until either the player or the computer has won five times. for (var i = 0; playerWins < 5 && computerWins < 5; ){ console.log("Let's play Rock, Paper, Scissors"); var playerMove = getPlayerMove(getInput()); var computerMove = getComputerMove(randomPlay()); var winner = getWinner(playerMove, computerMove); console.log (([playerWins, computerWins]) + ' Winner = ' + winner + ',' + ' Player Move = ' + playerMove + ', Computer Move = ' + computerMove); if (winner == 'player') { playerWins++; } else if (winner == 'computer') { computerWins++; } } return [playerWins, computerWins] } playToFive();
{ "content_hash": "18e7b0760ca1174c5cb33ad7165335d4", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 152, "avg_line_length": 33.56122448979592, "alnum_prop": 0.5649133475220431, "repo_name": "samucapark/wdi-fundamentals-rps", "id": "cc10a1a1d9cd6b595cf7bedf4d8a46bc4d9f8f5b", "size": "3289", "binary": false, "copies": "1", "ref": "refs/heads/student", "path": "app/js/rockpaperscissors.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "25073" }, { "name": "JavaScript", "bytes": "17518" } ] }
<?php namespace Oka\PaginationBundle\DependencyInjection; use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} */ class Configuration implements ConfigurationInterface { protected static $supportedDrivers = ['orm', 'mongodb']; /** * {@inheritDoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('oka_pagination'); /** @var \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode */ $rootNode = $treeBuilder->getRootNode(); $rootNode ->beforeNormalization() ->always(static function($v){ if (false === isset($v['pagination_managers']) || true === empty($v['pagination_managers'])) { return $v; } foreach ($v['pagination_managers'] as $key => $config) { if (false === isset($config['class'])) { $v['pagination_managers'][$key]['class'] = $key; } if (true === isset($v['filters'])) { $v['pagination_managers'][$key]['filters'] = array_merge($v['filters'], $config['filters'] ?? []); } if (true === isset($v['sort'])) { $v['pagination_managers'][$key]['sort'] = array_merge_recursive($v['sort'], $config['sort'] ??[]); } if (true === isset($v['query_mappings'])) { $v['pagination_managers'][$key]['query_mappings'] = array_merge($v['query_mappings'], $config['query_mappings'] ?? []); } } return $v; }) ->end() ->addDefaultsIfNotSet() ->validate() ->ifTrue(static function($v){ foreach ($v['sort']['order'] as $filterName => $direction) { if (false === array_key_exists($filterName, $v['filters'])) { return true; } } return false; }) ->thenInvalid('The configuration value "oka_pagination.sort.order" must only contains keys that matches to filter names.') ->end() ->validate() ->ifTrue(static function($v){ return array_key_exists('_defaults', $v['pagination_managers'] ?? []); }) ->thenInvalid('Invalid pagination manager name, the word "_defaults" is a reserved, it cannot be used for path "oka_pagination.pagination_managers._defaults".') ->end() ->children() ->append($this->getDBDriverNodeDefinition()) ->append($this->getObjectManageNameNodeDefinition()) ->append($this->getMaxPageNumberNodeDefinition()) ->append($this->getItemPerPageNodeDefinition()) ->append($this->getFiltersNodeDefinition()) ->append($this->getSortNodeDefinition()) ->append($this->getQueryMappingsNodeDefinition()) ->append($this->getTwigNodeDefinition()) ->arrayNode('pagination_managers') ->requiresAtLeastOneElement() ->validate() ->ifTrue(static function($v){ foreach ($v as $key => $config) { foreach ($config['sort']['order'] as $filterName => $direction) { if (false === array_key_exists($filterName, $config['filters'])) { return true; } } } return false; }) ->thenInvalid('The configuration value "oka_pagination.pagination_managers.*.sort.order" must only contains keys that matches to filter names %s.') ->end() ->arrayPrototype() ->children() ->append($this->getDBDriverNodeDefinition()) ->append($this->getObjectManageNameNodeDefinition()) ->scalarNode('class')->isRequired()->cannotBeEmpty()->end() ->append($this->getMaxPageNumberNodeDefinition()) ->append($this->getItemPerPageNodeDefinition()) ->append($this->getFiltersNodeDefinition()) ->append($this->getRouteNodeDefinition()) ->append($this->getSortNodeDefinition()) ->append($this->getQueryMappingsNodeDefinition()) ->append($this->getTwigNodeDefinition()) ->end() ->end() ->end() ->end(); return $treeBuilder; } protected function getDBDriverNodeDefinition() :NodeDefinition { $node = new ScalarNodeDefinition('db_driver'); $node ->validate() ->ifNotInArray(self::$supportedDrivers) ->thenInvalid('The driver %s is not supported. Please choose one of '.json_encode(self::$supportedDrivers)) ->end() ->isRequired() ->cannotBeEmpty() ->cannotBeOverwritten() ->end(); return $node; } protected function getObjectManageNameNodeDefinition() :NodeDefinition { $node = new ScalarNodeDefinition('object_manager_name'); $node ->defaultNull() ->end(); return $node; } protected function getItemPerPageNodeDefinition() :NodeDefinition { $node = new IntegerNodeDefinition('item_per_page'); $node ->min(1) ->defaultValue(10) ->end(); return $node; } protected function getMaxPageNumberNodeDefinition() :NodeDefinition { $node = new IntegerNodeDefinition('max_page_number'); $node ->min(1) ->defaultValue(400) ->end(); return $node; } protected function getFiltersNodeDefinition() :NodeDefinition { $supportedTypes = ['array', 'boolean', 'bool', 'double', 'float', 'real', 'integer', 'int', 'string', 'datetime', 'object']; $node = new ArrayNodeDefinition('filters'); $node ->beforeNormalization() ->always(static function($v){ if (true === empty($v)) { return $v; } foreach ($v as $key => $config) { if (false === isset($config['property_name'])) { $v[$key]['property_name'] = $key; } } return $v; }) ->end() ->treatNullLike([]) ->useAttributeAsKey('name') ->arrayPrototype() ->children() ->scalarNode('property_name')->isRequired()->cannotBeEmpty()->end() ->scalarNode('cast_type') ->defaultValue('string') ->validate() ->ifNotInArray($supportedTypes) ->thenInvalid('The type %s is not supported. Please choose one of '.json_encode($supportedTypes)) ->end() ->end() ->booleanNode('searchable')->defaultTrue()->end() ->booleanNode('orderable')->defaultTrue()->end() ->booleanNode('private')->defaultFalse()->end() ->end() ->end(); return $node; } protected function getSortNodeDefinition() :NodeDefinition { $node = new ArrayNodeDefinition('sort'); $node ->addDefaultsIfNotSet() ->treatNullLike([]) ->children() ->scalarNode('delimiter')->defaultValue(',')->end() ->arrayNode('order') ->treatNullLike([]) ->enumPrototype() ->values(['asc', 'desc', 'ASC', 'DESC']) ->defaultValue('asc') ->end() ->end() ->end(); return $node; } protected function getRouteNodeDefinition() :NodeDefinition { $node = new ArrayNodeDefinition('route'); $node ->addDefaultsIfNotSet() ->canBeEnabled() ->fixXmlConfig('default') ->fixXmlConfig('requirement') ->fixXmlConfig('option') ->fixXmlConfig('scheme') ->fixXmlConfig('method') ->children() ->scalarNode('path')->isRequired()->cannotBeEmpty()->end() ->arrayNode('defaults') ->treatNullLike([]) ->scalarPrototype() ->cannotBeEmpty() ->end() ->end() ->arrayNode('requirements') ->treatNullLike([]) ->scalarPrototype() ->cannotBeEmpty() ->end() ->end() ->arrayNode('options') ->treatNullLike([]) ->scalarPrototype() ->cannotBeEmpty() ->end() ->end() ->arrayNode('schemes') ->treatNullLike([]) ->scalarPrototype() ->cannotBeEmpty() ->end() ->end() ->arrayNode('methods') ->treatNullLike([]) ->scalarPrototype() ->cannotBeEmpty() ->end() ->end() ->scalarNode('condition')->defaultValue('')->end() ->end(); return $node; } protected function getQueryMappingsNodeDefinition() :NodeDefinition { $node = new ArrayNodeDefinition('query_mappings'); $node ->addDefaultsIfNotSet() ->children() ->scalarNode('page')->cannotBeEmpty()->defaultValue('page')->end() ->scalarNode('item_per_page')->cannotBeEmpty()->defaultValue('item_per_page')->end() ->scalarNode('sort')->cannotBeEmpty()->defaultValue('sort')->end() ->scalarNode('desc')->cannotBeEmpty()->defaultValue('desc')->end() ->scalarNode('fields')->cannotBeEmpty()->defaultValue('fields')->end() ->scalarNode('distinct')->cannotBeEmpty()->defaultValue('distinct')->end() ->end(); return $node; } protected function getTwigNodeDefinition() :NodeDefinition { $node = new ArrayNodeDefinition('twig'); $node ->addDefaultsIfNotSet() ->canBeEnabled() ->children() ->scalarNode('template') ->cannotBeEmpty() ->defaultValue('@OkaPagination/widget/pagination.html.twig') ->end() ->end(); return $node; } }
{ "content_hash": "03b4fbffe2243ccbdc38ad1ddee9a708", "timestamp": "", "source": "github", "line_count": 323, "max_line_length": 167, "avg_line_length": 29.904024767801857, "alnum_prop": 0.5929185215860855, "repo_name": "CedrickOka/oka-pagination", "id": "f72728eb7fb6d7751111a75beb9c93b2cf24f93b", "size": "9659", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/DependencyInjection/Configuration.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "857" }, { "name": "PHP", "bytes": "64438" } ] }
package com.halle.dao; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import com.halle.model.Message; /** * Classe responsável por manter a tabela de Mensagem no Banco de Dados. * * @author lbaiao * @version 1.0 (25/07/2016) * */ public class MessageDAO extends GenericDAO<Message> { /** * Instancia um novo Message dao. */ public MessageDAO() { super(Message.class); } /** * Metodo responsavel pelo registro da mensagem. * * @param message the message */ public void create(final Message message) { message.setRegister(new Date()); super.save(message); } /* (non-Javadoc) * @see com.halle.dao.GenericDAO#update(java.lang.Object) */ public Message update(final Message message) { return super.update(message); } /* (non-Javadoc) * @see com.halle.dao.GenericDAO#delete(java.lang.Object) */ public void delete(final Message message) { super.delete(message); } /** * Find message phone. * * @param phone the phone * @return the list */ public List<Message> findMessagePhone(final String phone) { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("phone", phone); return (List<Message>) super.findAllResult(Message.PHONE, parameters); } /** * Find message send. * * @param phoneFriend the phone friend * @return the list */ public List<Message> findMessageSentReceive(final String phoneFriend) { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("phoneFriend", phoneFriend); return (List<Message>) super.findAllResult(Message.SENT_RECEIVE, parameters); } /** * Find message read. * * @param phoneFriend the phone friend * @return the list */ public List<Message> findMessageRead(final String phoneFriend) { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("phoneFriend", phoneFriend); return (List<Message>) super.findAllResult(Message.READ, parameters); } /** * Find id. * * @param messageId the message id * @return the message */ public Message findId(final Integer messageId) { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("messageId", messageId); return (Message) super.findOneResult(Message.ID, parameters); } /** * Find message friend. * * @param phone the phone * @param phoneFriend the phone friend * @return the list */ public List<Message> findMessageFriend(final String phone, final String phoneFriend) { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("phone", phone); parameters.put("phoneFriend", phoneFriend); return (List<Message>) super.findAllResult(Message.FRIEND, parameters); } }
{ "content_hash": "dc1cf88291a37027084cb31ee0b8f598", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 87, "avg_line_length": 22.624, "alnum_prop": 0.6835219236209336, "repo_name": "FelipeAvila/hallejava", "id": "40be126653e147a42823dabbd0424abc68d28217", "size": "2828", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "HalleEJB/ejbModule/com/halle/dao/MessageDAO.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "127" }, { "name": "Java", "bytes": "126099" } ] }
""" Automata with states, transitions and actions. """ from __future__ import with_statement import types,itertools,time,os,sys,socket,functools from select import select from collections import deque import _thread from .config import conf from .utils import do_graph from .error import log_interactive from .plist import PacketList from .data import MTU from .supersocket import SuperSocket class ObjectPipe: def __init__(self): self.rd,self.wr = os.pipe() self.queue = deque() def fileno(self): return self.rd def send(self, obj): self.queue.append(obj) os.write(self.wr,b"X") def recv(self, n=0): os.read(self.rd,1) return self.queue.popleft() class Message: def __init__(self, **args): self.__dict__.update(args) def __repr__(self): return "<Message %s>" % " ".join("%s=%r"%(k,v) for (k,v) in self.__dict__.items() if not k.startswith("_")) # Currently does not seem necessary # class _meta_instance_state(type): # def __init__(cls, name, bases, dct): # def special_gen(special_method): # def special_wrapper(self): # print("Calling %s" % special_method) # return getattr(getattr(self, "im_func"), special_method) # return special_wrapper # type.__init__(cls, name, bases, dct) # for i in ["__int__", "__repr__", "__str__", "__index__", "__add__", "__radd__", "__bytes__"]: # setattr(cls, i, property(special_gen(i))) class _instance_state(): def __init__(self, instance): self.im_self = instance.__self__ self.im_func = instance.__func__ self.im_class = instance.__self__.__class__ def __getattr__(self, attr): return getattr(self.im_func, attr) def __call__(self, *args, **kargs): return self.im_func(self.im_self, *args, **kargs) def breaks(self): return self.im_self.add_breakpoints(self.im_func) def intercepts(self): return self.im_self.add_interception_points(self.im_func) def unbreaks(self): return self.im_self.remove_breakpoints(self.im_func) def unintercepts(self): return self.im_self.remove_interception_points(self.im_func) ############## ## Automata ## ############## class ATMT: STATE = "State" ACTION = "Action" CONDITION = "Condition" RECV = "Receive condition" TIMEOUT = "Timeout condition" IOEVENT = "I/O event" class NewStateRequested(Exception): def __init__(self, state_func, automaton, *args, **kargs): self.func = state_func self.state = state_func.atmt_state self.initial = state_func.atmt_initial self.error = state_func.atmt_error self.final = state_func.atmt_final Exception.__init__(self, "Request state [%s]" % self.state) self.automaton = automaton self.args = args self.kargs = kargs self.action_parameters() # init action parameters def action_parameters(self, *args, **kargs): self.action_args = args self.action_kargs = kargs return self def run(self): return self.func(self.automaton, *self.args, **self.kargs) def __repr__(self): return "NewStateRequested(%s)" % self.state @staticmethod def state(initial=0,final=0,error=0): def deco(f,initial=initial, final=final): f.atmt_type = ATMT.STATE f.atmt_state = f.__name__ f.atmt_initial = initial f.atmt_final = final f.atmt_error = error # @functools.wraps(f) This is possible alternative to assigning __qualname__; it would save __doc__, too def state_wrapper(self, *args, **kargs): return ATMT.NewStateRequested(f, self, *args, **kargs) state_wrapper.__qualname__ = "%s_wrapper" % f.__name__ state_wrapper.atmt_type = ATMT.STATE state_wrapper.atmt_state = f.__name__ state_wrapper.atmt_initial = initial state_wrapper.atmt_final = final state_wrapper.atmt_error = error state_wrapper.atmt_origfunc = f return state_wrapper return deco @staticmethod def action(cond, prio=0): def deco(f,cond=cond): if not hasattr(f,"atmt_type"): f.atmt_cond = {} f.atmt_type = ATMT.ACTION f.atmt_cond[cond.atmt_condname] = prio return f return deco @staticmethod def condition(state, prio=0): def deco(f, state=state): f.atmt_type = ATMT.CONDITION f.atmt_state = state.atmt_state f.atmt_condname = f.__name__ f.atmt_prio = prio return f return deco @staticmethod def receive_condition(state, prio=0): def deco(f, state=state): f.atmt_type = ATMT.RECV f.atmt_state = state.atmt_state f.atmt_condname = f.__name__ f.atmt_prio = prio return f return deco @staticmethod def ioevent(state, name, prio=0, as_supersocket=None): def deco(f, state=state): f.atmt_type = ATMT.IOEVENT f.atmt_state = state.atmt_state f.atmt_condname = f.__name__ f.atmt_ioname = name f.atmt_prio = prio f.atmt_as_supersocket = as_supersocket return f return deco @staticmethod def timeout(state, timeout): def deco(f, state=state, timeout=timeout): f.atmt_type = ATMT.TIMEOUT f.atmt_state = state.atmt_state f.atmt_timeout = timeout f.atmt_condname = f.__name__ return f return deco class _ATMT_Command: RUN = "RUN" NEXT = "NEXT" FREEZE = "FREEZE" STOP = "STOP" END = "END" EXCEPTION = "EXCEPTION" SINGLESTEP = "SINGLESTEP" BREAKPOINT = "BREAKPOINT" INTERCEPT = "INTERCEPT" ACCEPT = "ACCEPT" REPLACE = "REPLACE" REJECT = "REJECT" class _ATMT_supersocket(SuperSocket): def __init__(self, name, ioevent, automaton, proto, args, kargs): self.name = name self.ioevent = ioevent self.proto = proto self.spa,self.spb = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM) kargs["external_fd"] = {ioevent:self.spb} self.atmt = automaton(*args, **kargs) self.atmt.runbg() def fileno(self): return self.spa.fileno() def send(self, s): if type(s) is str: s = s.encode() elif type(s) is not bytes: s = bytes(s) return self.spa.send(s) def recv(self, n=MTU): r = self.spa.recv(n) if self.proto is not None: r = self.proto(r) return r def close(self): pass class _ATMT_to_supersocket: def __init__(self, name, ioevent, automaton): self.name = name self.ioevent = ioevent self.automaton = automaton def __call__(self, proto, *args, **kargs): return _ATMT_supersocket(self.name, self.ioevent, self.automaton, proto, args, kargs) class Automaton_metaclass(type): def __new__(cls, name, bases, dct): cls = super(Automaton_metaclass, cls).__new__(cls, name, bases, dct) cls.states={} cls.state = None cls.recv_conditions={} cls.conditions={} cls.ioevents={} cls.timeout={} cls.actions={} cls.initial_states=[] cls.ionames = [] cls.iosupersockets = [] members = {} classes = [cls] while classes: c = classes.pop(0) # order is important to avoid breaking method overloading classes += list(c.__bases__) for k,v in c.__dict__.items(): if k not in members: members[k] = v decorated = [v for v in members.values() if type(v) is types.FunctionType and hasattr(v, "atmt_type")] for m in decorated: if m.atmt_type == ATMT.STATE: s = m.atmt_state cls.states[s] = m cls.recv_conditions[s]=[] cls.ioevents[s]=[] cls.conditions[s]=[] cls.timeout[s]=[] if m.atmt_initial: cls.initial_states.append(m) elif m.atmt_type in [ATMT.CONDITION, ATMT.RECV, ATMT.TIMEOUT, ATMT.IOEVENT]: cls.actions[m.atmt_condname] = [] for m in decorated: if m.atmt_type == ATMT.CONDITION: cls.conditions[m.atmt_state].append(m) elif m.atmt_type == ATMT.RECV: cls.recv_conditions[m.atmt_state].append(m) elif m.atmt_type == ATMT.IOEVENT: cls.ioevents[m.atmt_state].append(m) cls.ionames.append(m.atmt_ioname) if m.atmt_as_supersocket is not None: cls.iosupersockets.append(m) elif m.atmt_type == ATMT.TIMEOUT: cls.timeout[m.atmt_state].append((m.atmt_timeout, m)) elif m.atmt_type == ATMT.ACTION: for c in m.atmt_cond: cls.actions[c].append(m) for v in cls.timeout.values(): #v.sort(lambda (t1,f1),(t2,f2): cmp(t1,t2)) v.sort(key = lambda x: x[0]) v.append((None, None)) for v in itertools.chain(cls.conditions.values(), cls.recv_conditions.values(), cls.ioevents.values()): v.sort(key = lambda x: x.atmt_prio) for condname,actlst in cls.actions.items(): actlst.sort(key = lambda x: x.atmt_cond[condname]) for ioev in cls.iosupersockets: setattr(cls, ioev.atmt_as_supersocket, _ATMT_to_supersocket(ioev.atmt_as_supersocket, ioev.atmt_ioname, cls)) return cls def graph(self, **kargs): s = 'digraph "%s" {\n' % self.__class__.__name__ se = "" # Keep initial nodes at the begining for better rendering for st in self.states.values(): if st.atmt_initial: se = ('\t"%s" [ style=filled, fillcolor=blue, shape=box, root=true];\n' % st.atmt_state)+se elif st.atmt_final: se += '\t"%s" [ style=filled, fillcolor=green, shape=octagon ];\n' % st.atmt_state elif st.atmt_error: se += '\t"%s" [ style=filled, fillcolor=red, shape=octagon ];\n' % st.atmt_state s += se for st in self.states.values(): for n in st.atmt_origfunc.__code__.co_names+st.atmt_origfunc.__code__.co_consts: if n in self.states: s += '\t"%s" -> "%s" [ color=green ];\n' % (st.atmt_state,n) for c,k,v in ([("purple",k,v) for k,v in self.conditions.items()]+ [("red",k,v) for k,v in self.recv_conditions.items()]+ [("orange",k,v) for k,v in self.ioevents.items()]): for f in v: for n in f.__code__.co_names+f.__code__.co_consts: if n in self.states: l = f.atmt_condname for x in self.actions[f.atmt_condname]: l += "\\l>[%s]" % x.__name__ s += '\t"%s" -> "%s" [label="%s", color=%s];\n' % (k,n,l,c) for k,v in self.timeout.items(): for t,f in v: if f is None: continue for n in f.__code__.co_names+f.__code__.co_consts: if n in self.states: l = "%s/%.1fs" % (f.atmt_condname,t) for x in self.actions[f.atmt_condname]: l += "\\l>[%s]" % x.__name__ s += '\t"%s" -> "%s" [label="%s",color=blue];\n' % (k,n,l) s += "}\n" return do_graph(s, **kargs) class Automaton(metaclass = Automaton_metaclass): ## Methods to overload def parse_args(self, debug=0, store=1, **kargs): self.debug_level=debug self.socket_kargs = kargs self.store_packets = store def master_filter(self, pkt): return True def my_send(self, pkt): self.send_sock.send(pkt) ## Utility classes and exceptions class _IO_fdwrapper: def __init__(self,rd,wr): if rd is not None and type(rd) is not int: rd = rd.fileno() if wr is not None and type(wr) is not int: wr = wr.fileno() self.rd = rd self.wr = wr def fileno(self): return self.rd def read(self, n=65535): return os.read(self.rd, n) def write(self, msg): return os.write(self.wr,msg) def recv(self, n=65535): return self.read(n) def send(self, msg): return self.write(msg) class _IO_mixer: def __init__(self,rd,wr): self.rd = rd self.wr = wr def fileno(self): if type(self.rd) is int: return self.rd return self.rd.fileno() def recv(self, n=None): return self.rd.recv(n) def read(self, n=None): return self.rd.recv(n) def send(self, msg): return self.wr.send(msg) def write(self, msg): return self.wr.send(msg) class AutomatonException(Exception): def __init__(self, msg, state=None, result=None): Exception.__init__(self, msg) self.state = state self.result = result class AutomatonError(AutomatonException): pass class ErrorState(AutomatonException): pass class Stuck(AutomatonException): pass class AutomatonStopped(AutomatonException): pass class Breakpoint(AutomatonStopped): pass class Singlestep(AutomatonStopped): pass class InterceptionPoint(AutomatonStopped): def __init__(self, msg, state=None, result=None, packet=None): Automaton.AutomatonStopped.__init__(self, msg, state=state, result=result) self.packet = packet class CommandMessage(AutomatonException): pass ## Services def debug(self, lvl, msg): if self.debug_level >= lvl: log_interactive.debug(msg) def send(self, pkt): if self.state.state in self.interception_points: self.debug(3,"INTERCEPT: packet intercepted: %s" % pkt.summary()) self.intercepted_packet = pkt cmd = Message(type = _ATMT_Command.INTERCEPT, state=self.state, pkt=pkt) self.cmdout.send(cmd) cmd = self.cmdin.recv() self.intercepted_packet = None if cmd.type == _ATMT_Command.REJECT: self.debug(3,"INTERCEPT: packet rejected") return elif cmd.type == _ATMT_Command.REPLACE: pkt = cmd.pkt self.debug(3,"INTERCEPT: packet replaced by: %s" % pkt.summary()) elif cmd.type == _ATMT_Command.ACCEPT: self.debug(3,"INTERCEPT: packet accepted") else: raise self.AutomatonError("INTERCEPT: unkown verdict: %r" % cmd.type) self.my_send(pkt) self.debug(3,"SENT : %s" % pkt.summary()) self.packets.append(pkt.copy()) ## Internals def __init__(self, *args, **kargs): external_fd = kargs.pop("external_fd",{}) self.send_sock_class = kargs.pop("ll", conf.L3socket) self.started = _thread.allocate_lock() self.threadid = None self.breakpointed = None self.breakpoints = set() self.interception_points = set() self.intercepted_packet = None self.debug_level=0 self.init_args=args self.init_kargs=kargs self.io = type.__new__(type, "IOnamespace",(),{}) self.oi = type.__new__(type, "IOnamespace",(),{}) self.cmdin = ObjectPipe() self.cmdout = ObjectPipe() self.ioin = {} self.ioout = {} for n in self.ionames: extfd = external_fd.get(n) if type(extfd) is not tuple: extfd = (extfd,extfd) ioin,ioout = extfd if ioin is None: ioin = ObjectPipe() #elif type(ioin) is not types.InstanceType: else: #print(type(ioin)) ioin = self._IO_fdwrapper(ioin,None) if ioout is None: ioout = ObjectPipe() #elif type(ioout) is not types.InstanceType: else: #print(type(ioout)) ioout = self._IO_fdwrapper(None,ioout) self.ioin[n] = ioin self.ioout[n] = ioout ioin.ioname = n ioout.ioname = n setattr(self.io, n, self._IO_mixer(ioout,ioin)) setattr(self.oi, n, self._IO_mixer(ioin,ioout)) for stname in self.states: setattr(self, stname, _instance_state(getattr(self, stname))) self.parse_args(*args, **kargs) self.start() def __iter__(self): return self def __del__(self): self.stop() def _run_condition(self, cond, *args, **kargs): try: self.debug(5, "Trying %s [%s]" % (cond.atmt_type, cond.atmt_condname)) cond(self,*args, **kargs) except ATMT.NewStateRequested as state_req: self.debug(2, "%s [%s] taken to state [%s]" % (cond.atmt_type, cond.atmt_condname, state_req.state)) if cond.atmt_type == ATMT.RECV: self.packets.append(args[0]) for action in self.actions[cond.atmt_condname]: self.debug(2, " + Running action [%s]" % action.__name__) action(self, *state_req.action_args, **state_req.action_kargs) raise except Exception as e: self.debug(2, "%s [%s] raised exception [%s]" % (cond.atmt_type, cond.atmt_condname, e)) raise else: self.debug(2, "%s [%s] not taken" % (cond.atmt_type, cond.atmt_condname)) def _do_start(self, *args, **kargs): _thread.start_new_thread(self._do_control, args, kargs) def _do_control(self, *args, **kargs): with self.started: self.threadid = _thread.get_ident() # Update default parameters a = args+self.init_args[len(args):] k = self.init_kargs.copy() k.update(kargs) self.parse_args(*a,**k) # Start the automaton self.state=self.initial_states[0](self) self.send_sock = self.send_sock_class() self.listen_sock = conf.L2listen(**self.socket_kargs) self.packets = PacketList(name="session[%s]"%self.__class__.__name__) singlestep = True iterator = self._do_iter() self.debug(3, "Starting control thread [tid=%i]" % self.threadid) try: while True: c = self.cmdin.recv() self.debug(5, "Received command %s" % c.type) if c.type == _ATMT_Command.RUN: singlestep = False elif c.type == _ATMT_Command.NEXT: singlestep = True elif c.type == _ATMT_Command.FREEZE: continue elif c.type == _ATMT_Command.STOP: break while True: state = next(iterator) if isinstance(state, self.CommandMessage): break elif isinstance(state, self.Breakpoint): c = Message(type=_ATMT_Command.BREAKPOINT,state=state) self.cmdout.send(c) break if singlestep: c = Message(type=_ATMT_Command.SINGLESTEP,state=state) self.cmdout.send(c) break except StopIteration as e: c = Message(type=_ATMT_Command.END, result=e.args[0]) self.cmdout.send(c) except Exception as e: self.debug(3, "Transfering exception [%s] from tid=%i"% (e,self.threadid)) m = Message(type = _ATMT_Command.EXCEPTION, exception=e, exc_info=sys.exc_info()) self.cmdout.send(m) self.debug(3, "Stopping control thread (tid=%i)"%self.threadid) self.threadid = None def _do_iter(self): while True: try: self.debug(1, "## state=[%s]" % self.state.state) # Entering a new state. First, call new state function if self.state.state in self.breakpoints and self.state.state != self.breakpointed: self.breakpointed = self.state.state yield self.Breakpoint("breakpoint triggered on state %s" % self.state.state, state = self.state.state) self.breakpointed = None state_output = self.state.run() if self.state.error: raise self.ErrorState("Reached %s: [%r]" % (self.state.state, state_output), result=state_output, state=self.state.state) if self.state.final: raise StopIteration(state_output) if state_output is None: state_output = () elif type(state_output) is not list: state_output = state_output, # Then check immediate conditions for cond in self.conditions[self.state.state]: self._run_condition(cond, *state_output) # If still there and no conditions left, we are stuck! if ( len(self.recv_conditions[self.state.state]) == 0 and len(self.ioevents[self.state.state]) == 0 and len(self.timeout[self.state.state]) == 1 ): raise self.Stuck("stuck in [%s]" % self.state.state, state=self.state.state, result=state_output) # Finally listen and pay attention to timeouts expirations = iter(self.timeout[self.state.state]) next_timeout,timeout_func = next(expirations) t0 = time.time() fds = [self.cmdin] if len(self.recv_conditions[self.state.state]) > 0: fds.append(self.listen_sock) for ioev in self.ioevents[self.state.state]: fds.append(self.ioin[ioev.atmt_ioname]) while 1: t = time.time()-t0 if next_timeout is not None: if next_timeout <= t: self._run_condition(timeout_func, *state_output) next_timeout,timeout_func = next(expirations) if next_timeout is None: remain = None else: remain = next_timeout-t self.debug(5, "Select on %r" % fds) r,_,_ = select(fds,[],[],remain) self.debug(5, "Selected %r" % r) for fd in r: self.debug(5, "Looking at %r" % fd) if fd == self.cmdin: yield self.CommandMessage("Received command message") elif fd == self.listen_sock: pkt = self.listen_sock.recv(MTU) if pkt is not None: if self.master_filter(pkt): self.debug(3, "RECVD: %s" % pkt.summary()) for rcvcond in self.recv_conditions[self.state.state]: self._run_condition(rcvcond, pkt, *state_output) else: self.debug(4, "FILTR: %s" % pkt.summary()) else: self.debug(3, "IOEVENT on %s" % fd.ioname) for ioevt in self.ioevents[self.state.state]: if ioevt.atmt_ioname == fd.ioname: self._run_condition(ioevt, fd, *state_output) except ATMT.NewStateRequested as state_req: self.debug(2, "switching from [%s] to [%s]" % (self.state.state,state_req.state)) self.state = state_req yield state_req ## Public API def add_interception_points(self, *ipts): for ipt in ipts: if hasattr(ipt,"atmt_state"): ipt = ipt.atmt_state self.interception_points.add(ipt) def remove_interception_points(self, *ipts): for ipt in ipts: if hasattr(ipt,"atmt_state"): ipt = ipt.atmt_state self.interception_points.discard(ipt) def add_breakpoints(self, *bps): for bp in bps: if hasattr(bp,"atmt_state"): bp = bp.atmt_state self.breakpoints.add(bp) def remove_breakpoints(self, *bps): for bp in bps: if hasattr(bp,"atmt_state"): bp = bp.atmt_state self.breakpoints.discard(bp) def start(self, *args, **kargs): if not self.started.locked(): self._do_start(*args, **kargs) def run(self, resume=None, wait=True): if resume is None: resume = Message(type = _ATMT_Command.RUN) self.cmdin.send(resume) if wait: try: c = self.cmdout.recv() except KeyboardInterrupt: self.cmdin.send(Message(type = _ATMT_Command.FREEZE)) return if c.type == _ATMT_Command.END: return c.result elif c.type == _ATMT_Command.INTERCEPT: raise self.InterceptionPoint("packet intercepted", state=c.state.state, packet=c.pkt) elif c.type == _ATMT_Command.SINGLESTEP: raise self.Singlestep("singlestep state=[%s]"%c.state.state, state=c.state.state) elif c.type == _ATMT_Command.BREAKPOINT: raise self.Breakpoint("breakpoint triggered on state [%s]"%c.state.state, state=c.state.state) elif c.type == _ATMT_Command.EXCEPTION: raise c.exc_info[0](c.exc_info[1]) #raise c.exc_info[0],c.exc_info[1],c.exc_info[2] def runbg(self, resume=None, wait=False): self.run(resume, wait) def next(self): return self.run(resume = Message(type=_ATMT_Command.NEXT)) def stop(self): self.cmdin.send(Message(type=_ATMT_Command.STOP)) with self.started: # Flush command pipes while True: r,_,_ = select([self.cmdin, self.cmdout],[],[],0) if not r: break for fd in r: fd.recv() def restart(self, *args, **kargs): self.stop() self.start(*args, **kargs) def accept_packet(self, pkt=None, wait=False): rsm = Message() if pkt is None: rsm.type = _ATMT_Command.ACCEPT else: rsm.type = _ATMT_Command.REPLACE rsm.pkt = pkt return self.run(resume=rsm, wait=wait) def reject_packet(self, wait=False): rsm = Message(type = _ATMT_Command.REJECT) return self.run(resume=rsm, wait=wait)
{ "content_hash": "f43d6d2127ff65416a3fd97345b590d3", "timestamp": "", "source": "github", "line_count": 748, "max_line_length": 121, "avg_line_length": 38.00133689839572, "alnum_prop": 0.5095866314863676, "repo_name": "kisel/trex-core", "id": "cd32b5c05e94e0431f2d9a407f7b43490e6ab740", "size": "28624", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "scripts/external_libs/scapy-2.3.1/python3/scapy/automaton.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "16355010" }, { "name": "C++", "bytes": "4832431" }, { "name": "CMake", "bytes": "8882" }, { "name": "CSS", "bytes": "333" }, { "name": "HTML", "bytes": "5012" }, { "name": "JavaScript", "bytes": "1234" }, { "name": "Makefile", "bytes": "163741" }, { "name": "Python", "bytes": "12389428" }, { "name": "Shell", "bytes": "22573" } ] }
.class public Landroid/widget/Gallery$LayoutParams; .super Landroid/view/ViewGroup$LayoutParams; .source "Gallery.java" # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Landroid/widget/Gallery; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x9 name = "LayoutParams" .end annotation # direct methods .method public constructor <init>(II)V .locals 0 .parameter "w" .parameter "h" .prologue .line 1479 invoke-direct {p0, p1, p2}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V .line 1480 return-void .end method .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V .locals 0 .parameter "c" .parameter "attrs" .prologue .line 1475 invoke-direct {p0, p1, p2}, Landroid/view/ViewGroup$LayoutParams;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V .line 1476 return-void .end method .method public constructor <init>(Landroid/view/ViewGroup$LayoutParams;)V .locals 0 .parameter "source" .prologue .line 1483 invoke-direct {p0, p1}, Landroid/view/ViewGroup$LayoutParams;-><init>(Landroid/view/ViewGroup$LayoutParams;)V .line 1484 return-void .end method
{ "content_hash": "7fba4be370a912c8138954b01c201ac9", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 132, "avg_line_length": 23.685185185185187, "alnum_prop": 0.7161845191555903, "repo_name": "baidurom/devices-onex", "id": "24f40e06341ebee55c3d2bcbf49a4491fb21eeb8", "size": "1279", "binary": false, "copies": "1", "ref": "refs/heads/coron-4.0", "path": "framework.jar.out/smali/android/widget/Gallery$LayoutParams.smali", "mode": "33188", "license": "apache-2.0", "language": [] }
package dice; import javafx.scene.paint.Color; import dice.abstractDice.SixSidedDie; import dice.enums.Face; public class SetbackDie extends SixSidedDie { public SetbackDie() { faces = createSixSidedDie(Face.EMPTY, Face.EMPTY, Face.FAILURE, Face.FAILURE, Face.THREAT, Face.THREAT); } @Override public Color getColor() { return Color.BLACK; } @Override public Boolean isPositive() { return false; } }
{ "content_hash": "369d03bfc671421a4a74597a324ba830", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 106, "avg_line_length": 18.26086956521739, "alnum_prop": 0.7428571428571429, "repo_name": "ijt002/eote_dice_roller", "id": "76587ec1ea5779e89d06420f894f9922a5bbd1e3", "size": "420", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/dice/SetbackDie.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1087" }, { "name": "Java", "bytes": "36443" } ] }
package org.assertj.core.error; import org.assertj.core.internal.ComparisonStrategy; import org.assertj.core.internal.StandardComparisonStrategy; /** * Creates an error message indicating that an assertion that verifies that a {@code CharSequence} contains a sequence of * several {@code CharSequence}s in order failed. * * @author Joel Costigliola * @author Mikhail Mazursky */ public class ShouldContainCharSequenceSequence extends BasicErrorMessageFactory { /** * Creates a new <code>{@link ShouldContainCharSequenceSequence}</code>. * * @param actual the actual value in the failed assertion. * @param strings the sequence of values expected to be in {@code actual}. * @return the created {@code ErrorMessageFactory}. */ public static ErrorMessageFactory shouldContainSequence(CharSequence actual, CharSequence[] strings, int firstBadOrderIndex) { return shouldContainSequence(actual, strings, firstBadOrderIndex, StandardComparisonStrategy.instance()); } /** * Creates a new <code>{@link ShouldContainCharSequenceSequence}</code>. * * @param actual the actual value in the failed assertion. * @param strings the sequence of values expected to be in {@code actual}. * @param comparisonStrategy the {@link ComparisonStrategy} used to evaluate assertion. * @return the created {@code ErrorMessageFactory}. */ public static ErrorMessageFactory shouldContainSequence(CharSequence actual, CharSequence[] strings, int badOrderIndex, ComparisonStrategy comparisonStrategy) { return new ShouldContainCharSequenceSequence( "%nExpecting:%n <%s>%nto contain the following CharSequences in this order:%n <%s>%nbut <%s> was found before <%s>%n%s", actual, strings, strings[badOrderIndex + 1], strings[badOrderIndex], comparisonStrategy); } private ShouldContainCharSequenceSequence(String format, CharSequence actual, CharSequence[] strings, CharSequence foundButBadOrder, CharSequence foundButBadOrder2, ComparisonStrategy comparisonStrategy) { super(format, actual, strings, foundButBadOrder, foundButBadOrder2, comparisonStrategy); } }
{ "content_hash": "9c42068c4254ebb4f1769a9a1a97a2f4", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 163, "avg_line_length": 46.02040816326531, "alnum_prop": 0.7250554323725056, "repo_name": "bric3/assertj-core", "id": "151c17992e03638c1efa615688f78d21c758fc4e", "size": "2862", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/assertj/core/error/ShouldContainCharSequenceSequence.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "9194670" }, { "name": "Shell", "bytes": "40820" } ] }
package edu.illinois.my.wiki.portlet.action.result; import javax.portlet.RenderRequest; public interface ActionResult { String sendToJsp(RenderRequest request); boolean isFirstVisit(); }
{ "content_hash": "f721cbc008872613a62ddcb79b552349", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 51, "avg_line_length": 19.9, "alnum_prop": 0.7788944723618091, "repo_name": "drewwills/confluence-portlet", "id": "8478415d8e73605aaeeadbc62467ebbc310f912f", "size": "966", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WikiPortlet/src/main/java/edu/illinois/my/wiki/portlet/action/result/ActionResult.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2222" }, { "name": "Java", "bytes": "274262" } ] }
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="42dip" > <TextView android:id="@+id/callToAction" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:text="@string/callToAction" android:textColor="#b11a12" android:textSize="42dip" /> <TextView android:id="@+id/invite" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_above="@id/callToAction" android:text="@string/invite" android:textSize="23dip" /> <TextView android:id="@+id/phonenumber" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/callToAction" android:layout_centerHorizontal="true" android:textSize="55dip" android:textStyle="bold" /> </RelativeLayout>
{ "content_hash": "ae9f2f431367b60391ef2cb7fa61915d", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 74, "avg_line_length": 31.56756756756757, "alnum_prop": 0.7037671232876712, "repo_name": "orangeman/AutoAuf", "id": "e351c58f2f0d9113868f213acfba550660a85748", "size": "1168", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "res/layout/close.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "9534" } ] }
"""wIcon is an image generation and manipulation library""" from __future__ import absolute_import, division, print_function, with_statement # version is a human-readable version number. # version_info is a four-tuple for programmatic comparison. The first # three numbers are the components of the version number. The fourth # is zero for an official release, positive for a development branch, # or negative for a release candidate or beta (after the base version # number has been incremented) version = "0.1.dev1" version_info = (0, 1, 0, -100)
{ "content_hash": "8d0bb4420cde0639e95a1aaed6b3204c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 80, "avg_line_length": 42.46153846153846, "alnum_prop": 0.7626811594202898, "repo_name": "Wudan07/wIcon", "id": "1d612b72faf68e99aa1587edf24452d5fd2e6010", "size": "677", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wicon/__init__.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "194371" } ] }
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title></title> <link rel="Stylesheet" href="../css/analysis.css" /> <script type="text/javascript"> function init() { if (window.location.hash) { var parentDiv, nodes, i, helpInfo, helpId, helpInfoArr, helpEnvFilter, envContent, hideEnvClass, hideNodes; helpInfo = window.location.hash.substring(1); if(helpInfo.indexOf("-")) { helpInfoArr = helpInfo.split("-"); helpId = helpInfoArr[0]; helpEnvFilter = helpInfoArr[1]; } else { helpId = helpInfo; } parentDiv = document.getElementById("topics"); nodes = parentDiv.children; hideEnvClass = (helpEnvFilter === "OnlineOnly"? "PortalOnly": "OnlineOnly"); if(document.getElementsByClassName) { hideNodes = document.getElementsByClassName(hideEnvClass); } else { hideNodes = document.querySelectorAll(hideEnvClass); } for(i=0; i < nodes.length; i++) { if(nodes[i].id !== helpId) { nodes[i].style.display ="none"; } } for(i=0; i < hideNodes.length; i++) { hideNodes[i].style.display ="none"; } } } </script> </head> <body onload="init()"> <div id="topics"> <div id="toolDescription" class="largesize"> <h2>Aggregér punkter</h2><p/> <h2><img src="../images/GUID-60C59C66-3038-4D0E-8F6A-EC6C53FEAA02-web.png" alt="Aggreg&eacute;r punkter"></h2> <hr/> <p>Dette v&aelig;rkt&oslash;j arbejder med et lag af punktobjekter og et lag med omr&aring;deobjekter. Det bestemmer f&oslash;rst, hvilke punkter der ligger inden for hvert omr&aring;de. N&aring;r denne punkt-i-omr&aring;de spatiale relation er bestemt, beregnes statistik om alle punkter i omr&aring;det og denne statistik tildeles omr&aring;det. Den mest grundl&aelig;ggende statistik er opt&aelig;llingen af punkterne i omr&aring;det, men du kan ogs&aring; generere anden statistik. </p> <p>Forestil dig for eksempel, at du har punktobjekter med placeringer af caf&eacute;er og omr&aring;deobjekter med regioner, og du &oslash;nsker at skabe en oversigt over det samlede salg i caf&eacute;er pr. region. Under foruds&aelig;tning af at caf&eacute;erne har en <i>TOTAL_SALES</i>-attribut, kan du f&aring; summen af alt <i>TOTAL_SALES</i> inden for hver region eller minimum- eller maksimum- <i>TOTAL_SALES</i> inden for hver region eller standardafvigelsen for det samlede salg i hver region. </p> <p>Resultatet er et kort, hvor farven i hvert omr&aring;de er baseret p&aring; det samlede antal punkter i omr&aring;det inddelt efter omr&aring;dets st&oslash;rrelse. Opdelingen i opt&aelig;llinger pr. omr&aring;de er kendt som &quot;normalisering&quot;, og det er en teknik, som kartografer altid benytter til at f&aring; vist data inddelt efter omr&aring;de. Med &quot;normalisering&quot; bliver det lettere at forst&aring; geografiske m&oslash;nstre, fordi st&oslash;rrelsen p&aring; omr&aring;det tages i betragtning, n&aring;r omr&aring;der sammenlignes visuelt med andre omr&aring;der </p> <p>Hvis feltet <b>Brug aktuel kortudstr&aelig;kning</b> er markeret, er det kun objekterne i det inputpunktlag og omr&aring;delag, der er synligt inden for den aktuelle kortudstr&aelig;kning, der analyseres. Hvis feltet ikke er markeret, analyseres alle objekter i b&aring;de inputpunktlaget og omr&aring;delaget, ogs&aring; selvom de befinder sig uden for den aktuelle kortudstr&aelig;kning. </p> </div> <!--Parameter divs for each param--> <div id="pointLayer"> <div><h2>Vælg det lag, der indeholder punkter, som skal aggregeres til områder</h2></div> <hr/> <div> <p>Det punktlag, der skal aggregeres til omr&aring;der. </p> <p class="OnlineOnly">Ud over at v&aelig;lge et lag fra dit kort kan du v&aelig;lge <b>V&aelig;lg Living Atlas-analyselag</b> eller <b>V&aelig;lg analyselag</b> nederst p&aring; rullelisten. Dette &aring;bner et galleri med en samling lag, der er nyttige til mange analysetyper. </p> </div> </div> <div id="polygonLayer"> <div><h2>Vælg det lag, der indeholder aggregeringsområder</h2></div> <hr/> <div> <p>Det omr&aring;delag, som punkterne bliver aggregeret til. Alle de punkter, der falder inden for omr&aring;degr&aelig;nserne i dette lag, vil blive talt med og vil muligvis indg&aring; i oversigten ud fra dine statistikvalg. </p> <p class="OnlineOnly">Ud over at v&aelig;lge et lag fra dit kort kan du v&aelig;lge <b>V&aelig;lg Living Atlas-analyselag</b> eller <b>V&aelig;lg analyselag</b> nederst p&aring; rullelisten. Dette &aring;bner et galleri med en samling lag, der er nyttige til mange analysetyper. </p> </div> </div> <div id="KeepBoundaryNoPoints"> <div><h2>Bevar områder uden punkter.</h2></div> <hr/> <div> <p>Det bestemmes, om omr&aring;der, der ikke indeholder nogen punkter, vil blive vist i resultatlaget. Hvis feltet ikke er markeret, vil omr&aring;der uden punkter ikke blive vist i resultatlaget. Hvis feltet er markeret, vil omr&aring;der uden punkter bliver vist i resultatlaget. </p> </div> </div> <div id="SummaryFields"> <div><h2>Tilføj statistik</h2></div> <hr/> <div> <p>Du kan beregne statistik om attributter for tilf&oslash;jede punktlag s&aring;som sum, middelv&aelig;rdi, minimumsv&aelig;rdi, makimumsv&aelig;rdi og standardafvigelse. Resultatlaget vil indeholde en ny attribut for hver beregnet statistik. Du kan tilf&oslash;je et vilk&aring;rligt antal statistikker ved at v&aelig;lge attributter og statistikker (der vises en ny rulleliste). </p> </div> </div> <div id="GroupByField"> <div><h2>Vælg felt at gruppere efter</h2></div> <hr/> <div> <p> Du kan oprette statistiske grupper ved hj&aelig;lp af en attribut i inputpunktlaget. Hvis du f.eks. aggregerer kriminalitet i forhold til lokalomr&aring;degr&aelig;nser, kan du have en attribut med navnet <i>Crime_type</i> med fem forskellige kriminalitetstyper. Hver entydig kriminalitetstype danner en gruppe, og den statistik, du v&aelig;lger, vil blive beregnet for hver entydig v&aelig;rdi for <i>Crime_type</i>. Statistikkerne for de enkelte grupper tillige med antallet af punkter vises i pop-up'en med resultatlaget. N&aring;r du v&aelig;lger en grupperingsattribut, fremkommer der to resultater: resultatlaget og en resultattabel med statistik for hver entydig gruppe. </p> </div> </div> <div id="MinorityMajority"> <div><h2>Tilføj minoritet, majoritet</h2></div> <hr/> <div> <p>Dette afkrydsningsfelt er markeret, n&aring;r du v&aelig;lger et felt, der skal grupperes efter. V&aelig;lg <b>Tilf&oslash;j minoritet/majoritet</b>, hvis du vil vide, hvilke attributv&aelig;rdier i hver gruppe, der er minoriteten (mindst dominante) eller majoriteten (mest dominante), inden for hver gr&aelig;nse. Der f&oslash;jes to nye felter til dit resultatlag, n&aring;r du v&aelig;lger <b>Tilf&oslash;j minoritet/majoritet</b>. Hvis du ogs&aring; v&aelig;lger <b>Tilf&oslash;j procentdele</b>, f&oslash;jes der yderligere to felter til resultatlaget, som indeholder procentdele af attributv&aelig;rdierne for minoritet og majoritet inden for de enkelte grupper. </p> <p>Hvis du f.eks. er byplanl&aelig;gger og &oslash;nsker at vide, hvilke tre arter der er f&aelig;rrest af, og hvilke der er flest af i alle byens parker, kan du aggregere dine data om tr&aelig;er med dine parkomr&aring;der og markere denne indstilling. </p> </div> </div> <div id="PercentPoints"> <div><h2>Tilføj procentdele</h2></div> <hr/> <div> <p>Dette afkrydsningsfelt er markeret, n&aring;r du v&aelig;lger et felt, der skal grupperes efter. V&aelig;lg <b>Tilf&oslash;j procentdele</b>, hvis du vil finde procentdelen af hver attributv&aelig;rdi i hver gruppe. Der f&oslash;jes et nyt felt til resultattabellen, der indeholder procentdelen af hver attributv&aelig;rdi inden for hver gruppe. Hvis du ogs&aring; v&aelig;lger <b>Tilf&oslash;j minoritet/majoritet</b>, f&oslash;jes der yderligere to felter til resultatlaget, som indeholder procentdele af attributv&aelig;rdierne for minoritet og majoritet inden for de enkelte grupper. </p> </div> </div> <div id="OutputLayer"> <div><h2>Navn på resultatlag</h2></div> <hr/> <div> <p>Dette er navnet p&aring; det lag, som oprettes i <b>Mit indhold</b> og f&oslash;jes til kortet. Standardnavnet er baseret p&aring; navnet p&aring; v&aelig;rkt&oslash;jet og navnet p&aring; inputlaget. Hvis laget allerede findes, vil du blive bedt om at angive et andet navn. </p> <p>Ved hj&aelig;lp af rullelisten <b>Gem resultat i</b> kan du angive navnet p&aring; en mappe i <b>Mit indhold</b>, hvor resultatet skal gemmes. </p> </div> </div> </div> </html>
{ "content_hash": "7b9f352c8b87b879f1ef50b01260e678", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 695, "avg_line_length": 73.37121212121212, "alnum_prop": 0.6524522457408364, "repo_name": "darklilium/Factigis_2", "id": "da00a89f79b1de1d831fc6891c482e296732fa2b", "size": "9696", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "arcgis_js_api/library/3.17/3.17/esri/dijit/analysis/help/da/AggregatePoints.html", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "39908" }, { "name": "Batchfile", "bytes": "3178" }, { "name": "CSS", "bytes": "1885995" }, { "name": "HTML", "bytes": "21011190" }, { "name": "JavaScript", "bytes": "1065201" }, { "name": "PHP", "bytes": "76208" }, { "name": "Ruby", "bytes": "1264" }, { "name": "Shell", "bytes": "2052" }, { "name": "XSLT", "bytes": "94766" } ] }
<?php /** * DO NOT EDIT THIS FILE! * * This file was automatically generated from external sources. * * Any manual change here will be lost the next time the SDK * is updated. You've been warned! */ namespace DTS\eBaySDK\ProductMetadata\Types; /** * * @property string $categoryId * @property string[] $dataset */ class GetProductSearchNamesRequest extends \DTS\eBaySDK\ProductMetadata\Types\BaseServiceRequest { /** * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ 'categoryId' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'categoryId' ], 'dataset' => [ 'type' => 'string', 'repeatable' => true, 'attribute' => false, 'elementName' => 'dataset' ] ]; /** * @param array $values Optional properties and values to assign to the object. */ public function __construct(array $values = []) { list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); parent::__construct($parentValues); if (!array_key_exists(__CLASS__, self::$properties)) { self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); } if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) { self::$xmlNamespaces[__CLASS__] = 'xmlns="http://www.ebay.com/marketplace/marketplacecatalog/v1/services"'; } if (!array_key_exists(__CLASS__, self::$requestXmlRootElementNames)) { self::$requestXmlRootElementNames[__CLASS__] = 'getProductSearchNamesRequest'; } $this->setValues(__CLASS__, $childValues); } }
{ "content_hash": "66e95e9032cf11bf013a885784175e9a", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 119, "avg_line_length": 30.081967213114755, "alnum_prop": 0.5896457765667575, "repo_name": "davidtsadler/ebay-sdk-php", "id": "8e5d9b5ed65937f7a7e590d52d0543abe29fd824", "size": "1835", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ProductMetadata/Types/GetProductSearchNamesRequest.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "10944" }, { "name": "PHP", "bytes": "9958599" } ] }
"use strict"; var _path = require("./path"); var _gatsbyDependents = require("./gatsby-dependents"); var _webpackUtils = require("./webpack-utils"); var _localEslintConfigFinder = require("./local-eslint-config-finder"); require(`v8-compile-cache`); const crypto = require(`crypto`); const fs = require(`fs-extra`); const path = require(`path`); const dotenv = require(`dotenv`); const PnpWebpackPlugin = require(`pnp-webpack-plugin`); const { store } = require(`../redux`); const { actions } = require(`../redux/actions`); const { getPublicPath } = require(`./get-public-path`); const debug = require(`debug`)(`gatsby:webpack-config`); const report = require(`gatsby-cli/lib/reporter`); const apiRunnerNode = require(`./api-runner-node`); const FRAMEWORK_BUNDLES = [`react`, `react-dom`, `scheduler`, `prop-types`]; // Four stages or modes: // 1) develop: for `gatsby develop` command, hot reload and CSS injection into page // 2) develop-html: same as develop without react-hmre in the babel config for html renderer // 3) build-javascript: Build JS and CSS chunks for production // 4) build-html: build all HTML files module.exports = async (program, directory, suppliedStage, port, { parentSpan } = {}) => { const modulesThatUseGatsby = await (0, _gatsbyDependents.getGatsbyDependents)(); const directoryPath = (0, _path.withBasePath)(directory); process.env.GATSBY_BUILD_STAGE = suppliedStage; // We combine develop & develop-html stages for purposes of generating the // webpack config. const stage = suppliedStage; const { rules, loaders, plugins } = (0, _webpackUtils.createWebpackUtils)(stage, program); const { assetPrefix, pathPrefix } = store.getState().config; const publicPath = getPublicPath({ assetPrefix, pathPrefix, ...program }); function processEnv(stage, defaultNodeEnv) { debug(`Building env for "${stage}"`); // node env should be DEVELOPMENT | PRODUCTION as these are commonly used in node land // this variable is used inside webpack const nodeEnv = process.env.NODE_ENV || `${defaultNodeEnv}`; // config env is dependant on the env that it's run, this can be anything from staging-production // this allows you to set use different .env environments or conditions in gatsby files const configEnv = process.env.GATSBY_ACTIVE_ENV || nodeEnv; const envFile = path.join(process.cwd(), `./.env.${configEnv}`); let parsed = {}; try { parsed = dotenv.parse(fs.readFileSync(envFile, { encoding: `utf8` })); } catch (err) { if (err.code !== `ENOENT`) { report.error(`There was a problem processing the .env file (${envFile})`, err); } } const envObject = Object.keys(parsed).reduce((acc, key) => { acc[key] = JSON.stringify(parsed[key]); return acc; }, {}); const gatsbyVarObject = Object.keys(process.env).reduce((acc, key) => { if (key.match(/^GATSBY_/)) { acc[key] = JSON.stringify(process.env[key]); } return acc; }, {}); // Don't allow overwriting of NODE_ENV, PUBLIC_DIR as to not break gatsby things envObject.NODE_ENV = JSON.stringify(nodeEnv); envObject.PUBLIC_DIR = JSON.stringify(`${process.cwd()}/public`); envObject.BUILD_STAGE = JSON.stringify(stage); envObject.CYPRESS_SUPPORT = JSON.stringify(process.env.CYPRESS_SUPPORT); const mergedEnvVars = Object.assign(envObject, gatsbyVarObject); return Object.keys(mergedEnvVars).reduce((acc, key) => { acc[`process.env.${key}`] = mergedEnvVars[key]; return acc; }, { "process.env": JSON.stringify({}) }); } function getHmrPath() { // ref: https://github.com/gatsbyjs/gatsby/issues/8348 let hmrBasePath = `/`; const hmrSuffix = `__webpack_hmr&reload=true&overlay=false`; if (process.env.GATSBY_WEBPACK_PUBLICPATH) { const pubPath = process.env.GATSBY_WEBPACK_PUBLICPATH; if (pubPath.substr(-1) === `/`) { hmrBasePath = pubPath; } else { hmrBasePath = (0, _path.withTrailingSlash)(pubPath); } } return hmrBasePath + hmrSuffix; } debug(`Loading webpack config for stage "${stage}"`); function getOutput() { switch (stage) { case `develop`: return { path: directory, filename: `[name].js`, // Add /* filename */ comments to generated require()s in the output. pathinfo: true, // Point sourcemap entries to original disk location (format as URL on Windows) publicPath: process.env.GATSBY_WEBPACK_PUBLICPATH || `/`, devtoolModuleFilenameTemplate: info => path.resolve(info.absoluteResourcePath).replace(/\\/g, `/`), // Avoid React cross-origin errors // See https://reactjs.org/docs/cross-origin-errors.html crossOriginLoading: `anonymous` }; case `build-html`: case `develop-html`: // A temp file required by static-site-generator-plugin. See plugins() below. // Deleted by build-html.js, since it's not needed for production. return { path: directoryPath(`public`), filename: `render-page.js`, libraryTarget: `umd`, library: `lib`, umdNamedDefine: true, globalObject: `this`, publicPath: (0, _path.withTrailingSlash)(publicPath) }; case `build-javascript`: return { filename: `[name]-[contenthash].js`, chunkFilename: `[name]-[contenthash].js`, path: directoryPath(`public`), publicPath: (0, _path.withTrailingSlash)(publicPath) }; default: throw new Error(`The state requested ${stage} doesn't exist.`); } } function getEntry() { switch (stage) { case `develop`: return { commons: [require.resolve(`event-source-polyfill`), `${require.resolve(`webpack-hot-middleware/client`)}?path=${getHmrPath()}`, directoryPath(`.cache/app`)] }; case `develop-html`: return { main: directoryPath(`.cache/develop-static-entry`) }; case `build-html`: return { main: directoryPath(`.cache/static-entry`) }; case `build-javascript`: return { app: directoryPath(`.cache/production-app`) }; default: throw new Error(`The state requested ${stage} doesn't exist.`); } } function getPlugins() { let configPlugins = [plugins.moment(), // Add a few global variables. Set NODE_ENV to production (enables // optimizations for React) and what the link prefix is (__PATH_PREFIX__). plugins.define({ ...processEnv(stage, `development`), __BASE_PATH__: JSON.stringify(program.prefixPaths ? pathPrefix : ``), __PATH_PREFIX__: JSON.stringify(program.prefixPaths ? publicPath : ``), __ASSET_PREFIX__: JSON.stringify(program.prefixPaths ? assetPrefix : ``) })]; switch (stage) { case `develop`: configPlugins = configPlugins.concat([process.env.GATSBY_HOT_LOADER === `fast-refresh` && plugins.fastRefresh(), plugins.hotModuleReplacement(), plugins.noEmitOnErrors(), plugins.eslintGraphqlSchemaReload()]).filter(Boolean); break; case `build-javascript`: { configPlugins = configPlugins.concat([plugins.extractText(), // Write out stats object mapping named dynamic imports (aka page // components) to all their async chunks. plugins.extractStats()]); break; } } return configPlugins; } function getDevtool() { switch (stage) { case `develop`: return `cheap-module-source-map`; // use a normal `source-map` for the html phases since // it gives better line and column numbers case `develop-html`: case `build-html`: case `build-javascript`: return `source-map`; default: return false; } } function getMode() { switch (stage) { case `build-javascript`: return `production`; case `develop`: case `develop-html`: case `build-html`: return `development`; // So we don't uglify the html bundle default: return `production`; } } function getModule() { // Common config for every env. // prettier-ignore let configRules = [rules.js({ modulesThatUseGatsby }), rules.yaml(), rules.fonts(), rules.images(), rules.media(), rules.miscAssets(), // This is a hack that exports one of @reach/router internals (BaseContext) // to export list. We need it to reset basepath and baseuri context after // Gatsby main router changes it, to keep v2 behaviour. // We will need to most likely remove this for v3. { test: require.resolve(`@reach/router/es/index`), type: `javascript/auto`, use: [{ loader: require.resolve(`./reach-router-add-basecontext-export-loader`) }] }]; // Speedup 🏎️💨 the build! We only include transpilation of node_modules on javascript production builds // TODO create gatsby plugin to enable this behaviour on develop (only when people are requesting this feature) if (stage === `build-javascript`) { configRules.push(rules.dependencies({ modulesThatUseGatsby })); } if (store.getState().themes.themes) { configRules = configRules.concat(store.getState().themes.themes.map(theme => { return { test: /\.jsx?$/, include: theme.themeDir, use: [loaders.js()] }; })); } switch (stage) { case `develop`: { // get schema to pass to eslint config and program for directory const { schema, program } = store.getState(); // if no local eslint config, then add gatsby config if (!(0, _localEslintConfigFinder.hasLocalEslint)(program.directory)) { configRules = configRules.concat([rules.eslint(schema)]); } configRules = configRules.concat([{ oneOf: [rules.cssModules(), rules.css()] }]); // RHL will patch React, replace React-DOM by React-🔥-DOM and work with fiber directly // It's necessary to remove the warning in console (https://github.com/gatsbyjs/gatsby/issues/11934) // TODO: Remove entire block when we make fast-refresh the default if (process.env.GATSBY_HOT_LOADER !== `fast-refresh`) { configRules.push({ include: /node_modules\/react-dom/, test: /\.jsx?$/, use: { loader: require.resolve(`./webpack-hmr-hooks-patch`) } }); } break; } case `build-html`: case `develop-html`: // We don't deal with CSS at all when building the HTML. // The 'null' loader is used to prevent 'module not found' errors. // On the other hand CSS modules loaders are necessary. // prettier-ignore configRules = configRules.concat([{ oneOf: [rules.cssModules(), { ...rules.css(), use: [loaders.null()] }] }]); break; case `build-javascript`: // We don't deal with CSS at all when building JavaScript but we still // need to process the CSS so offline-plugin knows about the various // assets referenced in your CSS. // // It's also necessary to process CSS Modules so your JS knows the // classNames to use. configRules = configRules.concat([{ oneOf: [rules.cssModules(), rules.css()] }]); break; } return { rules: configRules }; } function getResolve(stage) { const { program } = store.getState(); const resolve = { // Use the program's extension list (generated via the // 'resolvableExtensions' API hook). extensions: [...program.extensions], alias: { gatsby$: directoryPath(path.join(`.cache`, `gatsby-browser-entry.js`)), // Using directories for module resolution is mandatory because // relative path imports are used sometimes // See https://stackoverflow.com/a/49455609/6420957 for more details "@babel/runtime": path.dirname(require.resolve(`@babel/runtime/package.json`)), "core-js": path.dirname(require.resolve(`core-js/package.json`)), // TODO: Remove entire block when we make fast-refresh the default ...(process.env.GATSBY_HOT_LOADER !== `fast-refresh` ? { "react-hot-loader": path.dirname(require.resolve(`react-hot-loader/package.json`)) } : {}), "react-lifecycles-compat": directoryPath(`.cache/react-lifecycles-compat.js`), "create-react-context": directoryPath(`.cache/create-react-context.js`) }, plugins: [// Those two folders are special and contain gatsby-generated files // whose dependencies should be resolved through the `gatsby` package PnpWebpackPlugin.bind(directoryPath(`.cache`), module), PnpWebpackPlugin.bind(directoryPath(`public`), module), // Transparently resolve packages via PnP when needed; noop otherwise PnpWebpackPlugin] }; const target = stage === `build-html` || stage === `develop-html` ? `node` : `web`; if (target === `web`) { // force to use es modules when importing internals of @reach.router // for browser bundles resolve.alias[`@reach/router`] = path.join(path.dirname(require.resolve(`@reach/router/package.json`)), `es`); } if (stage === `build-javascript` && program.profile) { resolve.alias[`react-dom$`] = `react-dom/profiling`; resolve.alias[`scheduler/tracing`] = `scheduler/tracing-profiling`; } return resolve; } function getResolveLoader() { const root = [path.resolve(directory, `node_modules`)]; const userLoaderDirectoryPath = path.resolve(directory, `loaders`); try { if (fs.statSync(userLoaderDirectoryPath).isDirectory()) { root.push(userLoaderDirectoryPath); } } catch (err) { debug(`Error resolving user loaders directory`, err); } return { modules: [...root, path.join(__dirname, `../loaders`), `node_modules`], // Bare loaders should always be loaded via the user dependencies (loaders // configured via third-party like gatsby use require.resolve) plugins: [PnpWebpackPlugin.moduleLoader(`${directory}/`)] }; } const config = { // Context is the base directory for resolving the entry option. context: directory, entry: getEntry(), output: getOutput(), module: getModule(), plugins: getPlugins(), // Certain "isomorphic" packages have different entry points for browser // and server (see // https://github.com/defunctzombie/package-browser-field-spec); setting // the target tells webpack which file to include, ie. browser vs main. target: stage === `build-html` || stage === `develop-html` ? `node` : `web`, devtool: getDevtool(), // Turn off performance hints as we (for now) don't want to show the normal // webpack output anywhere. performance: { hints: false }, mode: getMode(), resolveLoader: getResolveLoader(), resolve: getResolve(stage), node: { __filename: true } }; if (stage === `build-javascript`) { const componentsCount = store.getState().components.size; const isCssModule = module => module.type === `css/mini-extract`; const splitChunks = { chunks: `all`, cacheGroups: { default: false, vendors: false, framework: { chunks: `all`, name: `framework`, // This regex ignores nested copies of framework libraries so they're bundled with their issuer. test: new RegExp(`(?<!node_modules.*)[\\\\/]node_modules[\\\\/](${FRAMEWORK_BUNDLES.join(`|`)})[\\\\/]`), priority: 40, // Don't let webpack eliminate this chunk (prevents this chunk from becoming a part of the commons chunk) enforce: true }, // if a module is bigger than 160kb from node_modules we make a separate chunk for it lib: { test(module) { return !isCssModule(module) && module.size() > 160000 && /node_modules[/\\]/.test(module.identifier()); }, name(module) { const hash = crypto.createHash(`sha1`); if (!module.libIdent) { throw new Error(`Encountered unknown module type: ${module.type}. Please open an issue.`); } hash.update(module.libIdent({ context: program.directory })); return hash.digest(`hex`).substring(0, 8); }, priority: 30, minChunks: 1, reuseExistingChunk: true }, commons: { name: `commons`, // if a chunk is used on all components we put it in commons minChunks: componentsCount, priority: 20 }, // If a chunk is used in at least 2 components we create a separate chunk shared: { test(module) { return !isCssModule(module); }, name(module, chunks) { const hash = crypto.createHash(`sha1`).update(chunks.reduce((acc, chunk) => acc + chunk.name, ``)).digest(`hex`); return hash; }, priority: 10, minChunks: 2, reuseExistingChunk: true }, // Bundle all css & lazy css into one stylesheet to make sure lazy components do not break // TODO make an exception for css-modules styles: { test(module) { return isCssModule(module); }, name: `styles`, priority: 40, enforce: true } }, maxInitialRequests: 25, minSize: 20000 }; config.optimization = { runtimeChunk: { name: `webpack-runtime` }, // use hashes instead of ids for module identifiers // TODO update to deterministic in webpack 5 (hashed is deprecated) // @see https://webpack.js.org/guides/caching/#module-identifiers moduleIds: `hashed`, splitChunks, minimizer: [// TODO: maybe this option should be noMinimize? !program.noUglify && plugins.minifyJs(program.profile ? { terserOptions: { keep_classnames: true, keep_fnames: true } } : {}), plugins.minifyCss()].filter(Boolean) }; } if (stage === `build-html` || stage === `develop-html`) { // Packages we want to externalize to save some build time // https://github.com/gatsbyjs/gatsby/pull/14208#pullrequestreview-240178728 const externalList = [`@reach/router/lib/history`, `@reach/router`, `common-tags`, /^core-js\//, `crypto`, `debug`, `fs`, `https`, `http`, `lodash`, `path`, `semver`, /^lodash\//, `zlib`]; // Packages we want to externalize because meant to be user-provided const userExternalList = [`react-helmet`, `react`, /^react-dom\//]; const checkItem = (item, request) => { if (typeof item === `string` && item === request) { return true; } else if (item instanceof RegExp && item.test(request)) { return true; } return false; }; const isExternal = request => { if (externalList.some(item => checkItem(item, request))) { return `umd ${require.resolve(request)}`; } if (userExternalList.some(item => checkItem(item, request))) { return `umd ${request}`; } return null; }; config.externals = [function (context, request, callback) { const external = isExternal(request); if (external !== null) { callback(null, external); } else { callback(); } }]; } store.dispatch(actions.replaceWebpackConfig(config)); const getConfig = () => store.getState().webpack; await apiRunnerNode(`onCreateWebpackConfig`, { getConfig, stage, rules, loaders, plugins, parentSpan }); return getConfig(); }; //# sourceMappingURL=webpack.config.js.map
{ "content_hash": "33179652b8662c82abd4aa9affc872d1", "timestamp": "", "source": "github", "line_count": 603, "max_line_length": 261, "avg_line_length": 33.59369817578773, "alnum_prop": 0.6080367280446265, "repo_name": "jpoeng/jpoeng.github.io", "id": "1439cd18b742050b0bd427681dffc47568f10545", "size": "20268", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node_modules/gatsby/dist/utils/webpack.config.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "5765" }, { "name": "HTML", "bytes": "53947" }, { "name": "JavaScript", "bytes": "1885" }, { "name": "PHP", "bytes": "9773" } ] }
Snipcart.execute('registerLocale', 'pt-BR', { yes: "Sim", no: "Não", print: "Print", download_as_pdf: "Download como PDF", checkout: "Checkout", close: "Fechar", first_name: "Primeiro nome", name: "Nome", last_name: "Último nome", company_name: "Nome da empresa", share_by_email: "Compartilhe por email", email: "Email", password: "Senha", confirm_password: "Confirmar Senha", ok: "OK", send: "Enviar", address_1: "Endereço", address_2: "Endereço 2", city: "Cidade", postal_code: "CEP", phone: "Telefone", previous: "Passo anterior", next: "Próximo passo", finalize: "Confirmar Pedido", country: "País", subtotal: "Subtotal", tax_adjustments: "Ajustes fiscais", rebate: "Desconto", apply_promo_code: "Aplicar código promocional", my_cart: "Meu carrinho", my_cart_content: "Conteúdo do meu carrinho", shipping_method: "Método de envio", payment_method: "Método de pagamento", confirm_order: "Confirmar pedido", bill_me_later: "Pague depois", bill_me_later_action: "Pague depois", bill_me_later_explanation: "Uma fatura será enviada por e-mail.", pay_via_mollie: "Escolha o método de pagamento", pay_now_via_mollie: "Pague agora", pay_via_mollie_explanation: "Você será redirecionado para uma lista de opções de pagamento disponíveis.", promo_code_applied_successfully: "Seu desconto foi aplicado com sucesso.", promo_code_is_invalid: "O código promocional é inválido.", promo_code_is_expired: "Este código de promoção expirou.", promo_code_code: "Tem um desconto?", promo_code_rate_on_order: "Desconto no pedido", promo_code_alternate_price: "Preço especial sobre produtos", total: "Total", total_paid: "Total pago", province_state: "Estado / Província", billing_address: "Endereço de cobrança", shipping_address: "Endereço de entrega", payment_informations: "Informação de pagamento", payment_informations_bill_me_later: "Eu pagarei mais tarde", payment_informations_no_payment_required: "Não é necessário pagamento", payment_informations_paypalexpress: "Pagamento com Paypal", credit_card_type_mastercard: "Mastercard", credit_card_type_visa: "Visa", credit_card_type_amex: "American Express", months_january: "Janeiro", months_february: "Fevereiro", months_march: "Março", months_april: "Abril", months_may: "Maio", months_june: "Junho", months_july: "Julho", months_august: "Augosto", months_september: "Setembro", months_october: "Outubro", months_november: "Novembro", months_december: "Dezembro", cart_items_table_item: "Item", cart_items_table_description: "Descrição", cart_items_table_quantity: "Quantidade", cart_items_table_unit_price: "Preço unitário", cart_items_table_total_price: "Preço total", cart_empty_text: "O carrinho está vazio. Selecione alguns produtos para comprar antes de efetuar o check-out.", new_account_form_create_new_account: "Crie um login", new_account_form_create_new_account_action: "Crie um login", login_form_having_an_account: "Assinar em", login_form_login_action: "Entrar", login_title: "Login", login_form_forgot_password_action: "Esqueci a minha senha", forgot_password_forgot_your_password: "Esqueceu sua senha?", forgot_password_please_enter_email: "Digite seu e-mail, nós lhe enviaremos um e-mail contendo um link exclusivo para redefinir sua senha.", forgot_password_success_email_sent: "E-mail enviado", forgot_password_email_sent_message: "Um e-mail foi enviado a você com instruções sobre como redefinir sua senha. Verifique seu email e siga os passos.", login_checkout_as_guest: "Checkout como convidado", login_checkout_as_guest_notice: "Checkout como convidado se você não quiser criar uma conta para esta compra. Tenha em mente que as suas informações não serão guardadas para as próximas encomendas.", shipping_address_same_as_billing: "Use este endereço para enviar", shipping_method_method_name: "Método de envio", shipping_method_shipping_price: "Preço de envio", shipping_method_failure_message: "Não conseguimos encontrar nenhum método de envio possível. Certifique-se de que o endereço de entrega está correto e tente novamente.", shipping_method_failure_click_here_to_edit: "Clique aqui para editar seu endereço de remessa", payment_method_card_holder: "Nome no cartão", payment_method_card_type: "Tipo de carta", payment_method_card_number: "Número do cartão", payment_method_card_cvc: "CVC", payment_method_card_exp_month: "Mês de validade", payment_method_card_exp_year: "Ano de expiração", payment_method_cvc_infos: "O CVC é o número de segurança de 3 dígitos atrás do seu cartão de crédito, geralmente à direita da sua assinatura.", payment_status: "Status do pagamento", create_an_account: "Crie um login", why_create_account: "Para uma compra mais rápida no seu próximo pedido, basta digitar uma senha para criar um login.", reset_password: "Redefinir senha", reset_password_success: "Redefinir senha concluída", reset_password_changed: "Sua senha foi alterada.", reset_password_click_here_to_login: "Clique aqui para fazer login", thankyou_message: "Obrigado pelo seu pedido! Sua fatura foi enviada por e-mail, você deve recebê-la em breve.", thankyou_submessage: "Você receberá um email de confirmação em breve", account_created_successfully: "Conta criada com sucesso", account_created_successfully_message: "Sua conta foi criada com sucesso, obrigado.", errors_required: "Este campo é obrigatório", errors_passwords_dont_match: "Ambas as senhas devem corresponder", errors_email_must_be_unique: "Um usuário com o mesmo e-mail já existe", errors_both_password_must_match: "Ambas as senhas devem corresponder", errors_email_must_be_valid: "O e-mail deve ser válido", errors_email_does_not_match_any_existing_user: "Nenhum usuário com este e-mail existe", errors_email_does_not_match_reset_password_request: "O email do usuário não corresponde a nenhuma solicitação de senha de reinicialização existente.", errors_reset_password_token_expired: "O token de senha de redefinição expirou.", errors_invalid_authentication_infos: "Informações de autenticação inválidas", error_payment_items_empty: "Parece que seu pedido não é válido, recarregue a página. Seu cartão de crédito não foi cobrado.", error_email_is_empty: "Parece que tivemos um problema salvando seu endereço de e-mail, por favor insira-o novamente e clique em Avançar para continuar.", error_payment_items_are_invalid: "Não conseguimos completar o seu pedido. Parece que um dos itens no seu carrinho tem um preço inválido.", error_crawling_failed: "Não conseguimos validar o seu pedido, o seu cartão de crédito não foi cobrado, tente novamente em alguns momentos.", error_discounts_have_expired: "Infelizmente, um dos descontos que você teve expirou antes de concluir o processo de pagamento. Por favor, reveja o pedido abaixo e tente novamente.", error_shipping_price_outdated: "A opção de envio que você selecionou não é mais válida, escolha outro método de envio.", powered_by: "Distribuído e protegido por", promocode_rate_format: "{0}% desconto no seu pedido", promocode_amount_format: "{0} desconto no seu pedido", shipping_method_business_days: "{0} dias úteis", shipping_method_business_day: "{0} dias úteis", shipping_method_delivery_time: "De {0}", welcome: "Bem Vindo", back: "Voltar", order_infos: "Informação de pedido", generic_error_title: "Ops! Ocorreu um erro.", promocode_deleted_at_checkout: "O desconto que você usou atingiu seu limite de uso enquanto fazia seu checkout. Desculpe pelo inconveniente.", continue_shopping: "Continue comprando", payment_required_message: "O carrinho de compras para este site foi desativado. Se você é o proprietário deste site, faça o login no painel do painel Snipcart para resolver o problema.", payment_require_title: "O carrinho de compras está desativado.", configuration_problem: "Problema de configuração", additionnal_information: "Digite uma mensagem abaixo se desejar enviar comentários ou mais informações sobre esse problema.", send_error: "Envie este erro ao proprietário do site", message_sent: "Mensagem enviada, obrigado", wait_few_seconds: "Apenas alguns segundos...", paypalexpress_cancelled: "Você cancelou a transação, você pode clicar no botão abaixo para tentar novamente ou simplesmente continuar a comprar.", retry: "Tente novamente", error_crawlingfailed_title: "Algo deu errado ao validar seu pedido, não se preocupe, você não foi cobrado.", error_crawling_unreachable: "O item <strong>{0}</strong> é inacessível em <strong>{1}</strong>. Verifique se a URL do produto está disponível publicamente.", error_crawling_product_not_found: "O item <strong>{0}</strong> não foi encontrado em <strong>{1}</strong>.", error_crawling_price_not_found: "O item <strong>{0}</strong> não tem nenhum preço especificado em <strong>{1}</strong>, especifique-o com dados-item-preço.", error_crawling_price_doesnot_match: "O item <strong>{0}</strong> preço em <strong>{3}</strong> é <strong>{2}</strong> mas deve ser <strong>{1}</strong>.", error_crawlingfailed_title_test: "Algo deu errado ao validar seu pedido, não se preocupe, você não foi cobrado. Este site está atualmente no modo Teste.", order_completedon: "Colocado sobre", payment_method_status: "Status da transação", payment_method_status_approved: "Aprovado", order_reference_number: "Número de referência", order_transaction_amount: "Valor da transação", order_invoice_number: "Número da fatura", order_authorization_code: "Código de autorização", item_is_being_added: "Adicionando item ao carrinho...", order_completing_payment: "Efetuando pagamento...", calculating_shipping_fees: "Obtendo taxas de envio...", saving: "Salvando...", loading: "Carregando...", free_shipping: "Frete grátis", cart_plans_name: "Plano", cart_plans_interval: "Intervalo", cart_plans_interval_count: "Contagem", cart_plans_quantity: "Quantidade", cart_plans_amount: "Montante", cart_plans_total: "Total", payable_now: "A pagar agora", upcoming_payment_for: "Inscrição", upcoming_payment_date: "Data", upcoming_payment_amount: "Total", upcoming_payment_subtotal: "Subtotal", upcoming_payment_shipping: "Remessa", upcoming_payments: "Próximos pagamentos", order_date: "Data", order_status: "Status", order_total: "Total", orders_history: "Meus pedidos", subscriptions_history_no_subscriptions: "Você ainda não possui assinaturas.", orders_history_no_orders: "Ainda não tem pedidos.", orders_fetching_orders: "Carregando seus pedidos...", user_nav_orders: "Meus pedidos", user_nav_subscriptions: "Minhas assinaturas", user_nav_cart: "Meu carrinho", subscriptions_history: "Minhas assinaturas", subscription_name: "Nome", subscription_amount: "Montante", subscription_quantity: "Quantidade", subscription_total_amount: "Total", subscriptions_fetching_subscriptions: "Carregando assinaturas...", subscriptions_fetching_details: "Carregando detalhes da assinatura...", subscription_no_invoices: "Esta assinatura ainda não possui faturas.", subscription_plan_name: "Nome do plano", subscription_plan_interval: "Intervalo do plano", subscription_plan_interval_count: "Contagem do intervalo do plano", subscription_invoice_number: "Número", subscription_invoice_date: "Data", subscription_invoice_amount: "Montante", subscription_invoice_item: "Item", subscription_invoice_info: "Informação de fatura", subscription_invoice_details: "Detalhes da fatura", subscription_invoice_fetching_details: "Carregando detalhes da fatura...", subscription_invoices_loading: "Carregando faturas de assinatura...", subscription_invoices_list: "Histórico de faturas", item_out_of_stock: "Lamentamos, este item está agora fora de estoque.", click_here_to_remove_it: "Clique aqui para removê-lo do seu carrinho.", outofstock_notification: "Lamentamos, alguns dos itens no seu carrinho ficaram fora de estoque durante o check-out. Por favor, reveja seu pedido. Não se preocupe, o seu cartão não foi cobrado.", plan_amount_per_day: "{0} / dia", plan_amount_per_week: "{0} / Semana", plan_amount_per_month: "{0} / Mês", plan_amount_per_year: "{0} / Ano", plan_amount_per_day_plural: "{0} / {1} dias", plan_amount_per_week_plural: "{0} / {1} Semanas", plan_amount_per_month_plural: "{0} / {1} meses", plan_amount_per_year_plural: "{0} / {1} Anos", plan_days_of_trial: "{0} dias de teste", subscription_cancel_button: "Cancelar", subscription_pause_button: "Pausar", subscription_cancel_confirmation: "Tem certeza de que deseja cancelar sua assinatura?", subscription_cancel_success: "Sua assinatura foi cancelada com sucesso.", subscription_cancelled_notice: "Esta assinatura não está mais ativa, foi cancelada em {0}.", subscription_cancelledon: "Cancelado em", paypal_express_checkout_link: "Pagar com Paypal", paypal_express_checkout_title: "Pagar com PayPal", paypal_express_checkout_explanation: "Clique neste botão se você preferir processar seu pagamento diretamente através do PayPal.", notifications_item_not_added_due_to_max_quantity: "O produto não foi adicionado, você já possui a quantidade máxima no seu carrinho.", error_impossible_to_calculate_taxes: "Não conseguimos calcular os impostos para o pedido, pode ser devido a um endereço inválido, por favor, assegure-se de ter inserido um endereço válido com um código postal de 8 dígitos.", have_a_promocode_question: "Código promocional?", order_totals_computing: "Cálculo de impostos...", order_validation_failed: "Não conseguimos validar o seu pedido. Parece que alguns preços dos produtos podem ter mudado desde que você os adicionou ao carrinho. Por favor, reveja seu pedido e tente novamente.", item_invalid_must_remove: "Parece que este item não está mais disponível. Talvez seja necessário entrar em contato com o comerciante para que isso seja resolvido, pois pode ser um problema de configuração. Ao continuar este item será removido do seu carrinho.", accept_cart_changes: "Aceite as mudanças e continue", payment_failed_text: "Desculpe, não conseguimos processar seu pagamento. Você pode continuar comprando ou tente novamente usando os botões abaixo.", payment_method_willbepaidlater: "Diferido", payment_method_paypal: "Paypal", payment_method_none: "Nenhum", payment_method_sofort: "Sofort", payment_method_ideal: "Ideal", payment_method_mistercash: "Mister Cash", payment_method_banktransfer: "Transferência bancária", payment_method_directdebit: "Débito Direto", payment_method_belfius: "Belfius", payment_method_bitcoin: "Bitcoin", payment_method_podiumcadeaukaart: "Podium Cadeau Kaart", payment_method_paysafecard: "PaySafe card", payment_method_bancontact: "Bancontact", payment_method_creditcard: "Cartão de crédito", error_item_stock_exceeded: "Desculpe! Seu pedido excede o estoque disponível para este item.", error_item_out_of_stock_text: "Desculpe! Parece que este produto já não está disponível. Sugerimos que você veja mais tarde.", item_out_of_stock_with_variant: "Desculpe! Parece que esta variação do produto já não está disponível. Selecione outra variação ou este item será removido do carrinho.", order_status_processed: "Processado", order_status_disputed: "Disputado", order_status_shipped: "Enviado", order_status_delivered: "Entregue", order_status_pending: "Pendente", order_status_cancelled: "Cancelado", something_went_wrong_while_fetching_rates: "Não foi possível encontrar nenhum método de envio para o endereço que você especificou. Contate-nos diretamente se precisar de ajuda sobre isso.", error_must_select_shipping_rate: "Você deve selecionar o método de envio para continuar.", back_to_orders: "Voltar aos pedidos", manage_subscriptions: "Gerenciar assinaturas", back_to_subscriptions_list: "Voltar à lista de assinaturas", back_to_subscription_details: "Voltar aos detalhes da assinatura", discount_remove_confirmation_msg: "Tem certeza de que deseja remover o desconto?", digital_files_not_found: "Não existem um ou mais arquivos digitais, entre em contato com o proprietário da loja para mais detalhes.", digital_files_download_button: "Fazer download do arquivo", notifications_item_not_modified_due_to_min_quantity: "Desculpe, você precisa solicitar pelo menos {0} deste produto.", subscription_resume_buttom: "Resumo", subscription_summary: "Resumo", subscription_notifications_paused: "Esta assinatura está pausada no momento, você pode retomá-la clicando no botão Continuar.", subscription_notifications_pause_confirm: "Tem certeza de que deseja pausar sua assinatura?", subscription_notifications_resume_confirm: "Tem certeza de que deseja retomar esta assinatura?", subscription_status_canceled: "Cancelado", subscription_status_paused: "Pausado", refund_line: "Devolvido", stripe_invalid_number: "O número do cartão é inválido.", stripe_invalid_expiry_month: "O mês de vencimento do cartão é inválido.", stripe_invalid_expiry_year: "O ano de validade do cartão é inválido.", stripe_invalid_cvc: "O código de segurança do cartão é inválido.", stripe_invalid_swipe_data: "Os dados de deslocamento do cartão são inválidos.", stripe_incorrect_number: "O número do cartão está incorreto.", stripe_expired_card: "O cartão expirou.", stripe_incorrect_cvc: "O código de segurança do cartão está incorreto.", stripe_incorrect_zip: "O código postal do cartão falhou na validação.", stripe_card_declined: "O cartão foi recusado.", stripe_missing: "Não há cartão no cliente que esteja sendo carregado.", stripe_processing_error: "Ocorreu um erro ao processar o cartão.", "profile_credit_card": "Cartão de crédito", "profile_current_credit_card": "Seu cartão de crédito atual termina com {0} e expira em {1} / {2}.", "profile_update_card": "Clique aqui para atualizar", "profile_saved_successfully": "Seu perfil foi salvo com sucesso.", "profile_loading": "Obtendo suas informações de perfil...", "profile_saving": "Salvando seu perfil...", "profile_billing_address": "Endereço de cobrança", "profile_shipping_address": "Endereço de entrega", "profile_edit_linktitle": "Clique aqui para editar seu perfil.", "feature_not_supported_subscriptions": "Lamentamos, mas as assinaturas não estão disponíveis no seu gateway de pagamento. Este item não pode ser adicionado." });
{ "content_hash": "c42aaa2e34fc8c028c97fc0a7435539c", "timestamp": "", "source": "github", "line_count": 604, "max_line_length": 235, "avg_line_length": 30.614238410596027, "alnum_prop": 0.7476610242820831, "repo_name": "snipcart/snipcart-localization", "id": "a0405d2792b588c8ee635df054beef07b18708dc", "size": "18802", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "locales/pt-BR.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "479766" } ] }
package org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.parts; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.parts.EditPartConstants.DEFAULT_PROPERTY_VALUE_TEXT; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.parts.EditPartConstants.HEADER_MEDIATOR_ICON_PATH; import org.apache.commons.lang.StringUtils; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.Label; import org.eclipse.draw2d.PositionConstants; import org.eclipse.draw2d.Shape; import org.eclipse.draw2d.ToolbarLayout; import org.eclipse.gef.EditPart; import org.eclipse.gef.EditPolicy; import org.eclipse.gef.Request; import org.eclipse.gef.commands.Command; import org.eclipse.gef.editpolicies.LayoutEditPolicy; import org.eclipse.gef.editpolicies.NonResizableEditPolicy; import org.eclipse.gef.requests.CreateRequest; import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy; import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator; import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.EsbGraphicalShapeWithLabel; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.FixedBorderItemLocator; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.FixedSizedAbstractMediator; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.ShowPropertyViewEditPolicy; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.editpolicy.FeedbackIndicateDragDropEditPolicy; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.policies.HeaderMediatorCanonicalEditPolicy; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.policies.HeaderMediatorItemSemanticEditPolicy; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.part.EsbVisualIDRegistry; /** * @generated NOT */ public class HeaderMediatorEditPart extends FixedSizedAbstractMediator { /** * @generated */ public static final int VISUAL_ID = 3516; /** * @generated */ protected IFigure contentPane; /** * @generated */ public HeaderMediatorEditPart(View view) { super(view); } /** * @generated NOT */ protected void createDefaultEditPolicies() { installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy()); super.createDefaultEditPolicies(); installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new HeaderMediatorItemSemanticEditPolicy()); installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy()); installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new FeedbackIndicateDragDropEditPolicy()); installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new HeaderMediatorCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); // For handle Double click Event. installEditPolicy(EditPolicyRoles.OPEN_ROLE, new ShowPropertyViewEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); } /** * @generated */ protected LayoutEditPolicy createLayoutEditPolicy() { org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() { protected EditPolicy createChildEditPolicy(EditPart child) { View childView = (View) child.getModel(); switch (EsbVisualIDRegistry.getVisualID(childView)) { case HeaderMediatorInputConnectorEditPart.VISUAL_ID: case HeaderMediatorOutputConnectorEditPart.VISUAL_ID: return new BorderItemSelectionEditPolicy(); } EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); if (result == null) { result = new NonResizableEditPolicy(); } return result; } protected Command getMoveChildrenCommand(Request request) { return null; } protected Command getCreateCommand(CreateRequest request) { return null; } }; return lep; } /** * @generated NOT */ protected IFigure createNodeShape() { return primaryShape = new HeaderMediatorFigure() { public void setBounds(org.eclipse.draw2d.geometry.Rectangle rect) { super.setBounds(rect); if (this.getBounds().getLocation().x != 0 && this.getBounds().getLocation().y != 0) { connectToMostSuitableElement(); reAllocate(rect); } }; }; } /** * @generated */ public HeaderMediatorFigure getPrimaryShape() { return (HeaderMediatorFigure) primaryShape; } /** * @generated NOT */ protected boolean addFixedChild(EditPart childEditPart) { if (childEditPart instanceof HeaderMediatorValueLiteralEditPart) { ((HeaderMediatorValueLiteralEditPart) childEditPart).setLabel(getPrimaryShape() .getFigureHeaderMediatorPropertyValue()); return true; } if (childEditPart instanceof HeaderMediatorDescriptionEditPart) { ((HeaderMediatorDescriptionEditPart) childEditPart).setLabel(getPrimaryShape() .getHeaderMediatorDescriptionLabel()); return true; } if (childEditPart instanceof HeaderMediatorInputConnectorEditPart) { IFigure borderItemFigure = ((HeaderMediatorInputConnectorEditPart) childEditPart).getFigure(); BorderItemLocator locator = new FixedBorderItemLocator(getMainFigure(), borderItemFigure, PositionConstants.WEST, 0.5); getBorderedFigure().getBorderItemContainer().add(borderItemFigure, locator); return true; } if (childEditPart instanceof HeaderMediatorOutputConnectorEditPart) { IFigure borderItemFigure = ((HeaderMediatorOutputConnectorEditPart) childEditPart).getFigure(); BorderItemLocator locator = new FixedBorderItemLocator(getMainFigure(), borderItemFigure, PositionConstants.EAST, 0.5); getBorderedFigure().getBorderItemContainer().add(borderItemFigure, locator); return true; } return false; } /** * @generated */ protected boolean removeFixedChild(EditPart childEditPart) { if (childEditPart instanceof HeaderMediatorValueLiteralEditPart) { return true; } if (childEditPart instanceof HeaderMediatorDescriptionEditPart) { return true; } if (childEditPart instanceof HeaderMediatorInputConnectorEditPart) { getBorderedFigure().getBorderItemContainer().remove( ((HeaderMediatorInputConnectorEditPart) childEditPart).getFigure()); return true; } if (childEditPart instanceof HeaderMediatorOutputConnectorEditPart) { getBorderedFigure().getBorderItemContainer().remove( ((HeaderMediatorOutputConnectorEditPart) childEditPart).getFigure()); return true; } return false; } /** * @generated */ protected void addChildVisual(EditPart childEditPart, int index) { if (addFixedChild(childEditPart)) { return; } super.addChildVisual(childEditPart, -1); } /** * @generated */ protected void removeChildVisual(EditPart childEditPart) { if (removeFixedChild(childEditPart)) { return; } super.removeChildVisual(childEditPart); } /** * @generated */ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { if (editPart instanceof IBorderItemEditPart) { return getBorderedFigure().getBorderItemContainer(); } return getContentPane(); } /** * Creates figure for this edit part. * * Body of this method does not depend on settings in generation model * so you may safely remove <i>generated</i> tag and modify it. * * @generated NOT */ protected NodeFigure createMainFigure() { NodeFigure figure = createNodePlate(); figure.setLayoutManager(new ToolbarLayout(true)); IFigure shape = createNodeShape(); figure.add(shape); contentPane = setupContentPane(shape); return figure; } /** * Default implementation treats passed figure as content pane. * Respects layout one may have set for generated figure. * @param nodeShape instance of generated figure class * @generated */ protected IFigure setupContentPane(IFigure nodeShape) { if (nodeShape.getLayoutManager() == null) { ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); layout.setSpacing(5); nodeShape.setLayoutManager(layout); } return nodeShape; // use nodeShape itself as contentPane } /** * @generated */ public IFigure getContentPane() { if (contentPane != null) { return contentPane; } return super.getContentPane(); } /** * @generated */ protected void setForegroundColor(Color color) { if (primaryShape != null) { primaryShape.setForegroundColor(color); } } /** * @generated */ protected void setBackgroundColor(Color color) { if (primaryShape != null) { primaryShape.setBackgroundColor(color); } } /** * @generated */ protected void setLineWidth(int width) { if (primaryShape instanceof Shape) { ((Shape) primaryShape).setLineWidth(width); } } /** * @generated */ protected void setLineType(int style) { if (primaryShape instanceof Shape) { ((Shape) primaryShape).setLineStyle(style); } } /* *//** * @generated */ /* public EditPart getPrimaryChildEditPart() { return getChildBySemanticHint(EsbVisualIDRegistry .getType(HeaderMediatorValueLiteralEditPart.VISUAL_ID)); }*/ /** * @generated */ public class HeaderMediatorFigure extends EsbGraphicalShapeWithLabel { /** * @generated */ private WrappingLabel fFigureHeaderMediatorPropertyValue; private WrappingLabel headerMediatorDescriptionLabel; /** * @generated */ public HeaderMediatorFigure() { this.setBackgroundColor(THIS_BACK); createContents(); } /** * @generated NOT */ private void createContents() { fFigureHeaderMediatorPropertyValue = new WrappingLabel(); fFigureHeaderMediatorPropertyValue .setText(DEFAULT_PROPERTY_VALUE_TEXT); fFigureHeaderMediatorPropertyValue.setAlignment(SWT.CENTER); headerMediatorDescriptionLabel = getPropertyNameLabel(); } /** * @generated NOT */ public WrappingLabel getFigureHeaderMediatorPropertyValue() { return fFigureHeaderMediatorPropertyValue; } public WrappingLabel getHeaderMediatorDescriptionLabel() { return headerMediatorDescriptionLabel; } public String getIconPath() { return HEADER_MEDIATOR_ICON_PATH; } public String getNodeName() { return Messages.HeaderMediatorEditPart_NodeName; } public IFigure getToolTip() { if (StringUtils.isEmpty(toolTipMessage)) { return new Label(Messages.HeaderMediatorEditPart_ToolTipMessage); } else { return new Label(toolTipMessage); } } } /** * @generated */ static final Color THIS_BACK = new Color(null, 230, 230, 230); }
{ "content_hash": "b14f67604dd85c0e4a4657e3bfa0f5bf", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 145, "avg_line_length": 30.274193548387096, "alnum_prop": 0.762564375776949, "repo_name": "nwnpallewela/developer-studio", "id": "4092def64ebc99dccc44f93ec27ada47eb0ccec2", "size": "11906", "binary": false, "copies": "4", "ref": "refs/heads/developer-studio-product-plugins", "path": "esb/plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/edit/parts/HeaderMediatorEditPart.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "53060" }, { "name": "GAP", "bytes": "14192" }, { "name": "HTML", "bytes": "721781" }, { "name": "Java", "bytes": "65506028" }, { "name": "JavaScript", "bytes": "83573" }, { "name": "Lex", "bytes": "286788" }, { "name": "PHP", "bytes": "4628968" }, { "name": "Shell", "bytes": "2352" }, { "name": "XSLT", "bytes": "991" } ] }
package com.facebook.buck.intellij.ideabuck.build; import com.facebook.buck.intellij.ideabuck.config.BuckModule; import com.facebook.buck.intellij.ideabuck.config.BuckProjectSettingsProvider; import com.facebook.buck.intellij.ideabuck.ui.tree.BuckTextNode.TextType; import com.intellij.execution.ExecutionException; import com.intellij.execution.configurations.GeneralCommandLine; import com.intellij.execution.process.OSProcessHandler; import com.intellij.execution.process.ProcessEvent; import com.intellij.execution.process.ProcessListener; import com.intellij.execution.process.ProcessOutputTypes; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Key; import com.intellij.openapi.vcs.LineHandlerHelper; import com.intellij.openapi.vfs.CharsetToolkit; import java.io.File; import java.nio.charset.Charset; import java.util.regex.Pattern; import org.jetbrains.annotations.Nullable; /** The handler for buck commands with text outputs. */ public abstract class BuckCommandHandler { protected static final Logger LOG = Logger.getInstance(BuckCommandHandler.class); private static final long LONG_TIME = 10 * 1000; protected final Project project; protected final BuckModule buckModule; protected final BuckCommand command; private final File workingDirectory; private final GeneralCommandLine commandLine; private final Object processStateLock = new Object(); private static final Pattern CHARACTER_DIGITS_PATTERN = Pattern.compile("(?s).*[A-Z0-9a-z]+.*"); private final boolean doStartNotify; @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"}) private Process process; @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"}) private OSProcessHandler handler; /** Character set to use for IO. */ @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"}) private Charset charset = CharsetToolkit.UTF8_CHARSET; /** Buck execution start timestamp. */ private long startTime; /** The partial line from stderr stream. */ private final StringBuilder stderrLine = new StringBuilder(); public BuckCommandHandler(Project project, File directory, BuckCommand command) { this(project, directory, command, /* doStartNotify */ false); } /** * @param project a project * @param directory a process directory * @param command a command to execute (if empty string, the parameter is ignored) * @param doStartNotify true if the handler should call OSHandler#startNotify */ public BuckCommandHandler( Project project, File directory, BuckCommand command, boolean doStartNotify) { this.doStartNotify = doStartNotify; String buckExecutable = BuckProjectSettingsProvider.getInstance(project).resolveBuckExecutable(); this.project = project; this.buckModule = project.getComponent(BuckModule.class); this.command = command; commandLine = new GeneralCommandLine(); commandLine.setExePath(buckExecutable); workingDirectory = directory; commandLine.withWorkDirectory(workingDirectory); commandLine.addParameter(command.name()); for (String parameter : command.getParameters()) { commandLine.addParameter(parameter); } } /** Start process */ public synchronized void start() { checkNotStarted(); buckModule .getBuckEventsConsumer() .sendAsConsoleEvent(commandLine.getCommandLineString(), TextType.INFO); try { startTime = System.currentTimeMillis(); process = startProcess(); startHandlingStreams(); } catch (ProcessCanceledException e) { LOG.warn(e); } catch (Throwable t) { if (!project.isDisposed()) { LOG.error(t); } } } /** Stop process */ public synchronized void stop() { process.destroy(); } /** @return true if process is started. */ public final synchronized boolean isStarted() { return process != null; } /** * Check that process is not started yet. * * @throws IllegalStateException if process has been already started */ private void checkNotStarted() { if (isStarted()) { throw new IllegalStateException("The process has been already started"); } } /** * Check that process is started. * * @throws IllegalStateException if process has not been started */ protected final void checkStarted() { if (!isStarted()) { throw new IllegalStateException("The process is not started yet"); } } public GeneralCommandLine command() { return commandLine; } /** @return a context project */ public Project project() { return project; } /** Start the buck process. */ @Nullable protected Process startProcess() throws ExecutionException { synchronized (processStateLock) { handler = createProcess(commandLine); return handler.getProcess(); } } /** Start handling process output streams for the handler. */ protected void startHandlingStreams() { if (handler == null) { return; } handler.addProcessListener( new ProcessListener() { public void startNotified(final ProcessEvent event) {} public void processTerminated(final ProcessEvent event) { BuckCommandHandler.this.processTerminated(); } public void processWillTerminate( final ProcessEvent event, final boolean willBeDestroyed) {} public void onTextAvailable(final ProcessEvent event, final Key outputType) { BuckCommandHandler.this.onTextAvailable(event.getText(), outputType); } }); if (doStartNotify) { handler.startNotify(); } } protected boolean processExitSuccesfull() { return process.exitValue() == 0; } /** Wait for process termination. */ public void waitFor() { checkStarted(); if (handler != null) { // handler.waitFor will wait for a semaphore which will be released when the started // process terminates if doStartNotify is true. // If the following call never returns, please check the value of doStartNotify handler.waitFor(); } } public OSProcessHandler createProcess(GeneralCommandLine commandLine) throws ExecutionException { // TODO(t7984081): Use ProcessExecutor to start buck process. Process process = commandLine.createProcess(); return new OSProcessHandler(process, commandLine.getCommandLineString(), charset); } public void runInCurrentThread(@Nullable Runnable postStartAction) { if (!beforeCommand()) { return; } start(); if (isStarted()) { if (postStartAction != null) { postStartAction.run(); } waitFor(); } afterCommand(); logTime(); } public void runInCurrentThreadPostEnd(@Nullable Runnable postEndAction) { if (!beforeCommand()) { return; } start(); if (isStarted()) { waitFor(); } afterCommand(); if (postEndAction != null) { postEndAction.run(); } logTime(); } private void logTime() { if (startTime > 0) { long time = System.currentTimeMillis() - startTime; if (!LOG.isDebugEnabled() && time > LONG_TIME) { LOG.info( String.format( "buck %s took %s ms. Command parameters: %n%s", command, time, commandLine.getCommandLineString())); } else { LOG.debug(String.format("buck %s took %s ms", command, time)); } } else { LOG.debug(String.format("buck %s finished.", command)); } } protected void processTerminated() { if (stderrLine.length() != 0) { onTextAvailable("\n", ProcessOutputTypes.STDERR); } } protected void onTextAvailable(final String text, final Key outputType) { notifyLines(outputType, LineHandlerHelper.splitText(text)); } /** * Notify listeners for each complete line. Note that in the case of stderr, the last line is * saved. */ protected void notifyLines(final Key outputType, final Iterable<String> lines) { if (outputType == ProcessOutputTypes.STDERR) { StringBuilder stderr = new StringBuilder(); for (String line : lines) { // Check if the line has at least one character or digit if (CHARACTER_DIGITS_PATTERN.matcher(line).matches()) { stderr.append(line); } } if (stderr.length() != 0) { buckModule.getBuckEventsConsumer().consumeConsoleEvent(stderr.toString()); } } } protected abstract boolean beforeCommand(); protected abstract void afterCommand(); public OSProcessHandler getHandler() { return handler; } }
{ "content_hash": "f9aa742c643341458c644a5b03e6d6c9", "timestamp": "", "source": "github", "line_count": 287, "max_line_length": 99, "avg_line_length": 30.501742160278745, "alnum_prop": 0.6935115375828192, "repo_name": "shs96c/buck", "id": "f73867cef89c935afca447310836944de1dfb73a", "size": "9359", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tools/ideabuck/src/com/facebook/buck/intellij/ideabuck/build/BuckCommandHandler.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "1585" }, { "name": "Batchfile", "bytes": "2563" }, { "name": "C", "bytes": "274563" }, { "name": "C#", "bytes": "237" }, { "name": "C++", "bytes": "18013" }, { "name": "CSS", "bytes": "54894" }, { "name": "D", "bytes": "1017" }, { "name": "Dockerfile", "bytes": "1938" }, { "name": "Go", "bytes": "9630" }, { "name": "Groovy", "bytes": "3362" }, { "name": "HTML", "bytes": "7188" }, { "name": "Haskell", "bytes": "1008" }, { "name": "IDL", "bytes": "480" }, { "name": "Java", "bytes": "28323049" }, { "name": "JavaScript", "bytes": "934510" }, { "name": "Kotlin", "bytes": "21626" }, { "name": "Lex", "bytes": "3241" }, { "name": "Makefile", "bytes": "1916" }, { "name": "Matlab", "bytes": "47" }, { "name": "OCaml", "bytes": "4935" }, { "name": "Objective-C", "bytes": "172139" }, { "name": "Objective-C++", "bytes": "34" }, { "name": "PowerShell", "bytes": "486" }, { "name": "Prolog", "bytes": "1486" }, { "name": "Python", "bytes": "2027822" }, { "name": "Roff", "bytes": "1207" }, { "name": "Rust", "bytes": "5199" }, { "name": "Scala", "bytes": "5082" }, { "name": "Shell", "bytes": "67040" }, { "name": "Smalltalk", "bytes": "3922" }, { "name": "Swift", "bytes": "11377" }, { "name": "Thrift", "bytes": "80526" }, { "name": "Yacc", "bytes": "323" } ] }
module Unicorn::WorkerKiller class Configuration attr_accessor :max_quit, :max_term, :sleep_interval def initialize self.max_quit = 10 self.max_term = 15 self.sleep_interval = 1 end end end
{ "content_hash": "55e523ec3deb4f560f54ebd2fe445a76", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 55, "avg_line_length": 20.454545454545453, "alnum_prop": 0.6577777777777778, "repo_name": "suhongrui/gitlab", "id": "8f482539d00b07ceb2f53f6b88bd9bbc6fb8a150", "size": "225", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/bundle/ruby/2.1.0/gems/unicorn-worker-killer-0.4.2/lib/unicorn/configuration.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "113763" }, { "name": "CoffeeScript", "bytes": "109865" }, { "name": "Cucumber", "bytes": "113031" }, { "name": "HTML", "bytes": "372689" }, { "name": "JavaScript", "bytes": "29449" }, { "name": "Ruby", "bytes": "1841958" }, { "name": "Shell", "bytes": "12768" } ] }
<?xml version="1.0"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.nifi</groupId> <artifactId>nifi-extension-utils</artifactId> <version>1.18.0-SNAPSHOT</version> </parent> <artifactId>nifi-hadoop-utils</artifactId> <packaging>jar</packaging> <dependencies> <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-api</artifactId> </dependency> <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-utils</artifactId> <version>1.18.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-security-kerberos</artifactId> <version>1.18.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-kerberos-credentials-service-api</artifactId> </dependency> <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-kerberos-user-service-api</artifactId> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> </dependency> <!-- Other modules using nifi-hadoop-utils are expected to have the below dependencies available, typically through a NAR dependency --> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>${hadoop.version}</version> <scope>provided</scope> <exclusions> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-reload4j</artifactId> </exclusion> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-auth</artifactId> <version>${hadoop.version}</version> <scope>provided</scope> <exclusions> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-reload4j</artifactId> </exclusion> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <scope>provided</scope> </dependency> <!-- Test dependencies --> <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-mock</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.spockframework</groupId> <artifactId>spock-core</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-minikdc</artifactId> <version>3.2.0</version> <scope>test</scope> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <dependencyManagement> <dependencies> <!-- Override commons-compress:1.19 from hadoop --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> <version>1.21</version> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.apache.rat</groupId> <artifactId>apache-rat-plugin</artifactId> <configuration> <excludes combine.children="append"> <exclude>src/test/resources/krb5.conf</exclude> </excludes> </configuration> </plugin> </plugins> </build> </project>
{ "content_hash": "78c599122bd73fc42e4dd0831f2b0bfc", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 205, "avg_line_length": 39.77215189873418, "alnum_prop": 0.5579248886059834, "repo_name": "jfrazee/nifi", "id": "4070f9638fed58423c1199f78f449b8471c78725", "size": "6284", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "44090" }, { "name": "C++", "bytes": "652" }, { "name": "CSS", "bytes": "286195" }, { "name": "Clojure", "bytes": "3993" }, { "name": "Dockerfile", "bytes": "24505" }, { "name": "GAP", "bytes": "31169" }, { "name": "Groovy", "bytes": "2205715" }, { "name": "HTML", "bytes": "1120188" }, { "name": "Handlebars", "bytes": "38564" }, { "name": "Java", "bytes": "54569943" }, { "name": "JavaScript", "bytes": "4035982" }, { "name": "Lua", "bytes": "983" }, { "name": "Mustache", "bytes": "2438" }, { "name": "Python", "bytes": "26583" }, { "name": "Ruby", "bytes": "23018" }, { "name": "SCSS", "bytes": "22032" }, { "name": "Shell", "bytes": "166750" }, { "name": "TypeScript", "bytes": "1337" }, { "name": "XSLT", "bytes": "7835" } ] }
CREATE database DBTEST1; CREATE database DBTEST2; CREATE database DBTEST3; CREATE TABLE `IUSER` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `taobaoId` bigint(20) DEFAULT '0', `name` varchar(20) DEFAULT '', `upd_time` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
{ "content_hash": "ae241d83a16d39302f034dca5a154717", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 55, "avg_line_length": 34.4, "alnum_prop": 0.686046511627907, "repo_name": "lizwmaster/cobar-client-demo", "id": "57bb64ca566ef4c55e0c236d86533677bb783e3b", "size": "344", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "cobar-client-demo/src/main/resources/db/db.sql", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "40261" } ] }
experiments with FLIR One SDK in Swift ## Prerequisites: https://git-lfs.github.com/
{ "content_hash": "6bc97092eee499725e3f249e86a366d5", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 38, "avg_line_length": 28.333333333333332, "alnum_prop": 0.7647058823529411, "repo_name": "jruhym/flirmebaby", "id": "f67c62a985830ae8c68ebac0a0cefddbea880165", "size": "98", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Objective-C", "bytes": "58603" }, { "name": "Swift", "bytes": "8818" } ] }
End of preview.

No dataset card yet

Downloads last month
4